Skip to content

Commit 8344bad

Browse files
committed
F1 pinmap: input mode may be associated with an alternate function
On F1 specifically, input alternate functions must configure GPIO in input mode. Example: on F103 PinMap_UART_RX {PB_7, USART1, STM_PIN_DATA(STM_MODE_INPUT, GPIO_PULLUP, AFIO_USART1_ENABLE)},
1 parent 2aa8531 commit 8344bad

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: libraries/SrcWrapper/src/stm32/pinmap.c

+4
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ void pin_function(PinName pin, int function)
121121
switch (mode) {
122122
case STM_PIN_INPUT:
123123
ll_mode = LL_GPIO_MODE_INPUT;
124+
#if defined(STM32F1xx)
125+
// on F1 family, input mode may be associated with an alternate function
126+
pin_SetAFPin(gpio, pin, afnum);
127+
#endif
124128
break;
125129
case STM_PIN_OUTPUT:
126130
ll_mode = LL_GPIO_MODE_OUTPUT;

0 commit comments

Comments
 (0)