]>
Commit | Line | Data |
---|---|---|
1 | //----------------------------------------------------------------------------- | |
2 | // Willok, June 2018 | |
3 | // Edits by Iceman, July 2018 | |
4 | // | |
5 | // This code is licensed to you under the terms of the GNU GPL, version 2 or, | |
6 | // at your option, any later version. See the LICENSE.txt file for the text of | |
7 | // the license. | |
8 | //----------------------------------------------------------------------------- | |
9 | // The main i2c code, for communications with smart card module | |
10 | //----------------------------------------------------------------------------- | |
11 | #ifndef __I2C_H | |
12 | #define __I2C_H | |
13 | ||
14 | #include <stdint.h> | |
15 | #include <stdbool.h> | |
16 | ||
17 | #define I2C_DEVICE_ADDRESS_BOOT 0xB0 | |
18 | #define I2C_DEVICE_ADDRESS_MAIN 0xC0 | |
19 | ||
20 | #define I2C_DEVICE_CMD_GENERATE_ATR 0x01 | |
21 | #define I2C_DEVICE_CMD_SEND 0x02 | |
22 | #define I2C_DEVICE_CMD_READ 0x03 | |
23 | #define I2C_DEVICE_CMD_SETBAUD 0x04 | |
24 | #define I2C_DEVICE_CMD_SIM_CLC 0x05 | |
25 | #define I2C_DEVICE_CMD_GETVERSION 0x06 | |
26 | ||
27 | bool I2C_is_available(void); | |
28 | ||
29 | #ifdef WITH_SMARTCARD | |
30 | void SmartCardAtr(void); | |
31 | void SmartCardRaw(uint64_t arg0, uint64_t arg1, uint8_t *data); | |
32 | void SmartCardUpgrade(uint64_t arg0); | |
33 | void SmartCardSetClock(uint64_t arg0); | |
34 | void I2C_print_status(void); | |
35 | #endif | |
36 | ||
37 | #endif // __I2C_H |