Go to the documentation of this file.
52 #ifndef __GR55xx_HAL_ISO7816_H__
53 #define __GR55xx_HAL_ISO7816_H__
184 #define HAL_ISO7816_ACTION_NONE LL_ISO7816_ACTION_NONE
185 #define HAL_ISO7816_ACTION_OFF LL_ISO7816_ACTION_OFF
186 #define HAL_ISO7816_ACTION_STOPCLK LL_ISO7816_ACTION_STOPCLK
187 #define HAL_ISO7816_ACTION_ON LL_ISO7816_ACTION_ON
188 #define HAL_ISO7816_ACTION_WARMRST LL_ISO7816_ACTION_WARMRST
189 #define HAL_ISO7816_ACTION_RX LL_ISO7816_ACTION_RX
190 #define HAL_ISO7816_ACTION_TX LL_ISO7816_ACTION_TX
191 #define HAL_ISO7816_ACTION_TXRX LL_ISO7816_ACTION_TXRX
197 #define HAL_ISO7816_INTR_TEST LL_ISO7816_INTR_TEST
198 #define HAL_ISO7816_INTR_PRESENCE LL_ISO7816_INTR_PRESENCE
199 #define HAL_ISO7816_INTR_STATE_ERR LL_ISO7816_INTR_STATE_ERR
200 #define HAL_ISO7816_INTR_DMA_ERR LL_ISO7816_INTR_DMA_ERR
201 #define HAL_ISO7816_INTR_RETRY_ERR LL_ISO7816_INTR_RETRY_ERR
202 #define HAL_ISO7816_INTR_RX_ERR LL_ISO7816_INTR_RX_ERR
203 #define HAL_ISO7816_INTR_DONE LL_ISO7816_INTR_DONE
210 #define HAL_ISO7816_CARD_ABSENT LL_ISO7816_CARD_ABSENT
211 #define HAL_ISO7816_CARD_PRESENT LL_ISO7816_CARD_PRESENT
217 #define HAL_ISO7816_IO_STATE_OFF LL_ISO7816_IO_STATE_OFF
218 #define HAL_ISO7816_IO_STATE_IDLE LL_ISO7816_IO_STATE_IDLE
219 #define HAL_ISO7816_IO_STATE_RX_WAIT LL_ISO7816_IO_STATE_RX_WAIT
220 #define HAL_ISO7816_IO_STATE_RX LL_ISO7816_IO_STATE_RX
221 #define HAL_ISO7816_IO_STATE_TX LL_ISO7816_IO_STATE_TX
222 #define HAL_ISO7816_IO_STATE_TX_GUARD LL_ISO7816_IO_STATE_TX_GUARD
228 #define HAL_ISO7816_PWR_STATE_OFF LL_ISO7816_PWR_STATE_OFF
229 #define HAL_ISO7816_PWR_STATE_PWRUP_VCC LL_ISO7816_PWR_STATE_PWRUP_VCC
230 #define HAL_ISO7816_PWR_STATE_PWRUP_RST LL_ISO7816_PWR_STATE_PWRUP_RST
231 #define HAL_ISO7816_PWR_STATE_PWRDN_RST LL_ISO7816_PWR_STATE_PWRDN_RST
232 #define HAL_ISO7816_PWR_STATE_PWRDN_VCC LL_ISO7816_PWR_STATE_PWRDN_VCC
233 #define HAL_ISO7816_PWR_STATE_STOP_PRE LL_ISO7816_PWR_STATE_STOP_PRE
234 #define HAL_ISO7816_PWR_STATE_STOP LL_ISO7816_PWR_STATE_STOP
235 #define HAL_ISO7816_PWR_STATE_STOP_POST LL_ISO7816_PWR_STATE_STOP_POST
236 #define HAL_ISO7816_PWR_STATE_IDLE LL_ISO7816_PWR_STATE_IDLE
237 #define HAL_ISO7816_PWR_STATE_RX_TS0 LL_ISO7816_PWR_STATE_RX_TS0
238 #define HAL_ISO7816_PWR_STATE_RX_TS1 LL_ISO7816_PWR_STATE_RX_TS1
239 #define HAL_ISO7816_PWR_STATE_RX LL_ISO7816_PWR_STATE_RX
240 #define HAL_ISO7816_PWR_STATE_TX LL_ISO7816_PWR_STATE_TX
241 #define HAL_ISO7816_PWR_STATE_TX_RX LL_ISO7816_PWR_STATE_TX_RX
247 #define HAL_ISO7816_ERROR_NONE ((uint32_t)0x00000000)
248 #define HAL_ISO7816_ERROR_TIMEOUT ((uint32_t)0x00000001)
249 #define HAL_ISO7816_ERROR_TRANSFER ((uint32_t)0x00000002)
250 #define HAL_ISO7816_ERROR_INVALID_PARAM ((uint32_t)0x00000008)
256 #define ISO7816_DEFAULT_CONFIG \
260 .guard_time = 0x00, \
261 .detect_coding = ENABLE, \
284 #define __HAL_ISO7816_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BITS((__HANDLE__)->p_instance->INT_MASK, (__INTERRUPT__))
299 #define __HAL_ISO7816_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BITS((__HANDLE__)->p_instance->INT_MASK, (__INTERRUPT__))
305 #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.
ISO7816 handle Structure definition.
__IO hal_iso7816_state_t rx_state
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.
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...
void(* iso7816_error_callback)(iso7816_handle_t *p_iso7816)
hal_status_t hal_iso7816_receive_it(iso7816_handle_t *p_iso7816, uint16_t rx_size)
Receive data in non-blocking mode with Interrupt.
void(* iso7816_tx_rx_cplt_callback)(iso7816_handle_t *p_iso7816)
void(* iso7816_presence_callback)(iso7816_handle_t *p_iso7816)
@ HAL_ISO7816_STATE_READY
void(* iso7816_tx_cplt_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
void(* iso7816_rx_cplt_callback)(iso7816_handle_t *p_iso7816)
@ HAL_ISO7816_STATE_ABORT
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_msp_deinit)(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.
void(* iso7816_msp_init)(iso7816_handle_t *p_iso7816)
Header file containing functions prototypes of ISO7816 LL library.
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
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 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.
@ 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.
HAL_ISO7816 Callback function definition.
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
struct _hal_iso7816_callback hal_iso7816_callback_t
HAL_ISO7816 Callback function definition.
@ HAL_ISO7816_STATE_BUSY_TX
void(* iso7816_abort_cplt_callback)(iso7816_handle_t *p_iso7816)
void hal_iso7816_error_callback(iso7816_handle_t *p_iso7816)
ISO7816 error callback.
This file contains HAL common definitions, enumeration, macros and structures definitions.
void(* iso7816_atr_cplt_callback)(iso7816_handle_t *p_iso7816)
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.