- .stop_bits = UART_STOP_BITS_1,
- .flow_ctrl = UART_HW_FLOWCTRL_DISABLE};
- uart_param_config(UART_NUM, &uart_config);
- uart_set_pin(UART_NUM, PIN_TXD, PIN_RXD, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
- uart_driver_install(UART_NUM, BUF_SIZE * 2, 0, 0, NULL, 0);
-
- /* init imu */
- printf("initialising CX5-25 IMU\n");
- /*
- 75 65 01 02 02 02 E1 C7 // Put the Device in Idle Mode
- 75 65 0C 0A 0A 08 01 02 04 00 01 05 00 01 10 73 // IMU data: acc+gyr at 1000Hz
- 75 65 0C 0A 0A 0A 01 02 05 00 01 0D 00 01 1B A3 // EF data: RPY + LinACC at 500Hz (max)
- 75 65 0C 07 07 0A 01 01 05 00 01 06 23 // EF data: RPY at 500Hz (max)
- 75 65 0C 0A 05 11 01 01 01 05 11 01 03 01 24 CC // Enable the data stream for IMU and EF
- 75 65 0D 06 06 03 00 00 00 00 F6 E4 // set heading at 0
- 75 65 01 02 02 06 E5 CB // Resume the Device (is it needed?)
- */
- const char cmd0[8] = {0x75, 0x65, 0x01, 0x02, 0x02, 0x02, 0xE1, 0xC7};
- const char cmd1[16] = {0x75, 0x65, 0x0C, 0x0A, 0x0A, 0x08, 0x01, 0x02, 0x04, 0x00, 0x01, 0x05, 0x00, 0x01, 0x10, 0x73}; //IMU 1000Hz
- //const char cmd1[16] = {0x75, 0x65, 0x0C, 0x0A, 0x0A, 0x08, 0x01, 0x02, 0x04, 0x00, 0x0A, 0x05, 0x00, 0x0A, 0x22, 0xa0}; //IMU 100Hz
- //const char cmd2[13] = {0x75, 0x65, 0x0C, 0x07, 0x07, 0x0A, 0x01, 0x01, 0x05, 0x00, 0x01, 0x06, 0x23}; //EF RPY 500Hz