18#ifndef __ST_HAL_SMARTCARD_H__
19#define __ST_HAL_SMARTCARD_H__
25#if VSF_HAL_USE_USART == ENABLED && defined(HAL_SMARTCARD_MODULE_ENABLED)
33# define HAL_SMARTCARD_ERROR_NONE 0x00000000U
34# define HAL_SMARTCARD_ERROR_PE 0x00000001U
35# define HAL_SMARTCARD_ERROR_NE 0x00000002U
36# define HAL_SMARTCARD_ERROR_FE 0x00000004U
37# define HAL_SMARTCARD_ERROR_ORE 0x00000008U
38# define HAL_SMARTCARD_ERROR_DMA 0x00000010U
39# if (USE_HAL_SMARTCARD_REGISTER_CALLBACKS == 1)
40# define HAL_SMARTCARD_ERROR_INVALID_CALLBACK 0x00000020U
43# define SMARTCARD_WORDLENGTH_9B VSF_USART_9_BIT_LENGTH
45# define SMARTCARD_STOPBITS_0_5 VSF_USART_0_5_STOPBIT
46# define SMARTCARD_STOPBITS_1_5 VSF_USART_1_5_STOPBIT
48# define SMARTCARD_PARITY_EVEN VSF_USART_EVEN_PARITY
49# define SMARTCARD_PARITY_ODD VSF_USART_ODD_PARITY
51# define SMARTCARD_MODE_RX (VSF_USART_TX_ENABLE | VSF_USART_RX_DISABLE)
52# define SMARTCARD_MODE_TX (VSF_USART_RX_ENABLE | VSF_USART_TX_DISABLE)
53# define SMARTCARD_MODE_TX_RX (VSF_USART_TX_ENABLE | VSF_USART_RX_ENABLE)
55# define SMARTCARD_POLARITY_LOW VSF_USART_SMARTCARD_CLOCK_POLARITY_LOW
56# define SMARTCARD_POLARITY_HIGH VSF_USART_SMARTCARD_CLOCK_POLARITY_HIGH
58# define SMARTCARD_PHASE_1EDGE VSF_USART_SMARTCARD_CLOCK_PHASE_1_EDGE
59# define SMARTCARD_PHASE_2EDGE VSF_USART_SMARTCARD_CLOCK_PHASE_2_EDGE
61# if defined(VSF_USART_SMARTCARD_LAST_BIT_MASK)
62# if define VSF_USART_SMARTCARD_CLOCK_LAST_BIT_DISABLE
63# define SMARTCARD_LASTBIT_DISABLE \
64 VSF_USART_SMARTCARD_CLOCK_LAST_BIT_DISABLE
66# if define VSF_USART_SMARTCARD_CLOCK_LAST_BIT_ENABLE
67# define SMARTCARD_LASTBIT_ENABLE \
68 VSF_USART_SMARTCARD_CLOCK_LAST_BIT_ENABLE
72# if defined(VSF_USART_SMARTCARD_NACK_MASK)
73# if define VSF_USART_SMARTCARD_NACK_ENABLE
74# define SMARTCARD_NACK_ENABLE VSF_USART_SMARTCARD_NACK_ENABLE
76# if define VSF_USART_SMARTCARD_NACK_DISABLE
77# define SMARTCARD_NACK_DISABLE VSF_USART_SMARTCARD_NACK_DISABLE
81# if defined(VSF_USART_SMARTCARD_NACK_MASK)
82# if define VSF_USART_SMARTCARD_NACK_ENABLE
83# define SMARTCARD_NACK_ENABLE VSF_USART_SMARTCARD_NACK_ENABLE
85# if define VSF_USART_SMARTCARD_NACK_DISABLE
86# define SMARTCARD_NACK_DISABLE VSF_USART_SMARTCARD_NACK_DISABLE
90# define SMARTCARD_PRESCALER_SYSCLK_DIV2 0x00000001U
91# define SMARTCARD_PRESCALER_SYSCLK_DIV4 0x00000002U
92# define SMARTCARD_PRESCALER_SYSCLK_DIV6 0x00000003U
93# define SMARTCARD_PRESCALER_SYSCLK_DIV8 0x00000004U
94# define SMARTCARD_PRESCALER_SYSCLK_DIV10 0x00000005U
95# define SMARTCARD_PRESCALER_SYSCLK_DIV12 0x00000006U
96# define SMARTCARD_PRESCALER_SYSCLK_DIV14 0x00000007U
97# define SMARTCARD_PRESCALER_SYSCLK_DIV16 0x00000008U
98# define SMARTCARD_PRESCALER_SYSCLK_DIV18 0x00000009U
99# define SMARTCARD_PRESCALER_SYSCLK_DIV20 0x0000000AU
100# define SMARTCARD_PRESCALER_SYSCLK_DIV22 0x0000000BU
101# define SMARTCARD_PRESCALER_SYSCLK_DIV24 0x0000000CU
102# define SMARTCARD_PRESCALER_SYSCLK_DIV26 0x0000000DU
103# define SMARTCARD_PRESCALER_SYSCLK_DIV28 0x0000000EU
104# define SMARTCARD_PRESCALER_SYSCLK_DIV30 0x0000000FU
105# define SMARTCARD_PRESCALER_SYSCLK_DIV32 0x00000010U
106# define SMARTCARD_PRESCALER_SYSCLK_DIV34 0x00000011U
107# define SMARTCARD_PRESCALER_SYSCLK_DIV36 0x00000012U
108# define SMARTCARD_PRESCALER_SYSCLK_DIV38 0x00000013U
109# define SMARTCARD_PRESCALER_SYSCLK_DIV40 0x00000014U
110# define SMARTCARD_PRESCALER_SYSCLK_DIV42 0x00000015U
111# define SMARTCARD_PRESCALER_SYSCLK_DIV44 0x00000016U
112# define SMARTCARD_PRESCALER_SYSCLK_DIV46 0x00000017U
113# define SMARTCARD_PRESCALER_SYSCLK_DIV48 0x00000018U
114# define SMARTCARD_PRESCALER_SYSCLK_DIV50 0x00000019U
115# define SMARTCARD_PRESCALER_SYSCLK_DIV52 0x0000001AU
116# define SMARTCARD_PRESCALER_SYSCLK_DIV54 0x0000001BU
117# define SMARTCARD_PRESCALER_SYSCLK_DIV56 0x0000001CU
118# define SMARTCARD_PRESCALER_SYSCLK_DIV58 0x0000001DU
119# define SMARTCARD_PRESCALER_SYSCLK_DIV60 0x0000001EU
120# define SMARTCARD_PRESCALER_SYSCLK_DIV62 0x0000001FU
123# ifndef SMARTCARD_LASTBIT_DISABLE
124# define SMARTCARD_LASTBIT_DISABLE 0
127# ifndef SMARTCARD_LASTBIT_ENABLE
128# define SMARTCARD_LASTBIT_ENABLE 0
131# ifndef SMARTCARD_NACK_ENABLE
132# define SMARTCARD_NACK_ENABLE 0
135# ifndef SMARTCARD_NACK_DISABLE
136# define SMARTCARD_NACK_DISABLE 0
151} HAL_SMARTCARD_StateTypeDef;
153# if (USE_HAL_SMARTCARD_REGISTER_CALLBACKS == 1)
155 HAL_SMARTCARD_TX_COMPLETE_CB_ID = __HAL_UART_TX_HALFCOMPLETE_CB_ID,
156 HAL_SMARTCARD_RX_COMPLETE_CB_ID = __HAL_UART_TX_COMPLETE_CB_ID,
157 HAL_SMARTCARD_ERROR_CB_ID = __HAL_UART_ERROR_CB_ID,
158 HAL_SMARTCARD_ABORT_COMPLETE_CB_ID = __HAL_UART_ABORT_COMPLETE_CB_ID,
159 HAL_SMARTCARD_ABORT_TRANSMIT_COMPLETE_CB_ID =
160 __HAL_UART_ABORT_TRANSMIT_COMPLETE_CB_ID,
161 HAL_SMARTCARD_ABORT_RECEIVE_COMPLETE_CB_ID =
162 __HAL_UART_ABORT_RECEIVE_COMPLETE_CB_ID,
163 HAL_SMARTCARD_MSPINIT_CB_ID = __HAL_UART_MSPINIT_CB_ID,
164 HAL_SMARTCARD_MSPDEINIT_CB_ID = __HAL_UART_MSPDEINIT_CB_ID
165} HAL_SMARTCARD_CallbackIDTypeDef;
171typedef void (*pSMARTCARD_CallbackTypeDef)(SMARTCARD_HandleTypeDef *hsc);
181# if (USE_HAL_SMARTCARD_REGISTER_CALLBACKS == 1)
183 SMARTCARD_HandleTypeDef *hsc, HAL_SMARTCARD_CallbackIDTypeDef CallbackID,
184 pSMARTCARD_CallbackTypeDef pCallback);
186 SMARTCARD_HandleTypeDef *hsc, HAL_SMARTCARD_CallbackIDTypeDef CallbackID);
222 const SMARTCARD_HandleTypeDef *hsc);
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_SMARTCARD_AbortTransmit_IT(SMARTCARD_HandleTypeDef *hsc)
Definition sthal_smartcard.c:344
HAL_StatusTypeDef HAL_SMARTCARD_AbortReceive_IT(SMARTCARD_HandleTypeDef *hsc)
Definition sthal_smartcard.c:352
void HAL_SMARTCARD_MspInit(SMARTCARD_HandleTypeDef *hsc)
Definition sthal_smartcard.c:76
HAL_StatusTypeDef HAL_SMARTCARD_Transmit_DMA(SMARTCARD_HandleTypeDef *hsc, const uint8_t *pData, uint16_t Size)
Definition sthal_smartcard.c:293
uint32_t HAL_SMARTCARD_GetError(const SMARTCARD_HandleTypeDef *hsc)
Definition sthal_smartcard.c:369
void HAL_SMARTCARD_AbortTransmitCpltCallback(SMARTCARD_HandleTypeDef *hsc)
Definition sthal_smartcard.c:63
HAL_StatusTypeDef HAL_SMARTCARD_Transmit_IT(SMARTCARD_HandleTypeDef *hsc, const uint8_t *pData, uint16_t Size)
Definition sthal_smartcard.c:275
HAL_StatusTypeDef HAL_SMARTCARD_AbortTransmit(SMARTCARD_HandleTypeDef *hsc)
Definition sthal_smartcard.c:320
HAL_StatusTypeDef HAL_SMARTCARD_DeInit(SMARTCARD_HandleTypeDef *hsc)
Definition sthal_smartcard.c:94
void HAL_SMARTCARD_AbortReceiveCpltCallback(SMARTCARD_HandleTypeDef *hsc)
Definition sthal_smartcard.c:70
void HAL_SMARTCARD_AbortCpltCallback(SMARTCARD_HandleTypeDef *hsc)
Definition sthal_smartcard.c:57
HAL_StatusTypeDef HAL_SMARTCARD_Receive_IT(SMARTCARD_HandleTypeDef *hsc, uint8_t *pData, uint16_t Size)
Definition sthal_smartcard.c:284
void HAL_SMARTCARD_IRQHandler(SMARTCARD_HandleTypeDef *hsc)
Definition sthal_smartcard.c:249
void HAL_SMARTCARD_ErrorCallback(SMARTCARD_HandleTypeDef *hsc)
Definition sthal_smartcard.c:51
HAL_StatusTypeDef HAL_SMARTCARD_Receive(SMARTCARD_HandleTypeDef *hsc, uint8_t *pData, uint16_t Size, uint32_t Timeout)
Definition sthal_smartcard.c:265
HAL_StatusTypeDef HAL_SMARTCARD_Init(SMARTCARD_HandleTypeDef *hsc)
Definition sthal_smartcard.c:87
void HAL_SMARTCARD_RxCpltCallback(SMARTCARD_HandleTypeDef *hsc)
Definition sthal_smartcard.c:45
HAL_StatusTypeDef HAL_SMARTCARD_Receive_DMA(SMARTCARD_HandleTypeDef *hsc, uint8_t *pData, uint16_t Size)
Definition sthal_smartcard.c:303
HAL_SMARTCARD_StateTypeDef HAL_SMARTCARD_GetState(const SMARTCARD_HandleTypeDef *hsc)
Definition sthal_smartcard.c:360
HAL_StatusTypeDef HAL_SMARTCARD_Abort_IT(SMARTCARD_HandleTypeDef *hsc)
Definition sthal_smartcard.c:336
HAL_StatusTypeDef HAL_SMARTCARD_Transmit(SMARTCARD_HandleTypeDef *hsc, const uint8_t *pData, uint16_t Size, uint32_t Timeout)
Definition sthal_smartcard.c:255
HAL_StatusTypeDef HAL_SMARTCARD_Abort(SMARTCARD_HandleTypeDef *hsc)
Definition sthal_smartcard.c:312
HAL_StatusTypeDef HAL_SMARTCARD_AbortReceive(SMARTCARD_HandleTypeDef *hsc)
Definition sthal_smartcard.c:328
void HAL_SMARTCARD_MspDeInit(SMARTCARD_HandleTypeDef *hsc)
Definition sthal_smartcard.c:82
void HAL_SMARTCARD_TxCpltCallback(SMARTCARD_HandleTypeDef *hsc)
Definition sthal_smartcard.c:39
@ __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
Definition sthal_uart_base.h:80
Definition sthal_uart_base.h:39
Definition vsf_template_usart.h:726