AN1527 STMICROELECTRONICS [STMicroelectronics], AN1527 Datasheet
AN1527
Related parts for AN1527
AN1527 Summary of contents
Page 1
... If there are any interrupt messages, they are sent just before the Bulk-in message is sent. Specific CCID class requests are managed by the setup management function in the USB li- brary (USER_USB_setup() function). AN1527/0702 APPLICATION NOTE DEVELOPING A USB SMARTCARD READER WITH ST7SCR by Microcontroller Division Applications AN1527 1/14 1 ...
Page 2
DEVELOPING A USB SMARTCARD READER WITH ST7SCR 1 CCID IMPLEMENTATION 1.1 GENERALITIES The Chip Card Interface Device (CCID) firmware implementation conforms to the “Universal Serial Bus Device Class Specification for USB Chip/Smart Card Interface Devices” revision 1.0. It contains two ...
Page 3
To finish the main loop, the CCID_BulkInMessage() function sends the Bulk-in message as an answer to the previous Bulk-out message. The message is sent in a process that requires sev- eral Bulk-in transactions (same concept as for the Bulk-out process). ...
Page 4
DEVELOPING A USB SMARTCARD READER WITH ST7SCR void CcidClassRequestAbort(void) This function is called from the USER_USB_Setup() function to process an Abort request. unsigned char PC_to_RDR_IccPowerOn(void) This function verifies the PC_TO_RDR_ICCPOWERON command format and calls the IFD_IccPowerOn() function (from Interface Device ...
Page 5
PC_to_RDR_Escape(void) This function verifies the PC_T O_RD R_ESCAPE com mand format and calls the IFD_Escape() function (from the Interface Device level). This PC_to_RDR function returns an error code (from IFD_Escape(), for example). unsigned char PC_to_RDR_IccClock(void) This function verifies ...
Page 6
DEVELOPING A USB SMARTCARD READER WITH ST7SCR 2 IFD IMPLEMENTATION The Interface Device (IFD) implementation firmware contains one file: – Ifd_protocol.c: This is the ISO 7816 implementation for Protocol types T=0 and T=1 and for character, TPDU and short APDU ...
Page 7
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 ...
Page 8
DEVELOPING A USB SMARTCARD READER WITH ST7SCR unsigned char CRD_VccOn(unsigned char Voltage) This function switches ON the V three possible voltage values: – CRD_Voltage18V (for 1.8 volts) – CRD_Voltage3V (for 3.0 volts) – CRD_Voltage5V (for 5.0 volts) This function returns ...
Page 9
CRD_GetConvention(void) This function returns the convention currently in use in the CRD. There are two conventions: – CRD_DirectConv – CRD_InverseConv unsigned char CRD_GetClockStatus(void) This function returns the status of the CRD clock signal. There are three possible states ...
Page 10
DEVELOPING A USB SMARTCARD READER WITH ST7SCR void CRD_StartWaitingTime(void) This function starts the Waiting Timer. The bWaitingTimeFlag software flag is set by an inter- rupt when the count is finished. For more information, please refer to the crd.h file. This ...
Page 11
CRD_EndTransmit(void) This function finishes the transmission by disabling the interrupt. This function returns the re- maining number of bytes to be transmitted. 3.3 INTERRUPT FUNCTIONS The following two functions are executed when an interrupt occurs: void INT_UART(void) This ...
Page 12
DEVELOPING A USB SMARTCARD READER WITH ST7SCR – Slot_No_Error – SlotError_HW_Error – SlotError_ICC_Mute Note: At the end of this function, the CRD is in Manual mode. void ICC_ResetAsync(void) This function executes a warm reset sequence in compliance with ISO 7816 ...
Page 13
CommandSize is the size of the buffer in bytes. – ProtocolType is 0 (for T= (for T=1). This variable is used to set a flag tested in the interrupt process at transmission and reception levels. This function ...
Page 14
DEVELOPING A USB SMARTCARD READER WITH ST7SCR “THE PRESENT NOTE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE ...