sam3x: Add convenince functions for setting clocks and usart baudrate.
This commit is contained in:
committed by
Piotr Esden-Tempski
parent
8265953b35
commit
e2eadfddb8
@@ -18,6 +18,12 @@
|
||||
*/
|
||||
|
||||
#include <libopencm3/sam3x/usart.h>
|
||||
#include <libopencm3/sam3x/pmc.h>
|
||||
|
||||
void usart_set_baudrate(u32 usart, u32 baud)
|
||||
{
|
||||
USART_BRGR(usart) = pmc_mck_frequency / (16 * baud);
|
||||
}
|
||||
|
||||
void usart_set_databits(u32 usart, int bits)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user