diff options
author | Oxore <oxore@protonmail.com> | 2023-03-09 01:42:59 +0300 |
---|---|---|
committer | Oxore <oxore@protonmail.com> | 2023-03-09 01:42:59 +0300 |
commit | 34746d3783af1ae601487c88f0a7e44f81842618 (patch) | |
tree | 508a849e81e1f7a83e1df053719579e4452b4e35 /app/platform/stm32f0-gcc/uart.h | |
parent | 8370de05bb807f02c0077ba59c68053b283671e2 (diff) |
Impl UART buffering (still not tested)
Diffstat (limited to 'app/platform/stm32f0-gcc/uart.h')
-rw-r--r-- | app/platform/stm32f0-gcc/uart.h | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/app/platform/stm32f0-gcc/uart.h b/app/platform/stm32f0-gcc/uart.h index 176f847..1cbc56f 100644 --- a/app/platform/stm32f0-gcc/uart.h +++ b/app/platform/stm32f0-gcc/uart.h @@ -2,11 +2,20 @@ #include <cstddef> #include "stm32f0xx.h" -// Non-blocking buffered write -size_t UARTWrite(USART_TypeDef*, const void *data, size_t nbytes); -// Blocking write directly into data register -size_t UARTWriteDirect(USART_TypeDef*, const void *data, size_t nbytes); -// Non-blocking buffered read -size_t UARTRead(USART_TypeDef*, void *data, size_t nbytes); -// Blocking read directly from data register -size_t UARTReadDirect(USART_TypeDef*, void *data, size_t nbytes); +struct UART; + +/// Non-blocking buffered write +size_t UARTWrite(UART*, const void *buf, size_t nbytes); +/// Blocking write directly into data register +size_t UARTWriteDirect(UART*, const void *buf, size_t nbytes); +/// Non-blocking buffered read +size_t UARTRead(UART*, void *buf, size_t nbytes); +/// Blocking read directly from data register +size_t UARTReadDirect(UART*, void *buf, size_t nbytes); +/// Generic interrupt handler +void UARTHandleInterrupt(UART*); + +extern UART g_uart1; +extern UART g_uart2; +extern UART g_uart3; +extern UART g_uart4; |