1 |
//************************************************************************ |
1 |
//************************************************************************ |
2 |
//** |
2 |
//** |
3 |
//** Project......: Firmware USB AVR Si570 controler. |
3 |
//** Project......: Firmware USB AVR Si570 controler. |
4 |
//** |
4 |
//** |
5 |
//** Platform.....: ATtiny45 @ 16.5 MHz |
5 |
//** Platform.....: ATtiny45 @ 16.5 MHz |
6 |
//** |
6 |
//** |
7 |
//** Licence......: This software is freely available for non-commercial |
7 |
//** Licence......: This software is freely available for non-commercial |
8 |
//** use - i.e. for research and experimentation only! |
8 |
//** use - i.e. for research and experimentation only! |
9 |
//** |
9 |
//** |
10 |
//** Programmer...: F.W. Krom, PE0FKO |
10 |
//** Programmer...: F.W. Krom, PE0FKO |
11 |
//** |
11 |
//** |
12 |
//** Description..: USB commando codes |
12 |
//** Description..: USB commando codes |
13 |
//** |
13 |
//** |
14 |
//** History......: V15.12: First version |
14 |
//** History......: V15.12: First version |
15 |
//** |
15 |
//** |
16 |
//************************************************************************** |
16 |
//************************************************************************** |
17 |
// |
17 |
// |
18 |
|
18 |
|
19 |
//#define CMD_ECHO_WORD 0x00 |
19 |
//#define CMD_ECHO_WORD 0x00 |
20 |
#define CMD_GET_VERSION 0x00 |
20 |
#define CMD_GET_VERSION 0x00 |
21 |
#define CMD_SET_DDR 0x01 |
21 |
#define CMD_SET_DDR 0x01 |
22 |
#define CMD_GET_PIN 0x02 |
22 |
#define CMD_GET_PIN 0x02 |
23 |
#define CMD_GET_PORT 0x03 |
23 |
#define CMD_GET_PORT 0x03 |
24 |
#define CMD_SET_PORT 0x04 |
24 |
#define CMD_SET_PORT 0x04 |
25 |
// 0x05 // Used in old V1.4 |
25 |
// 0x05 // Used in old V1.4 |
26 |
// 0x06 // Used in old V1.4 |
26 |
// 0x06 // Used in old V1.4 |
27 |
// 0x07 // Used in old V1.4 |
27 |
// 0x07 // Used in old V1.4 |
28 |
// 0x08 // Used in old V1.4 |
28 |
// 0x08 // Used in old V1.4 |
29 |
// 0x09 // Used in old V1.4 |
29 |
// 0x09 // Used in old V1.4 |
30 |
// 0x0A // Used in old V1.4 |
30 |
// 0x0A // Used in old V1.4 |
31 |
// 0x0B // Used in old V1.4 |
31 |
// 0x0B // Used in old V1.4 |
32 |
// 0x0C // Used in old V1.4 |
32 |
// 0x0C // Used in old V1.4 |
33 |
#define CMD_REBOOT 0x0F |
33 |
#define CMD_REBOOT 0x0F |
34 |
// 0x10 // Used in old V1.4 |
34 |
// 0x10 // Used in old V1.4 |
35 |
// 0x11 // Used in old V1.4 |
35 |
// 0x11 // Used in old V1.4 |
36 |
#define CMD_SET_IO 0x15 |
36 |
#define CMD_SET_IO 0x15 |
37 |
#define CMD_GET_IO 0x16 |
37 |
#define CMD_GET_IO 0x16 |
38 |
#define CMD_SET_FILTER 0x17 |
38 |
#define CMD_SET_FILTER 0x17 |
39 |
#define CMD_SET_RX_BAND_FILTER 0x18 // V15.12 |
39 |
#define CMD_SET_RX_BAND_FILTER 0x18 // V15.12 |
40 |
#define CMD_GET_RX_BAND_FILTER 0x19 // V15.12 |
40 |
#define CMD_GET_RX_BAND_FILTER 0x19 // V15.12 |
41 |
#define CMD_SET_TX_BAND_FILTER 0x1A // MOBO Only |
41 |
#define CMD_SET_TX_BAND_FILTER 0x1A // MOBO Only |
42 |
#define CMD_GET_TX_BAND_FILTER 0x1B // MOBO Only |
42 |
#define CMD_GET_TX_BAND_FILTER 0x1B // MOBO Only |
43 |
|
43 |
|
44 |
#define CMD_SET_SI570 0x20 // Write byte to Si570 register |
44 |
#define CMD_SET_SI570 0x20 // Write byte to Si570 register |
45 |
// 0x21 // Used in old V1.4 |
45 |
// 0x21 // Used in old V1.4 |
46 |
// 0x22 // Used in old V1.4 |
46 |
// 0x22 // Used in old V1.4 |
47 |
// 0x23 // Used in old V1.4 |
47 |
// 0x23 // Used in old V1.4 |
48 |
|
48 |
|
49 |
#define CMD_SET_FREQ_REG 0x30 |
49 |
#define CMD_SET_FREQ_REG 0x30 |
50 |
#define CMD_SET_LO_SM 0x31 |
50 |
#define CMD_SET_LO_SM 0x31 |
51 |
#define CMD_SET_FREQ 0x32 |
51 |
#define CMD_SET_FREQ 0x32 |
52 |
#define CMD_SET_XTAL 0x33 |
52 |
#define CMD_SET_XTAL 0x33 |
53 |
#define CMD_SET_STARTUP 0x34 |
53 |
#define CMD_SET_STARTUP 0x34 |
54 |
#define CMD_SET_PPM 0x35 |
54 |
#define CMD_SET_PPM 0x35 |
55 |
// 0x36 // Used in old V2.0 |
55 |
// 0x36 // Used in old V2.0 |
56 |
// 0x37 // Used in old V2.0 |
56 |
// 0x37 // Used in old V2.0 |
57 |
// 0x38 // Used in old V2.0 |
57 |
// 0x38 // Used in old V2.0 |
58 |
#define CMD_GET_LO_SM 0x39 |
58 |
#define CMD_GET_LO_SM 0x39 |
59 |
#define CMD_GET_FREQ 0x3a |
59 |
#define CMD_GET_FREQ 0x3a |
60 |
#define CMD_GET_PPM 0x3b |
60 |
#define CMD_GET_PPM 0x3b |
61 |
#define CMD_GET_STARTUP 0x3c |
61 |
#define CMD_GET_STARTUP 0x3c |
62 |
#define CMD_GET_XTAL 0x3d |
62 |
#define CMD_GET_XTAL 0x3d |
63 |
#define CMD_GET_REGS 0x3e |
63 |
#define CMD_GET_REGS 0x3e |
64 |
#define CMD_GET_SI570 0x3f |
64 |
#define CMD_GET_SI570 0x3f |
65 |
#define CMD_GET_I2C_ERR 0x40 |
65 |
#define CMD_GET_I2C_ERR 0x40 |
66 |
#define CMD_SET_I2C_ADDR 0x41 |
66 |
#define CMD_SET_I2C_ADDR 0x41 |
67 |
#define CMD_GET_CPU_TEMP 0x42 // |
67 |
#define CMD_GET_CPU_TEMP 0x42 // |
68 |
|
68 |
|
69 |
#define CMD_SET_USRP1 0x50 |
69 |
#define CMD_SET_USRP1 0x50 |
70 |
#define CMD_GET_CW_KEY 0x51 |
70 |
#define CMD_GET_CW_KEY 0x51 |
71 |
// 0x52 // Used in old V2.0 |
71 |
// 0x52 // Used in old V2.0 |
72 |
// 0x53 // Used in old V2.0 |
72 |
// 0x53 // Used in old V2.0 |
73 |
// 0x54 // Used in old V2.0 |
73 |
// 0x54 // Used in old V2.0 |
74 |
|
74 |
|
75 |
// Mobo command's |
75 |
// Mobo command's |
76 |
#define CMD_GET_FW_FEATURE 0x60 // Firmware Feature select |
76 |
#define CMD_GET_FW_FEATURE 0x60 // Firmware Feature select |
77 |
#define CMD_GET_ADC_INPUTS 0x61 // Read analog inputs (Temp, PA current, P_out, P_ref, Vdd) |
77 |
#define CMD_GET_ADC_INPUTS 0x61 // Read analog inputs (Temp, PA current, P_out, P_ref, Vdd) |
78 |
#define CMD_RM_PA_HIGH_TEMP 0x64 // Read/Modify the PA High Temperature limit |
78 |
#define CMD_RM_PA_HIGH_TEMP 0x64 // Read/Modify the PA High Temperature limit |
79 |
#define CMD_RM_PA_BIAS 0x65 // Read/Modify PA bias setting related values, 5 items |
79 |
#define CMD_RM_PA_BIAS 0x65 // Read/Modify PA bias setting related values, 5 items |
80 |
#define CMD_RM_PA_SWR 0x66 // Read/Modify SWR measurement and SWR alarm related values 4 items |
80 |
#define CMD_RM_PA_SWR 0x66 // Read/Modify SWR measurement and SWR alarm related values 4 items |
81 |
#define CMD_RM_ROTARY 0x67 // Read/Modify Rotatry Encoder Resolution |
81 |
#define CMD_RM_ROTARY 0x67 // Read/Modify Rotatry Encoder Resolution |
82 |
#define CMD_SET_BYTE_GPIO 0x6e // Write a Byte to (PCF8584) GPIO Extender |
82 |
#define CMD_SET_BYTE_GPIO 0x6e // Write a Byte to (PCF8584) GPIO Extender |
83 |
#define CMD_GET_BYTE_GPIO 0x6f // Read a Byte from (PCF8584) GPIO Extender |
83 |
#define CMD_GET_BYTE_GPIO 0x6f // Read a Byte from (PCF8584) GPIO Extender |
84 |
|
84 |
|
85 |
// 0xEE // Used in old V2.0 |
85 |
// 0xEE // Used in old V2.0 |
86 |
// 0xEF // Used in old V2.0 |
86 |
// 0xEF // Used in old V2.0 |
87 |
// 0xFF // Used in old V2.0 |
87 |
// 0xFF // Used in old V2.0 |