summaryrefslogtreecommitdiff
path: root/src/stm/stm32l.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/stm/stm32l.h')
-rw-r--r--src/stm/stm32l.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/stm/stm32l.h b/src/stm/stm32l.h
index 50e5cc34..531a4fb9 100644
--- a/src/stm/stm32l.h
+++ b/src/stm/stm32l.h
@@ -133,6 +133,10 @@ stm_pupdr_get(struct stm_gpio *gpio, int pin) {
static inline void
stm_afr_set(struct stm_gpio *gpio, int pin, uint32_t value) {
+ /*
+ * Set alternate pin mode too
+ */
+ stm_moder_set(gpio, pin, STM_MODER_ALTERNATE);
if (pin < 8)
gpio->afrl = ((gpio->afrl &
~(STM_AFR_MASK << STM_AFR_SHIFT(pin))) |