2021-01-12 18:22:11 +00:00
|
|
|
/* SPDX-License-Identifier: MIT */
|
|
|
|
|
|
|
|
#ifndef UART_H
|
|
|
|
#define UART_H
|
|
|
|
|
2021-01-16 15:45:10 +00:00
|
|
|
#include "types.h"
|
|
|
|
|
2021-10-31 19:25:36 +00:00
|
|
|
int uart_init(void);
|
2021-01-12 18:22:11 +00:00
|
|
|
|
2021-01-14 09:18:07 +00:00
|
|
|
void uart_putbyte(u8 c);
|
|
|
|
u8 uart_getbyte(void);
|
|
|
|
|
|
|
|
void uart_putchar(u8 c);
|
|
|
|
u8 uart_getchar(void);
|
2021-01-12 18:22:11 +00:00
|
|
|
|
|
|
|
void uart_write(const void *buf, size_t count);
|
2021-01-14 10:22:38 +00:00
|
|
|
size_t uart_read(void *buf, size_t count);
|
2021-01-12 18:22:11 +00:00
|
|
|
|
|
|
|
void uart_puts(const char *s);
|
|
|
|
|
2021-01-14 18:55:20 +00:00
|
|
|
void uart_setbaud(int baudrate);
|
|
|
|
|
|
|
|
void uart_flush(void);
|
|
|
|
|
2021-08-23 08:02:28 +00:00
|
|
|
void uart_clear_irqs(void);
|
|
|
|
|
2021-05-27 12:09:48 +00:00
|
|
|
int uart_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
|
|
|
|
|
2021-01-12 18:22:11 +00:00
|
|
|
#endif
|