Prusa MINI Firmware overview
uartrxbuff.h
Go to the documentation of this file.
1 //uartrxbuff.h
2 #ifndef _UARTRXBUFF_H
3 #define _UARTRXBUFF_H
4 
5 #include <inttypes.h>
6 #include "stm32f4xx_hal.h"
7 
8 #define UARTRXBUFF_FLG_HALF 0x01
9 #define UARTRXBUFF_FLG_CPLT 0x02
10 #define UARTRXBUFF_FLG_FULL 0x04
11 #define UARTRXBUFF_FLG_OVER 0x08
12 
13 #pragma pack(push)
14 #pragma pack(1)
15 
16 typedef struct _uartrxbuff_t {
23 } uartrxbuff_t;
24 
25 #pragma pack(pop)
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif //__cplusplus
30 
31 extern void uartrxbuff_init(uartrxbuff_t *prxbuff, UART_HandleTypeDef *phuart, DMA_HandleTypeDef *phdma, uint8_t size, uint8_t *pdata);
32 
33 extern void uartrxbuff_open(uartrxbuff_t *prxbuff);
34 
35 extern void uartrxbuff_close(uartrxbuff_t *prxbuff);
36 
37 extern void uartrxbuff_reset(uartrxbuff_t *prxbuff);
38 
39 extern int uartrxbuff_getchar(uartrxbuff_t *prxbuff);
40 
41 extern void uartrxbuff_rxhalf_cb(uartrxbuff_t *prxbuff);
42 
43 extern void uartrxbuff_rxcplt_cb(uartrxbuff_t *prxbuff);
44 
45 #ifdef __cplusplus
46 }
47 #endif //__cplusplus
48 
49 #endif //_UARTRXBUFF_H
UARTRXBUFF_FLG_HALF
#define UARTRXBUFF_FLG_HALF
Definition: uartrxbuff.h:8
uartrxbuff_init
void uartrxbuff_init(uartrxbuff_t *prxbuff, UART_HandleTypeDef *phuart, DMA_HandleTypeDef *phdma, uint8_t size, uint8_t *pdata)
Definition: uartrxbuff.c:15
__DMA_HandleTypeDef::Instance
DMA_Stream_TypeDef * Instance
Definition: stm32f4xx_hal_dma.h:157
uartrxbuff_open
void uartrxbuff_open(uartrxbuff_t *prxbuff)
Definition: uartrxbuff.c:24
HAL_UART_Receive_DMA
HAL_StatusTypeDef HAL_UART_Receive_DMA(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size)
_dbg0
#define _dbg0
Definition: dbg.h:31
_uartrxbuff_t::index
uint8_t index
Definition: uartrxbuff.h:20
uartrxbuff_rxcplt_cb
void uartrxbuff_rxcplt_cb(uartrxbuff_t *prxbuff)
Definition: uartrxbuff.c:71
uartrxbuff_reset
void uartrxbuff_reset(uartrxbuff_t *prxbuff)
Definition: uartrxbuff.c:33
dbg.h
uartrxbuff_rxhalf_cb
void uartrxbuff_rxhalf_cb(uartrxbuff_t *prxbuff)
Definition: uartrxbuff.c:61
UARTRXBUFF_FLG_CPLT
#define UARTRXBUFF_FLG_CPLT
Definition: uartrxbuff.h:9
_uartrxbuff_t::pdata
uint8_t * pdata
Definition: uartrxbuff.h:22
uartrxbuff_rx_full
void uartrxbuff_rx_full(uartrxbuff_t *prxbuff)
Definition: uartrxbuff.c:5
_uartrxbuff_t::phuart
UART_HandleTypeDef * phuart
Definition: uartrxbuff.h:17
uartrxbuff_getchar
int uartrxbuff_getchar(uartrxbuff_t *prxbuff)
Definition: uartrxbuff.c:38
uartrxbuff_open
void uartrxbuff_open(uartrxbuff_t *prxbuff)
Definition: uartrxbuff.c:24
uartrxbuff_rxcplt_cb
void uartrxbuff_rxcplt_cb(uartrxbuff_t *prxbuff)
Definition: uartrxbuff.c:71
uartrxbuff_close
void uartrxbuff_close(uartrxbuff_t *prxbuff)
Definition: uartrxbuff.c:29
UARTRXBUFF_FLG_OVER
#define UARTRXBUFF_FLG_OVER
Definition: uartrxbuff.h:11
_uartrxbuff_t::flags
uint8_t flags
Definition: uartrxbuff.h:19
__DMA_HandleTypeDef
DMA handle Structure definition.
Definition: stm32f4xx_hal_dma.h:155
HAL_UART_AbortReceive
HAL_StatusTypeDef HAL_UART_AbortReceive(UART_HandleTypeDef *huart)
uartrxbuff_init
void uartrxbuff_init(uartrxbuff_t *prxbuff, UART_HandleTypeDef *phuart, DMA_HandleTypeDef *phdma, uint8_t size, uint8_t *pdata)
Definition: uartrxbuff.c:15
uartrxbuff_t
struct _uartrxbuff_t uartrxbuff_t
uint8_t
const uint8_t[]
Definition: 404_html.c:3
uartrxbuff.h
uartrxbuff_rxhalf_cb
void uartrxbuff_rxhalf_cb(uartrxbuff_t *prxbuff)
Definition: uartrxbuff.c:61
uartrxbuff_close
void uartrxbuff_close(uartrxbuff_t *prxbuff)
Definition: uartrxbuff.c:29
uartrxbuff_getchar
int uartrxbuff_getchar(uartrxbuff_t *prxbuff)
Definition: uartrxbuff.c:38
stm32f4xx_hal.h
This file contains all the functions prototypes for the HAL module driver.
uartrxbuff_rx_overflow
void uartrxbuff_rx_overflow(uartrxbuff_t *prxbuff)
Definition: uartrxbuff.c:10
uartrxbuff_reset
void uartrxbuff_reset(uartrxbuff_t *prxbuff)
Definition: uartrxbuff.c:33
UARTRXBUFF_FLG_FULL
#define UARTRXBUFF_FLG_FULL
Definition: uartrxbuff.h:10
UART_HandleTypeDef
UART handle Structure definition.
Definition: stm32f4xx_hal_uart.h:158
_uartrxbuff_t::size
uint8_t size
Definition: uartrxbuff.h:21
_uartrxbuff_t::phdma
DMA_HandleTypeDef * phdma
Definition: uartrxbuff.h:18
_uartrxbuff_t
Definition: uartrxbuff.h:16
size
static png_bytep size_t size
Definition: pngwrite.c:2170