diff options
author | Bdale Garbee <bdale@gag.com> | 2016-05-06 18:13:12 -0600 |
---|---|---|
committer | Bdale Garbee <bdale@gag.com> | 2016-05-06 18:13:12 -0600 |
commit | 4c20fdfa543059739b756171b991d430789cded1 (patch) | |
tree | f39e6c729364211bf0570c459c37b576ecf9faa9 /src/stm/stm32l.h | |
parent | e58dd78bcb749315f84168c83a74cf80851bf815 (diff) | |
parent | 2f0c977c747824d0798550ac64eceb1d66c50efd (diff) |
Merge branch 'branch-1.6' into debian
Diffstat (limited to 'src/stm/stm32l.h')
-rw-r--r-- | src/stm/stm32l.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/stm/stm32l.h b/src/stm/stm32l.h index 01afedc6..0b6b2798 100644 --- a/src/stm/stm32l.h +++ b/src/stm/stm32l.h @@ -166,6 +166,16 @@ stm_gpio_set(struct stm_gpio *gpio, int pin, uint8_t value) { gpio->bsrr = ((uint32_t) (value ^ 1) << (pin + 16)) | ((uint32_t) value << pin); } +static inline void +stm_gpio_set_bits(struct stm_gpio *gpio, uint16_t bits) { + gpio->bsrr = bits; +} + +static inline void +stm_gpio_clr_bits(struct stm_gpio *gpio, uint16_t bits) { + gpio->bsrr = ((uint32_t) bits) << 16; +} + static inline uint8_t stm_gpio_get(struct stm_gpio *gpio, int pin) { return (gpio->idr >> pin) & 1; |