Protocol: x16
Header:
- Command: 6 bits - [00111111]
- flag: 2 bits - [11000000]
//**************************************************
//* Command: CMD_GET_DEVICE_INFO
//* Desc: querry device informations
//**************************************************
Lenght: 2 byte
format: [header] [index]
command: [0x01] [0x00 - 0x05]
Index:
0x00 = firmware version (string)
0x01 = device name (string)
0x02 = device manufacturer (string)
0x03 = device ID - return 1 byte
0x04 = numeric version - return 2 byte [value].[value]
0x05 = external EEPROM - return 1 byte, 1 = eeprom found / 0 not found
*string = [num char] [data] …]
example: querrying the device for the firmware version
- command: 0x01 0x00
- return: 0x0C 0x53 0x53 0x43 0x33 0x32 0x2D 0x56 0x30 0x2E 0x33 0x44 0x53
//**************************************************
//* Command: CMD_GET_DEVICE_LED_STATE
//* Desc: querry the device LED state
//**************************************************
Lenght: 1 byte
format: [header]
command: [0x04]
return 1 byte - [led_State]
LED State:
0x00 = led_state_off
0x01 = led_state_on
0x02 = led_state_active_low
0x03 = led_state_active_hi
//**************************************************
//* Command: CMD_SET_DEVICE_LED_STATE
//* Desc: set the device LED state
//**************************************************
Lenght: 2 byte
format: [header] [led_state]
command: [0x05] [0x00 - 0x03]
LED State
0x00 = led_state_off
0x01 = led_state_on
0x02 = led_state_active_low
0x03 = led_state_active_hi
//**************************************************
//* Command: CMD_GET_SERIAL_TX_DELAY
//* Desc: querry the serial transmission delay
//**************************************************
Lenght: 1 byte
format: [header]
command: [0x0A]
return 2 byte [tx delay]
//**************************************************
//* Command: CMD_SET_SERIAL_TX_DELAY
//* Desc: set the serial transmission delay
//**************************************************
Lenght: 3 byte
format: [header] [tx_delay]
command: [0x0B] [0xFFFF]
minimum value: 10us
default value: 600us
//**************************************************
//* Command: CMD_GET_SERIAL_TX_PACING
//* Desc: set the serial transmission pacing
//**************************************************
Lenght: 1 byte
format: [header]
command: [0x0C]
return 2 byte [tx pacing]
//**************************************************
//* Command: CMD_SET_SERIAL_TX_PACING
//* Desc: set the serial transmission pacing
//**************************************************
Lenght: 3 byte
format: [header] [tx_delay]
command: [0x0D] [0xFFFF]
minimum value: 10us
default value: 70us
//**************************************************
//* Command: CMD_GET_DEVICE_TIME_UNIT
//* Desc: querry the current time unit
//**************************************************
Lenght: 1 byte
format: [header]
command: [0x08]
return 1 byte - [time unit]
time unit:
0x00 = ms
0x01 = cs
0x02 = ds
0x03 = sec
//**************************************************
//* Command: CMD_SET_DEVICE_TIME_UNIT
//* Desc: set the time unit
//**************************************************
Lenght: 2 byte
format: [header] [time unit]
command: [0x09] [0x00 - 0x03]
time unit:
0x00 = ms
0x01 = cs
0x02 = ds
0x03 = sec
//**************************************************
//* Command: CMD_GET_INPUT
//* Desc: querry the inputs mode and resolution
//**************************************************
Lenght: 1 byte
format: [header]
command: [0x1A]
return 5 byte - [resolution] [ModeA] [ModeB] [ModeC] [ModeD]
resolution: 0 = 8bit / 1 = 10bit
Mode*: 0x00 = Analog
0x01 = Digital
0x02 = Latch LOW
0x03 = Latch HI
//**************************************************
//* Command: CMD_SET_INPUT
//* Desc: set the inputs mode and resolution
//**************************************************
Lenght: 6 byte
format: [header] [resolution] [ModeA] [ModeB] [ModeC] [ModeD]
command: [0x1B] [0x00 - 0x01] [0x00] [0x01] [0x02] [0x03]
resolution: 0 = 8bit / 1 = 10bit
Mode*: 0x00 = Analog
0x01 = Digital
0x02 = Latch LOW
0x03 = Latch HI
//**************************************************
//* Command: CMD_GET_INPUT_DATA
//* Desc: querry the inputs
//**************************************************
Lenght: 1 byte
format: [header]
command: [0x1c]
8bit res: return 4 bytes - AxFF ] BxFF ] CxFF ] DxFF ]
10bit res: return 8 bytes - Ax03FF ] Bx03FF ] Cx03FF ] Dx03FF ]
- 10bit resolution is sent over using 16bits data
//**************************************************
//* Command: CMD_GET_OUTPUT
//* Desc: querry PWM output state, normal/reverse
//**************************************************
Lenght: 2 byte
format: [header][index]
command: [0x10] [0x00 - 0x1F]
return 1 byte [state]
index: 0 - 31
state: 0 normal / 1 reverse
//**************************************************
//* Command: CMD_SET_OUTPUT
//* Desc: set PWM output state, normal/reverse
//**************************************************
Lenght: 3 byte
format: [header][index] [state]
command: [0x11] [0x00 - 0x1F] [0x00 - 0x01]
index: 0 - 31
state: 0 normal / 1 reverse
//**************************************************
//* Command: CMD_GET_OUTPUT_PWM
//* Desc: querry the output(s) current value
//**************************************************
Lenght: 5 byte
format: [header] [bank0] [bank1] [bank2] [bank3]
command: [0x12] [11111111] [11111111] [11111111] [11111111]
return 0 to 32 byte
example: querying the 32 outputs
-
command: 0x12 0xff 0xff 0xff 0xff
-
return: 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96
0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96 0x96
0x96 0x96 0x96 0x96 0x96 0x96
//**************************************************
//* Command: CMD_SET_OUTPUT_PWM
//* Desc: set the output(s) PWM
//**************************************************
Lenght: 5-69 byte
format: [header] [bank0] [bank1] [bank2] [bank3] [output value] …]
command: [0x14] [11111111] [11111111] [11111111] [11111111] [0x0000 - 0xFFFF] …]
bank*: this is the banks information that hold the datas that specify the output index to move
output value:
- off = 0
- on = 65535
- pwm = 1500-2500
example: set the output 0 to a PWM of 1500us
- command: 0x15 0x01 0x00 0x00 0x00 0x05DC
example: move the 4 first outputs to 1500us
- command: 0x15 0x0f 0x00 0x00 0x00 0x05DC 0x05DC 0x05DC 0x05DC
speed flag: [01000000]
if speed flag is on, the command expect to see 2 word data per output
format: [header] [bank0] [bank1] [bank2] [bank3] [output value] [speed] …] …]
example: move output 0 and 16 to 1000us with a speed value of 200
- command: 0x4E 0x01 0x00 0x01 0x00 0x05DC 0x00C8 0x03E8 0x00C8
time flag: [10000000]
if time flag is on, time data must be inserted in front of the output pwm value(s)
format: [header] [bank0] [bank1] [bank2] [bank3] [time] [output value] …]
example: move output 0-1-16-17 to 2000us with a time value of 10000
- command: 0x8E 0x03 0x00 0x03 0x00 0x03E8 0x2710 0x07D0 0x07D0 0x07D0
//**************************************************
//* Command: CMD_SET_OUTPUT_LOGIC
//* Desc: set output logic
//**************************************************
Lenght: 5-9 byte
format: [header] [bank0] [bank1] [bank2] [bank3] [bit value] …]
command: [0x15] [11111111] [11111111] [11111111] [11111111] [0xff] [0xff] [0xff] [0xff]
//**************************************************
//* Command: CMD_SET_OUTPUT_SPEED
//* Desc: change output speed while in motion
//**************************************************
Lenght: 4 byte
format: [header] [index] [speed]
command: [0x16] [0x00 - 0x1F] [0x07D0]
//**************************************************
//* Command: CMD_GET_OUTPUT_OFFSET
//* Desc: querry output PWM offset
//**************************************************
Lenght: 2 byte
format: [header] [index]
command: [0x17] [0x00 - 0x1F]
return 1 byte - [offset]
//**************************************************
//* Command: CMD_SET_OUTPUT_OFFSET
//* Desc: set output PWM offset
//**************************************************
Lenght: 3 byte
format: [header] [index] [offset]
command: [0x18] [0x00 - 0x1F] [0xff]
default value: 0
minimum value: -128
maximum value: 127
//**************************************************
//* Command: CMD_SET_OUTPUT_STOP
//* Desc: stop output(s)
//**************************************************
Lenght: 5 byte
format: [header] [bitbank0] [bitbank1] [bitbank2] [bitbank3]
command: [0x19] [11111111] [11111111] [11111111] [11111111]
example: stop all outputs
- command: 0x19 0xff 0xff 0xff 0xff
//**************************************************
//* Command: CMD_GET_MULTIPLEXER
//* Desc: querry multiplexer configuration
//**************************************************
Lenght: 2 byte
format: [header] [index]
command: [0x20] [0x00 - 0x03]
return 7 byte - [type] [hardware processing] [pin_input] [pin_output0] [pin_output1] [pin_output2] [pin_output3]
index: 0-3
type: 0 = 8ch / 1 = 16ch
hardware processing: 0 = false / 1 = true
pin_intput: 0-3 (A B C D)
pin_output*: 0-31
//**************************************************
//* Command: CMD_SET_MULTIPLEXER
//* Desc: set multiplexer configuration
//**************************************************
Lenght: 9 byte
format: [header] [index] [type] [enable HP] [pin_input] [pin_output0] [pin_output1] [pin_output2] [pin_output3]
command: [0x21] [0x03] [0/1] [0/1] [0x04] [0x1F] [0x1F] [0x1F] [0x1F]
index: 0-3
type: 0 = 8ch / 1 = 16ch
hardware processing: true/false
pin_input: 0-3 (A B C D)
pin_output*: 0-31
//**************************************************
//* Command: CMD_GET_MULTIPLEXER_CHANNEL
//* Desc: querry the multiplexer’s current channel
//**************************************************
Lenght: 1 byte
format: [header]
command: [0x22]
return 1 byte - [ch index]
//**************************************************
//* Command: CMD_SET_MULTIPLEXER_CHANNEL
//* Desc: set the multiplexer channel
//**************************************************
Lenght: 2 byte
format: [header] [channel]
command: [0x23] [0x00 - 0x0f]
channel: 0-15
//**************************************************
//* Command: CMD_GET_MULTIPLEXER_DATA
//* Desc: querry the multiplexer datas
//**************************************************
Lenght: 2 byte
format: [header] [index]
command: [0x24] [0x03]
return 16 bytes - 0 to 15 channel datas
[code]#define CMD_GET_DEVICE_INFO 0x01
#define CMD_GET_DEVICE_LED_STATE 0x04
#define CMD_SET_DEVICE_LED_STATE 0x05
#define CMD_GET_DEVICE_PROTOCOL 0x06
#define CMD_SET_DEVICE_PROTOCOL 0x07
#define CMD_GET_DEVICE_TIME_UNIT 0x08
#define CMD_SET_DEVICE_TIME_UNIT 0x09
#define CMD_GET_SERIAL_TX_DELAY 0x0A
#define CMD_SET_SERIAL_TX_DELAY 0x0B
#define CMD_GET_SERIAL_TX_PACING 0x0C
#define CMD_SET_SERIAL_TX_PACING 0x0D
#define CMD_GET_OUTPUT 0x10
#define CMD_SET_OUTPUT 0x11
#define CMD_GET_OUTPUT_PWM 0x12
#define CMD_SET_OUTPUT_PWM 0x13
#define CMD_SET_OUTPUT_LOGIC 0x14
#define CMD_SET_OUTPUT_SPEED 0x15
#define CMD_GET_OUTPUT_OFFSET 0x16
#define CMD_SET_OUTPUT_OFFSET 0x17
#define CMD_SET_OUTPUT_STOP 0x18
#define CMD_SET_OUTPUT_BANK 0x19
#define CMD_GET_INPUT 0x1A
#define CMD_SET_INPUT 0x1B
#define CMD_GET_INPUT_DATA 0x1C
#define CMD_GET_MULTIPLEXER 0x20
#define CMD_SET_MULTIPLEXER 0x21
#define CMD_GET_MULTIPLEXER_CHANNEL 0x22
#define CMD_SET_MULTIPLEXER_CHANNEL 0x23
#define CMD_GET_MULTIPLEXER_DATA 0x24[/code]