|
esp32_BNO08x 1.4
C++ BNO08x IMU driver component for esp-idf.
|
#include <math.h>#include <inttypes.h>#include <stdint.h>#include <cstring>#include <driver/gpio.h>#include <driver/spi_common.h>#include <driver/spi_master.h>#include "sh2_SensorValue.h"

Go to the source code of this file.
Classes | |
| struct | bno08x_config_t |
| IMU configuration settings passed into constructor. More... | |
| struct | bno08x_quat_t |
| Struct to represent unit quaternion. More... | |
| struct | bno08x_euler_angle_t |
| Struct to represent euler angle (units in degrees or rads) More... | |
| struct | bno08x_ang_vel_t |
| Struct to represent angular velocity (units in rad/s) More... | |
| struct | bno08x_magf_t |
| Struct to represent magnetic field data (units in uTesla) More... | |
| struct | bno08x_magf_bias_t |
| Struct to represent magnetic field bias data (units in uTesla) More... | |
| struct | bno08x_gyro_t |
| Struct to represent gyro data (units in rad/s) More... | |
| struct | bno08x_gyro_bias_t |
| Struct to represent gyro bias data (units in rad/s) More... | |
| struct | bno08x_activity_classifier_t |
| Struct to represent activity classifier data. More... | |
| struct | bno08x_tap_detector_t |
| Struct to represent tap detector data (flag meaning: 0 = no tap, 1 = positive tap on axis, -1 = negative tap on axis) More... | |
| struct | bno08x_shake_detector_t |
| Struct to represent shake detector data (flag meaning: 0 = no shake 1 = shake detected) More... | |
| struct | bno08x_accel_t |
| Struct to represent acceleration data from acceleration, linear acceleration, and gravity reports. More... | |
| struct | bno08x_step_counter_t |
| Struct to represent step counter data from step counter reports. More... | |
| struct | bno08x_raw_gyro_t |
| Struct to represent raw mems gyro data from raw gyro reports (units in ADC counts). More... | |
| struct | bno08x_raw_accel_t |
| Struct to represent raw mems accelerometer data from raw accelerometer reports (units in ADC counts). More... | |
| struct | bno08x_raw_magf_t |
| Struct to represent raw mems magnetometer data from raw magnetometer reports (units in ADC counts). More... | |
| struct | bno08x_stability_classifier_t |
| Struct to represent stability classifier data from stability classifier reports. More... | |
| struct | bno08x_sample_counts_t |
| Struct to represent sample counts, returned from BNO08xRpt::get_sample_counts() More... | |
| struct | bno08x_meta_data_t |
| Struct to represent sensor/report meta data, returned from BNO08xRpt::get_meta_data() More... | |
Macros | |
| #define | TAP_DETECTED_X_AXIS(tap) ((tap) & (1U << 0U) ? 1 : 0) |
| #define | TAP_DETECTED_X_AXIS_POSITIVE(tap) ((tap) & (1U << 1U) ? 1 : 0) |
| #define | TAP_DETECTED_Y_AXIS(tap) ((tap) & (1U << 2U) ? 1 : 0) |
| #define | TAP_DETECTED_Y_AXIS_POSITIVE(tap) ((tap) & (1U << 3U) ? 1 : 0) |
| #define | TAP_DETECTED_Z_AXIS(tap) ((tap) & (1U << 4U) ? 1 : 0) |
| #define | TAP_DETECTED_Z_AXIS_POSITIVE(tap) ((tap) & (1U << 5U) ? 1 : 0) |
| #define | TAP_DETECTED_DOUBLE(tap) ((tap) & (1U << 6U) ? 1 : 0) |
| #define | SHAKE_DETECTED_X(tap) ((tap) & (1U << 0U) ? 1 : 0) |
| #define | SHAKE_DETECTED_Y(tap) ((tap) & (1U << 1U) ? 1 : 0) |
| #define | SHAKE_DETECTED_Z(tap) ((tap) & (1U << 2U) ? 1 : 0) |
Typedefs | |
| typedef struct bno08x_config_t | bno08x_config_t |
| IMU configuration settings passed into constructor. More... | |
| typedef bno08x_config_t | imu_config_t |
| using | IMUAccuracy = BNO08xAccuracy |
| typedef struct bno08x_quat_t | bno08x_quat_t |
| Struct to represent unit quaternion. More... | |
| typedef struct bno08x_euler_angle_t | bno08x_euler_angle_t |
| Struct to represent euler angle (units in degrees or rads) More... | |
| typedef struct bno08x_ang_vel_t | bno08x_ang_vel_t |
| Struct to represent angular velocity (units in rad/s) More... | |
| typedef struct bno08x_magf_t | bno08x_magf_t |
| Struct to represent magnetic field data (units in uTesla) More... | |
| typedef struct bno08x_magf_bias_t | bno08x_magf_bias_t |
| Struct to represent magnetic field bias data (units in uTesla) More... | |
| typedef struct bno08x_gyro_t | bno08x_gyro_t |
| Struct to represent gyro data (units in rad/s) More... | |
| typedef struct bno08x_gyro_bias_t | bno08x_gyro_bias_t |
| Struct to represent gyro bias data (units in rad/s) More... | |
| typedef struct bno08x_activity_classifier_t | bno08x_activity_classifier_t |
| Struct to represent activity classifier data. More... | |
| typedef struct bno08x_tap_detector_t | bno08x_tap_detector_t |
| Struct to represent tap detector data (flag meaning: 0 = no tap, 1 = positive tap on axis, -1 = negative tap on axis) More... | |
| typedef struct bno08x_shake_detector_t | bno08x_shake_detector_t |
| Struct to represent shake detector data (flag meaning: 0 = no shake 1 = shake detected) More... | |
| typedef struct bno08x_accel_t | bno08x_accel_t |
| Struct to represent acceleration data from acceleration, linear acceleration, and gravity reports. More... | |
| typedef struct bno08x_step_counter_t | bno08x_step_counter_t |
| Struct to represent step counter data from step counter reports. More... | |
| typedef struct bno08x_raw_gyro_t | bno08x_raw_gyro_t |
| Struct to represent raw mems gyro data from raw gyro reports (units in ADC counts). More... | |
| typedef struct bno08x_raw_accel_t | bno08x_raw_accel_t |
| Struct to represent raw mems accelerometer data from raw accelerometer reports (units in ADC counts). More... | |
| typedef struct bno08x_raw_magf_t | bno08x_raw_magf_t |
| Struct to represent raw mems magnetometer data from raw magnetometer reports (units in ADC counts). More... | |
| typedef struct bno08x_stability_classifier_t | bno08x_stability_classifier_t |
| Struct to represent stability classifier data from stability classifier reports. More... | |
| typedef struct bno08x_sample_counts_t | bno08x_sample_counts_t |
| Struct to represent sample counts, returned from BNO08xRpt::get_sample_counts() More... | |
| typedef struct bno08x_meta_data_t | bno08x_meta_data_t |
| Struct to represent sensor/report meta data, returned from BNO08xRpt::get_meta_data() More... | |
Enumerations | |
| enum class | BNO08xCalSel : uint8_t { accelerometer = SH2_CAL_ACCEL , gyro = SH2_CAL_GYRO , magnetometer = SH2_CAL_MAG , planar_accelerometer = SH2_CAL_PLANAR , all = (SH2_CAL_ACCEL | SH2_CAL_GYRO | SH2_CAL_MAG | SH2_CAL_PLANAR) } |
| enum class | BNO08xResetReason : uint8_t { UNDEFINED , POR , INT_RST , WTD , EXT_RST , OTHER } |
| Reason for previous IMU reset (returned by get_reset_reason()) More... | |
| enum class | BNO08xAccuracy : uint8_t { UNRELIABLE , LOW , MED , HIGH , UNDEFINED } |
| Sensor accuracy returned from input reports, corresponds to status bits (see ref. manual 6.5.1) More... | |
| enum class | BNO08xActivityEnable : uint32_t { UNKNOWN = (1U << 0U) , IN_VEHICLE = (1U << 1U) , ON_BICYCLE = (1U << 2U) , ON_FOOT = (1U << 3U) , STILL = (1U << 4U) , TILTING = (1U << 5U) , WALKING = (1U << 6U) , RUNNING = (1U << 7U) , ON_STAIRS = (1U << 8U) , ALL = (UNKNOWN | IN_VEHICLE | ON_BICYCLE | ON_FOOT | STILL | TILTING | WALKING | RUNNING | ON_STAIRS) } |
| BNO08xActivity Classifier enable bits passed to enable_activity_classifier() See ref manual 6.5.36.1. More... | |
| enum class | BNO08xActivity : uint8_t { UNKNOWN = 0 , IN_VEHICLE = 1 , ON_BICYCLE = 2 , ON_FOOT = 3 , STILL = 4 , TILTING = 5 , WALKING = 6 , RUNNING = 7 , ON_STAIRS = 8 , UNDEFINED = 9 } |
| BNO08xActivity states returned from BNO08x::activity_classifier.get() More... | |
| enum class | BNO08xStability : uint8_t { UNKNOWN = 0 , ON_TABLE = 1 , STATIONARY = 2 , STABLE = 3 , MOTION = 4 , RESERVED = 5 , UNDEFINED = 6 } |
| BNO08xStability states returned from BNO08x::stability_classifier.get() More... | |
| enum class | BNO08xFrsID : uint16_t { STATIC_CALIBRATION_AGM = 0x7979 , NOMINAL_CALIBRATION = 0x4D4D , STATIC_CALIBRATION_SRA = 0x8A8A , NOMINAL_CALIBRATION_SRA = 0x4E4E , DYNAMIC_CALIBRATION = 0x1F1F , ME_POWER_MGMT = 0xD3E2 , SYSTEM_ORIENTATION = 0x2D3E , ACCEL_ORIENTATION = 0x2D41 , SCREEN_ACCEL_ORIENTATION = 0x2D43 , GYROSCOPE_ORIENTATION = 0x2D46 , MAGNETOMETER_ORIENTATION = 0x2D4C , ARVR_STABILIZATION_RV = 0x3E2D , ARVR_STABILIZATION_GRV = 0x3E2E , TAP_DETECT_CONFIG = 0xC269 , SIG_MOTION_DETECT_CONFIG = 0xC274 , SHAKE_DETECT_CONFIG = 0x7D7D , MAX_FUSION_PERIOD = 0xD7D7 , SERIAL_NUMBER = 0x4B4B , ES_PRESSURE_CAL = 0x39AF , ES_TEMPERATURE_CAL = 0x4D20 , ES_HUMIDITY_CAL = 0x1AC9 , ES_AMBIENT_LIGHT_CAL = 0x39B1 , ES_PROXIMITY_CAL = 0x4DA2 , ALS_CAL = 0xD401 , PROXIMITY_SENSOR_CAL = 0xD402 , PICKUP_DETECTOR_CONFIG = 0x1B2A , FLIP_DETECTOR_CONFIG = 0xFC94 , STABILITY_DETECTOR_CONFIG = 0xED85 , ACTIVITY_TRACKER_CONFIG = 0xED88 , SLEEP_DETECTOR_CONFIG = 0xED87 , TILT_DETECTOR_CONFIG = 0xED89 , POCKET_DETECTOR_CONFIG = 0xEF27 , CIRCLE_DETECTOR_CONFIG = 0xEE51 , USER_RECORD = 0x74B4 , ME_TIME_SOURCE_SELECT = 0xD403 , UART_FORMAT = 0xA1A1 , GYRO_INTEGRATED_RV_CONFIG = 0xA1A2 , META_RAW_ACCELEROMETER = 0xE301 , META_ACCELEROMETER = 0xE302 , META_LINEAR_ACCELERATION = 0xE303 , META_GRAVITY = 0xE304 , META_RAW_GYROSCOPE = 0xE305 , META_GYROSCOPE_CALIBRATED = 0xE306 , META_GYROSCOPE_UNCALIBRATED = 0xE307 , META_RAW_MAGNETOMETER = 0xE308 , META_MAGNETIC_FIELD_CALIBRATED = 0xE309 , META_MAGNETIC_FIELD_UNCALIBRATED = 0xE30A , META_ROTATION_VECTOR = 0xE30B , META_GAME_ROTATION_VECTOR = 0xE30C , META_GEOMAGNETIC_ROTATION_VECTOR = 0xE30D , META_PRESSURE = 0xE30E , META_AMBIENT_LIGHT = 0xE30F , META_HUMIDITY = 0xE310 , META_PROXIMITY = 0xE311 , META_TEMPERATURE = 0xE312 , META_TAP_DETECTOR = 0xE313 , META_STEP_DETECTOR = 0xE314 , META_STEP_COUNTER = 0xE315 , META_SIGNIFICANT_MOTION = 0xE316 , META_STABILITY_CLASSIFIER = 0xE317 , META_SHAKE_DETECTOR = 0xE318 , META_FLIP_DETECTOR = 0xE319 , META_PICKUP_DETECTOR = 0xE31A , META_STABILITY_DETECTOR = 0xE31B , META_PERSONAL_ACTIVITY_CLASSIFIER = 0xE31C , META_SLEEP_DETECTOR = 0xE31D , META_TILT_DETECTOR = 0xE31E , META_POCKET_DETECTOR = 0xE31F , META_CIRCLE_DETECTOR = 0xE320 , META_HEART_RATE_MONITOR = 0xE321 , META_ARVR_STABILIZED_RV = 0xE322 , META_ARVR_STABILIZED_GRV = 0xE323 , META_GYRO_INTEGRATED_RV = 0xE324 } |
Functions | |
| const constexpr char * | BNO08xAccuracy_to_str (BNO08xAccuracy accuracy) |
| const constexpr char * | BNO08xActivity_to_str (BNO08xActivity activity) |
| Converts a BNO08xActivity enum to string. More... | |
| const constexpr char * | BNO08xStability_to_str (BNO08xStability stability) |
| Converts a BNO08xStability enum to string. More... | |
| const constexpr char * | BNO08xFrsID_to_str (BNO08xFrsID id) |
| #define SHAKE_DETECTED_X | ( | tap | ) | ((tap) & (1U << 0U) ? 1 : 0) |
| #define SHAKE_DETECTED_Y | ( | tap | ) | ((tap) & (1U << 1U) ? 1 : 0) |
| #define SHAKE_DETECTED_Z | ( | tap | ) | ((tap) & (1U << 2U) ? 1 : 0) |
| #define TAP_DETECTED_DOUBLE | ( | tap | ) | ((tap) & (1U << 6U) ? 1 : 0) |
| #define TAP_DETECTED_X_AXIS | ( | tap | ) | ((tap) & (1U << 0U) ? 1 : 0) |
| #define TAP_DETECTED_X_AXIS_POSITIVE | ( | tap | ) | ((tap) & (1U << 1U) ? 1 : 0) |
| #define TAP_DETECTED_Y_AXIS | ( | tap | ) | ((tap) & (1U << 2U) ? 1 : 0) |
| #define TAP_DETECTED_Y_AXIS_POSITIVE | ( | tap | ) | ((tap) & (1U << 3U) ? 1 : 0) |
| #define TAP_DETECTED_Z_AXIS | ( | tap | ) | ((tap) & (1U << 4U) ? 1 : 0) |
| #define TAP_DETECTED_Z_AXIS_POSITIVE | ( | tap | ) | ((tap) & (1U << 5U) ? 1 : 0) |
| typedef struct bno08x_accel_t bno08x_accel_t |
Struct to represent acceleration data from acceleration, linear acceleration, and gravity reports.
| typedef struct bno08x_activity_classifier_t bno08x_activity_classifier_t |
Struct to represent activity classifier data.
| typedef struct bno08x_ang_vel_t bno08x_ang_vel_t |
Struct to represent angular velocity (units in rad/s)
| typedef struct bno08x_config_t bno08x_config_t |
IMU configuration settings passed into constructor.
| typedef struct bno08x_euler_angle_t bno08x_euler_angle_t |
Struct to represent euler angle (units in degrees or rads)
| typedef struct bno08x_gyro_bias_t bno08x_gyro_bias_t |
Struct to represent gyro bias data (units in rad/s)
| typedef struct bno08x_gyro_t bno08x_gyro_t |
Struct to represent gyro data (units in rad/s)
| typedef struct bno08x_magf_bias_t bno08x_magf_bias_t |
Struct to represent magnetic field bias data (units in uTesla)
| typedef struct bno08x_magf_t bno08x_magf_t |
Struct to represent magnetic field data (units in uTesla)
| typedef struct bno08x_meta_data_t bno08x_meta_data_t |
Struct to represent sensor/report meta data, returned from BNO08xRpt::get_meta_data()
| typedef struct bno08x_quat_t bno08x_quat_t |
Struct to represent unit quaternion.
| typedef struct bno08x_raw_accel_t bno08x_raw_accel_t |
Struct to represent raw mems accelerometer data from raw accelerometer reports (units in ADC counts).
| typedef struct bno08x_raw_gyro_t bno08x_raw_gyro_t |
Struct to represent raw mems gyro data from raw gyro reports (units in ADC counts).
| typedef struct bno08x_raw_magf_t bno08x_raw_magf_t |
Struct to represent raw mems magnetometer data from raw magnetometer reports (units in ADC counts).
| typedef struct bno08x_sample_counts_t bno08x_sample_counts_t |
Struct to represent sample counts, returned from BNO08xRpt::get_sample_counts()
| typedef struct bno08x_shake_detector_t bno08x_shake_detector_t |
Struct to represent shake detector data (flag meaning: 0 = no shake 1 = shake detected)
| typedef struct bno08x_stability_classifier_t bno08x_stability_classifier_t |
Struct to represent stability classifier data from stability classifier reports.
| typedef struct bno08x_step_counter_t bno08x_step_counter_t |
Struct to represent step counter data from step counter reports.
| typedef struct bno08x_tap_detector_t bno08x_tap_detector_t |
Struct to represent tap detector data (flag meaning: 0 = no tap, 1 = positive tap on axis, -1 = negative tap on axis)
| typedef bno08x_config_t imu_config_t |
| using IMUAccuracy = BNO08xAccuracy |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
Reason for previous IMU reset (returned by get_reset_reason())
|
strong |
|
constexpr |

|
constexpr |
Converts a BNO08xActivity enum to string.
|
constexpr |

|
constexpr |
Converts a BNO08xStability enum to string.