Go to the documentation of this file.
52 #ifndef __GR55xx_HAL_ISO7816_H__
53 #define __GR55xx_HAL_ISO7816_H__
117 #define ISO7816_DEFAULT_CONFIG \
121 .guard_time = 0x00, \
122 .detect_coding = ENABLE, \
200 #define HAL_ISO7816_ACTION_NONE LL_ISO7816_ACTION_NONE
201 #define HAL_ISO7816_ACTION_OFF LL_ISO7816_ACTION_OFF
202 #define HAL_ISO7816_ACTION_STOPCLK LL_ISO7816_ACTION_STOPCLK
203 #define HAL_ISO7816_ACTION_ON LL_ISO7816_ACTION_ON
204 #define HAL_ISO7816_ACTION_WARMRST LL_ISO7816_ACTION_WARMRST
205 #define HAL_ISO7816_ACTION_RX LL_ISO7816_ACTION_RX
206 #define HAL_ISO7816_ACTION_TX LL_ISO7816_ACTION_TX
207 #define HAL_ISO7816_ACTION_TXRX LL_ISO7816_ACTION_TXRX
213 #define HAL_ISO7816_INTR_TEST LL_ISO7816_INTR_TEST
214 #define HAL_ISO7816_INTR_PRESENCE LL_ISO7816_INTR_PRESENCE
215 #define HAL_ISO7816_INTR_STATE_ERR LL_ISO7816_INTR_STATE_ERR
216 #define HAL_ISO7816_INTR_DMA_ERR LL_ISO7816_INTR_DMA_ERR
217 #define HAL_ISO7816_INTR_RETRY_ERR LL_ISO7816_INTR_RETRY_ERR
218 #define HAL_ISO7816_INTR_RX_ERR LL_ISO7816_INTR_RX_ERR
219 #define HAL_ISO7816_INTR_DONE LL_ISO7816_INTR_DONE
226 #define HAL_ISO7816_CARD_ABSENT LL_ISO7816_CARD_ABSENT
227 #define HAL_ISO7816_CARD_PRESENT LL_ISO7816_CARD_PRESENT
233 #define HAL_ISO7816_IO_STATE_OFF LL_ISO7816_IO_STATE_OFF
234 #define HAL_ISO7816_IO_STATE_IDLE LL_ISO7816_IO_STATE_IDLE
235 #define HAL_ISO7816_IO_STATE_RX_WAIT LL_ISO7816_IO_STATE_RX_WAIT
236 #define HAL_ISO7816_IO_STATE_RX LL_ISO7816_IO_STATE_RX
237 #define HAL_ISO7816_IO_STATE_TX LL_ISO7816_IO_STATE_TX
238 #define HAL_ISO7816_IO_STATE_TX_GUARD LL_ISO7816_IO_STATE_TX_GUARD
244 #define HAL_ISO7816_PWR_STATE_OFF LL_ISO7816_PWR_STATE_OFF
245 #define HAL_ISO7816_PWR_STATE_PWRUP_VCC LL_ISO7816_PWR_STATE_PWRUP_VCC
246 #define HAL_ISO7816_PWR_STATE_PWRUP_RST LL_ISO7816_PWR_STATE_PWRUP_RST
247 #define HAL_ISO7816_PWR_STATE_PWRDN_RST LL_ISO7816_PWR_STATE_PWRDN_RST
248 #define HAL_ISO7816_PWR_STATE_PWRDN_VCC LL_ISO7816_PWR_STATE_PWRDN_VCC
249 #define HAL_ISO7816_PWR_STATE_STOP_PRE LL_ISO7816_PWR_STATE_STOP_PRE
250 #define HAL_ISO7816_PWR_STATE_STOP LL_ISO7816_PWR_STATE_STOP
251 #define HAL_ISO7816_PWR_STATE_STOP_POST LL_ISO7816_PWR_STATE_STOP_POST
252 #define HAL_ISO7816_PWR_STATE_IDLE LL_ISO7816_PWR_STATE_IDLE
253 #define HAL_ISO7816_PWR_STATE_RX_TS0 LL_ISO7816_PWR_STATE_RX_TS0
254 #define HAL_ISO7816_PWR_STATE_RX_TS1 LL_ISO7816_PWR_STATE_RX_TS1
255 #define HAL_ISO7816_PWR_STATE_RX LL_ISO7816_PWR_STATE_RX
256 #define HAL_ISO7816_PWR_STATE_TX LL_ISO7816_PWR_STATE_TX
257 #define HAL_ISO7816_PWR_STATE_TX_RX LL_ISO7816_PWR_STATE_TX_RX
263 #define HAL_ISO7816_ERROR_NONE ((uint32_t)0x00000000)
264 #define HAL_ISO7816_ERROR_TIMEOUT ((uint32_t)0x00000001)
265 #define HAL_ISO7816_ERROR_TRANSFER ((uint32_t)0x00000002)
266 #define HAL_ISO7816_ERROR_INVALID_PARAM ((uint32_t)0x00000008)
289 #define __HAL_ISO7816_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BITS((__HANDLE__)->p_instance->INT_MASK, (__INTERRUPT__))
304 #define __HAL_ISO7816_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BITS((__HANDLE__)->p_instance->INT_MASK, (__INTERRUPT__))
310 #define __HAL_ISO7816_IT_GET_IT_FLAG(__ISO7816_REGS) ll_iso7816_get_it_flag(__ISO7816_REGS)
hal_status_t hal_iso7816_suspend_reg(iso7816_handle_t *p_iso7816)
Suspend some registers related to ISO7816 configuration before sleep.
hal_status_t hal_iso7816_transmit_receive_it(iso7816_handle_t *p_iso7816, uint16_t tx_size, uint16_t rx_size)
Transimit and receive data in non-blocking mode with Interrupt.
void hal_iso7816_abort_cplt_callback(iso7816_handle_t *p_iso7816)
ISO7816 Abort Completed callback.
hal_lock_t
HAL Lock structures definition.
uint32_t hal_iso7816_get_error(iso7816_handle_t *p_iso7816)
Return the ISO7816 error code.
void(* iso7816_presence_callback)(iso7816_handle_t *p_iso7816)
ISO7816 handle Structure definition.
__IO hal_iso7816_state_t rx_state
HAL_ISO7816 Callback function definition.
hal_status_t hal_iso7816_receive(iso7816_handle_t *p_iso7816, uint16_t rx_size, uint32_t timeout)
Receive data in blocking mode.
hal_status_t hal_iso7816_transmit_it(iso7816_handle_t *p_iso7816, uint16_t tx_size)
Transimit data in non-blocking mode with Interrupt.
uint32_t hal_iso7816_get_power_states(iso7816_handle_t *p_iso7816)
Get ISO7816 Power States.
void(* iso7816_tx_cplt_callback)(iso7816_handle_t *p_iso7816)
hal_status_t hal_iso7816_resume_reg(iso7816_handle_t *p_iso7816)
Restore some registers related to ISO7816 configuration after sleep. This function must be used in co...
hal_status_t hal_iso7816_receive_it(iso7816_handle_t *p_iso7816, uint16_t rx_size)
Receive data in non-blocking mode with Interrupt.
@ HAL_ISO7816_STATE_READY
void(* iso7816_error_callback)(iso7816_handle_t *p_iso7816)
void hal_iso7816_msp_deinit(iso7816_handle_t *p_iso7816)
De-initialize the ISO7816 MSP.
@ HAL_ISO7816_STATE_ERROR
__IO hal_iso7816_state_t state
@ HAL_ISO7816_STATE_ABORT
struct _iso7816_callback iso7816_callback_t
HAL_ISO7816 Callback function definition.
hal_iso7816_state_t hal_iso7816_get_state(iso7816_handle_t *p_iso7816)
Return the ISO7816 handle state.
hal_status_t hal_iso7816_abort(iso7816_handle_t *p_iso7816)
Transfer Abort functions.
void(* iso7816_tx_rx_cplt_callback)(iso7816_handle_t *p_iso7816)
void hal_iso7816_msp_init(iso7816_handle_t *p_iso7816)
Initialize the ISO7816 MSP.
void hal_iso7816_atr_cplt_callback(iso7816_handle_t *p_iso7816)
Receive ART completed callback.
hal_status_t hal_iso7816_transmit_receive(iso7816_handle_t *p_iso7816, uint16_t tx_size, uint16_t rx_size, uint32_t timeout)
Transimit and receive data in blocking mode.
@ HAL_ISO7816_STATE_TIMEOUT
void hal_iso7816_irq_handler(iso7816_handle_t *p_iso7816)
Handle ISO7816 interrupt request.
Header file containing functions prototypes of ISO7816 LL library.
void(* iso7816_msp_deinit)(iso7816_handle_t *p_iso7816)
hal_status_t hal_iso7816_init(iso7816_handle_t *p_iso7816)
Initializes the ISO7816 according to the specified parameters in the iso7816_init_t and initialize th...
@ HAL_ISO7816_STATE_BUSY_TX_RX
@ HAL_ISO7816_STATE_BUSY_RX
void(* iso7816_atr_cplt_callback)(iso7816_handle_t *p_iso7816)
hal_status_t
HAL Status structures definition.
__IO uint32_t previous_action
hal_status_t hal_iso7816_set_etudiv(iso7816_handle_t *p_iso7816, uint32_t divide)
Set divide ISO7816 clock.
void hal_iso7816_rx_cplt_callback(iso7816_handle_t *p_iso7816)
Rx Transfer completed callback.
hal_status_t hal_iso7816_deinit(iso7816_handle_t *p_iso7816)
De-initializes the ISO7816 according to the specified parameters in the iso7816_init_t and initialize...
__IO uint16_t tx_xfer_count
void(* iso7816_rx_cplt_callback)(iso7816_handle_t *p_iso7816)
void hal_iso7816_tx_cplt_callback(iso7816_handle_t *p_iso7816)
Tx Transfer completed callback.
hal_iso7816_state_t
HAL ISO7816 State Enumerations definition.
__IO hal_iso7816_state_t tx_state
void hal_iso7816_presence_callback(iso7816_handle_t *p_iso7816)
Card presence state changed callback.
void(* iso7816_abort_cplt_callback)(iso7816_handle_t *p_iso7816)
@ HAL_ISO7816_STATE_RESET
__IO uint16_t rx_xfer_count
void hal_iso7816_tx_rx_cplt_callback(iso7816_handle_t *p_iso7816)
Tx and Rx Transfer completed callback.
void(* iso7816_msp_init)(iso7816_handle_t *p_iso7816)
ISO7816_init_structure ISO7816 init structure definition.
hal_status_t hal_iso7816_transmit(iso7816_handle_t *p_iso7816, uint16_t tx_size, uint32_t timeout)
Transimit data in blocking mode.
iso7816_regs_t * p_instance
@ HAL_ISO7816_STATE_BUSY_TX
void hal_iso7816_error_callback(iso7816_handle_t *p_iso7816)
ISO7816 error callback.
This file contains HAL common definitions, enumeration, macros and structures definitions.
struct _iso7816_handle_t iso7816_handle_t
ISO7816 handle Structure definition.
hal_status_t hal_iso7816_set_action(iso7816_handle_t *p_iso7816, uint32_t action)
Request ISO7816 to go to the next action.