SAMV71 Xplained Ultra Software Package 1.5

iso7816_4.c File Reference

#include "board.h"

Go to the source code of this file.

Defines

#define CASE1   1
#define CASE2   2
#define CASE3   3
#define USART_SEND   0
#define USART_RECEIVE   1
#define USART7816BAUDRATE   9600

Functions

void ISO7816_IccPowerOff (void)
uint16_t ISO7816_XfrBlockTPDU_T0 (const uint8_t *pAPDU, uint8_t *pMessage, uint16_t wLength)
void ISO7816_Escape (void)
void ISO7816_RestartClock (void)
void ISO7816_StopClock (void)
void ISO7816_toAPDU (void)
void ISO7816_Datablock_ATR (uint8_t *pAtr, uint8_t *pLength)
void ISO7816_SetDataRateandClockFrequency (uint32_t dwClockFrequency, uint32_t dwDataRate)
uint8_t ISO7816_StatusReset (void)
void ISO7816_cold_reset (void)
void ISO7816_warm_reset (void)
void ISO7816_Decode_ATR (uint8_t *pAtr)
void ISO7816_Init (Usart *pUsart, uint32_t usartId, const Pin pPinIso7816RstMC)

Detailed Description

Purpose

ISO 7816 driver

Usage

Explanation on the usage of the code made available through the header file.

Definition in file iso7816_4.c.


Define Documentation

#define CASE1   1

Case for APDU commands

Definition at line 52 of file iso7816_4.c.

#define USART_SEND   0

Flip flop for send and receive char

Definition at line 57 of file iso7816_4.c.


Function Documentation

void ISO7816_cold_reset ( void   ) 

cold reset

Definition at line 429 of file iso7816_4.c.

void ISO7816_Datablock_ATR ( uint8_t *  pAtr,
uint8_t *  pLength 
)

Answer To Reset (ATR)

Parameters:
pAtr ATR buffer
pLength Pointer for store the ATR length

Definition at line 351 of file iso7816_4.c.

void ISO7816_Decode_ATR ( uint8_t *  pAtr  ) 

Decode ATR trace

Parameters:
pAtr pointer on ATR buffer

Definition at line 466 of file iso7816_4.c.

void ISO7816_Escape ( void   ) 

Escape ISO7816

Definition at line 314 of file iso7816_4.c.

void ISO7816_IccPowerOff ( void   ) 

Iso 7816 ICC power off

Definition at line 177 of file iso7816_4.c.

Here is the call graph for this function:

void ISO7816_Init ( Usart pUsart,
uint32_t  usartId,
const Pin  pPinIso7816RstMC 
)

Initializes a ISO driver

Parameters:
pUsart Pointer to the USART peripheral to configure.
usartId USART ID for iso7816
pPinIso7816RstMC Pin ISO 7816 Rst MC

Definition at line 572 of file iso7816_4.c.

Here is the call graph for this function:

void ISO7816_RestartClock ( void   ) 

Restart clock ISO7816

Definition at line 322 of file iso7816_4.c.

void ISO7816_SetDataRateandClockFrequency ( uint32_t  dwClockFrequency,
uint32_t  dwDataRate 
)

Set data rate and clock frequency

Parameters:
dwClockFrequency ICC clock frequency in KHz.
dwDataRate ICC data rate in bpd

Definition at line 399 of file iso7816_4.c.

uint8_t ISO7816_StatusReset ( void   ) 

Pin status for ISO7816 RESET

Returns:
1 if the Pin RstMC is high; otherwise 0.

Definition at line 421 of file iso7816_4.c.

Here is the call graph for this function:

void ISO7816_StopClock ( void   ) 

Stop clock ISO7816

Definition at line 331 of file iso7816_4.c.

void ISO7816_toAPDU ( void   ) 

T0 APDU

Definition at line 340 of file iso7816_4.c.

void ISO7816_warm_reset ( void   ) 

Warm reset

Definition at line 446 of file iso7816_4.c.

Here is the call graph for this function:

uint16_t ISO7816_XfrBlockTPDU_T0 ( const uint8_t *  pAPDU,
uint8_t *  pMessage,
uint16_t  wLength 
)

Transfer Block TPDU T=0

Parameters:
pAPDU APDU buffer
pMessage Message buffer
wLength Block length
Returns:
Message index

Definition at line 190 of file iso7816_4.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines