Core
Loading...
Searching...
No Matches
usart.h
1#ifndef USART_H
2#define USART_H
3#include <stdint.h>
4#include <stdbool.h>
5#include <stm32g4xx_hal.h>
6#include "core_config.h"
7
8#define CORE_USART1_UPDATE 0x01
9#define CORE_USART2_UPDATE 0x02
10#define CORE_USART3_UPDATE 0x04
11
12bool core_USART_init(USART_TypeDef *usart, uint32_t baud);
13bool core_USART_start_rx(USART_TypeDef *usart, volatile uint8_t *rxbuf, volatile uint32_t *rxbuflen);
14void core_USART_update_disable(USART_TypeDef *usart);
15void core_USART_update_enable(USART_TypeDef *usart);
16bool core_USART_transmit(USART_TypeDef *usart, uint8_t *txbuf, uint8_t txbuflen);
17void core_USART_RX_callback(USART_HandleTypeDef *husart);
18bool core_USART_register_callback(USART_TypeDef *usart, void (*callback)(uint8_t *, uint32_t));
19uint32_t core_USART_receive(USART_TypeDef *usart, uint8_t *rxbuf, uint32_t rxbuflen, uint32_t timeout);
20
21#ifdef CORE_USART_UPRINTF
22int uprintf(USART_TypeDef *usart, const char *format, ...);
23#endif
24
25#endif
Configuration file for the core library.