0xFFFF - STATE_DIG_SIGNAL (Flags of digital signals.)
0x0001 - STATE_RIGHT_EDGE (Engine stuck at the right edge.)
0x0002 - STATE_LEFT_EDGE (Engine stuck at the left edge.)
0x0004 - STATE_BUTTON_RIGHT (Button "right" state (1 if pressed).)
0x0008 - STATE_BUTTON_LEFT (Button "left" state (1 if pressed).)
0x0010 - STATE_GPIO_PINOUT (External GPIO works as Out, if flag set; otherwise works as In.)
0x0020 - STATE_GPIO_LEVEL (State of external GPIO pin.)
0x0040 - STATE_HALL_A (State of Hall_a pin.)
0x0080 - STATE_HALL_B (State of Hall_b pin.)
0x0100 - STATE_HALL_C (State of Hall_c pin.)
0x0200 - STATE_BRAKE (State of Brake pin.)
0x0400 - STATE_REV_SENSOR (State of Revolution sensor pin.)
0x0800 - STATE_SYNC_INPUT (State of Sync input pin.)
0x1000 - STATE_SYNC_OUTPUT (State of Sync output pin.)
0x2000 - STATE_ENC_A (State of encoder A pin.)
0x4000 - STATE_ENC_B (State of encoder B pin.)
INT8U CmdBufFreeSpace This field shows the amount of free cells buffer synchronization chain.
INT8U Reserved [4] Reserved (4 bytes)
INT16U CRC Checksum
Description:
Return device state. Useful function that fills structure with snapshot of controller state, including speed, position and boolean flags.
Command STMS
result_t command_start_measurements (device_t id)
Command code (CMD): "stms" or 0x736D7473.
Request: (4 bytes)
INT32U CMD Command
Answer: (4 bytes)
INT32U CMD Command (answer)
Description:
Start measurements and buffering of speed, following error.
Command GETM
result_t get_measurements (device_t id, measurements_t* measurements)
Command code (CMD): "getm" or 0x6D746567.
Request: (4 bytes)
INT32U CMD Command
Answer: (216 bytes)
INT32U CMD Command (answer)
INT32S Speed [25] Current speed.
INT32S Error [25] Current error.
INT32U Length Length of actual data in buffer.
INT8U Reserved [6] Reserved (6 bytes)
INT16U CRC Checksum