Skip to content

Commit 2ee64a0

Browse files
nessotrinfpistm
andcommitted
fix(c0): missing GPIO_AF0_USART2 for STM32C051xx
See STMicroelectronics/stm32c0xx-hal-driver#4 Signed-off-by: Nessotrin <nessotrin@hotmail.fr> Co-authored-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 07e97a5 commit 2ee64a0

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

libraries/SrcWrapper/inc/stm32_def.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,14 @@ __STATIC_INLINE void LL_RTC_SetBinMixBCDU(RTC_TypeDef *RTCx, uint32_t BinMixBcdU
222222
#define GPIO_AF1_SPI1 STM_PIN_AFNUM_MASK
223223
#endif
224224

225-
#if defined(STM32C0xx) && defined(USART3) && !defined(GPIO_AF7_USART3)
226-
#define GPIO_AF7_USART3 ((uint8_t)0x07)
227-
#endif // STM32C0xx && !defined(USART3)
225+
#if defined(STM32C0xx)
226+
#if defined(USART3) && !defined(GPIO_AF7_USART3)
227+
#define GPIO_AF7_USART3 ((uint8_t)0x07)
228+
#endif /* USART3 & !GPIO_AF7_USART3*/
229+
#if defined(STM32C051xx) && !defined(GPIO_AF0_USART2)
230+
#define GPIO_AF0_USART2 ((uint8_t)0x00)
231+
#endif
232+
#endif // STM32C0xx
228233

229234
#if defined(STM32WBAxx) && defined(USB_OTG_HS) && !defined(GPIO_AF4_USB_OTG_HS)
230235
#define GPIO_AF4_USB_OTG_HS GPIO_AF4_OTG_HS

system/Drivers/STM32C0xx_HAL_Driver/Inc/stm32c0xx_hal_gpio_ex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ extern "C" {
6161
#define GPIO_AF0_OSC ((uint8_t)0x00) /*!< OSC (By pass and Enable) Alternate Function mapping */
6262
#define GPIO_AF0_TIM14 ((uint8_t)0x00) /*!< TIM14 Alternate Function mapping */
6363
#endif /* !STM32C011xx */
64-
#if defined(STM32C031xx) || defined(STM32C071xx) || defined(STM32C091xx) || defined(STM32C092xx)
64+
#if defined(STM32C031xx) || defined(STM32C051xx) || defined(STM32C071xx) || defined(STM32C091xx) || defined(STM32C092xx)
6565
#define GPIO_AF0_USART2 ((uint8_t)0x00) /*!< USART2 Alternate Function mapping */
6666
#endif /* STM32C031xx | STM32C071xx | STM32C091xx | STM32C092xx*/
6767
#if defined(SPI2)

0 commit comments

Comments
 (0)