beautypg.com

Icc_warmreset(), E 75) – Maxim Integrated 73S12xxF Software User Manual

Page 75

background image


UG_12xxF_016

73S12xxF Software User Guide

Rev. 1.50

75

The eIccId parameter is split into two fields: Card Detect Polarity and Card Slot number, by using the
most significant nibble and least significant nibble, respectively. Therefore, the most significant nibble of
the eIccId parameter is used to determine if the Card Detect Polarity is to be configured High or Low.
The constants CARD_DET_H and CARD_DET_L are defined in ICCMgt.h. Examples:

1. If Card Detect Polarity is to be set to High when a card is inserted, it can be done so by calling:

ICC_Enable( eIccId | CARD_DET_H, bIccATRAutoCheck,etc.).

2. If Card Detect Polarity is to be set to Low when a card is inserted, it can be done so by calling:

ICC_Enable( eIccId | CARD_DET_L, bIccATRAutoCheck,etc.).

3. Calling ICC_Enable (eIccId, bIccATRAutoCheck, etc.) without OR’ing eIccId with CARD_DET_L or

CARD_DET_H (in other words, eIccID <= 0x09) will default to CARD_DET_H.


ICC_WarmReset()

Purpose

Perform a Warm Reset on the Smart Card and return the ATR to the application.


Synopsis

AR_ICC_RC ICC_WarmReset (

IN enum ICC_ID eIccId,

OUT unsigned char *pucIccATR,

OUT unsigned int *punIccATRLength );


Parameters

eIccId: Input parameter
Specifies which Smart Card interface is to be activated. Possible values are:

ICC_1ST 0, (Internal)
ICC_2ND 1, (External)

ICC_9TH 8 (External).

pucIccATR: Output parameter
ATR value returned by the Smart Card.

punIccATRLength: Output parameter
Length of the ATR returned by the Smart Card. This value should not exceed 32, as
the ATR cannot contain more than 32 bytes.

Return Codes AR_ICC_OK

Successful operation. The received ATR is stored in pucIccATR.

AR_ICC_ERR_BAD_PARAM

An invalid parameter (eIccId for example) was specified.

AR_ICC_ERR_CARD_MUTE

The Smart Card is mute.

AR_ICC_ERR_CARD_ABSENT

No Smart Card is inserted.

AR_ICC_ERR_CARD_DISCONNECTED

The Smart Card was deactivated.

AR_ICC_ERR_CARD_OVERLOAD

The Smart Card has generated an over current.

AR_ICC_ERR_CARD_UNSUPPORTED_ATR

The Smart Card ATR is not supported by the chip and is stored in pucIccAtr. The
Smart Card interface has not been de-activated (the bIccATRAutoCheck option not
selected).

AR_ICC_ERR_BAD_TCK

The ATR has a bad TCK byte.

AR_ICC_ERR_BAD_TS

The ATR has a bad TS byte.

AR_ICC_ERR_CARD_COMM_PB

The ATR has either a parity error, an Rx over run or a VCC unstable error.