AN1527 APPLICATION NOTE DEVELOPING A USB SMARTCARD READER WITH ST7SCR
This document describes a firmware implementation developed by STMicroelectronics for a USB Smart Card Reader using the ST7SCR microcontroller. The firmware is designed to work with the associated Smart Card Reader board available from the manufacturer.
The implementation is divided into four main parts: USB management, Chip Card Interface Device (CCID) implementation, Interface Device (IFD) implementation, and 7816 UART Smartcard Interface (CRD) management. The main loop polls USB transactions using a state machine process to handle Bulk-in and Bulk-out messages.
The CCID implementation uses a 271-byte buffer for all messages.
The message header is fixed at 10 bytes.
The data portion of the message can be up to 261 bytes.