AN1527 STMICROELECTRONICS [STMicroelectronics], AN1527 Datasheet - Page 7

no-image

AN1527

Manufacturer Part Number
AN1527
Description
DEVELOPING A USB SMARTCARD READER WITH ST7SCR
Manufacturer
STMICROELECTRONICS [STMicroelectronics]
Datasheet
3 ISO 7816 UART LIBRARY (CRD)
3.1 GENERAL INTRODUCTION
The aim of this library is to provide the user with a set of functions for using the Smartcard In-
terface (ISO7816-3 UART Interface) to directly access the hardware and to communicate with
an Integrated Circuit Card (ICC) through a few simple functions. This library is composed of 4
files:
– crd.c
– crd.h
– int_crd.c
– int_crd.h
The crd.x files provide the general functions for the main loop program. The int_crd.x files are
used for interrupt management.
The transactions between the ST7 microcontroller and the ICC are performed by the ICC_xxx
functions. These functions poll flags waiting for the end of the transaction. The transaction it-
self and the flag settings are managed by interrupts.
3.2 SMARTCARD INTERFACE FUNCTIONS
The Smartcard Interface (CRD) functions described below are very low level functions used to
interact directly with the hardware.
This function resets and initialize the CRD and the local software flags.
This function checks the hardware state and returns one of the following error codes:
– Slot_No_Error
– SlotError_HW_Error
– SlotError_ICC_Mute (no card present)
If the function returns SlotError_HW_Error, pHwErrorCode will contain one of the following
error codes:
– HardwareErrorCode_OverCurrent
– HardwareErrorCode_VoltageError
– HardwareErrorCode_OverCurrent_IT
– HardwareErrorCode_VoltageError_IT
Note: In case of a hardware error, the slot is inactivated (VCC Card off).
void CRD_Init(void)
unsigned char CRD_GetHwError(unsigned char * pHwErrorCode)
DEVELOPING A USB SMARTCARD READER WITH ST7SCR
7/14

Related parts for AN1527