26 lines
620 B
C
26 lines
620 B
C
#pragma once
|
|
|
|
#include <stddef.h>
|
|
#include <ringbuffer.h>
|
|
|
|
#define UART_BUFLEN 0x800
|
|
|
|
void uart_init(void);
|
|
char uart_getc(void);
|
|
void uart_puts(const char *s);
|
|
void uart_hex(uint64_t d);
|
|
|
|
void uart_irq_handler(void);
|
|
|
|
size_t uart_putb_sync(const uint8_t *bytes, size_t len);
|
|
size_t uart_getb_sync(uint8_t *bytes, size_t len);
|
|
|
|
size_t uart_putb_async(const uint8_t *bytes, size_t len);
|
|
size_t uart_getb_async(uint8_t *bytes, size_t len);
|
|
|
|
extern size_t (*uart_putb)(const uint8_t *bytes, size_t len);
|
|
extern size_t (*uart_getb)(uint8_t *bytes, size_t len);
|
|
extern int is_uart_inited;
|
|
|
|
extern ringbuffer_t *uart_readbuf;
|