23 #include "wiring_constants.h"
35 #define bitRead(value, bit) (((value) >> (bit)) & 0x01)
36 #define bitSet(value, bit) ((value) |= (1UL << (bit)))
37 #define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
38 #define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
58 return GPIO_ReadInputDataBit(PIN_MAP[pin].port, 1<<PIN_MAP[pin].pin);
63 typedef enum DigitalPolarity {
64 ACTIVE_HIGH, ACTIVE_LOW
67 typedef enum LEDOutputMode {
71 void ledInit(uint8_t name, DigitalPolarity polarity, LEDOutputMode mode);
73 void ledWrite(uint8_t name,
float val);
76 void ledConfigBarGraph(uint8_t green, uint8_t yellow, uint8_t red);
77 void ledBarGraph(
float val,
float tgreen,
float tyellow,
float tred);
static uint8_t digitalRead(uint8_t pin) __attribute__((always_inline
Read a digital pin.
Definition: gpio.h:57
void digitalWrite(uint8_t pin, LogicValue val)
Set a digital pin to a given logic level.
Definition: gpio.c:26