Split out arm_atsam shift register logic (#14848)
This commit is contained in:
parent
1b93d576f8
commit
1b1f3ec68e
10 changed files with 301 additions and 140 deletions
|
@ -64,7 +64,13 @@ typedef uint8_t pin_t;
|
|||
PORT->Group[SAMD_PORT(pin)].OUTCLR.reg = SAMD_PIN_MASK(pin); \
|
||||
} while (0)
|
||||
|
||||
#define writePin(pin, level) ((level) ? (writePinHigh(pin)) : (writePinLow(pin)))
|
||||
#define writePin(pin, level) \
|
||||
do { \
|
||||
if (level) \
|
||||
PORT->Group[SAMD_PORT(pin)].OUTSET.reg = SAMD_PIN_MASK(pin); \
|
||||
else \
|
||||
PORT->Group[SAMD_PORT(pin)].OUTCLR.reg = SAMD_PIN_MASK(pin); \
|
||||
} while (0)
|
||||
|
||||
#define readPin(pin) ((PORT->Group[SAMD_PORT(pin)].IN.reg & SAMD_PIN_MASK(pin)) != 0)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue