5 #ifndef MOTION_MODULE_H 6 #define MOTION_MODULE_H 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);
271 #endif // MOTION_MODULE_H unsigned short imu_entries_num
Definition: motion-module.h:79
mm_accel_range accel_range
Definition: motion-module.h:92
Definition: motion-module.h:19
const char * get_mm_request_name(mm_request request)
Definition: motion-module.h:116
wraparound_mechanism< unsigned long long > frame_counter_wraparound
Definition: motion-module.h:149
Definition: motion-module.h:143
Definition: motion-module.h:28
Definition: motion-module.h:98
rs_motion_data parse_motion(const unsigned char *data)
Definition: motion-module.h:111
std::bitset< 16 > error_state
Definition: motion-module.h:77
mm_request
Definition: motion-module.h:109
unsigned short non_imu_entries_num
Definition: motion-module.h:80
Definition: motion-module.h:29
Definition: motion-module.h:152
uint8_t dummy
Definition: motion-module.h:102
mm_state
Definition: motion-module.h:125
void toggle_motion_module_power(bool on)
power_states
Definition: motion-module.h:241
Definition: motion-module.h:26
unsigned pwr_mode_change_done
Definition: motion-module.h:70
int requested_state(mm_request, bool on) const
Definition: motion-module.h:24
Definition: motion-module.h:34
mm_gyro_range
Definition: motion-module.h:39
Definition: motion-module.h:112
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)
rs_motion_data imu_packets[4]
Definition: motion-module.h:82
Definition: motion-module.h:32
Definition: motion-module.h:165
Definition: motion-module.h:20
uint32_t address
Definition: motion-module.h:100
Definition: motion-module.h:176
std::vector< motion_module_wraparound > mm_data_wraparound
Definition: motion-module.h:162
mm_gyro_bandwidth
Definition: motion-module.h:46
adaptor_board_command
Definition: motion-module.h:249
Definition: motion-module.h:30
motion_event_status status
Definition: motion-module.h:78
unsigned reserved_6_15
Definition: motion-module.h:72
void firmware_upgrade(void *data, int size)
static bool valid(int check_state)
Definition: motion-module.h:171
Definition: motion-module.h:128
unsigned cx3_packet_number
Definition: motion-module.h:71
void switch_to_operational()
motion_module_state()
Definition: motion-module.h:168
uint32_t mm_time_seed
Definition: motion-module.h:89
Definition: motion-module.h:129
Definition: motion-module.h:130
uint16_t length
Definition: motion-module.h:101
void toggle_motion_module_events(bool on)
uint8_t op_code
Definition: motion-module.h:99
#define FW_IMAGE_PACKET_PAYLOAD_LEN
Definition: motion-module.h:96
Definition: motion-module.h:113
Definition: motion-module.h:22
Definition: motion-module.h:25
Definition: motion-module.h:127
mm_accel_bandwidth accel_bandwidth
Definition: motion-module.h:93
Definition: motion-module.h:21
Definition: motion-module.h:23
motion_module_control(uvc::device *device, std::timed_mutex &usbMutex)
Definition: motion-module.h:31
uint8_t data[FW_IMAGE_PACKET_PAYLOAD_LEN]
Definition: motion-module.h:103
std::vector< motion_event > operator()(const unsigned char *data, const int &data_size)
mm_state state
Definition: motion-module.h:168
rs_timestamp_data non_imu_packets[8]
Definition: motion-module.h:83
Definition: motion-module.h:87
mm_gyro_range gyro_range
Definition: motion-module.h:90
motion_module_errors
Definition: motion-module.h:17
motion_module_wraparound()
Definition: motion-module.h:145
Definition: motion-module.h:33
Definition: motion-module.h:67
Definition: motion-module.h:75
mm_accel_bandwidth
Definition: motion-module.h:60
unsigned reserved_0
Definition: motion-module.h:69
Definition: motion-module.h:35
wraparound_mechanism< unsigned long long > timestamp_wraparound
Definition: motion-module.h:148
const char * get_mm_state_name(mm_state state)
Definition: motion-module.h:133
motion_module_parser()
Definition: motion-module.h:154
i2c_register
Definition: motion-module.h:208
Definition: motion-module.h:27
mm_gyro_bandwidth gyro_bandwidth
Definition: motion-module.h:91
unsigned long timestamp
Definition: motion-module.h:81
void parse_timestamp(const unsigned char *data, rs_timestamp_data &)
mm_accel_range
Definition: motion-module.h:52