1 /* ----------------------------------------------------------------------------
\r
2 * SAM Software Package License
\r
3 * ----------------------------------------------------------------------------
\r
4 * Copyright (c) 2011, Atmel Corporation
\r
6 * All rights reserved.
\r
8 * Redistribution and use in source and binary forms, with or without
\r
9 * modification, are permitted provided that the following conditions are met:
\r
11 * - Redistributions of source code must retain the above copyright notice,
\r
12 * this list of conditions and the disclaimer below.
\r
14 * Atmel's name may not be used to endorse or promote products derived from
\r
15 * this software without specific prior written permission.
\r
17 * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
\r
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
\r
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
\r
20 * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
\r
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
\r
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
\r
23 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
\r
24 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
\r
25 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
\r
26 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\r
27 * ----------------------------------------------------------------------------
\r
30 //------------------------------------------------------------------------------
\r
35 * Definition of methods for ISO7816 driver.
\r
40 * -# ISO7816_IccPowerOff
\r
41 * -# ISO7816_XfrBlockTPDU_T0
\r
43 * -# ISO7816_RestartClock
\r
44 * -# ISO7816_StopClock
\r
46 * -# ISO7816_Datablock_ATR
\r
47 * -# ISO7816_SetDataRateandClockFrequency
\r
48 * -# ISO7816_StatusReset
\r
49 * -# ISO7816_cold_reset
\r
50 * -# ISO7816_warm_reset
\r
51 * -# ISO7816_Decode_ATR
\r
52 *----------------------------------------------------------------------------*/
\r
57 /*------------------------------------------------------------------------------
\r
58 * Constants Definition
\r
59 *----------------------------------------------------------------------------*/
\r
61 /** Size max of Answer To Reset */
\r
62 #define ATR_SIZE_MAX 55
\r
64 /** NULL byte to restart byte procedure */
\r
65 #define ISO_NULL_VAL 0x60
\r
67 /*------------------------------------------------------------------------------
\r
68 * Exported functions
\r
69 *----------------------------------------------------------------------------*/
\r
70 extern void ISO7816_Init( const Pin pPinIso7816RstMC );
\r
71 extern void ISO7816_IccPowerOff(void);
\r
72 extern uint16_t ISO7816_XfrBlockTPDU_T0(const uint8_t *pAPDU,
\r
75 extern void ISO7816_Escape( void );
\r
76 extern void ISO7816_RestartClock(void);
\r
77 extern void ISO7816_StopClock( void );
\r
78 extern void ISO7816_toAPDU( void );
\r
79 extern void ISO7816_Datablock_ATR( uint8_t* pAtr, uint8_t* pLength );
\r
80 extern void ISO7816_SetDataRateandClockFrequency( uint32_t dwClockFrequency, uint32_t dwDataRate );
\r
81 extern uint8_t ISO7816_StatusReset( void );
\r
82 extern void ISO7816_cold_reset( void );
\r
83 extern void ISO7816_warm_reset( void );
\r
84 extern void ISO7816_Decode_ATR( uint8_t* pAtr );
\r
86 #endif /* ISO7816_4_H */
\r