]>
Commit | Line | Data |
---|---|---|
e98300f2 | 1 | //-----------------------------------------------------------------------------\r |
2 | //\r | |
3 | // This code is licensed to you under the terms of the GNU GPL, version 2 or,\r | |
4 | // at your option, any later version. See the LICENSE.txt file for the text of\r | |
5 | // the license.\r | |
6 | //-----------------------------------------------------------------------------\r | |
7 | // Low frequency T55xx commands\r | |
8 | //-----------------------------------------------------------------------------\r | |
9 | \r | |
10 | #ifndef CMDLFT55XX_H__\r | |
11 | #define CMDLFT55XX_H__\r | |
12 | \r | |
5490c2d6 | 13 | typedef struct {\r |
14 | uint32_t bl1;\r | |
15 | uint32_t bl2; \r | |
16 | uint32_t acl; \r | |
17 | uint32_t mfc; \r | |
18 | uint32_t cid; \r | |
19 | uint32_t year; \r | |
20 | uint32_t quarter; \r | |
21 | uint32_t icr;\r | |
22 | uint32_t lotid; \r | |
23 | uint32_t wafer; \r | |
24 | uint32_t dw;\r | |
25 | } t55x7_tracedata_t;\r | |
26 | \r | |
27 | typedef struct {\r | |
28 | uint32_t bl1;\r | |
29 | uint32_t bl2;\r | |
30 | uint32_t icr;\r | |
31 | char lotidc;\r | |
32 | uint32_t lotid;\r | |
33 | uint32_t wafer;\r | |
34 | uint32_t dw;\r | |
35 | } t5555_tracedata_t;\r | |
36 | \r | |
13d77ef9 | 37 | typedef struct {\r |
38 | enum {\r | |
39 | DEMOD_NRZ = 0x00, \r | |
40 | DEMOD_PSK1 = 0x01,\r | |
41 | DEMOD_PSK2 = 0x02,\r | |
42 | DEMOD_PSK3 = 0x03,\r | |
43 | DEMOD_FSK1 = 0x04, \r | |
44 | DEMOD_FSK1a = 0x05, \r | |
45 | DEMOD_FSK2 = 0x06, \r | |
46 | DEMOD_FSK2a = 0x07, \r | |
47 | DEMOD_FSK = 0xF0, //generic FSK (auto detect FCs) \r | |
48 | DEMOD_ASK = 0x08,\r | |
49 | DEMOD_BI = 0x10,\r | |
50 | DEMOD_BIa = 0x18, \r | |
51 | } modulation;\r | |
52 | bool inverted;\r | |
53 | uint8_t offset;\r | |
54 | uint32_t block0;\r | |
55 | enum {\r | |
56 | RF_8 = 0x00,\r | |
57 | RF_16 = 0x01,\r | |
58 | RF_32 = 0x02,\r | |
59 | RF_40 = 0x03,\r | |
60 | RF_50 = 0x04,\r | |
61 | RF_64 = 0x05,\r | |
62 | RF_100 = 0x06,\r | |
63 | RF_128 = 0x07,\r | |
64 | } bitrate;\r | |
f6650679 | 65 | bool Q5;\r |
13d77ef9 | 66 | } t55xx_conf_block_t;\r |
9f669cb2 | 67 | t55xx_conf_block_t Get_t55xx_Config();\r |
68 | void Set_t55xx_Config(t55xx_conf_block_t conf);\r | |
69 | \r | |
13d77ef9 | 70 | \r |
e98300f2 | 71 | int CmdLFT55XX(const char *Cmd);\r |
506672c4 | 72 | int CmdT55xxBruteForce(const char *Cmd);\r |
13d77ef9 | 73 | int CmdT55xxSetConfig(const char *Cmd);\r |
74 | int CmdT55xxReadBlock(const char *Cmd);\r | |
75 | int CmdT55xxWriteBlock(const char *Cmd);\r | |
76 | int CmdT55xxReadTrace(const char *Cmd);\r | |
77 | int CmdT55xxInfo(const char *Cmd);\r | |
78 | int CmdT55xxDetect(const char *Cmd);\r | |
66837a03 | 79 | int CmdResetRead(const char *Cmd);\r |
f6650679 | 80 | int CmdT55xxWipe(const char *Cmd);\r |
13d77ef9 | 81 | \r |
82 | char * GetBitRateStr(uint32_t id);\r | |
83 | char * GetSaferStr(uint32_t id);\r | |
84 | char * GetModulationStr( uint32_t id);\r | |
85 | char * GetModelStrFromCID(uint32_t cid);\r | |
86 | char * GetSelectedModulationStr( uint8_t id);\r | |
9632ecbe | 87 | uint32_t PackBits(uint8_t start, uint8_t len, uint8_t *bitstream);\r |
5490c2d6 | 88 | void printT5xxHeader(uint8_t page);\r |
13d77ef9 | 89 | void printT55xxBlock(const char *demodStr);\r |
be2d41b7 | 90 | int printConfiguration( t55xx_conf_block_t b);\r |
e98300f2 | 91 | \r |
13d77ef9 | 92 | bool DecodeT55xxBlock();\r |
93 | bool tryDetectModulation();\r | |
f6650679 | 94 | bool test(uint8_t mode, uint8_t *offset, int *fndBitRate, uint8_t clk, bool *Q5);\r |
13d77ef9 | 95 | int special(const char *Cmd);\r |
be2d41b7 | 96 | int AquireData( uint8_t page, uint8_t block, bool pwdmode, uint32_t password );\r |
e98300f2 | 97 | \r |
5490c2d6 | 98 | void printT55x7Trace( t55x7_tracedata_t data, uint8_t repeat );\r |
99 | void printT5555Trace( t5555_tracedata_t data, uint8_t repeat );\r | |
100 | \r | |
e98300f2 | 101 | #endif\r |