Add baudrate change function to uart driver
This commit is contained in:
parent
1ef7713351
commit
c923fb3e12
@ -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);
|
||||
|
@ -86,6 +86,14 @@ 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->uart_dev->BRR = brr;
|
||||
}
|
||||
|
||||
void uart_disable(struct stm_uart *uart)
|
||||
{
|
||||
if (!uart)
|
||||
|
Loading…
Reference in New Issue
Block a user