X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fstm%2Fstm32l.h;h=0b6b27983d6a3633d891be36bfdd0f0ecb3063fe;hb=04759dddeb29e4de9f7e6b3673dc06c633fa2369;hp=01afedc625bc0b66fe4c07798237903019e5f2a9;hpb=742f7c834bb5d651d2bebf2069d4e8facc33390d;p=fw%2Faltos 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;