18#ifndef __ST_HAL_UART_H__
19#define __ST_HAL_UART_H__
25#if VSF_HAL_USE_USART == ENABLED && defined(HAL_UART_MODULE_ENABLED)
33# define HAL_UART_ERROR_NONE 0x00000000U
34# define HAL_UART_ERROR_PE 0x00000001U
35# define HAL_UART_ERROR_NE 0x00000002U
36# define HAL_UART_ERROR_FE 0x00000004U
37# define HAL_UART_ERROR_ORE 0x00000008U
38# define HAL_UART_ERROR_DMA 0x00000010U
39# if (USE_HAL_UART_REGISTER_CALLBACKS == 1)
40# define HAL_UART_ERROR_INVALID_CALLBACK 0x00000020U
43# define HAL_UART_RXEVENT_TC (0x00000000U)
44# define HAL_UART_RXEVENT_HT (0x00000001U)
45# define HAL_UART_RXEVENT_IDLE (0x00000002U)
47# define HAL_UART_RECEPTION_STANDARD (0x00000000U)
48# define HAL_UART_RECEPTION_TOIDLE (0x00000001U)
50# define UART_WORDLENGTH_8B VSF_USART_8_BIT_LENGTH
51# define UART_WORDLENGTH_9B VSF_USART_9_BIT_LENGTH
53# define UART_STOPBITS_1 VSF_USART_1_STOPBIT
54# define UART_STOPBITS_2 VSF_USART_2_STOPBIT
56# define UART_PARITY_NONE VSF_USART_NO_PARITY
57# define UART_PARITY_EVEN VSF_USART_EVEN_PARITY
58# define UART_PARITY_ODD VSF_USART_ODD_PARITY
60# define UART_HWCONTROL_NONE VSF_USART_NO_HWCONTROL
61# define UART_HWCONTROL_RTS VSF_USART_RTS_HWCONTROL
62# define UART_HWCONTROL_CTS VSF_USART_CTS_HWCONTROL
63# define UART_HWCONTROL_RTS_CTS VSF_USART_RTS_CTS_HWCONTROL
65# define UART_MODE_RX (VSF_USART_TX_ENABLE | VSF_USART_RX_DISABLE)
66# define UART_MODE_TX (VSF_USART_RX_ENABLE | VSF_USART_TX_DISABLE)
67# define UART_MODE_TX_RX (VSF_USART_TX_ENABLE | VSF_USART_RX_ENABLE)
69# if defined(VSF_USART_LINE_BREAK_DETECT_LENGTH_MASK)
70# if define VSF_USART_LINE_BREAK_DETECT_LENGTH_10B
71# define UART_LINBREAKDETECTLENGTH_10B \
72 VSF_USART_LINE_BREAK_DETECT_LENGTH_10B
74# if define VSF_USART_LINE_BREAK_DETECT_LENGTH_11B
75# define UART_LINBREAKDETECTLENGTH_11B \
76 VSF_USART_LINE_BREAK_DETECT_LENGTH_11B
80# if defined(VSF_USART_OVER_SAMPLING_MASK)
81# if define VSF_USART_OVER_SAMPLING_16
82# define UART_OVERSAMPLING_16 VSF_USART_OVER_SAMPLING_16
84# if define VSF_USART_OVER_SAMPLING_8
85# define UART_OVERSAMPLING_8 VSF_USART_OVER_SAMPLING_8
89# if defined(VSF_USART_WAKEUP_METHOD_MASK)
90# if define VSF_USART_WAKEUP_METHOD_IDLE_LINE
91# define UART_WAKEUPMETHOD_IDLELINE VSF_USART_WAKEUP_METHOD_IDLE_LINE
93# if define VSF_USART_WAKEUP_METHOD_IDLE_ADDRESS_MARK
94# define UART_WAKEUPMETHOD_ADDRESSMARK \
95 VSF_USART_WAKEUP_METHOD_IDLE_ADDRESS_MARK
100# ifndef UART_LINBREAKDETECTLENGTH_10B
101# define UART_LINBREAKDETECTLENGTH_10B 0
104# ifndef UART_LINBREAKDETECTLENGTH_11B
105# define UART_LINBREAKDETECTLENGTH_11B 0
108# ifndef UART_OVERSAMPLING_16
109# define UART_OVERSAMPLING_16 0
112# ifndef UART_OVERSAMPLING_8
113# define UART_OVERSAMPLING_8 0
116# ifndef UART_WAKEUPMETHOD_IDLELINE
117# define UART_WAKEUPMETHOD_IDLELINE 0
120# ifndef UART_WAKEUPMETHOD_ADDRESSMARK
121# define UART_WAKEUPMETHOD_ADDRESSMARK 0
136} HAL_UART_StateTypeDef;
138# if (USE_HAL_UART_REGISTER_CALLBACKS == 1)
140 HAL_UART_TX_HALFCOMPLETE_CB_ID = __HAL_UART_TX_HALFCOMPLETE_CB_ID,
141 HAL_UART_TX_COMPLETE_CB_ID = __HAL_UART_TX_COMPLETE_CB_ID,
142 HAL_UART_RX_HALFCOMPLETE_CB_ID = __HAL_UART_RX_HALFCOMPLETE_CB_ID,
143 HAL_UART_RX_COMPLETE_CB_ID = __HAL_UART_RX_COMPLETE_CB_ID,
144 HAL_UART_ERROR_CB_ID = __HAL_UART_ERROR_CB_ID,
145 HAL_UART_ABORT_COMPLETE_CB_ID = __HAL_UART_ABORT_COMPLETE_CB_ID,
146 HAL_UART_ABORT_TRANSMIT_COMPLETE_CB_ID =
147 __HAL_UART_ABORT_TRANSMIT_COMPLETE_CB_ID,
148 HAL_UART_ABORT_RECEIVE_COMPLETE_CB_ID =
149 __HAL_UART_ABORT_RECEIVE_COMPLETE_CB_ID,
150 HAL_UART_WAKEUP_CB_ID = __HAL_UART_WAKEUP_CB_ID,
151 HAL_UART_MSPINIT_CB_ID = __HAL_UART_MSPINIT_CB_ID,
152 HAL_UART_MSPDEINIT_CB_ID = __HAL_UART_MSPDEINIT_CB_ID,
153} HAL_UART_CallbackIDTypeDef;
159typedef void (*pUART_CallbackTypeDef)(UART_HandleTypeDef *huart);
160typedef void (*pUART_RxEventCallbackTypeDef)(UART_HandleTypeDef *huart,
177# if (USE_HAL_UART_REGISTER_CALLBACKS == 1)
179 UART_HandleTypeDef *huart, HAL_UART_CallbackIDTypeDef CallbackID,
180 pUART_CallbackTypeDef pCallback);
182 UART_HandleTypeDef *huart, HAL_UART_CallbackIDTypeDef CallbackID);
185 UART_HandleTypeDef *huart, pUART_RxEventCallbackTypeDef pCallback);
215 UART_HandleTypeDef *huart);
unsigned short uint16_t
Definition lvgl.h:41
unsigned int uint32_t
Definition lvgl.h:43
unsigned char uint8_t
Definition lvgl.h:40
HAL_StatusTypeDef
Definition sthal_def.h:65
HAL_StatusTypeDef HAL_UART_Transmit(UART_HandleTypeDef *huart, const uint8_t *pData, uint16_t Size, uint32_t Timeout)
Definition sthal_uart.c:232
void HAL_UART_ErrorCallback(UART_HandleTypeDef *huart)
Definition sthal_uart.c:132
void HAL_UART_MspInit(UART_HandleTypeDef *huart)
Definition sthal_uart.c:175
void HAL_UART_AbortReceiveCpltCallback(UART_HandleTypeDef *huart)
Definition sthal_uart.c:150
HAL_StatusTypeDef HAL_UART_AbortTransmit_IT(UART_HandleTypeDef *huart)
Definition sthal_uart.c:339
void HAL_UART_RxHalfCpltCallback(UART_HandleTypeDef *huart)
Definition sthal_uart.c:126
HAL_StatusTypeDef HAL_LIN_Init(UART_HandleTypeDef *huart, uint32_t BreakDetectLength)
Definition sthal_uart.c:613
HAL_StatusTypeDef HAL_UART_Abort(UART_HandleTypeDef *huart)
Definition sthal_uart.c:307
HAL_StatusTypeDef HAL_UART_Abort_IT(UART_HandleTypeDef *huart)
Definition sthal_uart.c:331
HAL_UART_RxEventTypeTypeDef HAL_UARTEx_GetRxEventType(UART_HandleTypeDef *huart)
Definition sthal_uart.c:360
HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint16_t *RxLen, uint32_t Timeout)
Definition sthal_uart.c:569
HAL_StatusTypeDef HAL_HalfDuplex_EnableReceiver(UART_HandleTypeDef *huart)
Definition sthal_uart.c:551
void HAL_UARTEx_WakeupCallback(UART_HandleTypeDef *huart)
Definition sthal_uart.c:169
void HAL_UART_TxHalfCpltCallback(UART_HandleTypeDef *huart)
Definition sthal_uart.c:114
HAL_StatusTypeDef HAL_HalfDuplex_EnableTransmitter(UART_HandleTypeDef *huart)
Definition sthal_uart.c:543
HAL_StatusTypeDef HAL_UART_AbortTransmit(UART_HandleTypeDef *huart)
Definition sthal_uart.c:315
HAL_StatusTypeDef HAL_MultiProcessor_EnterMuteMode(UART_HandleTypeDef *huart)
Definition sthal_uart.c:627
HAL_StatusTypeDef HAL_UART_Transmit_IT(UART_HandleTypeDef *huart, const uint8_t *pData, uint16_t Size)
Definition sthal_uart.c:255
void HAL_UART_MspDeInit(UART_HandleTypeDef *huart)
Definition sthal_uart.c:181
uint32_t HAL_UART_GetError(const UART_HandleTypeDef *huart)
Definition sthal_uart.c:564
HAL_StatusTypeDef HAL_MultiProcessor_ExitMuteMode(UART_HandleTypeDef *huart)
Definition sthal_uart.c:635
HAL_StatusTypeDef HAL_UART_Transmit_DMA(UART_HandleTypeDef *huart, const uint8_t *pData, uint16_t Size)
Definition sthal_uart.c:277
HAL_StatusTypeDef HAL_UART_DMAPause(UART_HandleTypeDef *huart)
Definition sthal_uart.c:597
HAL_StatusTypeDef HAL_UART_DeInit(UART_HandleTypeDef *huart)
Definition sthal_uart.c:224
void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size)
Definition sthal_uart.c:156
HAL_StatusTypeDef HAL_HalfDuplex_Init(UART_HandleTypeDef *huart)
Definition sthal_uart.c:200
HAL_StatusTypeDef HAL_UART_AbortReceive(UART_HandleTypeDef *huart)
Definition sthal_uart.c:323
void HAL_UART_IRQHandler(UART_HandleTypeDef *huart)
Definition sthal_uart.c:368
HAL_StatusTypeDef HAL_UART_AbortReceive_IT(UART_HandleTypeDef *huart)
Definition sthal_uart.c:347
HAL_StatusTypeDef HAL_MultiProcessor_Init(UART_HandleTypeDef *huart, uint8_t Address, uint32_t WakeUpMethod)
Definition sthal_uart.c:209
HAL_StatusTypeDef HAL_UART_DMAStop(UART_HandleTypeDef *huart)
Definition sthal_uart.c:299
HAL_StatusTypeDef HAL_UART_Receive(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout)
Definition sthal_uart.c:244
void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
Definition sthal_uart.c:108
HAL_StatusTypeDef HAL_UART_Init(UART_HandleTypeDef *huart)
Definition sthal_uart.c:186
void HAL_UART_AbortCpltCallback(UART_HandleTypeDef *huart)
Definition sthal_uart.c:138
void HAL_UART_AbortTransmitCpltCallback(UART_HandleTypeDef *huart)
Definition sthal_uart.c:144
HAL_UART_StateTypeDef HAL_UART_GetState(const UART_HandleTypeDef *huart)
Definition sthal_uart.c:559
HAL_StatusTypeDef HAL_UART_Receive_DMA(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size)
Definition sthal_uart.c:288
HAL_StatusTypeDef HAL_UART_Receive_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size)
Definition sthal_uart.c:266
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
Definition sthal_uart.c:120
HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size)
Definition sthal_uart.c:579
HAL_StatusTypeDef HAL_UART_DMAResume(UART_HandleTypeDef *huart)
Definition sthal_uart.c:605
HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle_DMA(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size)
Definition sthal_uart.c:588
HAL_StatusTypeDef HAL_LIN_SendBreak(UART_HandleTypeDef *huart)
Definition sthal_uart.c:355
@ __HAL_UART_STATE_ERROR
Definition sthal_uart_base.h:73
@ __HAL_UART_STATE_READY
Definition sthal_uart_base.h:67
@ __HAL_UART_STATE_BUSY_TX
Definition sthal_uart_base.h:69
@ __HAL_UART_STATE_BUSY_TX_RX
Definition sthal_uart_base.h:71
@ __HAL_UART_STATE_RESET
Definition sthal_uart_base.h:66
@ __HAL_UART_STATE_TIMEOUT
Definition sthal_uart_base.h:72
@ __HAL_UART_STATE_BUSY
Definition sthal_uart_base.h:68
@ __HAL_UART_STATE_BUSY_RX
Definition sthal_uart_base.h:70
uint32_t HAL_UART_RxEventTypeTypeDef
Definition sthal_uart_base.h:78
Definition sthal_uart_base.h:80
Definition sthal_uart_base.h:39
Definition vsf_template_usart.h:726