gr55xx_ll_iso7816.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file gr55xx_ll_iso7816.h
5 * @author BLE Driver Team
6 * @brief Header file containing functions prototypes of ISO7816 LL 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 LL_DRIVER LL Driver
43 * @{
44 */
45
46 /** @defgroup LL_ISO7816 ISO7816
47 * @brief ISO7816 LL module driver.
48 * @{
49 */
50
51 /* Define to prevent recursive inclusion -------------------------------------*/
52 #ifndef __GR55xx_LL_ISO7816_H__
53 #define __GR55xx_LL_ISO7816_H__
54
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58
59 /* Includes ------------------------------------------------------------------*/
60 #include "gr55xx.h"
61
62 #if defined (ISO7816)
63 /** @defgroup ISO7816_LL_STRUCTURES Structures
64 * @{
65 */
66 /* Exported types ------------------------------------------------------------*/
67 /** @defgroup ISO7816_LL_ES_INIT ISO7816 Exported init structure
68 * @{
69 */
70 /**
71 * @brief ISO7816_LL_init_structure LL ISO7816 init Structure definition
72 */
73 typedef struct _ll_iso7816_init
74 {
75 uint32_t clk_div; /*!< clk_div is used for dividing the system clock,
76 and ISO7816 output clock is equal to (system clock)/(clk_div+1).*/
77 uint32_t wait_time; /*!< Specifies the guard time value in terms of number of baud clocks */
78 uint16_t guard_time; /*!< Specifies the maximum card response time (leading edge to leading edge) */
79 uint8_t detect_coding; /*!< Specifies whether automatically detect coding convention during ATR receiption. */
80 } ll_iso7816_init_t;
81 /** @} */
82 /** @} */
83
84 /**
85 * @defgroup ISO7816_LL_MACRO Defines
86 * @{
87 */
88
89 /* Exported constants --------------------------------------------------------*/
90 /** @defgroup ISO7816_LL_Exported_Constants ISO7816 Exported Constants
91 * @{
92 */
93
94 /** @defgroup ISO7816_LL_EC_ACTION Action state.
95 * @{
96 */
97 #define LL_ISO7816_ACTION_NONE 0x00000000U /**< Do Nothing. */
98 #define LL_ISO7816_ACTION_OFF 0x00000001U /**< Switch Off. */
99 #define LL_ISO7816_ACTION_STOPCLK 0x00000002U /**< Stop the clock. */
100 #define LL_ISO7816_ACTION_ON 0x00000003U /**< Switch on and receive ATR. */
101 #define LL_ISO7816_ACTION_WARMRST 0x00000004U /**< Trigger warm reset and receive ATR.*/
102 #define LL_ISO7816_ACTION_RX 0x00000005U /**< Receive. */
103 #define LL_ISO7816_ACTION_TX 0x00000006U /**< Transmit. */
104 #define LL_ISO7816_ACTION_TXRX 0x00000007U /**< Transmit, followed by RX. */
105 /** @} */
106
107 /** @defgroup ISO7816_LL_EC_IT IT Defines
108 * @brief Interrupt definitions which can be used with LL_ISO7816_ReadReg and LL_ISO7816_WriteReg functions
109 * @{
110 */
111 #define LL_ISO7816_INTR_TEST ISO7816_STAT_IRQ_TEST /**< Test interrupt */
112 #define LL_ISO7816_INTR_PRESENCE ISO7816_STAT_IRQ_PRESENCE /**< Source presence interrupt */
113 #define LL_ISO7816_INTR_STATE_ERR ISO7816_STAT_IRQ_STAT_ERR /**< Source state error interrupt */
114 #define LL_ISO7816_INTR_DMA_ERR ISO7816_STAT_IRQ_DMA_ERR /**< Source dma error interrupt */
115 #define LL_ISO7816_INTR_RETRY_ERR ISO7816_STAT_IRQ_RETRY_ERR /**< Source retry error interrupt */
116 #define LL_ISO7816_INTR_RX_ERR ISO7816_STAT_IRQ_RX_ERR /**< Source rx error interrupt */
117 #define LL_ISO7816_INTR_DONE ISO7816_STAT_IRQ_DONE /**< Source done error interrupt */
118
119 #define LL_ISO7816_INTR_MASK_ALL ISO7816_INTR_ALL /**< All interrupt */
120 /** @} */
121
122 /** @defgroup ISO7816_LL_EC_PRESENCE Card Presence Defines
123 * @{
124 */
125 #define LL_ISO7816_CARD_ABSENT 0x00000000U /**< SIM Card is absent. */
126 #define LL_ISO7816_CARD_PRESENT 0x00000001U /**< SIM Card is present. */
127 /** @} */
128
129 /** @defgroup ISO7816_LL_EC_IO_STATES IO States Defines
130 * @{
131 */
132 #define LL_ISO7816_IO_STATE_OFF (0x0UL << ISO7816_STAT_IO_STAT_POS) /**< Off */
133 #define LL_ISO7816_IO_STATE_IDLE (0x1UL << ISO7816_STAT_IO_STAT_POS) /**< Idle */
134 #define LL_ISO7816_IO_STATE_RX_WAIT (0x4UL << ISO7816_STAT_IO_STAT_POS) /**< Receive Wait */
135 #define LL_ISO7816_IO_STATE_RX (0x5UL << ISO7816_STAT_IO_STAT_POS) /**< Receive */
136 #define LL_ISO7816_IO_STATE_TX (0x6UL << ISO7816_STAT_IO_STAT_POS) /**< Transmit */
137 #define LL_ISO7816_IO_STATE_TX_GUARD (0x7UL << ISO7816_STAT_IO_STAT_POS) /**< Transmit Guard */
138 /** @} */
139
140 /** @defgroup ISO7816_LL_EC_PWR_STATES Power States Defines
141 * @{
142 */
143 #define LL_ISO7816_PWR_STATE_OFF (0x0UL << ISO7816_STAT_PWR_STAT_POS) /**< Off */
144 #define LL_ISO7816_PWR_STATE_PWRUP_VCC (0x1UL << ISO7816_STAT_PWR_STAT_POS) /**< Power up VCC */
145 #define LL_ISO7816_PWR_STATE_PWRUP_RST (0x2UL << ISO7816_STAT_PWR_STAT_POS) /**< Power up reset */
146 #define LL_ISO7816_PWR_STATE_PWRDN_RST (0x3UL << ISO7816_STAT_PWR_STAT_POS) /**< Power Down reset */
147 #define LL_ISO7816_PWR_STATE_PWRDN_VCC (0x4UL << ISO7816_STAT_PWR_STAT_POS) /**< Power Down VCC */
148 #define LL_ISO7816_PWR_STATE_STOP_PRE (0x5UL << ISO7816_STAT_PWR_STAT_POS) /**< Preparing Clock Stop */
149 #define LL_ISO7816_PWR_STATE_STOP (0x6UL << ISO7816_STAT_PWR_STAT_POS) /**< Clock Stopped */
150 #define LL_ISO7816_PWR_STATE_STOP_POST (0x7UL << ISO7816_STAT_PWR_STAT_POS) /**< Exiting Clock Stop */
151 #define LL_ISO7816_PWR_STATE_IDLE (0x8UL << ISO7816_STAT_PWR_STAT_POS) /**< Idle */
152 #define LL_ISO7816_PWR_STATE_RX_TS0 (0x9UL << ISO7816_STAT_PWR_STAT_POS) /**< RX TS Character */
153 #define LL_ISO7816_PWR_STATE_RX_TS1 (0xAUL << ISO7816_STAT_PWR_STAT_POS) /**< RX TS Character */
154 #define LL_ISO7816_PWR_STATE_RX (0xBUL << ISO7816_STAT_PWR_STAT_POS) /**< Receive */
155 #define LL_ISO7816_PWR_STATE_TX (0xCUL << ISO7816_STAT_PWR_STAT_POS) /**< Transmit */
156 #define LL_ISO7816_PWR_STATE_TX_RX (0xDUL << ISO7816_STAT_PWR_STAT_POS) /**< Transmit and Receive */
157 /** @} */
158
159 /** @defgroup ISO7816_LL_EC_CLKSTOP Clock Stop Select Defines
160 * @{
161 */
162 #define LL_ISO7816_CLKSTOP_LOW (0x00000000UL) /**< Stop the clock at low level. */
163 #define LL_ISO7816_CLKSTOP_HIGH (0x80000000UL) /**< Stop the clock at high level. */
164 /** @} */
165
166 /** @defgroup ISO7816_LL_EC_CODING Coding Convention Defines
167 * @{
168 */
169 #define LL_ISO7816_CODING_DEFAULT (0x00000000UL) /**< High=1, LSB first. */
170 #define LL_ISO7816_CODING_INVERSE (0x00000001UL) /**< High=0, MSB first. */
171 /** @} */
172
173 /** @} */
174
175 /* Exported macro ------------------------------------------------------------*/
176 /** @defgroup ISO7816_LL_Exported_Macros ISO7816 Exported Macros
177 * @{
178 */
179
180 /** @defgroup ISO7816_LL_EM_WRITE_READ Common Write and read registers Macros
181 * @{
182 */
183
184 /**
185 * @brief Write a value in ISO7816 register
186 * @param __instance__ ISO7816 instance
187 * @param __REG__ Register to be written
188 * @param __VALUE__ Value to be written in the register
189 * @retval None.
190 */
191 #define LL_ISO7816_WriteReg(__instance__, __REG__, __VALUE__) WRITE_REG(__instance__->__REG__, (__VALUE__))
192
193 /**
194 * @brief Read a value in ISO7816 register
195 * @param __instance__ ISO7816 instance
196 * @param __REG__ Register to be read
197 * @retval Register value
198 */
199 #define LL_ISO7816_ReadReg(__instance__, __REG__) READ_REG(__instance__->__REG__)
200
201 /** @} */
202
203 /** @} */
204
205 /** @} */
206
207
208 /* Private types -------------------------------------------------------------*/
209 /* Private variables ---------------------------------------------------------*/
210 /* Private constants ---------------------------------------------------------*/
211 /* Private macros ------------------------------------------------------------*/
212 /* Exported functions --------------------------------------------------------*/
213 /** @defgroup ISO7816_LL_DRIVER_FUNCTIONS Functions
214 * @{
215 */
216
217 /** @defgroup ISO7816_LL_EF_Configuration Configuration
218 * @{
219 */
220 /**
221 * @brief Request ISO7816 to go to the next action.
222 *
223 * \rst
224 * +----------------------+-----------------------------------+
225 * | Register | BitsName |
226 * +======================+===================================+
227 * | CTRL | ACTION |
228 * +----------------------+-----------------------------------+
229 * \endrst
230 *
231 * @param ISO7816x ISO7816 instance.
232 * @param action This parameter can be one of the following values:
233 * @arg @ref LL_ISO7816_ACTION_NONE
234 * @arg @ref LL_ISO7816_ACTION_OFF
235 * @arg @ref LL_ISO7816_ACTION_STOPCLK
236 * @arg @ref LL_ISO7816_ACTION_ON
237 * @arg @ref LL_ISO7816_ACTION_WARMRST
238 * @arg @ref LL_ISO7816_ACTION_RX
239 * @arg @ref LL_ISO7816_ACTION_TX
240 * @arg @ref LL_ISO7816_ACTION_TXRX
241 * @retval None.
242 */
243 __STATIC_INLINE void ll_iso7816_set_action(iso7816_regs_t *ISO7816x, uint32_t action)
244 {
245 WRITE_REG(ISO7816x->CTRL, action);
246 }
247
248
249 /**
250 * @brief Get ISO7816 states.
251 *
252 * \rst
253 * +----------------------+-----------------------------------+
254 * | Register | BitsName |
255 * +======================+===================================+
256 * | CTRL | ACTION |
257 * +----------------------+-----------------------------------+
258 * \endrst
259 *
260 * @param ISO7816x ISO7816 instance.
261 * @retval ISO7816 states
262 */
263 __STATIC_INLINE uint32_t ll_iso7816_is_busy(iso7816_regs_t *ISO7816x)
264 {
265 return (READ_BITS(ISO7816x->STAT, ISO7816_STAT_BUSY) == (ISO7816_STAT_BUSY));
266 }
267
268 /**
269 * @brief Clear Transmit Retries Maximum.
270 *
271 * \rst
272 * +----------------------+-----------------------------------+
273 * | Register | BitsName |
274 * +======================+===================================+
275 * | CTRL | TX_RETRY_MAX_CLR |
276 * +----------------------+-----------------------------------+
277 * \endrst
278 *
279 * @param ISO7816x ISO7816 instance.
280 * @retval None.
281 */
282 __STATIC_INLINE void ll_iso7816_clear_tx_retry_max(iso7816_regs_t *ISO7816x)
283 {
284 WRITE_REG(ISO7816x->CTRL, ISO7816_CTRL_TX_RETYR_MC);
285 }
286
287 /**
288 * @brief Clear Receive Retries Maximum.
289 *
290 * \rst
291 * +----------------------+-----------------------------------+
292 * | Register | BitsName |
293 * +======================+===================================+
294 * | CTRL | RX_RETRY_MAX_CLR |
295 * +----------------------+-----------------------------------+
296 * \endrst
297 *
298 * @param ISO7816x ISO7816 instance.
299 * @retval None.
300 */
301 __STATIC_INLINE void ll_iso7816_clear_rx_retry_max(iso7816_regs_t *ISO7816x)
302 {
303 WRITE_REG(ISO7816x->CTRL, ISO7816_CTRL_RX_RETYR_MC);
304 }
305
306 /**
307 * @brief Check Card presence.
308 *
309 * \rst
310 * +----------------------+-----------------------------------+
311 * | Register | BitsName |
312 * +======================+===================================+
313 * | STAT | PRESENCE |
314 * +----------------------+-----------------------------------+
315 * \endrst
316 *
317 * @param ISO7816x ISO7816 instance.
318 * @retval Returned value can be one of the following values:
319 * @arg @ref LL_ISO7816_CARD_ABSENT
320 * @arg @ref LL_ISO7816_CARD_PRESENT
321 */
322 __STATIC_INLINE uint32_t ll_iso7816_check_card_presence(iso7816_regs_t *ISO7816x)
323 {
324 return (uint32_t)(READ_BITS(ISO7816x->STAT, ISO7816_STAT_PRESENCE_STAT) >> ISO7816_STAT_PRESENCE_STAT_POS);
325 }
326
327 /**
328 * @brief Get Maximum number of seen transmit retries after error signaling by ISO7816.
329 *
330 * \rst
331 * +----------------------+-----------------------------------+
332 * | Register | BitsName |
333 * +======================+===================================+
334 * | STAT | TX_RETRY_MAX |
335 * +----------------------+-----------------------------------+
336 * \endrst
337 *
338 * @param ISO7816x ISO7816 instance.
339 * @retval Value range between 0x1 and 0x7.
340 */
341 __STATIC_INLINE uint32_t ll_iso7816_get_tx_retry_max(iso7816_regs_t *ISO7816x)
342 {
343 return (uint32_t)(READ_BITS(ISO7816x->STAT, ISO7816_STAT_TX_RETRY_MAX) >> ISO7816_STAT_RX_RETRY_MAX_POS);
344 }
345
346 /**
347 * @brief Get Maximum number of seen receive retries after error signaling by ISO7816.
348 *
349 * \rst
350 * +----------------------+-----------------------------------+
351 * | Register | BitsName |
352 * +======================+===================================+
353 * | STAT | RX_RETRY_MAX |
354 * +----------------------+-----------------------------------+
355 * \endrst
356 *
357 * @param ISO7816x ISO7816 instance.
358 * @retval Value range between 0x1 and 0x7.
359 */
360 __STATIC_INLINE uint32_t ll_iso7816_get_rx_retry_max(iso7816_regs_t *ISO7816x)
361 {
362 return (uint32_t)(READ_BITS(ISO7816x->STAT, ISO7816_STAT_RX_RETRY_MAX) >> ISO7816_STAT_RX_RETRY_MAX_POS);
363 }
364
365 /**
366 * @brief Get ISO7816 IO States.
367 *
368 * \rst
369 * +----------------------+-----------------------------------+
370 * | Register | BitsName |
371 * +======================+===================================+
372 * | STAT | IO_STATE |
373 * +----------------------+-----------------------------------+
374 * \endrst
375 *
376 * @param ISO7816x ISO7816 instance.
377 * @retval Returned value can be one or combination of the following values:
378 * @arg @ref LL_ISO7816_IO_STATE_OFF
379 * @arg @ref LL_ISO7816_IO_STATE_IDLE
380 * @arg @ref LL_ISO7816_IO_STATE_RX_WAIT
381 * @arg @ref LL_ISO7816_IO_STATE_RX
382 * @arg @ref LL_ISO7816_IO_STATE_TX
383 * @arg @ref LL_ISO7816_IO_STATE_TX_GUARD
384 */
385 __STATIC_INLINE uint32_t ll_iso7816_get_io_states(iso7816_regs_t *ISO7816x)
386 {
387 return (uint32_t)(READ_BITS(ISO7816x->STAT, ISO7816_STAT_IO_STAT) >> ISO7816_STAT_IO_STAT_POS);
388 }
389
390 /**
391 * @brief Get ISO7816 Power States.
392 *
393 * \rst
394 * +----------------------+-----------------------------------+
395 * | Register | BitsName |
396 * +======================+===================================+
397 * | STAT | PWR_STATE |
398 * +----------------------+-----------------------------------+
399 * \endrst
400 *
401 * @param ISO7816x ISO7816 instance.
402 * @retval Returned value can be one of the following values:
403 * @arg @ref LL_ISO7816_PWR_STATE_OFF
404 * @arg @ref LL_ISO7816_PWR_STATE_PWRUP_VCC
405 * @arg @ref LL_ISO7816_PWR_STATE_PWRUP_RST
406 * @arg @ref LL_ISO7816_PWR_STATE_PWRDN_RST
407 * @arg @ref LL_ISO7816_PWR_STATE_PWRDN_VCC
408 * @arg @ref LL_ISO7816_PWR_STATE_STOP_PRE
409 * @arg @ref LL_ISO7816_PWR_STATE_STOP
410 * @arg @ref LL_ISO7816_PWR_STATE_STOP_POST
411 * @arg @ref LL_ISO7816_PWR_STATE_IDLE
412 * @arg @ref LL_ISO7816_PWR_STATE_RX_TS0
413 * @arg @ref LL_ISO7816_PWR_STATE_RX_TS1
414 * @arg @ref LL_ISO7816_PWR_STATE_RX
415 * @arg @ref LL_ISO7816_PWR_STATE_TX
416 * @arg @ref LL_ISO7816_PWR_STATE_TX_RX
417 */
418 __STATIC_INLINE uint32_t ll_iso7816_get_power_states(iso7816_regs_t *ISO7816x)
419 {
420 return (uint32_t)(READ_BITS(ISO7816x->STAT, ISO7816_STAT_PWR_STAT));
421 }
422
423 /**
424 * @brief Set value of the clock output during stopped Clock.
425 *
426 * \rst
427 * +----------------------+-----------------------------------+
428 * | Register | BitsName |
429 * +======================+===================================+
430 * | CLK_CFG | CLK_STOP_SEL |
431 * +----------------------+-----------------------------------+
432 * \endrst
433 *
434 * @param ISO7816x ISO7816 instance.
435 * @param level This parameter can be one of the following values:
436 * @arg @ref LL_ISO7816_CLKSTOP_LOW
437 * @arg @ref LL_ISO7816_CLKSTOP_HIGH
438 * @retval None.
439 */
440 __STATIC_INLINE void ll_iso7816_set_clkstop_level(iso7816_regs_t *ISO7816x, uint32_t level)
441 {
442 MODIFY_REG(ISO7816x->CLK_CFG, ISO7816_CLK_CFG_CLK_STOP_SEL, level);
443 }
444
445 /**
446 * @brief Get value of the clock output during stopped Clock.
447 *
448 * \rst
449 * +----------------------+-----------------------------------+
450 * | Register | BitsName |
451 * +======================+===================================+
452 * | CLK_CFG | CLK_STOP_SEL |
453 * +----------------------+-----------------------------------+
454 * \endrst
455 *
456 * @param ISO7816x ISO7816 instance.
457 * @retval Returned value can be one of the following values:
458 * @arg @ref LL_ISO7816_CLKSTOP_LOW
459 * @arg @ref LL_ISO7816_CLKSTOP_HIGH
460 */
461 __STATIC_INLINE uint32_t ll_iso7816_get_clkstop_level(iso7816_regs_t *ISO7816x)
462 {
463 return (uint32_t)(READ_BITS(ISO7816x->CLK_CFG, ISO7816_CLK_CFG_CLK_STOP_SEL));
464 }
465
466 /**
467 * @brief Set clock division.
468 * @note Divide system clock by this value+1.
469 *
470 * \rst
471 * +----------------------+-----------------------------------+
472 * | Register | BitsName |
473 * +======================+===================================+
474 * | CLK_CFG | CLK_DIV |
475 * +----------------------+-----------------------------------+
476 * \endrst
477 *
478 * @param ISO7816x ISO7816 instance
479 * @param value This parameter should range between 0x0 and 0xFF.
480 * @retval None.
481 */
482 __STATIC_INLINE void ll_iso7816_set_clkdiv(iso7816_regs_t *ISO7816x, uint32_t value)
483 {
484 MODIFY_REG(ISO7816x->CLK_CFG, ISO7816_CLK_CFG_CLK_DIV, value << ISO7816_CLK_CFG_CLK_DIV_POS);
485 }
486
487 /**
488 * @brief Get clock division.
489 *
490 * \rst
491 * +----------------------+-----------------------------------+
492 * | Register | BitsName |
493 * +======================+===================================+
494 * | CLK_CFG | CLK_DIV |
495 * +----------------------+-----------------------------------+
496 * \endrst
497 *
498 * @param ISO7816x ISO7816 instance
499 * @retval Returned value should range between 0x0 and 0xFF.
500 */
501 __STATIC_INLINE uint32_t ll_iso7816_get_clkdiv(iso7816_regs_t *ISO7816x)
502 {
503 return (uint32_t)(READ_BITS(ISO7816x->CLK_CFG, ISO7816_CLK_CFG_CLK_DIV) >> ISO7816_CLK_CFG_CLK_DIV_POS);
504 }
505
506 /**
507 * @brief Set divide ISO7816 clock.
508 * @note Divide SIM clock by this value+1 to define ETU length. The reset value
509 * is the one, needed for theATR.
510 *
511 * \rst
512 * +----------------------+-----------------------------------+
513 * | Register | BitsName |
514 * +======================+===================================+
515 * | CLK_CFG | ETU_DIV |
516 * +----------------------+-----------------------------------+
517 * \endrst
518 *
519 * @param ISO7816x ISO7816 instance
520 * @param divide This parameter should range between 0x0 and 0x3FF.
521 * @retval None.
522 */
523 __STATIC_INLINE void ll_iso7816_set_etudiv(iso7816_regs_t *ISO7816x, uint32_t divide)
524 {
525 MODIFY_REG(ISO7816x->CLK_CFG, ISO7816_CLK_CFG_ETU_DIV, divide);
526 }
527
528 /**
529 * @brief Get divide ISO7816 clock.
530 *
531 * \rst
532 * +----------------------+-----------------------------------+
533 * | Register | BitsName |
534 * +======================+===================================+
535 * | CLK_CFG | ETU_DIV |
536 * +----------------------+-----------------------------------+
537 * \endrst
538 *
539 * @param ISO7816x ISO7816 instance
540 * @retval Returned value should range between 0x0 and 0x3FF.
541 */
542 __STATIC_INLINE uint32_t ll_iso7816_get_etudiv(iso7816_regs_t *ISO7816x)
543 {
544 return (uint32_t)(READ_BITS(ISO7816x->CLK_CFG, ISO7816_CLK_CFG_ETU_DIV));
545 }
546
547 /**
548 * @brief Set ISO7816 wait_time in ETU.
549
550 * @note Time between the leading edges of two consecutive characters
551 *
552 * \rst
553 * +----------------------+-----------------------------------+
554 * | Register | BitsName |
555 * +======================+===================================+
556 * | TIMES | WAIT_TIME |
557 * +----------------------+-----------------------------------+
558 * \endrst
559 *
560 * @param ISO7816x ISO7816 instance
561 * @param wait_time This parameter should range between 0x0 and 0x3FFF.
562 * @retval None.
563 */
564 __STATIC_INLINE void ll_iso7816_set_waittime(iso7816_regs_t *ISO7816x, uint32_t wait_time)
565 {
566 MODIFY_REG(ISO7816x->TIMES_CFG, ISO7816_TIMES_CFG_WAIT_TIME, wait_time << ISO7816_TIMES_CFG_WAIT_TIME_POS);
567 }
568
569 /**
570 * @brief Get maximum card response time(leading edge to leading edge)
571 *
572 * \rst
573 * +----------------------+-----------------------------------+
574 * | Register | BitsName |
575 * +======================+===================================+
576 * | TIMES | WAIT_TIME |
577 * +----------------------+-----------------------------------+
578 * \endrst
579 *
580 * @param ISO7816x ISO7816 instance
581 * @retval Returned value should range between 0x0 and 0x3FFFF.
582 */
583 __STATIC_INLINE uint32_t ll_iso7816_get_waittime(iso7816_regs_t *ISO7816x)
584 {
585 return (uint32_t)(READ_BITS(ISO7816x->TIMES_CFG, ISO7816_TIMES_CFG_WAIT_TIME) >> ISO7816_TIMES_CFG_WAIT_TIME_POS);
586 }
587
588 /**
589 * @brief Set ISO7816 guard_time in ETU.
590
591 * @note Set time between the leading edges of two consecutive characters
592 *
593 * \rst
594 * +----------------------+-----------------------------------+
595 * | Register | BitsName |
596 * +======================+===================================+
597 * | TIMES | GUARD_TIME |
598 * +----------------------+-----------------------------------+
599 * \endrst
600 *
601 * @param ISO7816x ISO7816 instance
602 * @param guardtime Time between the leading edges of two consecutive characters
603 * @retval None.
604 */
605 __STATIC_INLINE void ll_iso7816_set_guardtime(iso7816_regs_t *ISO7816x, uint32_t guardtime)
606 {
607 MODIFY_REG(ISO7816x->TIMES_CFG, ISO7816_TIMES_CFG_GUARD_TIME, guardtime);
608 }
609 /**
610 * @brief Get time between the leading edges of two consecutive characters.
611 *
612 * \rst
613 * +----------------------+-----------------------------------+
614 * | Register | BitsName |
615 * +======================+===================================+
616 * | TIMES | GUARDTIME |
617 * +----------------------+-----------------------------------+
618 * \endrst
619 *
620 * @param ISO7816x ISO7816 instance
621 * @retval Returned value should range between 0x0 and 0x3FF.
622 */
623 __STATIC_INLINE uint32_t ll_iso7816_get_guardtime(iso7816_regs_t *ISO7816x)
624 {
625 return (uint32_t)(READ_BITS(ISO7816x->TIMES_CFG, ISO7816_TIMES_CFG_GUARD_TIME));
626 }
627
628 /**
629 * @brief Set maximum number of issued retries before giving up.
630 *
631 * \rst
632 * +----------------------+-----------------------------------+
633 * | Register | BitsName |
634 * +======================+===================================+
635 * | DATA_CFG | RETRY_LIMIT |
636 * +----------------------+-----------------------------------+
637 * \endrst
638 *
639 * @param ISO7816x ISO7816 instance
640 * @param number This parameter should range between 0x0 and 0x7.
641 * @retval None.
642 */
643 __STATIC_INLINE void ll_iso7816_set_retry_limit(iso7816_regs_t *ISO7816x, uint32_t number)
644 {
645 MODIFY_REG(ISO7816x->DATA_CFG, ISO7816_DATA_CFG_RETRY_LIMIT, number << ISO7816_DATA_CFG_RETRY_LIMIT_POS);
646 }
647
648 /**
649 * @brief Get maximum number of issued retries before giving up.
650 *
651 * \rst
652 * +----------------------+-----------------------------------+
653 * | Register | BitsName |
654 * +======================+===================================+
655 * | DATA_CFG | RETRY_LIMIT |
656 * +----------------------+-----------------------------------+
657 * \endrst
658 *
659 * @param ISO7816x ISO7816 instance
660 * @retval Returned value should range between 0x0 and 0x7.
661 */
662 __STATIC_INLINE uint32_t ll_iso7816_get_retry_limit(iso7816_regs_t *ISO7816x)
663 {
664 return (uint32_t)(READ_BITS(ISO7816x->DATA_CFG, ISO7816_DATA_CFG_RETRY_LIMIT) >> ISO7816_DATA_CFG_RETRY_LIMIT_POS);
665 }
666
667 /**
668 * @brief Enable coding detection.
669 *
670 * \rst
671 * +----------------------+-----------------------------------+
672 * | Register | BitsName |
673 * +======================+===================================+
674 * | DATA_CFG | DETECT_CODING |
675 * +----------------------+-----------------------------------+
676 * \endrst
677 *
678 * @param ISO7816x ISO7816 instance.
679 * @retval None.
680 */
681 __STATIC_INLINE void ll_iso7816_enable_coding_detection(iso7816_regs_t *ISO7816x)
682 {
683 SET_BITS(ISO7816x->DATA_CFG, ISO7816_DATA_CFG_DETECT_CODING);
684 }
685
686 /**
687 * @brief Disable coding detection.
688 *
689 * \rst
690 * +----------------------+-----------------------------------+
691 * | Register | BitsName |
692 * +======================+===================================+
693 * | DATA_CFG | DETECT_CODING |
694 * +----------------------+-----------------------------------+
695 * \endrst
696 *
697 * @param ISO7816x ISO7816 instance.
698 * @retval None.
699 */
700 __STATIC_INLINE void ll_iso7816_disable_coding_detection(iso7816_regs_t *ISO7816x)
701 {
702 CLEAR_BITS(ISO7816x->DATA_CFG, ISO7816_DATA_CFG_DETECT_CODING);
703 }
704
705 /**
706 * @brief Set coding convention.
707 *
708 * \rst
709 * +----------------------+-----------------------------------+
710 * | Register | BitsName |
711 * +======================+===================================+
712 * | DATA_CFG | CODING |
713 * +----------------------+-----------------------------------+
714 * \endrst
715 *
716 * @param ISO7816x ISO7816 instance.
717 * @param convention This parameter can be one of the following values:
718 * @arg @ref LL_ISO7816_CODING_DEFAULT
719 * @arg @ref LL_ISO7816_CODING_INVERSE
720 * @retval None.
721 */
722 __STATIC_INLINE void ll_iso7816_set_coding_convention(iso7816_regs_t *ISO7816x, uint32_t convention)
723 {
724 MODIFY_REG(ISO7816x->DATA_CFG, ISO7816_DATA_CFG_CODING, convention);
725 }
726
727 /**
728 * @brief Get coding convention.
729 *
730 * \rst
731 * +----------------------+-----------------------------------+
732 * | Register | BitsName |
733 * +======================+===================================+
734 * | DATA_CFG | CODING |
735 * +----------------------+-----------------------------------+
736 * \endrst
737 *
738 * @param ISO7816x ISO7816 instance
739 * @retval Returned value can be one of the following values:
740 * @arg @ref LL_ISO7816_CODING_DEFAULT
741 * @arg @ref LL_ISO7816_CODING_INVERSE
742 */
743 __STATIC_INLINE uint32_t ll_iso7816_get_coding_convention(iso7816_regs_t *ISO7816x)
744 {
745 return (uint32_t)(READ_BITS(ISO7816x->DATA_CFG, ISO7816_DATA_CFG_CODING));
746 }
747
748 /**
749 * @brief Get current address relative to base_addr.
750 *
751 * \rst
752 * +----------------------+-----------------------------------+
753 * | Register | BitsName |
754 * +======================+===================================+
755 * | ADDR | ADDR |
756 * +----------------------+-----------------------------------+
757 * \endrst
758 *
759 * @param ISO7816x ISO7816 instance
760 * @retval Value between 0x0 and 0x3FFFF.
761 */
762 __STATIC_INLINE uint32_t ll_iso7816_get_current_addr(iso7816_regs_t *ISO7816x)
763 {
764 return (uint32_t)(READ_BITS(ISO7816x->ADDR, ISO7816_ADDR_ADDR) >> ISO7816_ADDR_ADDR_POS);
765 }
766
767 /**
768 * @brief Get address fraction.
769 *
770 * \rst
771 * +----------------------+-----------------------------------+
772 * | Register | BitsName |
773 * +======================+===================================+
774 * | ADDR | ADDR_FRAC |
775 * +----------------------+-----------------------------------+
776 * \endrst
777 *
778 * @param ISO7816x ISO7816 instance
779 * @retval Value between 0x0 and 0x3.
780 */
781 __STATIC_INLINE uint32_t ll_iso7816_get_current_addr_frac(iso7816_regs_t *ISO7816x)
782 {
783 return (uint32_t)(READ_BITS(ISO7816x->ADDR, ISO7816_ADDR_ADDR_FRAC));
784 }
785
786 /**
787 * @brief Set start address for RX and TX buffer.
788 *
789 * Register |BitsName
790 * ---------|--------
791 * STRT_ADDR| BASE_ADDR+START_ADDR
792 *
793 * @param ISO7816x ISO7816 instance
794 * @param addr This parameter should range between 0x0 and 0xFFFFFFFF.
795 * @retval None.
796 */
797 __STATIC_INLINE void ll_iso7816_set_buffer_addr(iso7816_regs_t *ISO7816x, uint32_t addr)
798 {
799 WRITE_REG(ISO7816x->START_ADDR, addr);
800 }
801
802 /**
803 * @brief Get start address for RX and TX buffer.
804 *
805 * Register |BitsName
806 * ---------|--------
807 * STRT_ADDR| BASE_ADDR+START_ADDR
808 *
809 * @param ISO7816x ISO7816 instance
810 */
811 __STATIC_INLINE uint32_t ll_iso7816_get_buffer_addr(iso7816_regs_t *ISO7816x)
812 {
813 return (uint32_t)(READ_REG(ISO7816x->START_ADDR));
814 }
815
816 /**
817 * @brief Set base address for RX and TX buffer.
818 *
819 * Register |BitsName
820 * ---------|--------
821 * STRT_ADDR| BASE_ADDR
822 *
823 * @param ISO7816x ISO7816 instance
824 * @param addr This parameter should range between 0x0 and 0xFFF.
825 * @retval None.
826 */
827 __STATIC_INLINE void ll_iso7816_set_base_addr(iso7816_regs_t *ISO7816x, uint32_t addr)
828 {
829 MODIFY_REG(ISO7816x->START_ADDR, ISO7816_START_ADDR_BASE_ADDR, addr << ISO7816_START_ADDR_BASE_ADDR_POS);
830 }
831
832 /**
833 * @brief Get base address for RX and TX buffer.
834 *
835 * Register |BitsName
836 * ---------|--------
837 * STRT_ADDR| BASE_ADDR
838 *
839 * @param ISO7816x ISO7816 instance
840 * @retval Value between 0x0 and 0xFFF.
841 */
842 __STATIC_INLINE uint32_t ll_iso7816_get_base_addr(iso7816_regs_t *ISO7816x)
843 {
844 return (uint32_t)(READ_BITS(ISO7816x->START_ADDR, ISO7816_START_ADDR_BASE_ADDR) >> ISO7816_START_ADDR_BASE_ADDR_POS);
845 }
846
847 /**
848 * @brief Set start address for RX and TX buffer, relative to base_addr.
849 *
850 * Register |BitsName
851 * ---------|--------
852 * STRT_ADDR| STRT_ADDR
853 *
854 * @param ISO7816x ISO7816 instance
855 * @param addr This parameter should range between 0x0 and 0x3FFFF.
856 * @retval None.
857 */
858 __STATIC_INLINE void ll_iso7816_set_start_addr(iso7816_regs_t *ISO7816x, uint32_t addr)
859 {
860 MODIFY_REG(ISO7816x->START_ADDR, ISO7816_START_ADDR_START_ADDR, addr << ISO7816_START_ADDR_START_ADDR_POS);
861 }
862
863 /**
864 * @brief Get start address for RX and TX buffer, relative to base_addr.
865 *
866 * Register |BitsName
867 * ---------|--------
868 * STRT_ADDR| STRT_ADDR
869 *
870 * @param ISO7816x ISO7816 instance
871 * @retval Value between 0x0 and 0x3FFFF.
872 */
873 __STATIC_INLINE uint32_t ll_iso7816_get_start_addr(iso7816_regs_t *ISO7816x)
874 {
875 return (uint32_t)(READ_BITS(ISO7816x->START_ADDR, ISO7816_START_ADDR_START_ADDR) >> ISO7816_START_ADDR_START_ADDR_POS);
876 }
877
878 /**
879 * @brief Set end address of receive buffer, relative to base_addr.
880 *
881 * Register | BitsName
882 * -----------|--------
883 * RX_END_ADDR| RX_END_ADDR+
884 *
885 * @param ISO7816x ISO7816 instance
886 * @param addr This parameter should range between 0x0 and 0x3FFFF.
887 * @retval None.
888 */
889 __STATIC_INLINE void ll_iso7816_set_rx_end_addr(iso7816_regs_t *ISO7816x, uint32_t addr)
890 {
891 MODIFY_REG(ISO7816x->RX_END_ADDR, ISO7816_RX_END_ADDR_RX_END_ADDR, addr << ISO7816_RX_END_ADDR_RX_END_ADDR_POS);
892 }
893
894 /**
895 * @brief Set RX endbyte address of receive buffer, relative to base_addr.
896 *
897 * Register | BitsName
898 * -----------|--------
899 * RX_END_ADDR| RX_END_ADDR+RX_END_AF
900 *
901 * @param ISO7816x ISO7816 instance
902 * @param addr This parameter should range between 0x0 and 0x3FFFF.
903 * @retval None.
904 */
905 __STATIC_INLINE void ll_iso7816_set_rx_endbyte_addr(iso7816_regs_t *ISO7816x, uint32_t addr)
906 {
907 WRITE_REG(ISO7816x->RX_END_ADDR, addr);
908 }
909
910 /**
911 * @brief Get RX end address of receive buffer, relative to base_addr.
912 *
913 * Register | BitsName
914 * -----------|--------
915 * RX_END_ADDR| RX_END_ADDR
916 *
917 * @param ISO7816x ISO7816 instance
918 * @retval Value between 0x0 and 0x3FFFF.
919 */
920 __STATIC_INLINE uint32_t ll_iso7816_get_rx_end_addr(iso7816_regs_t *ISO7816x)
921 {
922 return (uint32_t)(READ_BITS(ISO7816x->RX_END_ADDR, ISO7816_RX_END_ADDR_RX_END_ADDR) >> ISO7816_RX_END_ADDR_RX_END_ADDR_POS);
923 }
924
925 /**
926 * @brief Set RX end address fraction.
927 *
928 * Register | BitsName
929 * -----------|--------
930 * RX_END_ADDR| RX_END_AF
931 *
932 * @param ISO7816x ISO7816 instance
933 * @param frac This parameter should range between 0x0 and 0x3.
934 * @retval None.
935 */
936 __STATIC_INLINE void ll_iso7816_set_rx_end_addr_frac(iso7816_regs_t *ISO7816x, uint32_t frac)
937 {
938 MODIFY_REG(ISO7816x->RX_END_ADDR, ISO7816_RX_END_ADDR_RX_END_AF, frac);
939 }
940
941 /**
942 * @brief Set TX endbyte address of buffer, relative to base_addr.
943 *
944 * Register | BitsName
945 * -----------|--------
946 * TX_END_ADDR| TX_END_ADDR+TX_END_AF
947 *
948 * @param ISO7816x ISO7816 instance
949 * @param addr This parameter should range between 0x0 and 0x3FFFF.
950 * @retval None.
951 */
952 __STATIC_INLINE void ll_iso7816_set_tx_endbyte_addr(iso7816_regs_t *ISO7816x, uint32_t addr)
953 {
954 WRITE_REG(ISO7816x->TX_END_ADDR, addr);
955 }
956
957 /**
958 * @brief Get TX endbyte address of buffer, relative to base_addr.
959 *
960 * Register | BitsName
961 * -----------|--------
962 * TX_END_ADDR| TX_END_ADDR+TX_END_AF
963 *
964 * @param ISO7816x ISO7816 instance
965 * @retval TX endbyte address.
966 */
967 __STATIC_INLINE uint32_t ll_iso7816_get_tx_endbyte_addr(iso7816_regs_t *ISO7816x)
968 {
969 return READ_REG(ISO7816x->TX_END_ADDR);
970 }
971
972 /**
973 * @brief Get RX endbyte address of buffer, relative to base_addr.
974 *
975 * Register | BitsName
976 * -----------|--------
977 * TX_END_ADDR| TX_END_ADDR+TX_END_AF
978 *
979 * @param ISO7816x ISO7816 instance
980 * @retval RX endbyte address.
981 */
982 __STATIC_INLINE uint32_t ll_iso7816_get_rx_endbyte_addr(iso7816_regs_t *ISO7816x)
983 {
984 return READ_REG(ISO7816x->RX_END_ADDR);
985 }
986
987 /**
988 * @brief Get RX end address fraction.
989 *
990 * Register | BitsName
991 * -----------|--------
992 * RX_END_ADDR| RX_END_AF
993 *
994 * @param ISO7816x ISO7816 instance
995 * @retval Value between 0x0 and 0x3.
996 */
997 __STATIC_INLINE uint32_t ll_iso7816_get_rx_end_addr_frac(iso7816_regs_t *ISO7816x)
998 {
999 return (uint32_t)(READ_BITS(ISO7816x->RX_END_ADDR, ISO7816_RX_END_ADDR_RX_END_AF));
1000 }
1001
1002 /**
1003 * @brief Set end address of transmit buffer, relative to base_addr.
1004 *
1005 * Register | BitsName
1006 * -----------|--------
1007 * TX_END_ADDR| TX_END_ADDR
1008 *
1009 * @param ISO7816x ISO7816 instance
1010 * @param addr This parameter should range between 0x0 and 0x3FFFF.
1011 * @retval None.
1012 */
1013 __STATIC_INLINE void ll_iso7816_set_tx_end_addr(iso7816_regs_t *ISO7816x, uint32_t addr)
1014 {
1015 MODIFY_REG(ISO7816x->TX_END_ADDR, ISO7816_TX_END_ADDR_TX_END_ADDR, addr << ISO7816_TX_END_ADDR_TX_END_ADDR_POS);
1016 }
1017
1018 /**
1019 * @brief Get end address of transmit buffer, relative to base_addr.
1020 *
1021 * Register | BitsName
1022 * -----------|--------
1023 * TX_END_ADDR| TX_END_ADDR
1024 *
1025 * @param ISO7816x ISO7816 instance
1026 * @retval Value between 0x0 and 0x3FFFF.
1027 */
1028 __STATIC_INLINE uint32_t ll_iso7816_get_tx_end_addr(iso7816_regs_t *ISO7816x)
1029 {
1030 return (uint32_t)(READ_BITS(ISO7816x->TX_END_ADDR, ISO7816_TX_END_ADDR_TX_END_ADDR) >> ISO7816_TX_END_ADDR_TX_END_ADDR_POS);
1031 }
1032
1033 /**
1034 * @brief Set TX end address fraction.
1035 *
1036 * Register | BitsName
1037 * -----------|--------
1038 * TX_END_ADDR| TX_END_AF
1039 *
1040 * @param ISO7816x ISO7816 instance
1041 * @param frac This parameter should range between 0x0 and 0x3.
1042 * @retval None.
1043 */
1044 __STATIC_INLINE void ll_iso7816_set_tx_end_addr_frac(iso7816_regs_t *ISO7816x, uint32_t frac)
1045 {
1046 MODIFY_REG(ISO7816x->TX_END_ADDR, ISO7816_TX_END_ADDR_TX_END_AF, frac);
1047 }
1048
1049 /**
1050 * @brief Get TX end address fraction.
1051 *
1052 * Register | BitsName
1053 * -----------|--------
1054 * TX_END_ADDR| TX_END_AF
1055 *
1056 * @param ISO7816x ISO7816 instance
1057 * @retval Value between 0x0 and 0x3.
1058 */
1059 __STATIC_INLINE uint32_t ll_iso7816_get_tx_end_addr_frac(iso7816_regs_t *ISO7816x)
1060 {
1061 return (uint32_t)(READ_BITS(ISO7816x->TX_END_ADDR, ISO7816_TX_END_ADDR_TX_END_AF));
1062 }
1063
1064 /** @} */
1065
1066 /** @defgroup ISO7816_LL_EF_IT_Management IT_Management
1067 * @{
1068 */
1069
1070 /**
1071 * @brief Get ISO7816 interrupt flags
1072 *
1073 * \rst
1074 * +----------------------+-----------------------------------+
1075 * | Register | BitsName |
1076 * +======================+===================================+
1077 * | STAT | STAT_TEST |
1078 * +----------------------+-----------------------------------+
1079 * \endrst
1080 * STAT | STAT_PRESENCE
1081 * STAT | STAT_STATE_ERR
1082 * STAT | STAT_DMA_ERR
1083 * STAT | STAT_RETRY_ERR
1084 * STAT | STAT_RX_ERR
1085 * STAT | STAT_DONE
1086 *
1087 * @param ISO7816x ISO7816 instance.
1088 * @retval Returned value can be one or combination of the following values:
1089 * @arg @ref LL_ISO7816_INTR_TEST
1090 * @arg @ref LL_ISO7816_INTR_PRESENCE
1091 * @arg @ref LL_ISO7816_INTR_STATE_ERR
1092 * @arg @ref LL_ISO7816_INTR_DMA_ERR
1093 * @arg @ref LL_ISO7816_INTR_RETRY_ERR
1094 * @arg @ref LL_ISO7816_INTR_RX_ERR
1095 * @arg @ref LL_ISO7816_INTR_DONE
1096 */
1097 __STATIC_INLINE uint32_t ll_iso7816_get_it_flag(iso7816_regs_t *ISO7816x)
1098 {
1099 return (uint32_t)(READ_REG(ISO7816x->STAT) & ISO7816_INTR_ALL);
1100 }
1101
1102 /**
1103 * @brief Indicate the status of STAT_TEST flag.
1104 *
1105 * \rst
1106 * +----------------------+-----------------------------------+
1107 * | Register | BitsName |
1108 * +======================+===================================+
1109 * | STAT | STAT_TEST |
1110 * +----------------------+-----------------------------------+
1111 * \endrst
1112 *
1113 * @param ISO7816x ISO7816 instance.
1114 * @retval State of bit (1 or 0).
1115 */
1116 __STATIC_INLINE uint32_t ll_iso7816_is_active_flag_test(iso7816_regs_t *ISO7816x)
1117 {
1118 return (READ_BITS(ISO7816x->STAT, ISO7816_STAT_IRQ_TEST) == (ISO7816_STAT_IRQ_TEST));
1119 }
1120
1121 /**
1122 * @brief Indicate the status of STAT_PRESENCE flag.
1123 *
1124 * \rst
1125 * +----------------------+-----------------------------------+
1126 * | Register | BitsName |
1127 * +======================+===================================+
1128 * | STAT | STAT_PRESENCE |
1129 * +----------------------+-----------------------------------+
1130 * \endrst
1131 *
1132 * @param ISO7816x ISO7816 instance.
1133 * @retval State of bit (1 or 0).
1134 */
1135 __STATIC_INLINE uint32_t ll_iso7816_is_active_flag_presence(iso7816_regs_t *ISO7816x)
1136 {
1137 return (READ_BITS(ISO7816x->STAT, ISO7816_STAT_IRQ_PRESENCE) == (ISO7816_STAT_IRQ_PRESENCE));
1138 }
1139
1140 /**
1141 * @brief Indicate the status of STAT_STATE_ERR flag.
1142 *
1143 * \rst
1144 * +----------------------+-----------------------------------+
1145 * | Register | BitsName |
1146 * +======================+===================================+
1147 * | STAT | STAT_STATE_ERR |
1148 * +----------------------+-----------------------------------+
1149 * \endrst
1150 *
1151 * @param ISO7816x ISO7816 instance.
1152 * @retval State of bit (1 or 0).
1153 */
1154 __STATIC_INLINE uint32_t ll_iso7816_is_active_flag_state_err(iso7816_regs_t *ISO7816x)
1155 {
1156 return (READ_BITS(ISO7816x->STAT, ISO7816_STAT_IRQ_STAT_ERR) == (ISO7816_STAT_IRQ_STAT_ERR));
1157 }
1158
1159 /**
1160 * @brief Indicate the status of STAT_DMA_ERR flag.
1161 *
1162 * \rst
1163 * +----------------------+-----------------------------------+
1164 * | Register | BitsName |
1165 * +======================+===================================+
1166 * | STAT | STAT_DMA_ERR |
1167 * +----------------------+-----------------------------------+
1168 * \endrst
1169 *
1170 * @param ISO7816x ISO7816 instance.
1171 * @retval State of bit (1 or 0).
1172 */
1173 __STATIC_INLINE uint32_t ll_iso7816_is_active_flag_dma_err(iso7816_regs_t *ISO7816x)
1174 {
1175 return (READ_BITS(ISO7816x->STAT, ISO7816_STAT_IRQ_DMA_ERR) == (ISO7816_STAT_IRQ_DMA_ERR));
1176 }
1177
1178 /**
1179 * @brief Indicate the status of STAT_RETRY_ERR flag.
1180 *
1181 * \rst
1182 * +----------------------+-----------------------------------+
1183 * | Register | BitsName |
1184 * +======================+===================================+
1185 * | STAT | STAT_RETRY_ERR |
1186 * +----------------------+-----------------------------------+
1187 * \endrst
1188 *
1189 * @param ISO7816x ISO7816 instance.
1190 * @retval State of bit (1 or 0).
1191 */
1192 __STATIC_INLINE uint32_t ll_iso7816_is_active_flag_retry_err(iso7816_regs_t *ISO7816x)
1193 {
1194 return (READ_BITS(ISO7816x->STAT, ISO7816_STAT_IRQ_RETRY_ERR) == (ISO7816_STAT_IRQ_RETRY_ERR));
1195 }
1196
1197 /**
1198 * @brief Indicate the status of STAT_RX_ERR flag.
1199 *
1200 * \rst
1201 * +----------------------+-----------------------------------+
1202 * | Register | BitsName |
1203 * +======================+===================================+
1204 * | STAT | STAT_RX_ERR |
1205 * +----------------------+-----------------------------------+
1206 * \endrst
1207 *
1208 * @param ISO7816x ISO7816 instance.
1209 * @retval State of bit (1 or 0).
1210 */
1211 __STATIC_INLINE uint32_t ll_iso7816_is_active_flag_rx_err(iso7816_regs_t *ISO7816x)
1212 {
1213 return (READ_BITS(ISO7816x->STAT, ISO7816_STAT_IRQ_RX_ERR) == (ISO7816_STAT_IRQ_RX_ERR));
1214 }
1215
1216 /**
1217 * @brief Indicate the status of STAT_DONE flag.
1218 *
1219 * \rst
1220 * +----------------------+-----------------------------------+
1221 * | Register | BitsName |
1222 * +======================+===================================+
1223 * | STAT | STAT_DONE |
1224 * +----------------------+-----------------------------------+
1225 * \endrst
1226 *
1227 * @param ISO7816x ISO7816 instance.
1228 * @retval State of bit (1 or 0).
1229 */
1230 __STATIC_INLINE uint32_t ll_iso7816_is_active_flag_done(iso7816_regs_t *ISO7816x)
1231 {
1232 return (READ_BITS(ISO7816x->STAT, ISO7816_STAT_IRQ_DONE) == (ISO7816_STAT_IRQ_DONE));
1233 }
1234
1235 /**
1236 * @brief Clear the combined interrupt, all individual interrupts, and the STAT register
1237 *
1238 * \rst
1239 * +----------------------+-----------------------------------+
1240 * | Register | BitsName |
1241 * +======================+===================================+
1242 * | STAT | STAT_TEST |
1243 * +----------------------+-----------------------------------+
1244 * \endrst
1245 * STAT | STAT_PRESENCE
1246 * STAT | STAT_STATE_ERR
1247 * STAT | STAT_DMA_ERR
1248 * STAT | STAT_RETRY_ERR
1249 * STAT | STAT_RX_ERR
1250 * STAT | STAT_DONE
1251 *
1252 * @param ISO7816x ISO7816 instance.
1253 * @retval None.
1254 */
1255 __STATIC_INLINE void ll_iso7816_clear_flag_all_intr(iso7816_regs_t *ISO7816x)
1256 {
1257 WRITE_REG(ISO7816x->CTRL, ISO7816_INTR_ALL);
1258 }
1259
1260 /**
1261 * @brief Clear test flag.
1262 *
1263 * \rst
1264 * +----------------------+-----------------------------------+
1265 * | Register | BitsName |
1266 * +======================+===================================+
1267 * | CTRL | CTRL_TEST |
1268 * +----------------------+-----------------------------------+
1269 * \endrst
1270 *
1271 * @param ISO7816x ISO7816 instance.
1272 * @retval None.
1273 */
1274 __STATIC_INLINE void ll_iso7816_clear_flag_test(iso7816_regs_t *ISO7816x)
1275 {
1276 WRITE_REG(ISO7816x->CTRL, ISO7816_CTRL_IRQ_TEST_CLR);
1277 }
1278
1279 /**
1280 * @brief Clear presence flag.
1281 *
1282 * \rst
1283 * +----------------------+-----------------------------------+
1284 * | Register | BitsName |
1285 * +======================+===================================+
1286 * | CTRL | CTRL_PRESENCE |
1287 * +----------------------+-----------------------------------+
1288 * \endrst
1289 *
1290 * @param ISO7816x ISO7816 instance.
1291 * @retval None.
1292 */
1293 __STATIC_INLINE void ll_iso7816_clear_flag_presence(iso7816_regs_t *ISO7816x)
1294 {
1295 WRITE_REG(ISO7816x->CTRL, ISO7816_CTRL_IRQ_PRESENCE_CLR);
1296 }
1297
1298 /**
1299 * @brief Clear state error flag.
1300 *
1301 * \rst
1302 * +----------------------+-----------------------------------+
1303 * | Register | BitsName |
1304 * +======================+===================================+
1305 * | CTRL | CTRL_STATE_ERR |
1306 * +----------------------+-----------------------------------+
1307 * \endrst
1308 *
1309 * @param ISO7816x ISO7816 instance.
1310 * @retval None.
1311 */
1312 __STATIC_INLINE void ll_iso7816_clear_flag_state_err(iso7816_regs_t *ISO7816x)
1313 {
1314 WRITE_REG(ISO7816x->CTRL, ISO7816_CTRL_IRQ_STAT_EC);
1315 }
1316
1317 /**
1318 * @brief Clear dma error flag.
1319 *
1320 * \rst
1321 * +----------------------+-----------------------------------+
1322 * | Register | BitsName |
1323 * +======================+===================================+
1324 * | CTRL | CTRL_DMA_ERR |
1325 * +----------------------+-----------------------------------+
1326 * \endrst
1327 *
1328 * @param ISO7816x ISO7816 instance.
1329 * @retval None.
1330 */
1331 __STATIC_INLINE void ll_iso7816_clear_flag_dma_err(iso7816_regs_t *ISO7816x)
1332 {
1333 WRITE_REG(ISO7816x->CTRL, ISO7816_CTRL_IRQ_DMA_EC);
1334 }
1335
1336 /**
1337 * @brief Clear retry error flag.
1338 *
1339 * \rst
1340 * +----------------------+-----------------------------------+
1341 * | Register | BitsName |
1342 * +======================+===================================+
1343 * | CTRL | CTRL_RETRY_ERR |
1344 * +----------------------+-----------------------------------+
1345 * \endrst
1346 *
1347 * @param ISO7816x ISO7816 instance.
1348 * @retval None.
1349 */
1350 __STATIC_INLINE void ll_iso7816_clear_flag_retry_err(iso7816_regs_t *ISO7816x)
1351 {
1352 WRITE_REG(ISO7816x->CTRL, ISO7816_CTRL_IRQ_RETYR_EC);
1353 }
1354
1355 /**
1356 * @brief Clear RX error flag.
1357 *
1358 * \rst
1359 * +----------------------+-----------------------------------+
1360 * | Register | BitsName |
1361 * +======================+===================================+
1362 * | CTRL | CTRL_RX_ERR |
1363 * +----------------------+-----------------------------------+
1364 * \endrst
1365 *
1366 * @param ISO7816x ISO7816 instance.
1367 * @retval None.
1368 */
1369 __STATIC_INLINE void ll_iso7816_clear_flag_rx_err(iso7816_regs_t *ISO7816x)
1370 {
1371 WRITE_REG(ISO7816x->CTRL, ISO7816_CTRL_IRQ_RX_EC);
1372 }
1373
1374 /**
1375 * @brief Clear done flag.
1376 *
1377 * \rst
1378 * +----------------------+-----------------------------------+
1379 * | Register | BitsName |
1380 * +======================+===================================+
1381 * | CTRL | CTRL_DONE |
1382 * +----------------------+-----------------------------------+
1383 * \endrst
1384 *
1385 * @param ISO7816x ISO7816 instance.
1386 * @retval None.
1387 */
1388 __STATIC_INLINE void ll_iso7816_clear_flag_done(iso7816_regs_t *ISO7816x)
1389 {
1390 WRITE_REG(ISO7816x->CTRL, ISO7816_CTRL_IRQ_DONE_CLR);
1391 }
1392
1393 /** @} */
1394
1395
1396 /** @defgroup ISO7816_LL_Init ISO7816 Initialization and de-initialization functions
1397 * @{
1398 */
1399
1400 /**
1401 * @brief Initialize the ISO7816 registers according to the specified parameters in p_iso7816_init.
1402 * @param ISO7816x ISO7816 instance.
1403 * @param p_iso7816_init pointer to a @ref ll_iso7816_init_t structure.
1404 * @retval An ErrorStatus enumeration value:
1405 * - SUCCESS: ISO7816 registers are initialized
1406 * - ERROR: Not applicable
1407 */
1408 error_status_t ll_iso7816_init(iso7816_regs_t *ISO7816x, ll_iso7816_init_t *p_iso7816_init);
1409
1410 /**
1411 * @brief De-initialize the ISO7816 registers to their default reset values.
1412 * @param ISO7816x ISO7816 instance.
1413 * @retval An ErrorStatus enumeration value:
1414 * - SUCCESS: ISO7816 registers are de-initialized
1415 * - ERROR: ISO7816 registers are not de-initialized
1416 */
1417 error_status_t ll_iso7816_deinit(iso7816_regs_t *ISO7816x);
1418
1419 /** @} */
1420 /** @} */
1421
1422 #endif /* ISO7816 */
1423
1424 #ifdef __cplusplus
1425 }
1426 #endif
1427
1428 #endif /* __GR55xx_LL_ISO7816_H__ */
1429
1430 /** @} */
1431
1432 /** @} */
1433
1434 /** @} */
1435
ll_iso7816_get_tx_retry_max
__STATIC_INLINE uint32_t ll_iso7816_get_tx_retry_max(iso7816_regs_t *ISO7816x)
Get Maximum number of seen transmit retries after error signaling by ISO7816.
Definition: gr55xx_ll_iso7816.h:341
ll_iso7816_get_it_flag
__STATIC_INLINE uint32_t ll_iso7816_get_it_flag(iso7816_regs_t *ISO7816x)
Get ISO7816 interrupt flags.
Definition: gr55xx_ll_iso7816.h:1097
_ll_iso7816_init::detect_coding
uint8_t detect_coding
Definition: gr55xx_ll_iso7816.h:79
ll_iso7816_clear_flag_all_intr
__STATIC_INLINE void ll_iso7816_clear_flag_all_intr(iso7816_regs_t *ISO7816x)
Clear the combined interrupt, all individual interrupts, and the STAT register.
Definition: gr55xx_ll_iso7816.h:1255
ll_iso7816_get_tx_endbyte_addr
__STATIC_INLINE uint32_t ll_iso7816_get_tx_endbyte_addr(iso7816_regs_t *ISO7816x)
Get TX endbyte address of buffer, relative to base_addr.
Definition: gr55xx_ll_iso7816.h:967
ll_iso7816_get_current_addr_frac
__STATIC_INLINE uint32_t ll_iso7816_get_current_addr_frac(iso7816_regs_t *ISO7816x)
Get address fraction.
Definition: gr55xx_ll_iso7816.h:781
ll_iso7816_clear_flag_retry_err
__STATIC_INLINE void ll_iso7816_clear_flag_retry_err(iso7816_regs_t *ISO7816x)
Clear retry error flag.
Definition: gr55xx_ll_iso7816.h:1350
ll_iso7816_is_active_flag_retry_err
__STATIC_INLINE uint32_t ll_iso7816_is_active_flag_retry_err(iso7816_regs_t *ISO7816x)
Indicate the status of STAT_RETRY_ERR flag.
Definition: gr55xx_ll_iso7816.h:1192
ll_iso7816_set_tx_end_addr
__STATIC_INLINE void ll_iso7816_set_tx_end_addr(iso7816_regs_t *ISO7816x, uint32_t addr)
Set end address of transmit buffer, relative to base_addr.
Definition: gr55xx_ll_iso7816.h:1013
_ll_iso7816_init
ISO7816_LL_init_structure LL ISO7816 init Structure definition.
Definition: gr55xx_ll_iso7816.h:74
ll_iso7816_is_active_flag_state_err
__STATIC_INLINE uint32_t ll_iso7816_is_active_flag_state_err(iso7816_regs_t *ISO7816x)
Indicate the status of STAT_STATE_ERR flag.
Definition: gr55xx_ll_iso7816.h:1154
ll_iso7816_set_coding_convention
__STATIC_INLINE void ll_iso7816_set_coding_convention(iso7816_regs_t *ISO7816x, uint32_t convention)
Set coding convention.
Definition: gr55xx_ll_iso7816.h:722
ll_iso7816_get_start_addr
__STATIC_INLINE uint32_t ll_iso7816_get_start_addr(iso7816_regs_t *ISO7816x)
Get start address for RX and TX buffer, relative to base_addr.
Definition: gr55xx_ll_iso7816.h:873
ll_iso7816_get_buffer_addr
__STATIC_INLINE uint32_t ll_iso7816_get_buffer_addr(iso7816_regs_t *ISO7816x)
Get start address for RX and TX buffer.
Definition: gr55xx_ll_iso7816.h:811
ll_iso7816_get_coding_convention
__STATIC_INLINE uint32_t ll_iso7816_get_coding_convention(iso7816_regs_t *ISO7816x)
Get coding convention.
Definition: gr55xx_ll_iso7816.h:743
ll_iso7816_clear_flag_rx_err
__STATIC_INLINE void ll_iso7816_clear_flag_rx_err(iso7816_regs_t *ISO7816x)
Clear RX error flag.
Definition: gr55xx_ll_iso7816.h:1369
ll_iso7816_set_action
__STATIC_INLINE void ll_iso7816_set_action(iso7816_regs_t *ISO7816x, uint32_t action)
Request ISO7816 to go to the next action.
Definition: gr55xx_ll_iso7816.h:243
ll_iso7816_get_rx_end_addr_frac
__STATIC_INLINE uint32_t ll_iso7816_get_rx_end_addr_frac(iso7816_regs_t *ISO7816x)
Get RX end address fraction.
Definition: gr55xx_ll_iso7816.h:997
ll_iso7816_get_guardtime
__STATIC_INLINE uint32_t ll_iso7816_get_guardtime(iso7816_regs_t *ISO7816x)
Get time between the leading edges of two consecutive characters.
Definition: gr55xx_ll_iso7816.h:623
ll_iso7816_set_base_addr
__STATIC_INLINE void ll_iso7816_set_base_addr(iso7816_regs_t *ISO7816x, uint32_t addr)
Set base address for RX and TX buffer.
Definition: gr55xx_ll_iso7816.h:827
ll_iso7816_get_waittime
__STATIC_INLINE uint32_t ll_iso7816_get_waittime(iso7816_regs_t *ISO7816x)
Get maximum card response time(leading edge to leading edge)
Definition: gr55xx_ll_iso7816.h:583
ll_iso7816_get_tx_end_addr_frac
__STATIC_INLINE uint32_t ll_iso7816_get_tx_end_addr_frac(iso7816_regs_t *ISO7816x)
Get TX end address fraction.
Definition: gr55xx_ll_iso7816.h:1059
ll_iso7816_is_active_flag_presence
__STATIC_INLINE uint32_t ll_iso7816_is_active_flag_presence(iso7816_regs_t *ISO7816x)
Indicate the status of STAT_PRESENCE flag.
Definition: gr55xx_ll_iso7816.h:1135
ll_iso7816_get_tx_end_addr
__STATIC_INLINE uint32_t ll_iso7816_get_tx_end_addr(iso7816_regs_t *ISO7816x)
Get end address of transmit buffer, relative to base_addr.
Definition: gr55xx_ll_iso7816.h:1028
ll_iso7816_set_rx_endbyte_addr
__STATIC_INLINE void ll_iso7816_set_rx_endbyte_addr(iso7816_regs_t *ISO7816x, uint32_t addr)
Set RX endbyte address of receive buffer, relative to base_addr.
Definition: gr55xx_ll_iso7816.h:905
_ll_iso7816_init::clk_div
uint32_t clk_div
Definition: gr55xx_ll_iso7816.h:75
ll_iso7816_clear_rx_retry_max
__STATIC_INLINE void ll_iso7816_clear_rx_retry_max(iso7816_regs_t *ISO7816x)
Clear Receive Retries Maximum.
Definition: gr55xx_ll_iso7816.h:301
ll_iso7816_is_active_flag_dma_err
__STATIC_INLINE uint32_t ll_iso7816_is_active_flag_dma_err(iso7816_regs_t *ISO7816x)
Indicate the status of STAT_DMA_ERR flag.
Definition: gr55xx_ll_iso7816.h:1173
ll_iso7816_deinit
error_status_t ll_iso7816_deinit(iso7816_regs_t *ISO7816x)
De-initialize the ISO7816 registers to their default reset values.
ll_iso7816_get_etudiv
__STATIC_INLINE uint32_t ll_iso7816_get_etudiv(iso7816_regs_t *ISO7816x)
Get divide ISO7816 clock.
Definition: gr55xx_ll_iso7816.h:542
ll_iso7816_is_busy
__STATIC_INLINE uint32_t ll_iso7816_is_busy(iso7816_regs_t *ISO7816x)
Get ISO7816 states.
Definition: gr55xx_ll_iso7816.h:263
ll_iso7816_set_rx_end_addr_frac
__STATIC_INLINE void ll_iso7816_set_rx_end_addr_frac(iso7816_regs_t *ISO7816x, uint32_t frac)
Set RX end address fraction.
Definition: gr55xx_ll_iso7816.h:936
ll_iso7816_set_rx_end_addr
__STATIC_INLINE void ll_iso7816_set_rx_end_addr(iso7816_regs_t *ISO7816x, uint32_t addr)
Set end address of receive buffer, relative to base_addr.
Definition: gr55xx_ll_iso7816.h:889
ll_iso7816_set_tx_end_addr_frac
__STATIC_INLINE void ll_iso7816_set_tx_end_addr_frac(iso7816_regs_t *ISO7816x, uint32_t frac)
Set TX end address fraction.
Definition: gr55xx_ll_iso7816.h:1044
ll_iso7816_get_base_addr
__STATIC_INLINE uint32_t ll_iso7816_get_base_addr(iso7816_regs_t *ISO7816x)
Get base address for RX and TX buffer.
Definition: gr55xx_ll_iso7816.h:842
ll_iso7816_set_waittime
__STATIC_INLINE void ll_iso7816_set_waittime(iso7816_regs_t *ISO7816x, uint32_t wait_time)
Set ISO7816 wait_time in ETU.
Definition: gr55xx_ll_iso7816.h:564
ll_iso7816_get_power_states
__STATIC_INLINE uint32_t ll_iso7816_get_power_states(iso7816_regs_t *ISO7816x)
Get ISO7816 Power States.
Definition: gr55xx_ll_iso7816.h:418
_ll_iso7816_init::guard_time
uint16_t guard_time
Definition: gr55xx_ll_iso7816.h:78
ll_iso7816_clear_flag_test
__STATIC_INLINE void ll_iso7816_clear_flag_test(iso7816_regs_t *ISO7816x)
Clear test flag.
Definition: gr55xx_ll_iso7816.h:1274
ll_iso7816_get_current_addr
__STATIC_INLINE uint32_t ll_iso7816_get_current_addr(iso7816_regs_t *ISO7816x)
Get current address relative to base_addr.
Definition: gr55xx_ll_iso7816.h:762
ll_iso7816_set_tx_endbyte_addr
__STATIC_INLINE void ll_iso7816_set_tx_endbyte_addr(iso7816_regs_t *ISO7816x, uint32_t addr)
Set TX endbyte address of buffer, relative to base_addr.
Definition: gr55xx_ll_iso7816.h:952
ll_iso7816_set_guardtime
__STATIC_INLINE void ll_iso7816_set_guardtime(iso7816_regs_t *ISO7816x, uint32_t guardtime)
Set ISO7816 guard_time in ETU.
Definition: gr55xx_ll_iso7816.h:605
ll_iso7816_clear_flag_state_err
__STATIC_INLINE void ll_iso7816_clear_flag_state_err(iso7816_regs_t *ISO7816x)
Clear state error flag.
Definition: gr55xx_ll_iso7816.h:1312
ll_iso7816_set_retry_limit
__STATIC_INLINE void ll_iso7816_set_retry_limit(iso7816_regs_t *ISO7816x, uint32_t number)
Set maximum number of issued retries before giving up.
Definition: gr55xx_ll_iso7816.h:643
ll_iso7816_get_rx_endbyte_addr
__STATIC_INLINE uint32_t ll_iso7816_get_rx_endbyte_addr(iso7816_regs_t *ISO7816x)
Get RX endbyte address of buffer, relative to base_addr.
Definition: gr55xx_ll_iso7816.h:982
ll_iso7816_init
error_status_t ll_iso7816_init(iso7816_regs_t *ISO7816x, ll_iso7816_init_t *p_iso7816_init)
Initialize the ISO7816 registers according to the specified parameters in p_iso7816_init.
ll_iso7816_init_t
struct _ll_iso7816_init ll_iso7816_init_t
ISO7816_LL_init_structure LL ISO7816 init Structure definition.
ll_iso7816_clear_flag_presence
__STATIC_INLINE void ll_iso7816_clear_flag_presence(iso7816_regs_t *ISO7816x)
Clear presence flag.
Definition: gr55xx_ll_iso7816.h:1293
ll_iso7816_enable_coding_detection
__STATIC_INLINE void ll_iso7816_enable_coding_detection(iso7816_regs_t *ISO7816x)
Enable coding detection.
Definition: gr55xx_ll_iso7816.h:681
_ll_iso7816_init::wait_time
uint32_t wait_time
Definition: gr55xx_ll_iso7816.h:77
ll_iso7816_set_start_addr
__STATIC_INLINE void ll_iso7816_set_start_addr(iso7816_regs_t *ISO7816x, uint32_t addr)
Set start address for RX and TX buffer, relative to base_addr.
Definition: gr55xx_ll_iso7816.h:858
ll_iso7816_get_io_states
__STATIC_INLINE uint32_t ll_iso7816_get_io_states(iso7816_regs_t *ISO7816x)
Get ISO7816 IO States.
Definition: gr55xx_ll_iso7816.h:385
ll_iso7816_is_active_flag_rx_err
__STATIC_INLINE uint32_t ll_iso7816_is_active_flag_rx_err(iso7816_regs_t *ISO7816x)
Indicate the status of STAT_RX_ERR flag.
Definition: gr55xx_ll_iso7816.h:1211
ll_iso7816_get_clkdiv
__STATIC_INLINE uint32_t ll_iso7816_get_clkdiv(iso7816_regs_t *ISO7816x)
Get clock division.
Definition: gr55xx_ll_iso7816.h:501
ll_iso7816_check_card_presence
__STATIC_INLINE uint32_t ll_iso7816_check_card_presence(iso7816_regs_t *ISO7816x)
Check Card presence.
Definition: gr55xx_ll_iso7816.h:322
ll_iso7816_set_buffer_addr
__STATIC_INLINE void ll_iso7816_set_buffer_addr(iso7816_regs_t *ISO7816x, uint32_t addr)
Set start address for RX and TX buffer.
Definition: gr55xx_ll_iso7816.h:797
ll_iso7816_clear_flag_done
__STATIC_INLINE void ll_iso7816_clear_flag_done(iso7816_regs_t *ISO7816x)
Clear done flag.
Definition: gr55xx_ll_iso7816.h:1388
ll_iso7816_disable_coding_detection
__STATIC_INLINE void ll_iso7816_disable_coding_detection(iso7816_regs_t *ISO7816x)
Disable coding detection.
Definition: gr55xx_ll_iso7816.h:700
ll_iso7816_clear_flag_dma_err
__STATIC_INLINE void ll_iso7816_clear_flag_dma_err(iso7816_regs_t *ISO7816x)
Clear dma error flag.
Definition: gr55xx_ll_iso7816.h:1331
ll_iso7816_set_clkstop_level
__STATIC_INLINE void ll_iso7816_set_clkstop_level(iso7816_regs_t *ISO7816x, uint32_t level)
Set value of the clock output during stopped Clock.
Definition: gr55xx_ll_iso7816.h:440
ll_iso7816_get_rx_retry_max
__STATIC_INLINE uint32_t ll_iso7816_get_rx_retry_max(iso7816_regs_t *ISO7816x)
Get Maximum number of seen receive retries after error signaling by ISO7816.
Definition: gr55xx_ll_iso7816.h:360
ll_iso7816_is_active_flag_done
__STATIC_INLINE uint32_t ll_iso7816_is_active_flag_done(iso7816_regs_t *ISO7816x)
Indicate the status of STAT_DONE flag.
Definition: gr55xx_ll_iso7816.h:1230
ll_iso7816_set_clkdiv
__STATIC_INLINE void ll_iso7816_set_clkdiv(iso7816_regs_t *ISO7816x, uint32_t value)
Set clock division.
Definition: gr55xx_ll_iso7816.h:482
ll_iso7816_get_retry_limit
__STATIC_INLINE uint32_t ll_iso7816_get_retry_limit(iso7816_regs_t *ISO7816x)
Get maximum number of issued retries before giving up.
Definition: gr55xx_ll_iso7816.h:662
ll_iso7816_is_active_flag_test
__STATIC_INLINE uint32_t ll_iso7816_is_active_flag_test(iso7816_regs_t *ISO7816x)
Indicate the status of STAT_TEST flag.
Definition: gr55xx_ll_iso7816.h:1116
ll_iso7816_get_clkstop_level
__STATIC_INLINE uint32_t ll_iso7816_get_clkstop_level(iso7816_regs_t *ISO7816x)
Get value of the clock output during stopped Clock.
Definition: gr55xx_ll_iso7816.h:461
ll_iso7816_clear_tx_retry_max
__STATIC_INLINE void ll_iso7816_clear_tx_retry_max(iso7816_regs_t *ISO7816x)
Clear Transmit Retries Maximum.
Definition: gr55xx_ll_iso7816.h:282
ll_iso7816_set_etudiv
__STATIC_INLINE void ll_iso7816_set_etudiv(iso7816_regs_t *ISO7816x, uint32_t divide)
Set divide ISO7816 clock.
Definition: gr55xx_ll_iso7816.h:523
ll_iso7816_get_rx_end_addr
__STATIC_INLINE uint32_t ll_iso7816_get_rx_end_addr(iso7816_regs_t *ISO7816x)
Get RX end address of receive buffer, relative to base_addr.
Definition: gr55xx_ll_iso7816.h:920