gr55xx_ll_iso7816.h
Go to the documentation of this file.
1
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
66 /* Exported types ------------------------------------------------------------*/
73 typedef struct _ll_iso7816_init
74 {
75 uint32_t clk_div;
77 uint32_t wait_time;
78 uint16_t guard_time;
79 uint8_t detect_coding;
80 } ll_iso7816_init_t;
89 /* Exported constants --------------------------------------------------------*/
97 #define LL_ISO7816_ACTION_NONE 0x00000000U
98 #define LL_ISO7816_ACTION_OFF 0x00000001U
99 #define LL_ISO7816_ACTION_STOPCLK 0x00000002U
100 #define LL_ISO7816_ACTION_ON 0x00000003U
101 #define LL_ISO7816_ACTION_WARMRST 0x00000004U
102 #define LL_ISO7816_ACTION_RX 0x00000005U
103 #define LL_ISO7816_ACTION_TX 0x00000006U
104 #define LL_ISO7816_ACTION_TXRX 0x00000007U
111 #define LL_ISO7816_INTR_TEST ISO7816_STAT_IRQ_TEST
112 #define LL_ISO7816_INTR_PRESENCE ISO7816_STAT_IRQ_PRESENCE
113 #define LL_ISO7816_INTR_STATE_ERR ISO7816_STAT_IRQ_STAT_ERR
114 #define LL_ISO7816_INTR_DMA_ERR ISO7816_STAT_IRQ_DMA_ERR
115 #define LL_ISO7816_INTR_RETRY_ERR ISO7816_STAT_IRQ_RETRY_ERR
116 #define LL_ISO7816_INTR_RX_ERR ISO7816_STAT_IRQ_RX_ERR
117 #define LL_ISO7816_INTR_DONE ISO7816_STAT_IRQ_DONE
119 #define LL_ISO7816_INTR_MASK_ALL ISO7816_INTR_ALL
125 #define LL_ISO7816_CARD_ABSENT 0x00000000U
126 #define LL_ISO7816_CARD_PRESENT 0x00000001U
132 #define LL_ISO7816_IO_STATE_OFF (0x0UL << ISO7816_STAT_IO_STAT_POS)
133 #define LL_ISO7816_IO_STATE_IDLE (0x1UL << ISO7816_STAT_IO_STAT_POS)
134 #define LL_ISO7816_IO_STATE_RX_WAIT (0x4UL << ISO7816_STAT_IO_STAT_POS)
135 #define LL_ISO7816_IO_STATE_RX (0x5UL << ISO7816_STAT_IO_STAT_POS)
136 #define LL_ISO7816_IO_STATE_TX (0x6UL << ISO7816_STAT_IO_STAT_POS)
137 #define LL_ISO7816_IO_STATE_TX_GUARD (0x7UL << ISO7816_STAT_IO_STAT_POS)
143 #define LL_ISO7816_PWR_STATE_OFF (0x0UL << ISO7816_STAT_PWR_STAT_POS)
144 #define LL_ISO7816_PWR_STATE_PWRUP_VCC (0x1UL << ISO7816_STAT_PWR_STAT_POS)
145 #define LL_ISO7816_PWR_STATE_PWRUP_RST (0x2UL << ISO7816_STAT_PWR_STAT_POS)
146 #define LL_ISO7816_PWR_STATE_PWRDN_RST (0x3UL << ISO7816_STAT_PWR_STAT_POS)
147 #define LL_ISO7816_PWR_STATE_PWRDN_VCC (0x4UL << ISO7816_STAT_PWR_STAT_POS)
148 #define LL_ISO7816_PWR_STATE_STOP_PRE (0x5UL << ISO7816_STAT_PWR_STAT_POS)
149 #define LL_ISO7816_PWR_STATE_STOP (0x6UL << ISO7816_STAT_PWR_STAT_POS)
150 #define LL_ISO7816_PWR_STATE_STOP_POST (0x7UL << ISO7816_STAT_PWR_STAT_POS)
151 #define LL_ISO7816_PWR_STATE_IDLE (0x8UL << ISO7816_STAT_PWR_STAT_POS)
152 #define LL_ISO7816_PWR_STATE_RX_TS0 (0x9UL << ISO7816_STAT_PWR_STAT_POS)
153 #define LL_ISO7816_PWR_STATE_RX_TS1 (0xAUL << ISO7816_STAT_PWR_STAT_POS)
154 #define LL_ISO7816_PWR_STATE_RX (0xBUL << ISO7816_STAT_PWR_STAT_POS)
155 #define LL_ISO7816_PWR_STATE_TX (0xCUL << ISO7816_STAT_PWR_STAT_POS)
156 #define LL_ISO7816_PWR_STATE_TX_RX (0xDUL << ISO7816_STAT_PWR_STAT_POS)
162 #define LL_ISO7816_CLKSTOP_LOW (0x00000000UL)
163 #define LL_ISO7816_CLKSTOP_HIGH (0x80000000UL)
169 #define LL_ISO7816_CODING_DEFAULT (0x00000000UL)
170 #define LL_ISO7816_CODING_INVERSE (0x00000001UL)
175 /* Exported macro ------------------------------------------------------------*/
176
191 #define LL_ISO7816_WriteReg(__instance__, __REG__, __VALUE__) WRITE_REG(__instance__->__REG__, (__VALUE__))
192
199 #define LL_ISO7816_ReadReg(__instance__, __REG__) READ_REG(__instance__->__REG__)
200
208 /* Private types -------------------------------------------------------------*/
209 /* Private variables ---------------------------------------------------------*/
210 /* Private constants ---------------------------------------------------------*/
211 /* Private macros ------------------------------------------------------------*/
212 /* Exported functions --------------------------------------------------------*/
239 __STATIC_INLINE void ll_iso7816_set_action(iso7816_regs_t *ISO7816x, uint32_t action)
240 {
241 WRITE_REG(ISO7816x->CTRL, action);
242 }
243
244
255 __STATIC_INLINE uint32_t ll_iso7816_is_busy(iso7816_regs_t *ISO7816x)
256 {
257 return (READ_BITS(ISO7816x->STAT, ISO7816_STAT_BUSY) == (ISO7816_STAT_BUSY));
258 }
259
270 __STATIC_INLINE void ll_iso7816_clear_tx_retry_max(iso7816_regs_t *ISO7816x)
271 {
272 WRITE_REG(ISO7816x->CTRL, ISO7816_CTRL_TX_RETYR_MC);
273 }
274
285 __STATIC_INLINE void ll_iso7816_clear_rx_retry_max(iso7816_regs_t *ISO7816x)
286 {
287 WRITE_REG(ISO7816x->CTRL, ISO7816_CTRL_RX_RETYR_MC);
288 }
289
302 __STATIC_INLINE uint32_t ll_iso7816_check_card_presence(iso7816_regs_t *ISO7816x)
303 {
304 return (uint32_t)(READ_BITS(ISO7816x->STAT, ISO7816_STAT_PRESENCE_STAT) >> ISO7816_STAT_PRESENCE_STAT_POS);
305 }
306
317 __STATIC_INLINE uint32_t ll_iso7816_get_tx_retry_max(iso7816_regs_t *ISO7816x)
318 {
319 return (uint32_t)(READ_BITS(ISO7816x->STAT, ISO7816_STAT_TX_RETRY_MAX) >> ISO7816_STAT_RX_RETRY_MAX_POS);
320 }
321
332 __STATIC_INLINE uint32_t ll_iso7816_get_rx_retry_max(iso7816_regs_t *ISO7816x)
333 {
334 return (uint32_t)(READ_BITS(ISO7816x->STAT, ISO7816_STAT_RX_RETRY_MAX) >> ISO7816_STAT_RX_RETRY_MAX_POS);
335 }
336
353 __STATIC_INLINE uint32_t ll_iso7816_get_io_states(iso7816_regs_t *ISO7816x)
354 {
355 return (uint32_t)(READ_BITS(ISO7816x->STAT, ISO7816_STAT_IO_STAT) >> ISO7816_STAT_IO_STAT_POS);
356 }
357
382 __STATIC_INLINE uint32_t ll_iso7816_get_power_states(iso7816_regs_t *ISO7816x)
383 {
384 return (uint32_t)(READ_BITS(ISO7816x->STAT, ISO7816_STAT_PWR_STAT));
385 }
386
400 __STATIC_INLINE void ll_iso7816_set_clkstop_level(iso7816_regs_t *ISO7816x, uint32_t level)
401 {
402 MODIFY_REG(ISO7816x->CLK_CFG, ISO7816_CLK_CFG_CLK_STOP_SEL, level);
403 }
404
417 __STATIC_INLINE uint32_t ll_iso7816_get_clkstop_level(iso7816_regs_t *ISO7816x)
418 {
419 return (uint32_t)(READ_BITS(ISO7816x->CLK_CFG, ISO7816_CLK_CFG_CLK_STOP_SEL));
420 }
421
434 __STATIC_INLINE void ll_iso7816_set_clkdiv(iso7816_regs_t *ISO7816x, uint32_t value)
435 {
436 MODIFY_REG(ISO7816x->CLK_CFG, ISO7816_CLK_CFG_CLK_DIV, value << ISO7816_CLK_CFG_CLK_DIV_POS);
437 }
438
449 __STATIC_INLINE uint32_t ll_iso7816_get_clkdiv(iso7816_regs_t *ISO7816x)
450 {
451 return (uint32_t)(READ_BITS(ISO7816x->CLK_CFG, ISO7816_CLK_CFG_CLK_DIV) >> ISO7816_CLK_CFG_CLK_DIV_POS);
452 }
453
467 __STATIC_INLINE void ll_iso7816_set_etudiv(iso7816_regs_t *ISO7816x, uint32_t divide)
468 {
469 MODIFY_REG(ISO7816x->CLK_CFG, ISO7816_CLK_CFG_ETU_DIV, divide);
470 }
471
482 __STATIC_INLINE uint32_t ll_iso7816_get_etudiv(iso7816_regs_t *ISO7816x)
483 {
484 return (uint32_t)(READ_BITS(ISO7816x->CLK_CFG, ISO7816_CLK_CFG_ETU_DIV));
485 }
486
500 __STATIC_INLINE void ll_iso7816_set_waittime(iso7816_regs_t *ISO7816x, uint32_t wait_time)
501 {
502 MODIFY_REG(ISO7816x->TIMES_CFG, ISO7816_TIMES_CFG_WAIT_TIME, wait_time << ISO7816_TIMES_CFG_WAIT_TIME_POS);
503 }
504
515 __STATIC_INLINE uint32_t ll_iso7816_get_waittime(iso7816_regs_t *ISO7816x)
516 {
517 return (uint32_t)(READ_BITS(ISO7816x->TIMES_CFG, ISO7816_TIMES_CFG_WAIT_TIME) >> ISO7816_TIMES_CFG_WAIT_TIME_POS);
518 }
519
533 __STATIC_INLINE void ll_iso7816_set_guardtime(iso7816_regs_t *ISO7816x, uint32_t guardtime)
534 {
535 MODIFY_REG(ISO7816x->TIMES_CFG, ISO7816_TIMES_CFG_GUARD_TIME, guardtime);
536 }
547 __STATIC_INLINE uint32_t ll_iso7816_get_guardtime(iso7816_regs_t *ISO7816x)
548 {
549 return (uint32_t)(READ_BITS(ISO7816x->TIMES_CFG, ISO7816_TIMES_CFG_GUARD_TIME));
550 }
551
563 __STATIC_INLINE void ll_iso7816_set_retry_limit(iso7816_regs_t *ISO7816x, uint32_t number)
564 {
565 MODIFY_REG(ISO7816x->DATA_CFG, ISO7816_DATA_CFG_RETRY_LIMIT, number << ISO7816_DATA_CFG_RETRY_LIMIT_POS);
566 }
567
578 __STATIC_INLINE uint32_t ll_iso7816_get_retry_limit(iso7816_regs_t *ISO7816x)
579 {
580 return (uint32_t)(READ_BITS(ISO7816x->DATA_CFG, ISO7816_DATA_CFG_RETRY_LIMIT) >> ISO7816_DATA_CFG_RETRY_LIMIT_POS);
581 }
582
593 __STATIC_INLINE void ll_iso7816_enable_coding_detection(iso7816_regs_t *ISO7816x)
594 {
595 SET_BITS(ISO7816x->DATA_CFG, ISO7816_DATA_CFG_DETECT_CODING);
596 }
597
608 __STATIC_INLINE void ll_iso7816_disable_coding_detection(iso7816_regs_t *ISO7816x)
609 {
610 CLEAR_BITS(ISO7816x->DATA_CFG, ISO7816_DATA_CFG_DETECT_CODING);
611 }
612
626 __STATIC_INLINE void ll_iso7816_set_coding_convention(iso7816_regs_t *ISO7816x, uint32_t convention)
627 {
628 MODIFY_REG(ISO7816x->DATA_CFG, ISO7816_DATA_CFG_CODING, convention);
629 }
630
643 __STATIC_INLINE uint32_t ll_iso7816_get_coding_convention(iso7816_regs_t *ISO7816x)
644 {
645 return (uint32_t)(READ_BITS(ISO7816x->DATA_CFG, ISO7816_DATA_CFG_CODING));
646 }
647
658 __STATIC_INLINE uint32_t ll_iso7816_get_current_addr(iso7816_regs_t *ISO7816x)
659 {
660 return (uint32_t)(READ_BITS(ISO7816x->ADDR, ISO7816_ADDR_ADDR) >> ISO7816_ADDR_ADDR_POS);
661 }
662
673 __STATIC_INLINE uint32_t ll_iso7816_get_current_addr_frac(iso7816_regs_t *ISO7816x)
674 {
675 return (uint32_t)(READ_BITS(ISO7816x->ADDR, ISO7816_ADDR_ADDR_FRAC));
676 }
677
689 __STATIC_INLINE void ll_iso7816_set_buffer_addr(iso7816_regs_t *ISO7816x, uint32_t addr)
690 {
691 WRITE_REG(ISO7816x->START_ADDR, addr);
692 }
693
703 __STATIC_INLINE uint32_t ll_iso7816_get_buffer_addr(iso7816_regs_t *ISO7816x)
704 {
705 return (uint32_t)(READ_REG(ISO7816x->START_ADDR));
706 }
707
719 __STATIC_INLINE void ll_iso7816_set_base_addr(iso7816_regs_t *ISO7816x, uint32_t addr)
720 {
721 MODIFY_REG(ISO7816x->START_ADDR, ISO7816_START_ADDR_BASE_ADDR, addr << ISO7816_START_ADDR_BASE_ADDR_POS);
722 }
723
734 __STATIC_INLINE uint32_t ll_iso7816_get_base_addr(iso7816_regs_t *ISO7816x)
735 {
736 return (uint32_t)(READ_BITS(ISO7816x->START_ADDR, ISO7816_START_ADDR_BASE_ADDR) >> ISO7816_START_ADDR_BASE_ADDR_POS);
737 }
738
750 __STATIC_INLINE void ll_iso7816_set_start_addr(iso7816_regs_t *ISO7816x, uint32_t addr)
751 {
752 MODIFY_REG(ISO7816x->START_ADDR, ISO7816_START_ADDR_START_ADDR, addr << ISO7816_START_ADDR_START_ADDR_POS);
753 }
754
765 __STATIC_INLINE uint32_t ll_iso7816_get_start_addr(iso7816_regs_t *ISO7816x)
766 {
767 return (uint32_t)(READ_BITS(ISO7816x->START_ADDR, ISO7816_START_ADDR_START_ADDR) >> ISO7816_START_ADDR_START_ADDR_POS);
768 }
769
781 __STATIC_INLINE void ll_iso7816_set_rx_end_addr(iso7816_regs_t *ISO7816x, uint32_t addr)
782 {
783 MODIFY_REG(ISO7816x->RX_END_ADDR, ISO7816_RX_END_ADDR_RX_END_ADDR, addr << ISO7816_RX_END_ADDR_RX_END_ADDR_POS);
784 }
785
797 __STATIC_INLINE void ll_iso7816_set_rx_endbyte_addr(iso7816_regs_t *ISO7816x, uint32_t addr)
798 {
799 WRITE_REG(ISO7816x->RX_END_ADDR, addr);
800 }
801
812 __STATIC_INLINE uint32_t ll_iso7816_get_rx_end_addr(iso7816_regs_t *ISO7816x)
813 {
814 return (uint32_t)(READ_BITS(ISO7816x->RX_END_ADDR, ISO7816_RX_END_ADDR_RX_END_ADDR) >> ISO7816_RX_END_ADDR_RX_END_ADDR_POS);
815 }
816
828 __STATIC_INLINE void ll_iso7816_set_rx_end_addr_frac(iso7816_regs_t *ISO7816x, uint32_t frac)
829 {
830 MODIFY_REG(ISO7816x->RX_END_ADDR, ISO7816_RX_END_ADDR_RX_END_AF, frac);
831 }
832
844 __STATIC_INLINE void ll_iso7816_set_tx_endbyte_addr(iso7816_regs_t *ISO7816x, uint32_t addr)
845 {
846 WRITE_REG(ISO7816x->TX_END_ADDR, addr);
847 }
848
859 __STATIC_INLINE uint32_t ll_iso7816_get_tx_endbyte_addr(iso7816_regs_t *ISO7816x)
860 {
861 return READ_REG(ISO7816x->TX_END_ADDR);
862 }
863
874 __STATIC_INLINE uint32_t ll_iso7816_get_rx_endbyte_addr(iso7816_regs_t *ISO7816x)
875 {
876 return READ_REG(ISO7816x->RX_END_ADDR);
877 }
878
889 __STATIC_INLINE uint32_t ll_iso7816_get_rx_end_addr_frac(iso7816_regs_t *ISO7816x)
890 {
891 return (uint32_t)(READ_BITS(ISO7816x->RX_END_ADDR, ISO7816_RX_END_ADDR_RX_END_AF));
892 }
893
905 __STATIC_INLINE void ll_iso7816_set_tx_end_addr(iso7816_regs_t *ISO7816x, uint32_t addr)
906 {
907 MODIFY_REG(ISO7816x->TX_END_ADDR, ISO7816_TX_END_ADDR_TX_END_ADDR, addr << ISO7816_TX_END_ADDR_TX_END_ADDR_POS);
908 }
909
920 __STATIC_INLINE uint32_t ll_iso7816_get_tx_end_addr(iso7816_regs_t *ISO7816x)
921 {
922 return (uint32_t)(READ_BITS(ISO7816x->TX_END_ADDR, ISO7816_TX_END_ADDR_TX_END_ADDR) >> ISO7816_TX_END_ADDR_TX_END_ADDR_POS);
923 }
924
936 __STATIC_INLINE void ll_iso7816_set_tx_end_addr_frac(iso7816_regs_t *ISO7816x, uint32_t frac)
937 {
938 MODIFY_REG(ISO7816x->TX_END_ADDR, ISO7816_TX_END_ADDR_TX_END_AF, frac);
939 }
940
951 __STATIC_INLINE uint32_t ll_iso7816_get_tx_end_addr_frac(iso7816_regs_t *ISO7816x)
952 {
953 return (uint32_t)(READ_BITS(ISO7816x->TX_END_ADDR, ISO7816_TX_END_ADDR_TX_END_AF));
954 }
955
985 __STATIC_INLINE uint32_t ll_iso7816_get_it_flag(iso7816_regs_t *ISO7816x)
986 {
987 return (uint32_t)(READ_REG(ISO7816x->STAT) & ISO7816_INTR_ALL);
988 }
989
1000 __STATIC_INLINE uint32_t ll_iso7816_is_active_flag_test(iso7816_regs_t *ISO7816x)
1001 {
1002 return (READ_BITS(ISO7816x->STAT, ISO7816_STAT_IRQ_TEST) == (ISO7816_STAT_IRQ_TEST));
1003 }
1004
1015 __STATIC_INLINE uint32_t ll_iso7816_is_active_flag_presence(iso7816_regs_t *ISO7816x)
1016 {
1017 return (READ_BITS(ISO7816x->STAT, ISO7816_STAT_IRQ_PRESENCE) == (ISO7816_STAT_IRQ_PRESENCE));
1018 }
1019
1030 __STATIC_INLINE uint32_t ll_iso7816_is_active_flag_state_err(iso7816_regs_t *ISO7816x)
1031 {
1032 return (READ_BITS(ISO7816x->STAT, ISO7816_STAT_IRQ_STAT_ERR) == (ISO7816_STAT_IRQ_STAT_ERR));
1033 }
1034
1045 __STATIC_INLINE uint32_t ll_iso7816_is_active_flag_dma_err(iso7816_regs_t *ISO7816x)
1046 {
1047 return (READ_BITS(ISO7816x->STAT, ISO7816_STAT_IRQ_DMA_ERR) == (ISO7816_STAT_IRQ_DMA_ERR));
1048 }
1049
1060 __STATIC_INLINE uint32_t ll_iso7816_is_active_flag_retry_err(iso7816_regs_t *ISO7816x)
1061 {
1062 return (READ_BITS(ISO7816x->STAT, ISO7816_STAT_IRQ_RETRY_ERR) == (ISO7816_STAT_IRQ_RETRY_ERR));
1063 }
1064
1075 __STATIC_INLINE uint32_t ll_iso7816_is_active_flag_rx_err(iso7816_regs_t *ISO7816x)
1076 {
1077 return (READ_BITS(ISO7816x->STAT, ISO7816_STAT_IRQ_RX_ERR) == (ISO7816_STAT_IRQ_RX_ERR));
1078 }
1079
1090 __STATIC_INLINE uint32_t ll_iso7816_is_active_flag_done(iso7816_regs_t *ISO7816x)
1091 {
1092 return (READ_BITS(ISO7816x->STAT, ISO7816_STAT_IRQ_DONE) == (ISO7816_STAT_IRQ_DONE));
1093 }
1094
1111 __STATIC_INLINE void ll_iso7816_clear_flag_all_intr(iso7816_regs_t *ISO7816x)
1112 {
1113 WRITE_REG(ISO7816x->CTRL, ISO7816_INTR_ALL);
1114 }
1115
1126 __STATIC_INLINE void ll_iso7816_clear_flag_test(iso7816_regs_t *ISO7816x)
1127 {
1128 WRITE_REG(ISO7816x->CTRL, ISO7816_CTRL_IRQ_TEST_CLR);
1129 }
1130
1141 __STATIC_INLINE void ll_iso7816_clear_flag_presence(iso7816_regs_t *ISO7816x)
1142 {
1143 WRITE_REG(ISO7816x->CTRL, ISO7816_CTRL_IRQ_PRESENCE_CLR);
1144 }
1145
1156 __STATIC_INLINE void ll_iso7816_clear_flag_state_err(iso7816_regs_t *ISO7816x)
1157 {
1158 WRITE_REG(ISO7816x->CTRL, ISO7816_CTRL_IRQ_STAT_EC);
1159 }
1160
1171 __STATIC_INLINE void ll_iso7816_clear_flag_dma_err(iso7816_regs_t *ISO7816x)
1172 {
1173 WRITE_REG(ISO7816x->CTRL, ISO7816_CTRL_IRQ_DMA_EC);
1174 }
1175
1186 __STATIC_INLINE void ll_iso7816_clear_flag_retry_err(iso7816_regs_t *ISO7816x)
1187 {
1188 WRITE_REG(ISO7816x->CTRL, ISO7816_CTRL_IRQ_RETYR_EC);
1189 }
1190
1201 __STATIC_INLINE void ll_iso7816_clear_flag_rx_err(iso7816_regs_t *ISO7816x)
1202 {
1203 WRITE_REG(ISO7816x->CTRL, ISO7816_CTRL_IRQ_RX_EC);
1204 }
1205
1216 __STATIC_INLINE void ll_iso7816_clear_flag_done(iso7816_regs_t *ISO7816x)
1217 {
1218 WRITE_REG(ISO7816x->CTRL, ISO7816_CTRL_IRQ_DONE_CLR);
1219 }
1220
1236 error_status_t ll_iso7816_init(iso7816_regs_t *ISO7816x, ll_iso7816_init_t *p_iso7816_init);
1237
1245 error_status_t ll_iso7816_deinit(iso7816_regs_t *ISO7816x);
1246
1250 #endif /* ISO7816 */
1251
1252 #ifdef __cplusplus
1253 }
1254 #endif
1255
1256 #endif /* __GR55xx_LL_ISO7816_H__ */
1257
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:317
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:985
_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:1111
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:859
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:673
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:1186
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:1060
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:905
_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:1030
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:626
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:765
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:703
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:643
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:1201
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:239
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:889
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:547
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:719
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:515
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:951
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:1015
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:920
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:797
_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:285
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:1045
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:482
ll_iso7816_is_busy
__STATIC_INLINE uint32_t ll_iso7816_is_busy(iso7816_regs_t *ISO7816x)
Get ISO7816 states.
Definition: gr55xx_ll_iso7816.h:255
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:828
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:781
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:936
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:734
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:500
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:382
_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:1126
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:658
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:844
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:533
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:1156
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:563
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:874
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:1141
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:593
_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:750
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:353
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:1075
ll_iso7816_get_clkdiv
__STATIC_INLINE uint32_t ll_iso7816_get_clkdiv(iso7816_regs_t *ISO7816x)
Get clock division.
Definition: gr55xx_ll_iso7816.h:449
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:302
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:689
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:1216
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:608
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:1171
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:400
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:332
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:1090
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:434
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:578
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:1000
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:417
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:270
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:467
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:812