26#include <stm32g4xx_hal.h>
29#define CORE_USART1_UPDATE 0x01
30#define CORE_USART2_UPDATE 0x02
31#define CORE_USART3_UPDATE 0x04
34 UART_HandleTypeDef husart;
36 uint32_t rxbuflen_int;
37 void (*callback)(uint8_t *, uint32_t);
83uint32_t
core_USART_receive(USART_TypeDef *usart, uint8_t *rxbuf, uint32_t rxbuflen, uint32_t timeout);
85#if (CORE_USART_UPRINTF != 0) || defined(DOXYGEN)
97int uprintf(USART_TypeDef *usart,
const char *format, ...);
Configuration file for the core library.
#define CORE_USART_RXBUFLEN
Size of the internal RX buffer. One buffer will be created for each USART module.
Definition core_config.h:226
bool core_USART_init(USART_TypeDef *usart, uint32_t baud)
Initialize a USART module in asynchronous mode with the given baud rate.
Definition usart.c:54
bool core_USART_transmit(USART_TypeDef *usart, uint8_t *txbuf, uint8_t txbuflen)
Transmit data from a USART.
Definition usart.c:184
bool core_USART_register_callback(USART_TypeDef *usart, void(*callback)(uint8_t *, uint32_t))
Set the RX callback and start the receiver for the given USART module.
Definition usart.c:128
int uprintf(USART_TypeDef *usart, const char *format,...)
Print a formatted string to a USART.
Definition usart.c:193
uint32_t core_USART_receive(USART_TypeDef *usart, uint8_t *rxbuf, uint32_t rxbuflen, uint32_t timeout)
Synchronously receive data from a USART.
Definition usart.c:203