18#ifndef __ST_HAL_USART_H__
19#define __ST_HAL_USART_H__
25#if VSF_HAL_USE_USART == ENABLED && defined(HAL_USART_MODULE_ENABLED)
34# define IS_USART_INSTANCE(INSTANCE) 1
36# define HAL_USART_ERROR_NONE 0x00000000U
37# define HAL_USART_ERROR_PE 0x00000001U
38# define HAL_USART_ERROR_NE 0x00000002U
39# define HAL_USART_ERROR_FE 0x00000004U
40# define HAL_USART_ERROR_ORE 0x00000008U
41# define HAL_USART_ERROR_DMA 0x00000010U
42# if (USE_HAL_USART_REGISTER_CALLBACKS == 1)
43# define HAL_USART_ERROR_INVALID_CALLBACK 0x00000020U
46# define USART_WORDLENGTH_8B VSF_USART_8_BIT_LENGTH
47# define USART_WORDLENGTH_9B VSF_USART_9_BIT_LENGTH
49# define USART_STOPBITS_1 VSF_USART_1_STOPBIT
50# define USART_STOPBITS_0_5 VSF_USART_0_5_STOPBIT
51# define USART_STOPBITS_2 VSF_USART_2_STOPBIT
52# define USART_STOPBITS_1_5 VSF_USART_1_5_STOPBIT
54# define USART_PARITY_NONE VSF_USART_NO_PARITY
55# define USART_PARITY_EVEN VSF_USART_EVEN_PARITY
56# define USART_PARITY_ODD VSF_USART_ODD_PARITY
58# define USART_MODE_RX (VSF_USART_TX_ENABLE | VSF_USART_RX_DISABLE)
59# define USART_MODE_TX (VSF_USART_RX_ENABLE | VSF_USART_TX_DISABLE)
60# define USART_MODE_TX_RX (VSF_USART_TX_ENABLE | VSF_USART_RX_ENABLE)
62# define USART_CLOCK_DISABLE VSF_USART_SYNC_CLOCK_DISABLE
63# define USART_CLOCK_ENABLE VSF_USART_SYNC_CLOCK_ENABLE
65# define USART_POLARITY_LOW VSF_USART_SYNC_CLOCK_POLARITY_LOW
66# define USART_POLARITY_HIGH VSF_USART_SYNC_CLOCK_POLARITY_HIGH
68# define USART_PHASE_1EDGE VSF_USART_SYNC_CLOCK_PHASE_1_EDGE
69# define USART_PHASE_2EDGE VSF_USART_SYNC_CLOCK_PHASE_2_EDGE
71# ifdef VSF_USART_SYNC_CLOCK_LAST_BIT_MASK
72# ifdef VSF_USART_SYNC_CLOCK_LAST_BIT_DISABLE
73# define USART_LASTBIT_DISABLE VSF_USART_SYNC_CLOCK_LAST_BIT_DISABLE
76# ifdef VSF_USART_SYNC_CLOCK_LAST_BIT_ENABLE
77# define USART_LASTBIT_ENABLE VSF_USART_SYNC_CLOCK_LAST_BIT_ENABLE
81# ifndef USART_LASTBIT_DISABLE
82# define USART_LASTBIT_DISABLE 0
85# ifndef USART_LASTBIT_ENABLE
86# define USART_LASTBIT_ENABLE 0
101} HAL_USART_StateTypeDef;
103# if (USE_HAL_USART_REGISTER_CALLBACKS == 1)
105 HAL_USART_TX_RX_COMPLETE_CB_ID = __HAL_UART_TX_RX_COMPLETE_CB_ID,
106 HAL_USART_TX_HALFCOMPLETE_CB_ID = __HAL_UART_TX_HALFCOMPLETE_CB_ID,
107 HAL_USART_TX_COMPLETE_CB_ID = __HAL_UART_TX_COMPLETE_CB_ID,
108 HAL_USART_RX_HALFCOMPLETE_CB_ID = __HAL_UART_RX_HALFCOMPLETE_CB_ID,
109 HAL_USART_RX_COMPLETE_CB_ID = __HAL_UART_RX_COMPLETE_CB_ID,
110 HAL_USART_ERROR_CB_ID = __HAL_UART_ERROR_CB_ID,
111 HAL_USART_ABORT_COMPLETE_CB_ID = __HAL_UART_ABORT_COMPLETE_CB_ID,
112 HAL_USART_MSPINIT_CB_ID = __HAL_UART_MSPINIT_CB_ID,
113 HAL_USART_MSPDEINIT_CB_ID = __HAL_UART_MSPDEINIT_CB_ID,
114} HAL_USART_CallbackIDTypeDef;
121typedef void (*pUSART_CallbackTypeDef)(USART_HandleTypeDef *husart);
131# if (USE_HAL_USART_REGISTER_CALLBACKS == 1)
133 USART_HandleTypeDef *husart, HAL_USART_CallbackIDTypeDef CallbackID,
134 pUSART_CallbackTypeDef pCallback);
136 USART_HandleTypeDef *husart, HAL_USART_CallbackIDTypeDef CallbackID);
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
void HAL_USART_TxRxCpltCallback(USART_HandleTypeDef *huart)
Definition sthal_uart.c:163
@ __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
void HAL_USART_TxHalfCpltCallback(USART_HandleTypeDef *husart)
Definition sthal_usart.c:44
void HAL_USART_TxCpltCallback(USART_HandleTypeDef *husart)
Definition sthal_usart.c:38
HAL_StatusTypeDef HAL_USART_Transmit_DMA(USART_HandleTypeDef *husart, const uint8_t *pTxData, uint16_t Size)
Definition sthal_usart.c:330
HAL_StatusTypeDef HAL_USART_Receive_IT(USART_HandleTypeDef *husart, uint8_t *pRxData, uint16_t Size)
Definition sthal_usart.c:308
HAL_StatusTypeDef HAL_USART_Receive(USART_HandleTypeDef *husart, uint8_t *pRxData, uint16_t Size, uint32_t Timeout)
Definition sthal_usart.c:275
HAL_StatusTypeDef HAL_USART_Transmit_IT(USART_HandleTypeDef *husart, const uint8_t *pTxData, uint16_t Size)
Definition sthal_usart.c:299
HAL_StatusTypeDef HAL_USART_DMAResume(USART_HandleTypeDef *husart)
Definition sthal_usart.c:370
void HAL_USART_RxHalfCpltCallback(USART_HandleTypeDef *husart)
Definition sthal_usart.c:56
HAL_StatusTypeDef HAL_USART_Init(USART_HandleTypeDef *husart)
Definition sthal_usart.c:92
HAL_StatusTypeDef HAL_USART_TransmitReceive_DMA(USART_HandleTypeDef *husart, const uint8_t *pTxData, uint8_t *pRxData, uint16_t Size)
Definition sthal_usart.c:348
void HAL_USART_IRQHandler(USART_HandleTypeDef *husart)
Definition sthal_usart.c:259
HAL_StatusTypeDef HAL_USART_Transmit(USART_HandleTypeDef *husart, const uint8_t *pTxData, uint16_t Size, uint32_t Timeout)
Definition sthal_usart.c:265
void HAL_USART_RxCpltCallback(USART_HandleTypeDef *husart)
Definition sthal_usart.c:50
HAL_StatusTypeDef HAL_USART_TransmitReceive(USART_HandleTypeDef *husart, const uint8_t *pTxData, uint8_t *pRxData, uint16_t Size, uint32_t Timeout)
Definition sthal_usart.c:285
HAL_USART_StateTypeDef HAL_USART_GetState(const USART_HandleTypeDef *husart)
Definition sthal_usart.c:402
void HAL_USART_MspDeInit(USART_HandleTypeDef *husart)
Definition sthal_usart.c:87
HAL_StatusTypeDef HAL_USART_TransmitReceive_IT(USART_HandleTypeDef *husart, const uint8_t *pTxData, uint8_t *pRxData, uint16_t Size)
Definition sthal_usart.c:317
void HAL_USART_AbortCpltCallback(USART_HandleTypeDef *husart)
Definition sthal_usart.c:74
HAL_StatusTypeDef HAL_USART_Abort(USART_HandleTypeDef *husart)
Definition sthal_usart.c:386
HAL_StatusTypeDef HAL_USART_Receive_DMA(USART_HandleTypeDef *husart, uint8_t *pRxData, uint16_t Size)
Definition sthal_usart.c:339
HAL_StatusTypeDef HAL_USART_DMAPause(USART_HandleTypeDef *husart)
Definition sthal_usart.c:362
HAL_StatusTypeDef HAL_USART_DeInit(USART_HandleTypeDef *husart)
Definition sthal_usart.c:100
HAL_StatusTypeDef HAL_USART_DMAStop(USART_HandleTypeDef *husart)
Definition sthal_usart.c:378
void HAL_USART_MspInit(USART_HandleTypeDef *husart)
Definition sthal_usart.c:80
HAL_StatusTypeDef HAL_USART_Abort_IT(USART_HandleTypeDef *husart)
Definition sthal_usart.c:394
void HAL_USART_ErrorCallback(USART_HandleTypeDef *husart)
Definition sthal_usart.c:68
uint32_t HAL_USART_GetError(const USART_HandleTypeDef *husart)
Definition sthal_usart.c:407
Definition sthal_uart_base.h:80
Definition sthal_uart_base.h:39
Definition vsf_template_usart.h:726