34 #ifndef NZ_USBHIDDEFS_H
35 #define NZ_USBHIDDEFS_H
39 #define CMDUSB_DEBUG_MESSAGE 0x01 //Debug message. Parameter 1 is message type. Rest is NULL terminated string. When received from
41 #define CMDUSB_COMMAND 0x02 //Send a "Command" to the device. Message content is a NULL terminated string.
42 #define CMDUSB_REQUEST_COMMAND 0x03 //Send a "Request Command" to the device. Message content is a NULL terminated string.
43 #define CMDUSB_DEVICE_INFO 0x10
44 #define CMDUSB_RESET_DEVICE 0x11
45 #define CMDUSB_SYNC 0xA5 //Sync character
50 #define IDLE_STATE 0x00
51 #define NOT_IDLE_STATE 0x01
53 #define TOTAL_PACKET_SIZE 64
56 typedef enum _BOARD_ID {
58 BOARD_ID_DEFAULT_DEBUG = 1,
60 BOARD_ID_SBC66EC_CONFIG = 10,
61 BOARD_ID_SBC66EC_MAIN_APP = 11,
63 BOARD_ID_SBC66ECL_CONFIG = 20,
64 BOARD_ID_SBC66ECL_MAIN_APP = 21,
66 BOARD_ID_SBC66ZL_CONFIG = 30,
67 BOARD_ID_SBC66ZL_MAIN_APP = 31,
69 BOARD_ID_SBC66ZB_CONFIG = 40,
70 BOARD_ID_SBC66ZB_MAIN_APP = 41,
72 BOARD_ID_SBC66WL_CONFIG = 50,
73 BOARD_ID_SBC66WL_MAIN_APP = 51,
75 BOARD_ID_SBC66WB_CONFIG = 60,
76 BOARD_ID_SBC66WB_MAIN_APP = 61,
78 BOARD_ID_SBC32UL_CONFIG = 1000,
79 BOARD_ID_SBC32UL_MAIN_APP = 1001,
82 #if !defined(DONT_DEFINE_PACKET_TO_FROM_PC)
85 unsigned char Contents[64];
88 struct __attribute__((packed)) {
89 unsigned char Command;
90 unsigned char reserved;
96 struct __attribute__((packed)) {
97 unsigned char Command;
99 unsigned char Data[TOTAL_PACKET_SIZE - 2];
105 struct __attribute__((packed)) {
106 unsigned char UsbCommandSize;
107 unsigned char UsbCommandData[TOTAL_PACKET_SIZE - 1];
110 #endif //#if !defined(DONT_DEFINE_PACKET_TO_FROM_PC)
115 #if defined(BRD_SBC66EC_R1)
116 #define USBHID_BOARD_ID_MAIN BOARD_ID_SBC66EC_MAIN_APP
117 #define USBHID_BOARD_REV 2
118 #elif defined(BRD_SBC66EC_R2)
119 #define USBHID_BOARD_ID_MAIN BOARD_ID_SBC66EC_MAIN_APP
120 #define USBHID_BOARD_REV 3
121 #elif defined(BRD_SBC66EC_R3)
122 #define USBHID_BOARD_ID_MAIN BOARD_ID_SBC66EC_MAIN_APP
123 #define USBHID_BOARD_REV 4
124 #elif defined(BRD_SBC66ECL_R2)
125 #define USBHID_BOARD_ID_MAIN BOARD_ID_SBC66ECL_MAIN_APP
126 #define USBHID_BOARD_REV 3
127 #elif defined(BRD_SBC66ECL_R3)
128 #define USBHID_BOARD_ID_MAIN BOARD_ID_SBC66ECL_MAIN_APP
129 #define USBHID_BOARD_REV 4
130 #elif defined(BRD_SBC66ZL_R1)
131 #define USBHID_BOARD_ID_MAIN BOARD_ID_SBC66ZL_MAIN_APP
132 #define USBHID_BOARD_REV 2
133 #elif defined(BRD_SBC66ZL_R2)
134 #define USBHID_BOARD_ID_MAIN BOARD_ID_SBC66ZL_MAIN_APP
135 #define USBHID_BOARD_REV 3
136 #elif defined(BRD_SBC66ZB_R1)
137 #define USBHID_BOARD_ID_MAIN BOARD_ID_SBC66ZB_MAIN_APP
138 #define USBHID_BOARD_REV 2
139 #elif defined(BRD_SBC66ZB_R2)
140 #define USBHID_BOARD_ID_MAIN BOARD_ID_SBC66ZB_MAIN_APP
141 #define USBHID_BOARD_REV 3
142 #elif defined(BRD_SBC66WL_R1)
143 #define USBHID_BOARD_ID_MAIN BOARD_ID_SBC66WL_MAIN_APP
144 #define USBHID_BOARD_REV 2
145 #elif defined(BRD_SBC66WL_R2)
146 #define USBHID_BOARD_ID_MAIN BOARD_ID_SBC66WL_MAIN_APP
147 #define USBHID_BOARD_REV 3
148 #elif defined(BRD_SBC66WB_R1)
149 #define USBHID_BOARD_ID_MAIN BOARD_ID_SBC66WB_MAIN_APP
150 #define USBHID_BOARD_REV 2
151 #elif defined(BRD_SBC66WB_R2)
152 #define USBHID_BOARD_ID_MAIN BOARD_ID_SBC66WB_MAIN_APP
153 #define USBHID_BOARD_REV 3
154 #elif defined(BRD_SBC32UL_R1)
155 #define USBHID_BOARD_ID_MAIN BOARD_ID_SBC32UL_MAIN_APP
156 #define USBHID_BOARD_REV 3
158 #error "No board defined, required for BOARD_ID_Xxxx"