19 #ifndef HARDWARE_AVR_GPIO_H 20 #define HARDWARE_AVR_GPIO_H 30 template<BOARD::pin_t PIN>
37 __attribute__((always_inline))
48 __attribute__((always_inline))
57 __attribute__((always_inline))
66 __attribute__((always_inline))
77 __attribute__((always_inline))
79 return ((
SFR()->pin &
MASK) != 0);
87 __attribute__((always_inline))
96 __attribute__((always_inline))
105 __attribute__((always_inline))
114 __attribute__((always_inline))
125 __attribute__((always_inline))
136 __attribute__((always_inline))
148 if (width == 0)
return;
149 uint16_t count = ((width * (F_CPU / 1000000L)) / 4);
151 __asm__ __volatile__(
"cli" :::
"memory");
153 _delay_loop_2(count);
156 __asm__ __volatile__(
"" :::
"memory");
166 while (
read() == s0);
167 uint16_t t0 = micros();
168 while (
read() != s0);
169 return (micros() - t0);
185 __attribute__((always_inline))
187 return ((gpio_reg_t*)
GPIO_REG(PIN));
volatile uint8_t port
Data Register.
volatile uint8_t pin
Port Input Pins.
#define GPIO_ATOMIC(expr)
volatile uint8_t ddr
Data Direction Register.
void operator=(int value)
static const uint8_t MASK
void pulse(uint16_t width)