19 #ifndef HARDWARE_SAM_GPIO_H 20 #define HARDWARE_SAM_GPIO_H 30 template<BOARD::pin_t PIN>
38 pmc_enable_periph_clk(
ID_PIO());
46 __attribute__((always_inline))
57 __attribute__((always_inline))
66 __attribute__((always_inline))
75 __attribute__((always_inline))
86 __attribute__((always_inline))
88 return ((
SFR()->PIO_PDSR &
MASK) != 0);
96 __attribute__((always_inline))
105 __attribute__((always_inline))
114 __attribute__((always_inline))
123 __attribute__((always_inline))
134 __attribute__((always_inline))
145 __attribute__((always_inline))
157 if (width == 0)
return;
159 delayMicroseconds(width);
170 while (
read() == s0);
171 uint16_t t0 = micros();
172 while (
read() != s0);
173 return (micros() - t0);
185 __attribute__((always_inline))
188 case 0:
return (PIOA);
189 case 1:
return (PIOB);
190 case 2:
return (PIOC);
201 __attribute__((always_inline))
204 case 0:
return (ID_PIOA);
205 case 1:
return (ID_PIOB);
206 case 2:
return (ID_PIOC);
void operator=(int value)
static const uint8_t MASK
void pulse(uint16_t width)