|
@ -62,14 +62,6 @@ |
|
|
// Read a pin
|
|
|
// Read a pin
|
|
|
#define _READ(IO) bool(DIO ## IO ## _WPORT -> PIO_PDSR & MASK(DIO ## IO ## _PIN)) |
|
|
#define _READ(IO) bool(DIO ## IO ## _WPORT -> PIO_PDSR & MASK(DIO ## IO ## _PIN)) |
|
|
|
|
|
|
|
|
// Write to a pin
|
|
|
|
|
|
#define _WRITE_VAR(IO,V) do { \ |
|
|
|
|
|
volatile Pio* port = digitalPinToPort(IO); \ |
|
|
|
|
|
const uint32_t mask = digitalPinToBitMask(IO); \ |
|
|
|
|
|
if (V) port->PIO_SODR = mask; \ |
|
|
|
|
|
else port->PIO_CODR = mask; \ |
|
|
|
|
|
} while(0) |
|
|
|
|
|
|
|
|
|
|
|
// Write to a pin
|
|
|
// Write to a pin
|
|
|
#define _WRITE(IO,V) do { \ |
|
|
#define _WRITE(IO,V) do { \ |
|
|
volatile Pio* port = (DIO ## IO ## _WPORT); \ |
|
|
volatile Pio* port = (DIO ## IO ## _WPORT); \ |
|
@ -160,7 +152,6 @@ |
|
|
#define READ(IO) _READ(IO) |
|
|
#define READ(IO) _READ(IO) |
|
|
|
|
|
|
|
|
// Write to a pin (wrapper)
|
|
|
// Write to a pin (wrapper)
|
|
|
#define WRITE_VAR(IO,V) _WRITE_VAR(IO,V) |
|
|
|
|
|
#define WRITE(IO,V) _WRITE(IO,V) |
|
|
#define WRITE(IO,V) _WRITE(IO,V) |
|
|
|
|
|
|
|
|
// Toggle a pin (wrapper)
|
|
|
// Toggle a pin (wrapper)
|
|
|