|
esp32_BNO08x 1.2
C++ BNO08x IMU driver component for esp-idf.
|
#include <inttypes.h>#include <freertos/FreeRTOS.h>#include <freertos/event_groups.h>

Go to the source code of this file.
Macros | |
| #define | CHECK_TASKS_RUNNING(evt_grp_task_flow, running_bit) ((xEventGroupGetBits(evt_grp_task_flow) & (running_bit)) != 0) |
| Clears the most significant byte of a 16-bit value. | |
| #define | UINT16_CLR_MSB(val_16bit) ((val_16bit) & 0x00FFU) |
| Clears the most significant byte of a 16-bit value. | |
| #define | UINT16_CLR_LSB(val_16bit) ((val_16bit) & 0xFF00U) |
| Clears the least significant byte of a 16-bit value. | |
| #define | UINT32_CLR_BYTE(val_32bit, byte2clear) ((val_32bit) & ~(0xFFUL << (byte2clear * 8UL))) |
| Clears a specified byte in a 32-bit value. | |
| #define | UINT32_MSK_BYTE(val_32bit, byte2mask) ((val_32bit) & (0xFFUL << (byte2mask * 8UL))) |
| Masks a specified byte in a 32-bit value. | |
| #define | PARSE_PACKET_LENGTH(packet_ptr) (UINT16_CLR_LSB(static_cast<uint16_t>(packet_ptr->header[1]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet_ptr->header[0]))) |
| Parse length from SHTP packet header. | |
| #define | PARSE_PACKET_TIMESTAMP(packet_ptr) |
| Parse timestamp from SHTP packet. | |
| #define | PARSE_PRODUCT_ID_REPORT_RESET_REASON(packet_ptr) UINT32_MSK_BYTE(static_cast<uint32_t>(packet_ptr->body[1]), 0UL) |
| Parse reset reason from SHTP packet containing product ID report. | |
| #define | PARSE_PRODUCT_ID_REPORT_SW_PART_NO(packet_ptr) |
| Parse sw part number from SHTP packet containing product ID report. | |
| #define | PARSE_PRODUCT_ID_REPORT_SW_BUILD_NO(packet_ptr) |
| Parse sw build number from SHTP packet containing product ID report. | |
| #define | PARSE_PRODUCT_ID_REPORT_SW_VERSION_PATCH(packet_ptr) (UINT32_MSK_BYTE(static_cast<uint32_t>(packet->body[13]) << 8UL, 1UL) | UINT32_MSK_BYTE(static_cast<uint32_t>(packet->body[12]), 0UL)) |
| Parse sw version patch from SHTP packet containing product ID report. | |
| #define | PARSE_PRODUCT_ID_REPORT_PRODUCT_ID(packet_ptr) UINT32_MSK_BYTE(static_cast<uint32_t>(packet->body[0]), 0UL) |
| Parse product ID SHTP packet containing product ID report. | |
| #define | PARSE_PRODUCT_ID_REPORT_SW_VERSION_MAJOR(packet_ptr) UINT32_MSK_BYTE(static_cast<uint32_t>(packet->body[2]), 0UL) |
| Parse product sw version major containing product ID report. | |
| #define | PARSE_PRODUCT_ID_REPORT_SW_VERSION_MINOR(packet_ptr) UINT32_MSK_BYTE(static_cast<uint32_t>(packet->body[3]), 0UL) |
| Parse product sw version minor containing product ID report. | |
| #define | PARSE_GYRO_REPORT_RAW_QUAT_I(packet) (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[1]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[0]))) |
| Parse quat I data from integrated gyro rotation vector report. | |
| #define | PARSE_GYRO_REPORT_RAW_QUAT_J(packet) (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[3]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[2]))) |
| Parse quat J data from integrated gyro rotation vector report. | |
| #define | PARSE_GYRO_REPORT_RAW_QUAT_K(packet) (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[5]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[4]))) |
| Parse quat K data from integrated gyro rotation vector report. | |
| #define | PARSE_GYRO_REPORT_RAW_QUAT_REAL(packet) (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[7]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[6]))) |
| Parse quat real data from integrated gyro rotation vector report. | |
| #define | PARSE_GYRO_REPORT_RAW_GYRO_VEL_X(packet) (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[9]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[8]))) |
| Parse x axis velocity data from integrated gyro rotation vector report. | |
| #define | PARSE_GYRO_REPORT_RAW_GYRO_VEL_Y(packet) (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[11]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[10]))) |
| Parse y axis velocity data from integrated gyro rotation vector report. | |
| #define | PARSE_GYRO_REPORT_RAW_GYRO_VEL_Z(packet) (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[13]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[12]))) |
| Parse z axis velocity data from integrated gyro rotation vector report. | |
| #define | PARSE_INPUT_REPORT_STATUS_BITS(packet) (packet->body[5 + 2] & 0x03U) |
| Parse status bits from input report. | |
| #define | PARSE_INPUT_REPORT_REPORT_ID(packet) UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[5])) |
| Parse report ID from input report. | |
| #define | PARSE_INPUT_REPORT_DATA_1(packet) (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[5 + 5]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[5 + 4]))) |
| Parse first data block from input report. | |
| #define | PARSE_INPUT_REPORT_DATA_2(packet) (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[5 + 7]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[5 + 6]))) |
| Parse second data block from input report. | |
| #define | PARSE_INPUT_REPORT_DATA_3(packet) (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[5 + 9]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[5 + 8]))) |
| Parse third data block from input report. | |
| #define | PARSE_INPUT_REPORT_DATA_4(packet) (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[5 + 11]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[5 + 10]))) |
| Parse fourth data block from input report. | |
| #define | PARSE_INPUT_REPORT_DATA_5(packet) (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[5 + 13]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[5 + 12]))) |
| Parse fifth data block from input report. | |
| #define | PARSE_INPUT_REPORT_DATA_6(packet) (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[5 + 15]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[5 + 14]))) |
| Parse sixth data block from input report. | |
| #define | IS_ROTATION_VECTOR_REPORT(packet) |
| Checks if packet containing input report is a rotation vector report. | |
| #define | PARSE_FRS_READ_RESPONSE_REPORT_RECORD_ID(packet_body) (UINT16_CLR_LSB(static_cast<uint16_t>(packet_body[13]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet_body[12]))) |
| Parse FRS record ID from FRS read response report. | |
| #define | PARSE_FRS_READ_RESPONSE_REPORT_DATA_1(packet_body) |
| Parse data block 1 from FRS read response report. | |
| #define | PARSE_FRS_READ_RESPONSE_REPORT_DATA_2(packet_body) |
| Parse data block 2 from FRS read response report. | |
| #define CHECK_TASKS_RUNNING | ( | evt_grp_task_flow, | |
| running_bit ) ((xEventGroupGetBits(evt_grp_task_flow) & (running_bit)) != 0) |
Clears the most significant byte of a 16-bit value.
| evt_grp_task_flow | Task flow event group handle. |
| running_bit | EVT_GRP_TSK_FLW_RUNNING_BIT |
| #define IS_ROTATION_VECTOR_REPORT | ( | packet | ) |
Checks if packet containing input report is a rotation vector report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_FRS_READ_RESPONSE_REPORT_DATA_1 | ( | packet_body | ) |
Parse data block 1 from FRS read response report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_FRS_READ_RESPONSE_REPORT_DATA_2 | ( | packet_body | ) |
Parse data block 2 from FRS read response report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_FRS_READ_RESPONSE_REPORT_RECORD_ID | ( | packet_body | ) | (UINT16_CLR_LSB(static_cast<uint16_t>(packet_body[13]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet_body[12]))) |
Parse FRS record ID from FRS read response report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_GYRO_REPORT_RAW_GYRO_VEL_X | ( | packet | ) | (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[9]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[8]))) |
Parse x axis velocity data from integrated gyro rotation vector report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_GYRO_REPORT_RAW_GYRO_VEL_Y | ( | packet | ) | (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[11]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[10]))) |
Parse y axis velocity data from integrated gyro rotation vector report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_GYRO_REPORT_RAW_GYRO_VEL_Z | ( | packet | ) | (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[13]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[12]))) |
Parse z axis velocity data from integrated gyro rotation vector report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_GYRO_REPORT_RAW_QUAT_I | ( | packet | ) | (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[1]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[0]))) |
Parse quat I data from integrated gyro rotation vector report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_GYRO_REPORT_RAW_QUAT_J | ( | packet | ) | (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[3]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[2]))) |
Parse quat J data from integrated gyro rotation vector report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_GYRO_REPORT_RAW_QUAT_K | ( | packet | ) | (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[5]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[4]))) |
Parse quat K data from integrated gyro rotation vector report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_GYRO_REPORT_RAW_QUAT_REAL | ( | packet | ) | (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[7]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[6]))) |
Parse quat real data from integrated gyro rotation vector report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_INPUT_REPORT_DATA_1 | ( | packet | ) | (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[5 + 5]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[5 + 4]))) |
Parse first data block from input report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_INPUT_REPORT_DATA_2 | ( | packet | ) | (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[5 + 7]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[5 + 6]))) |
Parse second data block from input report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_INPUT_REPORT_DATA_3 | ( | packet | ) | (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[5 + 9]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[5 + 8]))) |
Parse third data block from input report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_INPUT_REPORT_DATA_4 | ( | packet | ) | (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[5 + 11]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[5 + 10]))) |
Parse fourth data block from input report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_INPUT_REPORT_DATA_5 | ( | packet | ) | (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[5 + 13]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[5 + 12]))) |
Parse fifth data block from input report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_INPUT_REPORT_DATA_6 | ( | packet | ) | (UINT16_CLR_LSB(static_cast<uint16_t>(packet->body[5 + 15]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[5 + 14]))) |
Parse sixth data block from input report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_INPUT_REPORT_REPORT_ID | ( | packet | ) | UINT16_CLR_MSB(static_cast<uint16_t>(packet->body[5])) |
Parse report ID from input report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_INPUT_REPORT_STATUS_BITS | ( | packet | ) | (packet->body[5 + 2] & 0x03U) |
Parse status bits from input report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_PACKET_LENGTH | ( | packet_ptr | ) | (UINT16_CLR_LSB(static_cast<uint16_t>(packet_ptr->header[1]) << 8U) | UINT16_CLR_MSB(static_cast<uint16_t>(packet_ptr->header[0]))) |
Parse length from SHTP packet header.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_PACKET_TIMESTAMP | ( | packet_ptr | ) |
Parse timestamp from SHTP packet.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_PRODUCT_ID_REPORT_PRODUCT_ID | ( | packet_ptr | ) | UINT32_MSK_BYTE(static_cast<uint32_t>(packet->body[0]), 0UL) |
Parse product ID SHTP packet containing product ID report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_PRODUCT_ID_REPORT_RESET_REASON | ( | packet_ptr | ) | UINT32_MSK_BYTE(static_cast<uint32_t>(packet_ptr->body[1]), 0UL) |
Parse reset reason from SHTP packet containing product ID report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_PRODUCT_ID_REPORT_SW_BUILD_NO | ( | packet_ptr | ) |
Parse sw build number from SHTP packet containing product ID report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_PRODUCT_ID_REPORT_SW_PART_NO | ( | packet_ptr | ) |
Parse sw part number from SHTP packet containing product ID report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_PRODUCT_ID_REPORT_SW_VERSION_MAJOR | ( | packet_ptr | ) | UINT32_MSK_BYTE(static_cast<uint32_t>(packet->body[2]), 0UL) |
Parse product sw version major containing product ID report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_PRODUCT_ID_REPORT_SW_VERSION_MINOR | ( | packet_ptr | ) | UINT32_MSK_BYTE(static_cast<uint32_t>(packet->body[3]), 0UL) |
Parse product sw version minor containing product ID report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define PARSE_PRODUCT_ID_REPORT_SW_VERSION_PATCH | ( | packet_ptr | ) | (UINT32_MSK_BYTE(static_cast<uint32_t>(packet->body[13]) << 8UL, 1UL) | UINT32_MSK_BYTE(static_cast<uint32_t>(packet->body[12]), 0UL)) |
Parse sw version patch from SHTP packet containing product ID report.
| packet | Pointer to bno08x_rx_packet_t containing data. |
| #define UINT16_CLR_LSB | ( | val_16bit | ) | ((val_16bit) & 0xFF00U) |
Clears the least significant byte of a 16-bit value.
| val_16bit | The 16-bit value to modify. |
| #define UINT16_CLR_MSB | ( | val_16bit | ) | ((val_16bit) & 0x00FFU) |
Clears the most significant byte of a 16-bit value.
| val_16bit | The 16-bit value to modify. |
| #define UINT32_CLR_BYTE | ( | val_32bit, | |
| byte2clear ) ((val_32bit) & ~(0xFFUL << (byte2clear * 8UL))) |
Clears a specified byte in a 32-bit value.
| val_32bit | The 32-bit value to modify. |
| byte2clear | The byte index to clear (0 = LSB, 3 = MSB). |
| #define UINT32_MSK_BYTE | ( | val_32bit, | |
| byte2mask ) ((val_32bit) & (0xFFUL << (byte2mask * 8UL))) |
Masks a specified byte in a 32-bit value.
| val_32bit | The 32-bit value to modify. |
| byte2mask | The byte index to mask (0 = LSB, 3 = MSB). |