Microchip® Advanced Software Framework

iso7816.c File Reference

Smart Card Standard ISO7816 driver.

Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.

#include "iso7816.h"

Macros

#define CASE1   1
 Case for APDU commands. More...
 
#define CASE2   2
 
#define CASE3   3
 
#define ISO_NULL_VAL   0x60
 NULL byte to restart byte procedure. More...
 
#define RST_WAIT_TIME   120
 Reset wait time. More...
 
#define RX_TIMEOUT   12000
 Receive timeout. More...
 

Functions

void iso7816_cold_reset (void)
 Cold reset. More...
 
void iso7816_data_block_atr (uint8_t *p_atr, uint8_t *p_length)
 Answer To Reset (ATR). More...
 
void iso7816_decode_atr (uint8_t *p_atr)
 Decode ATR trace. More...
 
static enum status_code iso7816_get_char (uint8_t *p_char_received)
 Get a character from ISO7816. More...
 
bool iso7816_get_reset_statuts (void)
 Pin status for ISO7816 RESET PIN. More...
 
static void iso7816_icc_power_off (void)
 ISO7816 ICC power off. More...
 
static void iso7816_icc_power_on (void)
 ISO7816 ICC power on. More...
 
void iso7816_init (struct usart_module *const module, uint32_t pin_rst, uint32_t clock_get_hz)
 Initializes a ISO7816 interface device. More...
 
static enum status_code iso7816_send_char (uint8_t uc_char)
 Send a char to ISO7816. More...
 
void iso7816_warm_reset (void)
 Warm reset. More...
 
uint16_t iso7816_xfr_block_tpdu_t0 (const uint8_t *p_apdu, uint8_t *p_message, uint16_t us_length)
 Transfer Block TPDU T = 0. More...
 

Variables

volatile uint32_t iso7816_gs_frequency
 Generator source frequency of smart card usart. More...
 
static uint32_t iso7816_pin_rst
 Smart Card reset PIN. More...
 
static struct usart_moduleiso7816_usart_module
 
static uint8_t iso7816_usart_status = ISO7816_USART_RCV
 Variable for state of send and receive from USART. More...