5 #ifndef MOTION_MODULE_H 6 #define MOTION_MODULE_H 15 namespace motion_module
69 unsigned reserved_0 : 1;
70 unsigned pwr_mode_change_done : 1;
71 unsigned cx3_packet_number : 4;
72 unsigned reserved_6_15 : 10;
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();
146 : timestamp_wraparound(1, std::numeric_limits<uint32_t>::max()), frame_counter_wraparound(0, 0xfff)
158 std::vector<motion_event> operator() (
const unsigned char* data,
const int& data_size);
170 int requested_state(
mm_request,
bool on)
const;
182 void toggle_motion_module_power(
bool on);
183 void toggle_motion_module_events(
bool on);
185 void switch_to_iap();
186 void switch_to_operational();
188 void firmware_upgrade(
void *data,
int 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);
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
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
power_states
Definition: motion-module.h:241
Definition: motion-module.h:26
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)
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
static bool valid(int check_state)
Definition: motion-module.h:171
Definition: motion-module.h:128
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
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
Definition: motion-module.h:31
mm_state state
Definition: motion-module.h:168
void set_control(device &device, const extension_unit &xu, uint8_t ctrl, void *data, int len)
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
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
mm_accel_range
Definition: motion-module.h:52