]>
Commit | Line | Data |
---|---|---|
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 | |
13 | #include <stdint.h>\r | |
14 | #include <stdbool.h>\r | |
15 | \r | |
16 | typedef struct {\r | |
17 | uint32_t bl1;\r | |
18 | uint32_t bl2; \r | |
19 | uint32_t acl; \r | |
20 | uint32_t mfc; \r | |
21 | uint32_t cid; \r | |
22 | uint32_t year; \r | |
23 | uint32_t quarter; \r | |
24 | uint32_t icr;\r | |
25 | uint32_t lotid; \r | |
26 | uint32_t wafer; \r | |
27 | uint32_t dw;\r | |
28 | } t55x7_tracedata_t;\r | |
29 | \r | |
30 | typedef struct {\r | |
31 | uint32_t bl1;\r | |
32 | uint32_t bl2;\r | |
33 | uint32_t icr;\r | |
34 | char lotidc;\r | |
35 | uint32_t lotid;\r | |
36 | uint32_t wafer;\r | |
37 | uint32_t dw;\r | |
38 | } t5555_tracedata_t;\r | |
39 | \r | |
40 | typedef struct {\r | |
41 | enum {\r | |
42 | DEMOD_NRZ = 0x00,\r | |
43 | DEMOD_PSK1 = 0x01,\r | |
44 | DEMOD_PSK2 = 0x02,\r | |
45 | DEMOD_PSK3 = 0x03,\r | |
46 | DEMOD_FSK1 = 0x04,\r | |
47 | DEMOD_FSK1a = 0x05,\r | |
48 | DEMOD_FSK2 = 0x06,\r | |
49 | DEMOD_FSK2a = 0x07, \r | |
50 | DEMOD_FSK = 0xF0, //generic FSK (auto detect FCs) \r | |
51 | DEMOD_ASK = 0x08,\r | |
52 | DEMOD_BI = 0x10,\r | |
53 | DEMOD_BIa = 0x18\r | |
54 | } modulation;\r | |
55 | bool inverted;\r | |
56 | uint8_t offset;\r | |
57 | uint32_t block0;\r | |
58 | enum {\r | |
59 | RF_8 = 0x00,\r | |
60 | RF_16 = 0x01,\r | |
61 | RF_32 = 0x02,\r | |
62 | RF_40 = 0x03,\r | |
63 | RF_50 = 0x04,\r | |
64 | RF_64 = 0x05,\r | |
65 | RF_100 = 0x06,\r | |
66 | RF_128 = 0x07\r | |
67 | } bitrate;\r | |
68 | bool Q5;\r | |
69 | bool ST;\r | |
70 | } t55xx_conf_block_t;\r | |
71 | \r | |
72 | t55xx_conf_block_t Get_t55xx_Config(void);\r | |
73 | void Set_t55xx_Config(t55xx_conf_block_t conf);\r | |
74 | \r | |
75 | extern int CmdLFT55XX(const char *Cmd);\r | |
76 | extern int CmdT55xxBruteForce(const char *Cmd);\r | |
77 | extern int CmdT55xxSetConfig(const char *Cmd);\r | |
78 | extern int CmdT55xxReadBlock(const char *Cmd);\r | |
79 | extern int CmdT55xxWriteBlock(const char *Cmd);\r | |
80 | extern int CmdT55xxReadTrace(const char *Cmd);\r | |
81 | extern int CmdT55xxInfo(const char *Cmd);\r | |
82 | extern int CmdT55xxDetect(const char *Cmd);\r | |
83 | extern int CmdResetRead(const char *Cmd);\r | |
84 | extern int CmdT55xxWipe(const char *Cmd);\r | |
85 | \r | |
86 | char * GetBitRateStr(uint32_t id, bool xmode);\r | |
87 | char * GetSaferStr(uint32_t id);\r | |
88 | char * GetModulationStr( uint32_t id);\r | |
89 | char * GetModelStrFromCID(uint32_t cid);\r | |
90 | char * GetSelectedModulationStr( uint8_t id);\r | |
91 | uint32_t PackBits(uint8_t start, uint8_t len, uint8_t *bitstream);\r | |
92 | void printT5xxHeader(uint8_t page);\r | |
93 | void printT55xxBlock(const char *demodStr);\r | |
94 | int printConfiguration( t55xx_conf_block_t b);\r | |
95 | \r | |
96 | bool DecodeT55xxBlock(void);\r | |
97 | bool tryDetectModulation(void);\r | |
98 | extern bool tryDetectP1(bool getData);\r | |
99 | bool test(uint8_t mode, uint8_t *offset, int *fndBitRate, uint8_t clk, bool *Q5);\r | |
100 | int special(const char *Cmd);\r | |
101 | int AquireData( uint8_t page, uint8_t block, bool pwdmode, uint32_t password,uint8_t downlink_mode );\r | |
102 | \r | |
103 | void printT55x7Trace( t55x7_tracedata_t data, uint8_t repeat );\r | |
104 | void printT5555Trace( t5555_tracedata_t data, uint8_t repeat );\r | |
105 | \r | |
106 | #endif\r |