15 namespace motion_module
96 #define FW_IMAGE_PACKET_PAYLOAD_LEN (128)
107 void config(uvc::device & device, uint8_t gyro_bw, uint8_t gyro_range, uint8_t accel_bw, uint8_t accel_range, uint32_t time_seed);
121 default:
return std::string(
to_string() <<
"unresolved request id: " << request).c_str();
139 default:
return std::string(
to_string() <<
"unresolved mm state id: " << state).c_str();
158 std::vector<motion_event>
operator() (
const unsigned char* data,
const int& data_size);
193 uvc::device* device_handle;
195 std::timed_mutex& usbMutex;
198 void i2c_iap_write(uint16_t slave_address, uint8_t *buffer, uint16_t len);
200 void write_firmware(uint8_t *data,
int size);
203 void enter_state(
mm_state new_state);
204 void set_control(
mm_request request,
bool on);
Definition motion-module.h:177
void toggle_motion_module_power(bool on)
void firmware_upgrade(void *data, int size)
void switch_to_operational()
void toggle_motion_module_events(bool on)
motion_module_control(uvc::device *device, std::timed_mutex &usbMutex)
Definition motion-module.h:166
int requested_state(mm_request, bool on) const
mm_state state
Definition motion-module.h:169
static bool valid(int check_state)
Definition motion-module.h:171
motion_module_state()
Definition motion-module.h:168
#define FW_IMAGE_PACKET_PAYLOAD_LEN
Definition motion-module.h:96
const char * get_mm_request_name(mm_request request)
Definition motion-module.h:116
i2c_register
Definition motion-module.h:208
adaptor_board_command
Definition motion-module.h:250
mm_gyro_bandwidth
Definition motion-module.h:47
void config(uvc::device &device, uint8_t gyro_bw, uint8_t gyro_range, uint8_t accel_bw, uint8_t accel_range, uint32_t time_seed)
motion_module_errors
Definition motion-module.h:18
@ eeprom_error
Definition motion-module.h:27
@ illegal_configuration
Definition motion-module.h:20
@ imu_fifo_overflow
Definition motion-module.h:22
@ reserved_2
Definition motion-module.h:34
@ uctrl_not_responding
Definition motion-module.h:29
@ general_cx3_failure
Definition motion-module.h:31
@ cx3_fifo_overflow
Definition motion-module.h:30
@ bootloader_failure
Definition motion-module.h:26
@ ts_fifo_overflow
Definition motion-module.h:21
@ max_mm_error
Definition motion-module.h:35
@ crc_error
Definition motion-module.h:24
@ bist_check_failed
Definition motion-module.h:28
@ missing_data_from_imu
Definition motion-module.h:25
@ imu_not_responding
Definition motion-module.h:19
@ cx3_usb_failure
Definition motion-module.h:32
@ watchdog_reset
Definition motion-module.h:23
@ reserved_1
Definition motion-module.h:33
mm_state
Definition motion-module.h:126
@ mm_full_load
Definition motion-module.h:130
@ mm_eventing
Definition motion-module.h:129
@ mm_idle
Definition motion-module.h:127
@ mm_streaming
Definition motion-module.h:128
mm_accel_range
Definition motion-module.h:53
mm_gyro_range
Definition motion-module.h:40
power_states
Definition motion-module.h:241
const char * get_mm_state_name(mm_state state)
Definition motion-module.h:133
mm_request
Definition motion-module.h:110
@ mm_events_output
Definition motion-module.h:113
@ mm_output_undefined
Definition motion-module.h:111
@ mm_video_output
Definition motion-module.h:112
mm_accel_bandwidth
Definition motion-module.h:61
@ RS_EVENT_SOURCE_COUNT
Definition rs.h:285
Motion data from gyroscope and accelerometer from the microcontroller.
Definition rs.h:348
Timestamp data from the motion microcontroller.
Definition rs.h:340
Definition motion-module.h:98
uint16_t length
Definition motion-module.h:101
uint32_t address
Definition motion-module.h:100
uint8_t op_code
Definition motion-module.h:99
uint8_t data[FW_IMAGE_PACKET_PAYLOAD_LEN]
Definition motion-module.h:103
uint8_t dummy
Definition motion-module.h:102
Definition motion-module.h:88
mm_accel_range accel_range
Definition motion-module.h:92
mm_accel_bandwidth accel_bandwidth
Definition motion-module.h:93
mm_gyro_range gyro_range
Definition motion-module.h:90
mm_gyro_bandwidth gyro_bandwidth
Definition motion-module.h:91
uint32_t mm_time_seed
Definition motion-module.h:89
Definition motion-module.h:68
unsigned reserved_0
Definition motion-module.h:69
unsigned pwr_mode_change_done
Definition motion-module.h:70
unsigned reserved_6_15
Definition motion-module.h:72
unsigned cx3_packet_number
Definition motion-module.h:71
Definition motion-module.h:76
motion_event_status status
Definition motion-module.h:78
rs_motion_data imu_packets[4]
Definition motion-module.h:82
unsigned long timestamp
Definition motion-module.h:81
rs_timestamp_data non_imu_packets[8]
Definition motion-module.h:83
std::bitset< 16 > error_state
Definition motion-module.h:77
unsigned short imu_entries_num
Definition motion-module.h:79
unsigned short non_imu_entries_num
Definition motion-module.h:80
Definition motion-module.h:153
std::vector< motion_event > operator()(const unsigned char *data, const int &data_size)
std::vector< motion_module_wraparound > mm_data_wraparound
Definition motion-module.h:162
void parse_timestamp(const unsigned char *data, rs_timestamp_data &)
motion_module_parser()
Definition motion-module.h:154
rs_motion_data parse_motion(const unsigned char *data)
Definition motion-module.h:144
wraparound_mechanism< unsigned long long > timestamp_wraparound
Definition motion-module.h:148
motion_module_wraparound()
Definition motion-module.h:145
wraparound_mechanism< unsigned long long > frame_counter_wraparound
Definition motion-module.h:149