app_iso7816.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file app_iso7816.h
5 * @author BLE Driver Team
6 * @brief Header file containing functions prototypes of ISO7816 app library.
7 *
8 ****************************************************************************************
9 * @attention
10 #####Copyright (c) 2019 GOODIX
11 All rights reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15 * Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright
18 notice, this list of conditions and the following disclaimer in the
19 documentation and/or other materials provided with the distribution.
20 * Neither the name of GOODIX nor the names of its contributors may be used
21 to endorse or promote products derived from this software without
22 specific prior written permission.
23
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35 ****************************************************************************************
36 */
37
38 /** @addtogroup PERIPHERAL Peripheral Driver
39 * @{
40 */
41
42 /** @addtogroup APP_DRIVER APP DRIVER
43 * @{
44 */
45
46 /** @defgroup APP_ISO7816 ISO7816
47 * @brief ISO7816 APP module driver.
48 * @{
49 */
50
51
52 #ifndef _APP_ISO7816_H_
53 #define _APP_ISO7816_H_
54
55 #include "grx_hal.h"
56 #include "app_io.h"
57 #include "app_drv_error.h"
58 #include "app_drv_config.h"
59 #include "stdbool.h"
60
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64
65 #ifdef HAL_ISO7816_MODULE_ENABLED
66 /** @addtogroup APP_ISO7816_DEFINE Defines
67 * @{
68 */
69
70 /** @defgroup APP_ISO7816_ACTION Action state
71 * @{
72 */
73 #define APP_ISO7816_ACTION_NONE HAL_ISO7816_ACTION_NONE /**< Do Nothing */
74 #define APP_ISO7816_ACTION_OFF HAL_ISO7816_ACTION_OFF /**< Switch Off */
75 #define APP_ISO7816_ACTION_STOPCLK HAL_ISO7816_ACTION_STOPCLK /**< Stop the clock */
76 #define APP_ISO7816_ACTION_ON HAL_ISO7816_ACTION_ON /**< Switch on and receive ATR */
77 #define APP_ISO7816_ACTION_WARMRST HAL_ISO7816_ACTION_WARMRST /**< Trigger warm reset and receive ATR */
78 #define APP_ISO7816_ACTION_RX HAL_ISO7816_ACTION_RX /**< Receive */
79 #define APP_ISO7816_ACTION_TX HAL_ISO7816_ACTION_TX /**< Transmit */
80 #define APP_ISO7816_ACTION_TXRX HAL_ISO7816_ACTION_TXRX /**< Transmit, followed by RX */
81 /** @} */
82
83 /** @defgroup APP_ISO7816_Interrupt_definition ISO7816 Interrupt Definition
84 * @{
85 */
86 #define APP_ISO7816_INTR_PRESENCE HAL_ISO7816_INTR_PRESENCE /**< Source presence interrupt */
87 #define APP_ISO7816_INTR_STATE_ERR HAL_ISO7816_INTR_STATE_ERR /**< Source state error interrupt */
88 #define APP_ISO7816_INTR_DMA_ERR HAL_ISO7816_INTR_DMA_ERR /**< Source dma error interrupt */
89 #define APP_ISO7816_INTR_RETRY_ERR HAL_ISO7816_INTR_RETRY_ERR /**< Source retry error interrupt */
90 #define APP_ISO7816_INTR_RX_ERR HAL_ISO7816_INTR_RX_ERR /**< Source rx error interrupt */
91 #define APP_ISO7816_INTR_DONE HAL_ISO7816_INTR_DONE /**< Source done error interrupt */
92 /** @} */
93
94
95 /** @defgroup APP_ISO7816_CARD_PRESENCE Card Presence Defines
96 * @{
97 */
98 #define APP_ISO7816_CARD_ABSENT HAL_ISO7816_CARD_ABSENT /**< SIM Card is absent */
99 #define APP_ISO7816_CARD_PRESENT HAL_ISO7816_CARD_PRESENT /**< SIM Card is present */
100 /** @} */
101
102 /** @defgroup APP_ISO7816_IO_STATES IO States Defines
103 * @{
104 */
105 #define APP_ISO7816_IO_STATE_OFF HAL_ISO7816_IO_STATE_OFF /**< Off */
106 #define APP_ISO7816_IO_STATE_IDLE HAL_ISO7816_IO_STATE_IDLE /**< Idle */
107 #define APP_ISO7816_IO_STATE_RX_WAIT HAL_ISO7816_IO_STATE_RX_WAIT /**< Receive Wait */
108 #define APP_ISO7816_IO_STATE_RX HAL_ISO7816_IO_STATE_RX /**< Receive */
109 #define APP_ISO7816_IO_STATE_TX HAL_ISO7816_IO_STATE_TX /**< Transmit */
110 #define APP_ISO7816_IO_STATE_TX_GUARD HAL_ISO7816_IO_STATE_TX_GUARD /**< Transmit Guard */
111 /** @} */
112
113 /** @defgroup APP_ISO7816_PWR_STATES Power States Defines
114 * @{
115 */
116 #define APP_ISO7816_PWR_STATE_OFF HAL_ISO7816_PWR_STATE_OFF /**< Off */
117 #define APP_ISO7816_PWR_STATE_PWRUP_VCC HAL_ISO7816_PWR_STATE_PWRUP_VCC /**< Power up VCC */
118 #define APP_ISO7816_PWR_STATE_PWRUP_RST HAL_ISO7816_PWR_STATE_PWRUP_RST /**< Power up reset */
119 #define APP_ISO7816_PWR_STATE_PWRDN_RST HAL_ISO7816_PWR_STATE_PWRDN_RST /**< Power Down reset */
120 #define APP_ISO7816_PWR_STATE_PWRDN_VCC HAL_ISO7816_PWR_STATE_PWRDN_VCC /**< Power Down VCC */
121 #define APP_ISO7816_PWR_STATE_STOP_PRE HAL_ISO7816_PWR_STATE_STOP_PRE /**< Preparing Clock Stop */
122 #define APP_ISO7816_PWR_STATE_STOP HAL_ISO7816_PWR_STATE_STOP /**< Clock Stopped */
123 #define APP_ISO7816_PWR_STATE_STOP_POST HAL_ISO7816_PWR_STATE_STOP_POST /**< Exiting Clock Stop */
124 #define APP_ISO7816_PWR_STATE_IDLE HAL_ISO7816_PWR_STATE_IDLE /**< Idle */
125 #define APP_ISO7816_PWR_STATE_RX_TS0 HAL_ISO7816_PWR_STATE_RX_TS0 /**< RX TS Character */
126 #define APP_ISO7816_PWR_STATE_RX_TS1 HAL_ISO7816_PWR_STATE_RX_TS1 /**< RX TS Character */
127 #define APP_ISO7816_PWR_STATE_RX HAL_ISO7816_PWR_STATE_RX /**< Receive */
128 #define APP_ISO7816_PWR_STATE_TX HAL_ISO7816_PWR_STATE_TX /**< Transmit */
129 #define APP_ISO7816_PWR_STATE_TX_RX HAL_ISO7816_PWR_STATE_TX_RX /**< Transmit and Receive */
130 /** @} */
131
132 /** @} */
133
134 /** @addtogroup APP_ISO7816_ENUM Enumerations
135 * @{
136 */
137
138 /**
139 * @brief ISO7816 operating mode Enumerations definition
140 */
141 typedef enum
142 {
143 APP_ISO7816_TYPE_INTERRUPT, /**< Interrupt operation mode. */
144 APP_ISO7816_TYPE_POLLING, /**< Polling operation mode. */
145 APP_ISO7816_TYPE_MAX, /**< Only for check parameter, not used as input parameters. */
146 } app_iso7816_mode_t;
147
148 /**
149 * @brief ISO7816 event Enumerations definition
150 */
151 typedef enum
152 {
153 APP_ISO7816_EVT_ERROR, /**< Error reported by ISO7816 peripheral. */
154 APP_ISO7816_EVT_ABORT, /**< Error reported by ISO7816 peripheral. */
155 APP_ISO7816_EVT_PRESENCE, /**< Requested RX transfer completed. */
156 APP_ISO7816_EVT_ATR_CPLT, /**< Requested TX transfer completed. */
157 APP_ISO7816_EVT_TX_CPLT, /**< Requested TX transfer completed. */
158 APP_ISO7816_EVT_RX_CPLT, /**< Requested RX transfer completed. */
159 APP_ISO7816_EVT_TX_RX_CPLT, /**< Requested RX transfer completed. */
160 } app_iso7816_evt_type_t;
161 /** @} */
162
163 /** @addtogroup APP_ISO7816_STRUCTURES Structures
164 * @{
165 */
166
167 /**
168 * @brief ISO7816 IO configuration Structures
169 */
170 typedef struct
171 {
172 app_io_type_t type; /**< Specifies the type of IO. */
173 app_io_mux_t mux; /**< Specifies the Peripheral to be connected to the selected pins. */
174 uint32_t pin; /**< Specifies the IO pins to be configured.
175 This parameter can be any value of @ref GR5xxx_pins. */
176 app_io_pull_t pull; /**< Specifies the Pull-up or Pull-Down activation for the selected pins. */
177 } app_iso7816_pin_t;
178
179 /**
180 * @brief ISO7816 pin configure structure definition
181 */
182 typedef struct
183 {
184 app_iso7816_pin_t clk; /**< Set the configuration of ISO7816 clock pin. */
185 app_iso7816_pin_t rst; /**< Set the configuration of ISO7816 reset pin. */
186 app_iso7816_pin_t io; /**< Set the configuration of ISO7816 io pin. */
187 app_iso7816_pin_t presence; /**< Set the configuration of ISO7816 presence pin. */
188 } app_iso7816_pin_cfg_t;
189
190 /**
191 * @brief ISO7816 event structure definition
192 */
193 typedef struct
194 {
195 app_iso7816_evt_type_t type; /**< Type of event. */
196 union
197 {
198 uint32_t error_code; /**< ISO7816 Error code. */
199 uint16_t size; /**< ISO7816 transmitted/received counter. */
200 } data; /**< ISO7816 union data. */
201 } app_iso7816_evt_t;
202
203 /** @} */
204
205 /** @addtogroup APP_ISO7816_TYPEDEFS Type definitions
206 * @{
207 */
208
209 /**
210 * @brief ISO7816 event callback definition
211 */
212 typedef void (*app_iso7816_evt_handler_t)(app_iso7816_evt_t *p_evt);
213
214 /** @} */
215
216 /** @addtogroup APP_ISO7816_ENUM Enumerations
217 * @{
218 */
219
220 /**@brief App iso7816 state types. */
221 typedef enum
222 {
223 APP_ISO7816_INVALID = 0,
224 APP_ISO7816_ACTIVITY,
225 #ifdef APP_DRIVER_WAKEUP_CALL_FUN
226 APP_ISO7816_SLEEP,
227 #endif
228 } app_iso7816_state_t;
229
230 /** @} */
231
232 /** @addtogroup APP_ISO7816_STRUCTURES Structures
233 * @{
234 */
235 /**
236 * @brief ISO7816 device structure definition
237 */
238 typedef struct
239 {
240 app_iso7816_evt_handler_t evt_handler; /**< ISO7816 event callback. */
241 iso7816_handle_t handle; /**< ISO7816 handle Structure. */
242 app_iso7816_mode_t use_mode; /**< ISO7816 operating mode Enumerations. */
243 app_iso7816_pin_cfg_t *p_pin_cfg; /**< ISO7816 pin configure structure. */
244 app_iso7816_state_t iso7816_state; /**< ISO7816 state configure structure. */
245 bool start_flag; /**< ISO7816 start_flage. */
246 }iso7816_env_t;
247
248 /**
249 * @brief ISO7816 parameters structure definition
250 */
251 typedef struct
252 {
253 app_iso7816_mode_t use_mode; /**< Specifies the operation mode of ISO7816. */
254 app_iso7816_pin_cfg_t pin_cfg; /**< The pin configuration information for the ISO7816. */
255 iso7816_init_t init; /**< ISO7816 communication parameters. */
256 iso7816_env_t iso7816_env; /**< ISO7816 device structure definition. */
257 } app_iso7816_params_t;
258
259 /** @} */
260
261 /* Exported functions --------------------------------------------------------*/
262 /** @addtogroup APP_ISO7816_DRIVER_FUNCTIONS Functions
263 * @{
264 */
265 /**
266 ****************************************************************************************
267 * @brief Initialize the APP ISO7816 DRIVER according to the specified parameters
268 * in the app_iso7816_params_t and app_iso7816_evt_handler_t.
269 * @note If interrupt mode is set, you can use blocking mode. Conversely, if blocking mode
270 * is set, you can't use interrupt mode.
271 *
272 * @param[in] p_params: Pointer to app_iso7816_params_t parameter which contains the
273 * configuration information for the specified ISO7816 module.
274 * @param[in] evt_handler: ISO7816 user callback function.
275 *
276 * @return Result of initialization.
277 ****************************************************************************************
278 */
279 uint16_t app_iso7816_init(app_iso7816_params_t *p_params, app_iso7816_evt_handler_t evt_handler);
280
281 /**
282 ****************************************************************************************
283 * @brief De-initialize the APP ISO7816 DRIVER peripheral.
284 *
285 * @return Result of De-initialization.
286 ****************************************************************************************
287 */
288 uint16_t app_iso7816_deinit(void);
289
290 /**
291 ****************************************************************************************
292 * @brief Receive an amount of data in blocking mode.
293 *
294 * @param[in] size: Amount of data to be sent
295 * @param[in] timeout: Timeout duration
296 *
297 * @return Result of operation.
298 ****************************************************************************************
299 */
300 uint16_t app_iso7816_receive_sync(uint16_t size, uint32_t timeout);
301
302 /**
303 ****************************************************************************************
304 * @brief Receive an amount of data in non-blocking mode with Interrupt/DMA.
305 *
306 * @param[in] size: Amount of data to be sent
307 *
308 * @return Result of operation.
309 ****************************************************************************************
310 */
311 uint16_t app_iso7816_receive_async(uint16_t size);
312
313 /**
314 ****************************************************************************************
315 * @brief Transmits an amount of data in blocking mode.
316 *
317 * @param[in] size: Amount of data to be sent
318 * @param[in] timeout: Timeout duration
319 *
320 * @return Result of operation.
321 ****************************************************************************************
322 */
323 uint16_t app_iso7816_transmit_sync(uint16_t size, uint32_t timeout);
324
325 /**
326 ****************************************************************************************
327 * @brief Transmits an amount of data in non-blocking mode with Interrupt/DMA.
328 *
329 * @param[in] size: Amount of data to be sent
330 *
331 * @return Result of operation.
332 ****************************************************************************************
333 */
334 uint16_t app_iso7816_transmit_async(uint16_t size);
335
336 /**
337 ****************************************************************************************
338 * @brief Transmit and receive in master mode an amount of data in blocking mode.
339 *
340 * @param[in] tx_size: Amount of data to be sent
341 * @param[in] rx_size: Amount of data to be receive
342 * @param[in] timeout: Timeout duration
343 *
344 * @return Result of operation.
345 ****************************************************************************************
346 */
347 uint16_t app_iso7816_transmit_receive_sync(uint16_t tx_size, uint16_t rx_size, uint32_t timeout);
348
349 /**
350 ****************************************************************************************
351 * @brief Transmit and receive in master mode an amount of data in non-blocking mode.
352 *
353 * @param[in] tx_size: Amount of data to be sent
354 * @param[in] rx_size: Amount of data to be receive
355 *
356 * @return Result of operation.
357 ****************************************************************************************
358 */
359 uint16_t app_iso7816_transmit_receive_async(uint16_t tx_size, uint16_t rx_size);
360
361 /**
362 * @brief Request ISO7816 to go to the next action.
363 * @param action: This parameter can be one of the following values:
364 * @arg @ref APP_ISO7816_ACTION_NONE
365 * @arg @ref APP_ISO7816_ACTION_OFF
366 * @arg @ref APP_ISO7816_ACTION_STOPCLK
367 * @arg @ref APP_ISO7816_ACTION_ON
368 * @arg @ref APP_ISO7816_ACTION_WARMRST
369 * @arg @ref APP_ISO7816_ACTION_RX
370 * @arg @ref APP_ISO7816_ACTION_TX
371 * @arg @ref APP_ISO7816_ACTION_TXRX
372 *
373 * @return Result of operation.
374 */
375 uint16_t app_iso7816_set_action(uint32_t action);
376
377 /**
378 * @brief Get ISO7816 Power States.
379 * @return Returned value can be one of the following values:
380 * @arg @ref APP_ISO7816_PWR_STATE_OFF
381 * @arg @ref APP_ISO7816_PWR_STATE_PWRUP_VCC
382 * @arg @ref APP_ISO7816_PWR_STATE_PWRUP_RST
383 * @arg @ref APP_ISO7816_PWR_STATE_PWRDN_RST
384 * @arg @ref APP_ISO7816_PWR_STATE_PWRDN_VCC
385 * @arg @ref APP_ISO7816_PWR_STATE_STOP_PRE
386 * @arg @ref APP_ISO7816_PWR_STATE_STOP
387 * @arg @ref APP_ISO7816_PWR_STATE_STOP_POST
388 * @arg @ref APP_ISO7816_PWR_STATE_IDLE
389 * @arg @ref APP_ISO7816_PWR_STATE_RX_TS0
390 * @arg @ref APP_ISO7816_PWR_STATE_RX_TS1
391 * @arg @ref APP_ISO7816_PWR_STATE_RX
392 * @arg @ref APP_ISO7816_PWR_STATE_TX
393 * @arg @ref APP_ISO7816_PWR_STATE_TX_RX
394 */
395 uint32_t app_iso7816_get_power_states(void);
396
397 /**
398 * @brief Set divide ISO7816 clock.
399 * @note Divide SIM clock by this value+1 to define ETU length. The reset value
400 * is the one, needed for theATR.
401 * @param divide This parameter should range between 0x0 and 0x3FF.
402 *
403 * @return Result of operation.
404 */
405 uint16_t app_iso7816_set_etudiv(uint32_t divide);
406
407 /**
408 ****************************************************************************************
409 * @brief Return the ISO7816 handle.
410 *
411 * @return Pointer to the specified ID's ISO7816 handle.
412 ****************************************************************************************
413 */
414 iso7816_handle_t *app_iso7816_get_handle(void);
415
416 /** @} */
417
418 #endif
419
420 #ifdef __cplusplus
421 }
422 #endif
423
424 #endif /* _APP_ISO7816_H_ */
425
426 /** @} */
427 /** @} */
428 /** @} */
429
app_iso7816_transmit_receive_async
uint16_t app_iso7816_transmit_receive_async(uint16_t tx_size, uint16_t rx_size)
Transmit and receive in master mode an amount of data in non-blocking mode.
app_iso7816_evt_type_t
app_iso7816_evt_type_t
ISO7816 event Enumerations definition.
Definition: app_iso7816.h:152
app_iso7816_get_handle
iso7816_handle_t * app_iso7816_get_handle(void)
Return the ISO7816 handle.
_iso7816_handle_t
ISO7816 handle Structure definition.
Definition: gr55xx_hal_iso7816.h:121
APP_ISO7816_EVT_RX_CPLT
@ APP_ISO7816_EVT_RX_CPLT
Requested RX transfer completed.
Definition: app_iso7816.h:158
APP_ISO7816_EVT_ATR_CPLT
@ APP_ISO7816_EVT_ATR_CPLT
Requested TX transfer completed.
Definition: app_iso7816.h:156
app_iso7816_pin_cfg_t::io
app_iso7816_pin_t io
Set the configuration of ISO7816 io pin.
Definition: app_iso7816.h:186
APP_ISO7816_EVT_TX_RX_CPLT
@ APP_ISO7816_EVT_TX_RX_CPLT
Requested RX transfer completed.
Definition: app_iso7816.h:159
iso7816_env_t
ISO7816 device structure definition.
Definition: app_iso7816.h:239
APP_ISO7816_EVT_ABORT
@ APP_ISO7816_EVT_ABORT
Error reported by ISO7816 peripheral.
Definition: app_iso7816.h:154
app_iso7816_state_t
app_iso7816_state_t
App iso7816 state types.
Definition: app_iso7816.h:222
APP_ISO7816_TYPE_INTERRUPT
@ APP_ISO7816_TYPE_INTERRUPT
Interrupt operation mode.
Definition: app_iso7816.h:143
app_iso7816_params_t::use_mode
app_iso7816_mode_t use_mode
Specifies the operation mode of ISO7816.
Definition: app_iso7816.h:253
app_iso7816_params_t::iso7816_env
iso7816_env_t iso7816_env
ISO7816 device structure definition.
Definition: app_iso7816.h:256
app_io_pull_t
app_io_pull_t
GPIO pull Enumerations definition.
Definition: app_io.h:183
app_io_type_t
app_io_type_t
GPIO type Enumerations definition.
Definition: app_io.h:147
app_iso7816_deinit
uint16_t app_iso7816_deinit(void)
De-initialize the APP ISO7816 DRIVER peripheral.
app_iso7816_pin_cfg_t
ISO7816 pin configure structure definition.
Definition: app_iso7816.h:183
APP_ISO7816_INVALID
@ APP_ISO7816_INVALID
Definition: app_iso7816.h:223
app_iso7816_evt_t::size
uint16_t size
ISO7816 transmitted/received counter.
Definition: app_iso7816.h:199
iso7816_env_t::use_mode
app_iso7816_mode_t use_mode
ISO7816 operating mode Enumerations.
Definition: app_iso7816.h:242
APP_ISO7816_EVT_TX_CPLT
@ APP_ISO7816_EVT_TX_CPLT
Requested TX transfer completed.
Definition: app_iso7816.h:157
APP_ISO7816_TYPE_MAX
@ APP_ISO7816_TYPE_MAX
Only for check parameter, not used as input parameters.
Definition: app_iso7816.h:145
app_iso7816_transmit_async
uint16_t app_iso7816_transmit_async(uint16_t size)
Transmits an amount of data in non-blocking mode with Interrupt/DMA.
app_io.h
Header file containing functions prototypes of GPIO app library.
app_iso7816_transmit_sync
uint16_t app_iso7816_transmit_sync(uint16_t size, uint32_t timeout)
Transmits an amount of data in blocking mode.
app_iso7816_params_t
ISO7816 parameters structure definition.
Definition: app_iso7816.h:252
iso7816_env_t::handle
iso7816_handle_t handle
ISO7816 handle Structure.
Definition: app_iso7816.h:241
app_iso7816_evt_t
ISO7816 event structure definition.
Definition: app_iso7816.h:194
app_iso7816_pin_cfg_t::presence
app_iso7816_pin_t presence
Set the configuration of ISO7816 presence pin.
Definition: app_iso7816.h:187
app_iso7816_receive_async
uint16_t app_iso7816_receive_async(uint16_t size)
Receive an amount of data in non-blocking mode with Interrupt/DMA.
app_iso7816_evt_t::error_code
uint32_t error_code
ISO7816 Error code.
Definition: app_iso7816.h:198
APP_ISO7816_EVT_PRESENCE
@ APP_ISO7816_EVT_PRESENCE
Requested RX transfer completed.
Definition: app_iso7816.h:155
grx_hal.h
This file contains all the functions prototypes for the HAL module driver.
app_iso7816_set_action
uint16_t app_iso7816_set_action(uint32_t action)
Request ISO7816 to go to the next action.
APP_ISO7816_TYPE_POLLING
@ APP_ISO7816_TYPE_POLLING
Polling operation mode.
Definition: app_iso7816.h:144
iso7816_env_t::evt_handler
app_iso7816_evt_handler_t evt_handler
ISO7816 event callback.
Definition: app_iso7816.h:240
app_iso7816_pin_t::mux
app_io_mux_t mux
Specifies the Peripheral to be connected to the selected pins.
Definition: app_iso7816.h:173
app_iso7816_pin_cfg_t::rst
app_iso7816_pin_t rst
Set the configuration of ISO7816 reset pin.
Definition: app_iso7816.h:185
iso7816_env_t::start_flag
bool start_flag
ISO7816 start_flage.
Definition: app_iso7816.h:245
app_iso7816_pin_t::pin
uint32_t pin
Specifies the IO pins to be configured.
Definition: app_iso7816.h:174
iso7816_env_t::iso7816_state
app_iso7816_state_t iso7816_state
ISO7816 state configure structure.
Definition: app_iso7816.h:244
APP_ISO7816_EVT_ERROR
@ APP_ISO7816_EVT_ERROR
Error reported by ISO7816 peripheral.
Definition: app_iso7816.h:153
app_iso7816_init
uint16_t app_iso7816_init(app_iso7816_params_t *p_params, app_iso7816_evt_handler_t evt_handler)
Initialize the APP ISO7816 DRIVER according to the specified parameters in the app_iso7816_params_t a...
app_iso7816_params_t::pin_cfg
app_iso7816_pin_cfg_t pin_cfg
The pin configuration information for the ISO7816.
Definition: app_iso7816.h:254
APP_ISO7816_ACTIVITY
@ APP_ISO7816_ACTIVITY
Definition: app_iso7816.h:224
app_iso7816_mode_t
app_iso7816_mode_t
ISO7816 operating mode Enumerations definition.
Definition: app_iso7816.h:142
app_iso7816_pin_t::pull
app_io_pull_t pull
Specifies the Pull-up or Pull-Down activation for the selected pins.
Definition: app_iso7816.h:176
app_io_mux_t
app_io_mux_t
GPIO mux Enumerations definition.
Definition: app_io.h:255
app_iso7816_transmit_receive_sync
uint16_t app_iso7816_transmit_receive_sync(uint16_t tx_size, uint16_t rx_size, uint32_t timeout)
Transmit and receive in master mode an amount of data in blocking mode.
app_iso7816_evt_handler_t
void(* app_iso7816_evt_handler_t)(app_iso7816_evt_t *p_evt)
ISO7816 event callback definition.
Definition: app_iso7816.h:212
app_iso7816_get_power_states
uint32_t app_iso7816_get_power_states(void)
Get ISO7816 Power States.
app_iso7816_pin_t
ISO7816 IO configuration Structures.
Definition: app_iso7816.h:171
app_iso7816_pin_t::type
app_io_type_t type
Specifies the type of IO.
Definition: app_iso7816.h:172
app_drv_error.h
Header file of app driver error code.
app_drv_config.h
Header file of app driver config code.
iso7816_init_t
ISO7816 init structure definition.
Definition: gr55xx_hal_iso7816.h:102
app_iso7816_params_t::init
iso7816_init_t init
ISO7816 communication parameters.
Definition: app_iso7816.h:255
app_iso7816_receive_sync
uint16_t app_iso7816_receive_sync(uint16_t size, uint32_t timeout)
Receive an amount of data in blocking mode.
app_iso7816_pin_cfg_t::clk
app_iso7816_pin_t clk
Set the configuration of ISO7816 clock pin.
Definition: app_iso7816.h:184
app_iso7816_set_etudiv
uint16_t app_iso7816_set_etudiv(uint32_t divide)
Set divide ISO7816 clock.
iso7816_env_t::p_pin_cfg
app_iso7816_pin_cfg_t * p_pin_cfg
ISO7816 pin configure structure.
Definition: app_iso7816.h:243
app_iso7816_evt_t::type
app_iso7816_evt_type_t type
Type of event.
Definition: app_iso7816.h:195