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);
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);
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 std::timed_mutex & usbMutex
unsigned short imu_entries_num
mm_accel_range accel_range
const char * get_mm_request_name(mm_request request)
wraparound_mechanism< unsigned long long > frame_counter_wraparound
std::bitset< 16 > error_state
unsigned short non_imu_entries_num
GLsizei const GLchar *const * string
uvc::device * device_handle
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)
std::vector< motion_module_wraparound > mm_data_wraparound
motion_event_status status
Motion data from gyroscope and accelerometer from the microcontroller.
static bool valid(int check_state)
motion_module_state state_handler
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const void * data
Timestamp data from the motion microcontroller.
#define FW_IMAGE_PACKET_PAYLOAD_LEN
mm_accel_bandwidth accel_bandwidth
void set_control(device &device, const extension_unit &xu, uint8_t ctrl, void *data, int len)
motion_module_wraparound()
wraparound_mechanism< unsigned long long > timestamp_wraparound
const char * get_mm_state_name(mm_state state)
mm_gyro_bandwidth gyro_bandwidth