make USART more noise resistant
This commit is contained in:
parent
765fb2e338
commit
875e0de18b
|
@ -44,7 +44,8 @@ void usart_setup(void)
|
|||
{
|
||||
rcc_periph_clock_enable(USART_RCC); // enable USART1 clock
|
||||
gpio_set_mode(USART_PORT, GPIO_MODE_OUTPUT_10_MHZ, GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, USART_PIN_TX); // setup GPIO pin USART transmit
|
||||
gpio_set_mode(USART_PORT, GPIO_MODE_INPUT, GPIO_CNF_INPUT_FLOAT, USART_PIN_RX); // setup GPIO pin USART receive
|
||||
gpio_set_mode(USART_PORT, GPIO_MODE_INPUT, GPIO_CNF_INPUT_PULL_UPDOWN, USART_PIN_RX); // setup GPIO pin USART receive
|
||||
gpio_set(USART_PORT, USART_PIN_RX); // pull up to avoid noise when not connected
|
||||
|
||||
/* setup UART parameters */
|
||||
usart_set_baudrate(USART, 115200);
|
||||
|
|
Loading…
Reference in New Issue