20 #ifndef PLUGINS_KARATE_KARATELIGHT_H_
21 #define PLUGINS_KARATE_KARATELIGHT_H_
45 uint16_t GetnChannels()
const {
return m_nChannels; }
46 uint8_t GetFWVersion()
const {
return m_fw_version; }
47 uint8_t GetHWVersion()
const {
return m_hw_version; }
48 uint16_t GetDMXOffset()
const {
return m_dmx_offset; }
49 bool IsActive()
const {
return m_active; }
52 bool ReadBack(uint8_t *rd_data, uint8_t *rd_len);
53 bool ReadByteFromEeprom(uint8_t addr, uint8_t *data);
54 bool SendCommand(uint8_t cmd,
const uint8_t *output_buffer,
55 int n_bytes_to_write, uint8_t *input_buffer,
56 int n_bytes_expected);
59 const string m_devname;
62 static const uint16_t CMD_MAX_LENGTH = 64;
63 static const uint16_t CHUNK_SIZE = 32;
68 uint16_t m_dmx_offset;
77 static const uint8_t CMD_HD_SYNC = 0x00;
78 static const uint8_t CMD_HD_COMMAND = 0x01;
79 static const uint8_t CMD_HD_CHECK = 0x02;
80 static const uint8_t CMD_HD_LEN = 0x03;
81 static const uint8_t CMD_DATA_START = 0x04;
84 static const uint8_t CMD_SYNC_SEND = 0xAA;
85 static const uint8_t CMD_SYNC_RECV = 0x55;
88 static const uint8_t CMD_SYS_ACK = 0x01;
89 static const uint8_t CMD_SYS_NACK = 0x02;
90 static const uint8_t CMD_SYS_NIMP = 0xFF;
91 static const uint8_t CMD_SYS_IR = 0x10;
92 static const uint8_t CMD_SYS_DATA = 0x20;
93 static const uint8_t CMD_SYS_NACK_LENGTH = 0x03;
94 static const uint8_t CMD_SYS_NACK_CHECK = 0x04;
97 static const uint8_t CMD_GET_VERSION = 0x01;
98 static const uint8_t CMD_GET_HARDWARE = 0x02;
100 static const uint8_t CMD_GET_TLC_PWM_VALUE = 0x14;
101 static const uint8_t CMD_SET_TLC_PWM_VALUE = 0x15;
103 static const uint8_t CMD_SET_DATA_00 = 0x20;
104 static const uint8_t CMD_SET_DATA_01 = 0x21;
105 static const uint8_t CMD_SET_DATA_02 = 0x22;
106 static const uint8_t CMD_SET_DATA_03 = 0x23;
107 static const uint8_t CMD_SET_DATA_04 = 0x24;
108 static const uint8_t CMD_SET_DATA_05 = 0x25;
109 static const uint8_t CMD_SET_DATA_06 = 0x26;
110 static const uint8_t CMD_SET_DATA_07 = 0x27;
111 static const uint8_t CMD_SET_DATA_08 = 0x28;
112 static const uint8_t CMD_SET_DATA_09 = 0x29;
113 static const uint8_t CMD_SET_DATA_0A = 0x2A;
114 static const uint8_t CMD_SET_DATA_0B = 0x2B;
115 static const uint8_t CMD_SET_DATA_0C = 0x2C;
116 static const uint8_t CMD_SET_DATA_0D = 0x2D;
117 static const uint8_t CMD_SET_DATA_0E = 0x2E;
118 static const uint8_t CMD_SET_DATA_0F = 0x2F;
120 static const uint8_t CMD_GET_N_CHANNELS = 0x30;
122 static const uint8_t CMD_READ_ADC0 = 0x40;
124 static const uint8_t CMD_READ_EEPROM = 0x50;
125 static const uint8_t CMD_WRITE_EEPROM = 0x51;
127 static const uint8_t CMD_BOOT_REQUEST = 0x80;
128 static const uint8_t CMD_BOOT_START = 0x81;
130 static const uint8_t HW_ID_KARATE = 0x01;
131 static const uint8_t HW_ID_USB2DMX = 0x02;
137 #endif // PLUGINS_KARATE_KARATELIGHT_H_