diff options
Diffstat (limited to 'src/target/firmware/include/calypso/uart.h')
-rw-r--r-- | src/target/firmware/include/calypso/uart.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/target/firmware/include/calypso/uart.h b/src/target/firmware/include/calypso/uart.h new file mode 100644 index 00000000..845612f0 --- /dev/null +++ b/src/target/firmware/include/calypso/uart.h @@ -0,0 +1,30 @@ +#ifndef _CAL_UART_H +#define _CAL_UART_H + +#include <stdint.h> + +enum uart_baudrate { + UART_38400, + UART_57600, + UART_115200, + UART_230400, + UART_460800, + UART_614400, + UART_921600, +}; + +void uart_init(uint8_t uart); +void uart_putchar_wait(uint8_t uart, int c); +int uart_putchar_nb(uint8_t uart, int c); +int uart_getchar_nb(uint8_t uart, uint8_t *ch); +int uart_tx_busy(uint8_t uart); +int uart_baudrate(uint8_t uart, enum uart_baudrate bdrt); + +enum uart_irq { + UART_IRQ_TX_EMPTY, + UART_IRQ_RX_CHAR, +}; + +void uart_irq_enable(uint8_t uart, enum uart_irq irq, int on); + +#endif /* _CAL_UART_H */ |