1
0
Fork 0

Split out arm_atsam shift register logic (#14848)

This commit is contained in:
Joel Challis 2021-10-22 00:49:38 +01:00 committed by GitHub
parent 1b93d576f8
commit 1b1f3ec68e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 301 additions and 140 deletions

View file

@ -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)