Add example USART driver

This commit is contained in:
Matte23
2024-11-03 12:04:40 +01:00
parent c265a35cc6
commit 6d0a60881c
6 changed files with 93 additions and 8 deletions

12
os/driver/usart.h Normal file
View File

@@ -0,0 +1,12 @@
#include <stdint.h>
#define TIMEOUT 1000
enum UartErrorCode {
USART_TX_ERROR,
USART_TX_BUSY,
USART_TX_COMPLETE
};
static uint32_t usart_tx_ready(void);
uint32_t usart_tx_write(const uint8_t *data_bytes, uint32_t n_bytes);
uint32_t usart_tx_write_string(const uint8_t *data_bytes);