stm32/common: Implemented oversampling control support for the F2/F4 parts

This commit is contained in:
dragonmux
2024-04-29 11:05:09 +01:00
committed by Piotr Esden-Tempski
parent 03a884bcca
commit 94411df91f
2 changed files with 25 additions and 0 deletions

View File

@@ -110,5 +110,14 @@ bool usart_get_flag(uint32_t usart, uint32_t flag)
return ((USART_SR(usart) & flag) != 0);
}
#ifdef LIBOPENCM3_USART_COMMON_F24_H
void usart_set_oversampling(uint32_t usart, uint32_t mode)
{
if (mode)
USART_CR1(usart) |= USART_CR1_OVER8;
else
USART_CR1(usart) &= ~USART_CR1_OVER8;
}
#endif
/**@}*/