diff options
author | Bdale Garbee <bdale@gag.com> | 2016-05-06 17:59:39 -0600 |
---|---|---|
committer | Bdale Garbee <bdale@gag.com> | 2016-05-06 17:59:39 -0600 |
commit | ac7be4a40df88ee3a0992e041635e4ac4cf5ac48 (patch) | |
tree | ee3c747b2ee98b772e02dce604b58878e9336def /src/stm/stm32l.h | |
parent | b53c78e75879d647935a30acb88fdd69467617a7 (diff) | |
parent | ce4c8a8ad57515e851207b0a82f3af791bb30d3e (diff) |
Merge branch 'master' into branch-1.6
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; |