Icc_tx(), E 36) – Maxim Integrated 73S12xxF Software User Manual
Page 36

73S12xxF Software User Guide
UG_12xxF_016
36
Rev. 1.50
ICC_Tx()
Purpose
Send data to the selected Smart Card. Before calling this function, the Smart Card
UART must have been initialized and the selected Smart Card activated.
Synopsis
ICC_RC ICC_Tx ( INOUT struct ICC_t *pICC );
struct {
IN char *IccData,
INOUT unsigned int IccLen,
IN Boolean IccLastByte,
INOUT int IccEDC,
OUT ICC_RC ICC_Status,
OUT Boolean IccDone
} ICC_t;
Parameters
IccData: Input parameter
Contains the data to be transmitted.
IccLen: Input / output parameter
On input, specifies the number of bytes to send. On output, specifies the number of
bytes successfully sent without errors, valid after IccDone is true.
IccLastByte: Input parameter
Specifies if the last transmitted byte is included in this buffer.
IccEDC: Input / output parameter
Contains the current LRC or CRC value (T=1).
ICC_Status: Output
Contains the current status of this transmission.
IccDone: Output
Set on completion of transmission, possibly with errors. Check ICC_Status for
status.
Return Codes
ICC_ERR_PRESENT_INACTIVE
The SmartCard is present but inactive.
ICC_ERR_NO_CARD
The Smart Card is not present.
ICC_TX_PENDING
Transmission has started, but is not yet completed. On either a successful
completion or a termination due to error, the ICC_Status will change to one of
the following:
ICC_OK
Successful operation: All of the data was successfully transmitted to the
SmartCard without parity error.
ICC_BREAK
Successful operation. All of the data was successfully sent to the SmartCard
with at most a few retries. Initially, break signaling was detected, which
necessitated at least one retransmission. (Only in T=0 protocol)
ICC_ERR_BREAK
All attempts at sending the next byte resulted in break signaling, indicating a
perceived parity error at the SmartCard end. (Only in T=0 protocol) The
SmartCard has been automatically deactivated. Check ICCTxLen to determine
how many bytes were successfully transmitted.
IccLastByte should be set when it is time to switch to reception mode and start the BGT and BWT timers
and possibly send the EDC.
The ICC_OK status will not occur until after the CRC/LRC has been sent to the SmartCard.