]>
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 | |
b97311b1 | 39 | DEMOD_NRZ = 0x00,\r |
13d77ef9 | 40 | DEMOD_PSK1 = 0x01,\r |
41 | DEMOD_PSK2 = 0x02,\r | |
42 | DEMOD_PSK3 = 0x03,\r | |
b97311b1 | 43 | DEMOD_FSK1 = 0x04,\r |
44 | DEMOD_FSK1a = 0x05,\r | |
45 | DEMOD_FSK2 = 0x06,\r | |
13d77ef9 | 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 | |
b97311b1 | 50 | DEMOD_BIa = 0x18\r |
13d77ef9 | 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 | |
b97311b1 | 63 | RF_128 = 0x07\r |
13d77ef9 | 64 | } bitrate;\r |
f6650679 | 65 | bool Q5;\r |
d1869c33 | 66 | bool ST;\r |
13d77ef9 | 67 | } t55xx_conf_block_t;\r |
9f669cb2 | 68 | \r |
b97311b1 | 69 | t55xx_conf_block_t Get_t55xx_Config(void);\r |
70 | void Set_t55xx_Config(t55xx_conf_block_t conf);\r | |
13d77ef9 | 71 | \r |
b97311b1 | 72 | extern int CmdLFT55XX(const char *Cmd);\r |
73 | extern int CmdT55xxBruteForce(const char *Cmd);\r | |
74 | extern int CmdT55xxSetConfig(const char *Cmd);\r | |
75 | extern int CmdT55xxReadBlock(const char *Cmd);\r | |
76 | extern int CmdT55xxWriteBlock(const char *Cmd);\r | |
77 | extern int CmdT55xxReadTrace(const char *Cmd);\r | |
78 | extern int CmdT55xxInfo(const char *Cmd);\r | |
79 | extern int CmdT55xxDetect(const char *Cmd);\r | |
80 | extern int CmdResetRead(const char *Cmd);\r | |
81 | extern int CmdT55xxWipe(const char *Cmd);\r | |
13d77ef9 | 82 | \r |
b97311b1 | 83 | char * GetBitRateStr(uint32_t id, bool xmode);\r |
13d77ef9 | 84 | char * GetSaferStr(uint32_t id);\r |
85 | char * GetModulationStr( uint32_t id);\r | |
86 | char * GetModelStrFromCID(uint32_t cid);\r | |
87 | char * GetSelectedModulationStr( uint8_t id);\r | |
9632ecbe | 88 | uint32_t PackBits(uint8_t start, uint8_t len, uint8_t *bitstream);\r |
5490c2d6 | 89 | void printT5xxHeader(uint8_t page);\r |
13d77ef9 | 90 | void printT55xxBlock(const char *demodStr);\r |
be2d41b7 | 91 | int printConfiguration( t55xx_conf_block_t b);\r |
e98300f2 | 92 | \r |
b97311b1 | 93 | bool DecodeT55xxBlock(void);\r |
94 | bool tryDetectModulation(void);\r | |
95 | extern bool tryDetectP1(bool getData);\r | |
f6650679 | 96 | bool test(uint8_t mode, uint8_t *offset, int *fndBitRate, uint8_t clk, bool *Q5);\r |
13d77ef9 | 97 | int special(const char *Cmd);\r |
be2d41b7 | 98 | int AquireData( uint8_t page, uint8_t block, bool pwdmode, uint32_t password );\r |
e98300f2 | 99 | \r |
5490c2d6 | 100 | void printT55x7Trace( t55x7_tracedata_t data, uint8_t repeat );\r |
101 | void printT5555Trace( t5555_tracedata_t data, uint8_t repeat );\r | |
102 | \r | |
e98300f2 | 103 | #endif\r |