#pragma once #include #include "stm32f0xx.h" 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;