#include <assert.h>
#include <interrupt.h>
#include <status-codes.h>
#include <util.h>
#include <chip/clk.h>
#include <console/core.h>
#include <console/driver.h>
#include <console/serial.h>
#include <hardware/usart.h>

Go to the source code of this file.
Functions | |
| static uint32_t | usart_calc_brgr (unsigned long base_hz, unsigned long baud) |
This is a very simple serial driver serving as a backend for the console layer. Everything that the console layer writes is dumped over the serial line.
Definition in file serial.c.
| static uint32_t usart_calc_brgr | ( | unsigned long | base_hz, | |
| unsigned long | baud | |||
| ) | [static] |
Calculate the value to be written to the BRGR register given a baud rate and assuming 8x oversampling. To calculate the baud rate with 16x oversampling, use base_hz = peripheral_clock / 2.
| base_hz | The input clock rate after accounting for oversampling | |
| baud | Desired baud rate. |
1.5.8