Compare commits

..

2 Commits

2 changed files with 11 additions and 0 deletions

View File

@ -48,6 +48,8 @@ struct stm_uart {
int uart_init(struct stm_uart *uart);
void uart_change_brr(struct stm_uart *uart, uint32_t brr);
void uart_disable(struct stm_uart *uart);
void uart_send_char(struct stm_uart *uart, char c);

View File

@ -86,6 +86,15 @@ int uart_init(struct stm_uart *uart)
return 0;
}
void uart_change_brr(struct stm_uart *uart, uint32_t brr)
{
if (!uart || !uart->uart_dev)
return;
uart->brr_val = brr;
uart->uart_dev->BRR = brr;
}
void uart_disable(struct stm_uart *uart)
{
if (!uart)