21 #ifndef COSA_OUTPUT_PIN_HH 22 #define COSA_OUTPUT_PIN_HH 58 volatile uint8_t* port =
PORT(pin);
59 volatile uint8_t* ddr =
DDR(pin);
60 const uint8_t mask =
MASK(pin);
76 __attribute__((always_inline))
86 __attribute__((always_inline))
96 __attribute__((always_inline))
106 __attribute__((always_inline))
115 __attribute__((always_inline))
125 __attribute__((always_inline))
135 __attribute__((always_inline))
145 __attribute__((always_inline))
154 __attribute__((always_inline))
164 __attribute__((always_inline))
174 __attribute__((always_inline))
185 __attribute__((always_inline))
201 void set(
int value)
const 202 __attribute__((always_inline))
220 __attribute__((always_inline))
237 __attribute__((always_inline))
256 __attribute__((always_inline))
269 __attribute__((always_inline))
297 void write(uint16_t value, uint8_t bits, uint16_t us)
const;
307 __attribute__((always_inline))
309 volatile uint8_t* port =
PORT(
pin);
310 const uint8_t mask =
MASK(
pin);
313 if (((
int) port < PORTH)
314 && __builtin_constant_p(
pin)
315 && __builtin_constant_p(value)) {
317 if (__builtin_constant_p(
pin) && __builtin_constant_p(value)) {
346 __attribute__((always_inline))
348 volatile uint8_t* port =
PORT(
pin);
349 const uint8_t mask =
MASK(
pin);
365 __attribute__((always_inline))
379 __attribute__((always_inline))
OutputPin & operator=(Pin &rhs)
void _set(int value) const
static uint8_t MASK(uint8_t pin)
void pulse(uint16_t us) const
void write(int value) const
OutputPin(Board::DigitalPin pin, uint8_t initial=0)
static void mode(Board::DigitalPin pin, uint8_t initial=0)
OutputPin & operator=(int value)
void _write(int value) const
static void _write(Board::DigitalPin pin, uint8_t value)
OutputPin & operator<<(int value)
volatile uint8_t * PORT() const
volatile uint8_t * PIN() const
static void toggle(Board::DigitalPin pin)
static void write(Board::DigitalPin pin, int value)
volatile uint8_t * DDR() const