esp32_BNO08x 1.01
C++ BNO08x IMU driver component for esp-idf.
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
BNO08x Class Reference

#include <BNO08x.hpp>

Public Member Functions

 BNO08x (bno08x_config_t imu_config=default_imu_config)
 BNO08x imu constructor.
 
bool initialize ()
 Initializes BNO08x sensor.
 
bool hard_reset ()
 Hard resets BNO08x sensor.
 
bool soft_reset ()
 Soft resets BNO08x sensor using executable channel.
 
uint8_t get_reset_reason ()
 Get the reason for the most recent reset.
 
bool mode_sleep ()
 Puts BNO08x sensor into sleep/low power mode using executable channel.
 
bool mode_on ()
 Turns on/ brings BNO08x sensor out of sleep mode using executable channel.
 
float q_to_float (int16_t fixed_point_value, uint8_t q_point)
 Converts a register value to a float using its associated Q point. (See https://en.wikipedia.org/wiki/Q_(number_format))
 
bool run_full_calibration_routine ()
 Runs full calibration routine.
 
void calibrate_all ()
 Sends command to calibrate accelerometer, gyro, and magnetometer.
 
void calibrate_accelerometer ()
 Sends command to calibrate accelerometer.
 
void calibrate_gyro ()
 Sends command to calibrate gyro.
 
void calibrate_magnetometer ()
 Sends command to calibrate magnetometer.
 
void calibrate_planar_accelerometer ()
 Sends command to calibrate planar accelerometer.
 
void request_calibration_status ()
 Requests ME calibration status from BNO08x (see Ref. Manual 6.4.7.2)
 
bool calibration_complete ()
 Returns true if calibration has completed.
 
void end_calibration ()
 Sends command to end calibration procedure.
 
void save_calibration ()
 Sends command to save internal calibration data (See Ref. Manual 6.4.7).
 
void enable_rotation_vector (uint16_t time_between_reports)
 Sends command to enable rotation vector reports (See Ref. Manual 6.5.18)
 
void enable_game_rotation_vector (uint16_t time_between_reports)
 Sends command to enable game rotation vector reports (See Ref. Manual 6.5.19)
 
void enable_ARVR_stabilized_rotation_vector (uint16_t time_between_reports)
 Sends command to enable ARVR stabilized rotation vector reports (See Ref. Manual 6.5.42)
 
void enable_ARVR_stabilized_game_rotation_vector (uint16_t time_between_reports)
 Sends command to enable ARVR stabilized game rotation vector reports (See Ref. Manual 6.5.43)
 
void enable_gyro_integrated_rotation_vector (uint16_t timeBetweenReports)
 Sends command to enable gyro integrated rotation vector reports (See Ref. Manual 6.5.44)
 
void enable_accelerometer (uint16_t time_between_reports)
 Sends command to enable accelerometer reports (See Ref. Manual 6.5.9)
 
void enable_linear_accelerometer (uint16_t time_between_reports)
 Sends command to enable linear accelerometer reports (See Ref. Manual 6.5.10)
 
void enable_gravity (uint16_t time_between_reports)
 Sends command to enable gravity reading reports (See Ref. Manual 6.5.11)
 
void enable_gyro (uint16_t time_between_reports)
 Sends command to enable gyro reports (See Ref. Manual 6.5.13)
 
void enable_uncalibrated_gyro (uint16_t time_between_reports)
 Sends command to enable uncalibrated gyro reports (See Ref. Manual 6.5.14)
 
void enable_magnetometer (uint16_t time_between_reports)
 Sends command to enable magnetometer reports (See Ref. Manual 6.5.16)
 
void enable_tap_detector (uint16_t time_between_reports)
 Sends command to enable tap detector reports (See Ref. Manual 6.5.27)
 
void enable_step_counter (uint16_t time_between_reports)
 Sends command to enable step counter reports (See Ref. Manual 6.5.29)
 
void enable_stability_classifier (uint16_t time_between_reports)
 Sends command to enable activity stability classifier reports (See Ref. Manual 6.5.31)
 
void enable_activity_classifier (uint16_t time_between_reports, uint32_t activities_to_enable, uint8_t(&activity_confidence_vals)[9])
 Sends command to enable activity classifier reports (See Ref. Manual 6.5.36)
 
void enable_raw_accelerometer (uint16_t time_between_reports)
 Sends command to enable raw accelerometer reports (See Ref. Manual 6.5.8)
 
void enable_raw_gyro (uint16_t time_between_reports)
 Sends command to enable raw gyro reports (See Ref. Manual 6.5.12)
 
void enable_raw_magnetometer (uint16_t time_between_reports)
 Sends command to enable raw magnetometer reports (See Ref. Manual 6.5.15)
 
void tare_now (uint8_t axis_sel=TARE_AXIS_ALL, uint8_t rotation_vector_basis=TARE_ROTATION_VECTOR)
 Sends command to tare an axis (See Ref. Manual 6.4.4.1)
 
void save_tare ()
 Sends command to save tare into non-volatile memory of BNO08x (See Ref. Manual 6.4.4.2)
 
void clear_tare ()
 Sends command to clear persistent tare settings in non-volatile memory of BNO08x (See Ref. Manual 6.4.4.3)
 
bool data_available ()
 Checks if BNO08x has asserted interrupt and sent data.
 
uint16_t parse_input_report ()
 Parses received input report sent by BNO08x.
 
uint16_t parse_command_report ()
 Parses received command report sent by BNO08x (See Ref. Manual 6.3.9)
 
uint16_t get_readings ()
 Waits for BNO08x HINT pin to assert, and parses the received data.
 
uint32_t get_time_stamp ()
 Return timestamp of most recent report.
 
void get_magf (float &x, float &y, float &z, uint8_t &accuracy)
 Get the full magnetic field vector.
 
float get_magf_X ()
 Get X component of magnetic field vector.
 
float get_magf_Y ()
 Get Y component of magnetic field vector.
 
float get_magf_Z ()
 Get Z component of magnetic field vector.
 
uint8_t get_magf_accuracy ()
 Get accuracy of reported magnetic field vector.
 
void get_gravity (float &x, float &y, float &z, uint8_t &accuracy)
 Get full reported gravity vector, units in m/s^2.
 
float get_gravity_X ()
 Get the reported x axis gravity.
 
float get_gravity_Y ()
 Get the reported y axis gravity.
 
float get_gravity_Z ()
 Get the reported z axis gravity.
 
uint8_t get_gravity_accuracy ()
 Get the reported gravity accuracy.
 
float get_roll ()
 Get the reported rotation about x axis.
 
float get_pitch ()
 Get the reported rotation about y axis.
 
float get_yaw ()
 Get the reported rotation about z axis.
 
float get_roll_deg ()
 Get the reported rotation about x axis.
 
float get_pitch_deg ()
 Get the reported rotation about y axis.
 
float get_yaw_deg ()
 Get the reported rotation about z axis.
 
void get_quat (float &i, float &j, float &k, float &real, float &rad_accuracy, uint8_t &accuracy)
 Get the full quaternion reading.
 
float get_quat_I ()
 Get I component of reported quaternion.
 
float get_quat_J ()
 Get J component of reported quaternion.
 
float get_quat_K ()
 Get K component of reported quaternion.
 
float get_quat_real ()
 Get real component of reported quaternion.
 
float get_quat_radian_accuracy ()
 Get radian accuracy of reported quaternion.
 
uint8_t get_quat_accuracy ()
 Get accuracy of reported quaternion.
 
void get_accel (float &x, float &y, float &z, uint8_t &accuracy)
 Get full acceleration (total acceleration of device, units in m/s^2).
 
float get_accel_X ()
 Get x axis acceleration (total acceleration of device, units in m/s^2).
 
float get_accel_Y ()
 Get y axis acceleration (total acceleration of device, units in m/s^2).
 
float get_accel_Z ()
 Get z axis acceleration (total acceleration of device, units in m/s^2).
 
uint8_t get_accel_accuracy ()
 Get accuracy of linear acceleration.
 
void get_linear_accel (float &x, float &y, float &z, uint8_t &accuracy)
 Get full linear acceleration (acceleration of the device minus gravity, units in m/s^2).
 
float get_linear_accel_X ()
 Get x axis linear acceleration (acceleration of device minus gravity, units in m/s^2)
 
float get_linear_accel_Y ()
 Get y axis linear acceleration (acceleration of device minus gravity, units in m/s^2)
 
float get_linear_accel_Z ()
 Get z axis linear acceleration (acceleration of device minus gravity, units in m/s^2)
 
uint8_t get_linear_accel_accuracy ()
 Get accuracy of linear acceleration.
 
int16_t get_raw_accel_X ()
 Get raw accelerometer x axis reading from physical accelerometer MEMs sensor (See Ref. Manual 6.5.8)
 
int16_t get_raw_accel_Y ()
 Get raw accelerometer y axis reading from physical accelerometer MEMs sensor (See Ref. Manual 6.5.8)
 
int16_t get_raw_accel_Z ()
 Get raw accelerometer z axis reading from physical accelerometer MEMs sensor (See Ref. Manual 6.5.8)
 
int16_t get_raw_gyro_X ()
 Get raw gyroscope x axis reading from physical gyroscope MEMs sensor (See Ref. Manual 6.5.12)
 
int16_t get_raw_gyro_Y ()
 Get raw gyroscope y axis reading from physical gyroscope MEMs sensor (See Ref. Manual 6.5.12)
 
int16_t get_raw_gyro_Z ()
 Get raw gyroscope z axis reading from physical gyroscope MEMs sensor (See Ref. Manual 6.5.12)
 
int16_t get_raw_magf_X ()
 Get raw magnetometer x axis reading from physical magnetometer sensor (See Ref. Manual 6.5.15)
 
int16_t get_raw_magf_Y ()
 Get raw magnetometer y axis reading from physical magnetometer sensor (See Ref. Manual 6.5.15)
 
int16_t get_raw_magf_Z ()
 Get raw magnetometer z axis reading from physical magnetometer sensor (See Ref. Manual 6.5.15)
 
void get_gyro_calibrated_velocity (float &x, float &y, float &z, uint8_t &accuracy)
 Get full rotational velocity with drift compensation (units in Rad/s).
 
float get_gyro_calibrated_velocity_X ()
 Get calibrated gyro x axis angular velocity measurement.
 
float get_gyro_calibrated_velocity_Y ()
 Get calibrated gyro y axis angular velocity measurement.
 
float get_gyro_calibrated_velocity_Z ()
 Get calibrated gyro z axis angular velocity measurement.
 
uint8_t get_gyro_accuracy ()
 Get calibrated gyro accuracy.
 
void get_uncalibrated_gyro (float &x, float &y, float &z, float &bx, float &by, float &bz, uint8_t &accuracy)
 Get full rotational velocity without drift compensation (units in Rad/s). An estimate of drift is given but not applied.
 
float get_uncalibrated_gyro_X ()
 Get uncalibrated gyro x axis angular velocity measurement.
 
float get_uncalibrated_gyro_Y ()
 Get uncalibrated gyro Y axis angular velocity measurement.
 
float get_uncalibrated_gyro_Z ()
 Get uncalibrated gyro Z axis angular velocity measurement.
 
float get_uncalibrated_gyro_bias_X ()
 Get uncalibrated gyro x axis drift estimate.
 
float get_uncalibrated_gyro_bias_Y ()
 Get uncalibrated gyro Y axis drift estimate.
 
float get_uncalibrated_gyro_bias_Z ()
 Get uncalibrated gyro Z axis drift estimate.
 
uint8_t get_uncalibrated_gyro_accuracy ()
 Get uncalibrated gyro accuracy.
 
void get_gyro_velocity (float &x, float &y, float &z)
 Full rotational velocity from gyro-integrated rotation vector (See Ref. Manual 6.5.44)
 
float get_gyro_velocity_X ()
 Get x axis angular velocity from gyro-integrated rotation vector. (See Ref. Manual 6.5.44)
 
float get_gyro_velocity_Y ()
 Get y axis angular velocity from gyro-integrated rotation vector. (See Ref. Manual 6.5.44)
 
float get_gyro_velocity_Z ()
 Get z axis angular velocity from gyro-integrated rotation vector. (See Ref. Manual 6.5.44)
 
uint8_t get_tap_detector ()
 Get if tap has occured.
 
uint16_t get_step_count ()
 Get the counted amount of steps.
 
int8_t get_stability_classifier ()
 Get the current stability classifier (Seee Ref. Manual 6.5.31)
 
uint8_t get_activity_classifier ()
 Get the current activity classifier (Seee Ref. Manual 6.5.36)
 
void print_header ()
 Prints the most recently received SHTP header to serial console with ESP_LOG statement.
 
void print_packet ()
 
int16_t get_Q1 (uint16_t record_ID)
 Gets Q1 point from BNO08x FRS (flash record system).
 
int16_t get_Q2 (uint16_t record_ID)
 Gets Q2 point from BNO08x FRS (flash record system).
 
int16_t get_Q3 (uint16_t record_ID)
 Gets Q3 point from BNO08x FRS (flash record system).
 
float get_resolution (uint16_t record_ID)
 Gets resolution from BNO08x FRS (flash record system).
 
float get_range (uint16_t record_ID)
 Gets range from BNO08x FRS (flash record system).
 
uint32_t FRS_read_word (uint16_t record_ID, uint8_t word_number)
 Reads meta data word from BNO08x FRS (flash record system) given the record ID and word number. (See Ref. Manual 5.1 & 6.3.7)
 
bool FRS_read_request (uint16_t record_ID, uint16_t read_offset, uint16_t block_size)
 Requests meta data from BNO08x FRS (flash record system) given the record ID. Contains Q points and other info. (See Ref. Manual 5.1 & 6.3.6)
 
bool FRS_read_data (uint16_t record_ID, uint8_t start_location, uint8_t words_to_read)
 Read meta data from BNO08x FRS (flash record system) given the record ID. Contains Q points and other info. (See Ref. Manual 5.1 & 6.3.7)
 

Static Public Attributes

static const constexpr uint16_t FRS_RECORDID_ACCELEROMETER = 0xE302
 
static const constexpr uint16_t FRS_RECORDID_GYROSCOPE_CALIBRATED = 0xE306
 
static const constexpr uint16_t FRS_RECORDID_MAGNETIC_FIELD_CALIBRATED = 0xE309
 
static const constexpr uint16_t FRS_RECORDID_ROTATION_VECTOR = 0xE30B
 
static const constexpr uint8_t TARE_AXIS_ALL = 0x07
 Tare all axes (used with tare now command)
 
static const constexpr uint8_t TARE_AXIS_Z = 0x04
 Tar yaw axis only (used with tare now command)
 
static const constexpr uint8_t TARE_ROTATION_VECTOR = 0
 Tare rotation vector.
 
static const constexpr uint8_t TARE_GAME_ROTATION_VECTOR = 1
 Tare game rotation vector.
 
static const constexpr uint8_t TARE_GEOMAGNETIC_ROTATION_VECTOR = 2
 tare geomagnetic rotation vector
 
static const constexpr uint8_t TARE_GYRO_INTEGRATED_ROTATION_VECTOR = 3
 Tare gyro integrated rotation vector.
 
static const constexpr uint8_t TARE_AR_VR_STABILIZED_ROTATION_VECTOR = 4
 Tare ARVR stabilized rotation vector.
 
static const constexpr uint8_t TARE_AR_VR_STABILIZED_GAME_ROTATION_VECTOR = 5
 Tare ARVR stabilized game rotation vector.
 
static const constexpr int16_t ROTATION_VECTOR_Q1 = 14
 Rotation vector Q point (See SH-2 Ref. Manual 6.5.18)
 
static const constexpr int16_t ROTATION_VECTOR_ACCURACY_Q1 = 12
 Rotation vector accuracy estimate Q point (See SH-2 Ref. Manual 6.5.18)
 
static const constexpr int16_t ACCELEROMETER_Q1 = 8
 Acceleration Q point (See SH-2 Ref. Manual 6.5.9)
 
static const constexpr int16_t LINEAR_ACCELEROMETER_Q1 = 8
 Linear acceleration Q point (See SH-2 Ref. Manual 6.5.10)
 
static const constexpr int16_t GYRO_Q1 = 9
 Gyro Q point (See SH-2 Ref. Manual 6.5.13)
 
static const constexpr int16_t MAGNETOMETER_Q1 = 4
 Magnetometer Q point (See SH-2 Ref. Manual 6.5.16)
 
static const constexpr int16_t ANGULAR_VELOCITY_Q1 = 10
 Angular velocity Q point (See SH-2 Ref. Manual 6.5.44)
 
static const constexpr int16_t GRAVITY_Q1 = 8
 Gravity Q point (See SH-2 Ref. Manual 6.5.11)
 

Private Member Functions

bool wait_for_device_int ()
 Re-enables interrupts and waits for BNO08x to assert HINT pin.
 
bool receive_packet ()
 Receives a SHTP packet via SPI.
 
void send_packet ()
 Sends a queued SHTP packet via SPI.
 
void queue_packet (uint8_t channel_number, uint8_t data_length)
 Queues an SHTP packet to be sent via SPI.
 
void queue_command (uint8_t command)
 Queues a packet containing a command.
 
void queue_feature_command (uint8_t report_ID, uint16_t time_between_reports)
 Queues a packet containing a command with a request for sensor reports, reported periodically. (See Ref. Manual 6.5.4)
 
void queue_feature_command (uint8_t report_ID, uint16_t time_between_reports, uint32_t specific_config)
 Queues a packet containing a command with a request for sensor reports, reported periodically. (See Ref. Manual 6.5.4)
 
void queue_calibrate_command (uint8_t _to_calibrate)
 Queues a packet containing a command to calibrate the specified sensor.
 
void queue_tare_command (uint8_t command, uint8_t axis=TARE_AXIS_ALL, uint8_t rotation_vector_basis=TARE_ROTATION_VECTOR)
 Queues a packet containing a command related to zeroing sensor's axes. (See Ref. Manual 6.4.4.1)
 
void queue_request_product_id_command ()
 Queues a packet containing the request product ID command.
 
void spi_task ()
 Task responsible for SPI transactions. Executed when HINT in is asserted by BNO08x.
 

Static Private Member Functions

static void spi_task_trampoline (void *arg)
 Static function used to launch spi task.
 
static void IRAM_ATTR hint_handler (void *arg)
 HINT interrupt service routine, handles falling edge of BNO08x HINT pin.
 

Private Attributes

volatile uint8_t tx_packet_queued
 Whether or not a packet is currently waiting to be sent, a queued packet is sent on assertion of BNO08x HINT pin)
 
SemaphoreHandle_t tx_semaphore
 Mutex semaphore used to prevent sending or receiving of packets if packet is currently being queued.
 
SemaphoreHandle_t int_asserted_semaphore
 Binary semaphore used to synchronize spi_task() calling wait_for_device_int(), given after hint_handler ISR launches SPI task and it has run to completion.
 
uint8_t rx_buffer [300]
 buffer used to receive packet with receive_packet()
 
uint8_t tx_buffer [50]
 buffer used for sending packet with send_packet()
 
uint8_t packet_header_rx [4]
 SHTP header received with receive_packet()
 
uint8_t commands [20]
 Command to be sent with send_packet()
 
uint8_t sequence_number [6]
 Sequence num of each com channel, 6 in total.
 
uint32_t meta_data [9]
 First 9 bytes of meta data returned from FRS read operation (we don't really need the rest) (See Ref. Manual 5.1)
 
uint8_t command_sequence_number = 0
 Sequence num of command, sent within command packet.
 
uint16_t packet_length_tx = 0
 Packet length to be sent with send_packet()
 
uint16_t packet_length_rx = 0
 Packet length received (calculated from packet_header_rx)
 
bno08x_config_t imu_config {}
 IMU configuration settings.
 
spi_bus_config_t bus_config {}
 SPI bus GPIO configuration settings.
 
spi_device_interface_config_t imu_spi_config {}
 SPI slave device settings.
 
spi_device_handle_t spi_hdl {}
 SPI device handle.
 
spi_transaction_t spi_transaction {}
 SPI transaction handle.
 
uint32_t time_stamp
 Report timestamp (see datasheet 1.3.5.3)
 
uint16_t raw_accel_X
 
uint16_t raw_accel_Y
 
uint16_t raw_accel_Z
 
uint16_t accel_accuracy
 Raw acceleration readings (See SH-2 Ref. Manual 6.5.8)
 
uint16_t raw_lin_accel_X
 
uint16_t raw_lin_accel_Y
 
uint16_t raw_lin_accel_Z
 
uint16_t accel_lin_accuracy
 Raw linear acceleration (See SH-2 Ref. Manual 6.5.10)
 
uint16_t raw_gyro_X
 
uint16_t raw_gyro_Y
 
uint16_t raw_gyro_Z
 
uint16_t gyro_accuracy
 Raw gyro reading (See SH-2 Ref. Manual 6.5.13)
 
uint16_t raw_quat_I
 
uint16_t raw_quat_J
 
uint16_t raw_quat_K
 
uint16_t raw_quat_real
 
uint16_t raw_quat_radian_accuracy
 
uint16_t quat_accuracy
 Raw quaternion reading (See SH-2 Ref. Manual 6.5.44)
 
uint16_t raw_velocity_gyro_X
 
uint16_t raw_velocity_gyro_Y
 
uint16_t raw_velocity_gyro_Z
 Raw gyro angular velocity reading (See SH-2 Ref. Manual 6.5.44)
 
uint16_t gravity_X
 
uint16_t gravity_Y
 
uint16_t gravity_Z
 
uint16_t gravity_accuracy
 Gravity reading in m/s^2 (See SH-2 Ref. Manual 6.5.11)
 
uint16_t raw_uncalib_gyro_X
 
uint16_t raw_uncalib_gyro_Y
 
uint16_t raw_uncalib_gyro_Z
 
uint16_t raw_bias_X
 
uint16_t raw_bias_Y
 
uint16_t raw_bias_Z
 
uint16_t uncalib_gyro_accuracy
 Uncalibrated gyro reading (See SH-2 Ref. Manual 6.5.14)
 
uint16_t raw_magf_X
 
uint16_t raw_magf_Y
 
uint16_t raw_magf_Z
 
uint16_t magf_accuracy
 Calibrated magnetic field reading in uTesla (See SH-2 Ref. Manual 6.5.16)
 
uint8_t tap_detector
 Tap detector reading (See SH-2 Ref. Manual 6.5.27)
 
uint16_t step_count
 Step counter reading (See SH-2 Ref. Manual 6.5.29)
 
uint8_t stability_classifier
 Stability status reading (See SH-2 Ref. Manual 6.5.31)
 
uint8_t activity_classifier
 Activity status reading (See SH-2 Ref. Manual 6.5.36)
 
uint8_t * activity_confidences
 Confidence of read activities (See SH-2 Ref. Manual 6.5.36)
 
uint8_t calibration_status
 Calibration status of device (See SH-2 Ref. Manual 6.4.7.1 & 6.4.7.2)
 
uint16_t mems_raw_accel_X
 
uint16_t mems_raw_accel_Y
 
uint16_t mems_raw_accel_Z
 Raw accelerometer readings from MEMS sensor (See SH2 Ref. Manual 6.5.8)
 
uint16_t mems_raw_gyro_X
 
uint16_t mems_raw_gyro_Y
 
uint16_t mems_raw_gyro_Z
 Raw gyro readings from MEMS sensor (See SH-2 Ref. Manual 6.5.12)
 
uint16_t mems_raw_magf_X
 
uint16_t mems_raw_magf_Y
 
uint16_t mems_raw_magf_Z
 Raw magnetometer (compass) readings from MEMS sensor (See SH-2 Ref. Manual 6.5.15)
 
TaskHandle_t spi_task_hdl
 SPI task handle.
 

Static Private Attributes

static bno08x_config_t default_imu_config
 default imu config settings
 
static bool isr_service_installed = {false}
 true of the isr service has been installed, only has to be done once regardless of how many devices are used
 
static const constexpr uint64_t HOST_INT_TIMEOUT_MS
 Max wait between HINT being asserted by BNO08x before transaction is considered failed (in miliseconds)
 
static const constexpr uint8_t CALIBRATE_ACCEL = 0
 Calibrate accelerometer command used by queue_calibrate_command.
 
static const constexpr uint8_t CALIBRATE_GYRO = 1
 Calibrate gyro command used by queue_calibrate_command.
 
static const constexpr uint8_t CALIBRATE_MAG = 2
 Calibrate magnetometer command used by queue_calibrate_command.
 
static const constexpr uint8_t CALIBRATE_PLANAR_ACCEL = 3
 Calibrate planar acceleration command used by queue_calibrate_command.
 
static const constexpr uint8_t CALIBRATE_ACCEL_GYRO_MAG
 Calibrate accelerometer, gyro, & magnetometer command used by queue_calibrate_command.
 
static const constexpr uint8_t CALIBRATE_STOP = 5
 Stop calibration command used by queue_calibrate_command.
 
static const constexpr uint8_t COMMAND_ERRORS = 1
 
static const constexpr uint8_t COMMAND_COUNTER = 2
 
static const constexpr uint8_t COMMAND_TARE = 3
 Command and response to tare command (See Sh2 Ref. Manual 6.4.4)
 
static const constexpr uint8_t COMMAND_INITIALIZE = 4
 Reinitialize sensor hub components See (SH2 Ref. Manual 6.4.5)
 
static const constexpr uint8_t COMMAND_DCD = 6
 Save DCD command (See SH2 Ref. Manual 6.4.7)
 
static const constexpr uint8_t COMMAND_ME_CALIBRATE = 7
 Command and response to configure ME calibration (See SH2 Ref. Manual 6.4.7)
 
static const constexpr uint8_t COMMAND_DCD_PERIOD_SAVE = 9
 Configure DCD periodic saving (See SH2 Ref. Manual 6.4)
 
static const constexpr uint8_t COMMAND_OSCILLATOR = 10
 Retrieve oscillator type command (See SH2 Ref. Manual 6.4)
 
static const constexpr uint8_t COMMAND_CLEAR_DCD = 11
 Clear DCD & Reset command (See SH2 Ref. Manual 6.4)
 
static const constexpr uint8_t SHTP_REPORT_COMMAND_RESPONSE = 0xF1
 See SH2 Ref. Manual 6.3.9.
 
static const constexpr uint8_t SHTP_REPORT_COMMAND_REQUEST = 0xF2
 See SH2 Ref. Manual 6.3.8.
 
static const constexpr uint8_t SHTP_REPORT_FRS_READ_RESPONSE = 0xF3
 See SH2 Ref. Manual 6.3.7.
 
static const constexpr uint8_t SHTP_REPORT_FRS_READ_REQUEST = 0xF4
 See SH2 Ref. Manual 6.3.6.
 
static const constexpr uint8_t SHTP_REPORT_PRODUCT_ID_RESPONSE = 0xF8
 See SH2 Ref. Manual 6.3.2.
 
static const constexpr uint8_t SHTP_REPORT_PRODUCT_ID_REQUEST = 0xF9
 See SH2 Ref. Manual 6.3.1.
 
static const constexpr uint8_t SHTP_REPORT_BASE_TIMESTAMP = 0xFB
 See SH2 Ref. Manual 7.2.1.
 
static const constexpr uint8_t SHTP_REPORT_SET_FEATURE_COMMAND = 0xFD
 See SH2 Ref. Manual 6.5.4.
 
static const constexpr uint8_t SENSOR_REPORTID_ACCELEROMETER = 0x01
 See SH2 Ref. Manual 6.5.9.
 
static const constexpr uint8_t SENSOR_REPORTID_GYROSCOPE = 0x02
 See SH2 Ref. Manual 6.5.13.
 
static const constexpr uint8_t SENSOR_REPORTID_MAGNETIC_FIELD = 0x03
 See SH2 Ref. Manual 6.5.16.
 
static const constexpr uint8_t SENSOR_REPORTID_LINEAR_ACCELERATION = 0x04
 See SH2 Ref. Manual 6.5.10.
 
static const constexpr uint8_t SENSOR_REPORTID_ROTATION_VECTOR = 0x05
 See SH2 Ref. Manual 6.5.18.
 
static const constexpr uint8_t SENSOR_REPORTID_GRAVITY = 0x06
 See SH2 Ref. Manual 6.5.11.
 
static const constexpr uint8_t SENSOR_REPORTID_UNCALIBRATED_GYRO = 0x07
 See SH2 Ref. Manual 6.5.14.
 
static const constexpr uint8_t SENSOR_REPORTID_GAME_ROTATION_VECTOR = 0x08
 See SH2 Ref. Manual 6.5.19.
 
static const constexpr uint8_t SENSOR_REPORTID_GEOMAGNETIC_ROTATION_VECTOR = 0x09
 See SH2 Ref. Manual 6.5.20.
 
static const constexpr uint8_t SENSOR_REPORTID_GYRO_INTEGRATED_ROTATION_VECTOR = 0x2A
 See SH2 Ref. Manual 6.5.44.
 
static const constexpr uint8_t SENSOR_REPORTID_TAP_DETECTOR = 0x10
 See SH2 Ref. Manual 6.5.27.
 
static const constexpr uint8_t SENSOR_REPORTID_STEP_COUNTER = 0x11
 See SH2 Ref. Manual 6.5.29.
 
static const constexpr uint8_t SENSOR_REPORTID_STABILITY_CLASSIFIER = 0x13
 See SH2 Ref. Manual 6.5.31.
 
static const constexpr uint8_t SENSOR_REPORTID_RAW_ACCELEROMETER = 0x14
 See SH2 Ref. Manual 6.5.8.
 
static const constexpr uint8_t SENSOR_REPORTID_RAW_GYROSCOPE = 0x15
 See SH2 Ref. Manual 6.5.12.
 
static const constexpr uint8_t SENSOR_REPORTID_RAW_MAGNETOMETER = 0x16
 See SH2 Ref. Manual 6.5.15.
 
static const constexpr uint8_t SENSOR_REPORTID_PERSONAL_ACTIVITY_CLASSIFIER = 0x1E
 See SH2 Ref. Manual 6.5.36.
 
static const constexpr uint8_t SENSOR_REPORTID_AR_VR_STABILIZED_ROTATION_VECTOR = 0x28
 See SH2 Ref. Manual 6.5.42.
 
static const constexpr uint8_t SENSOR_REPORTID_AR_VR_STABILIZED_GAME_ROTATION_VECTOR = 0x29
 See SH2 Ref. Manual 6.5.43.
 
static const constexpr uint8_t TARE_NOW = 0
 See SH2 Ref. Manual 6.4.4.1.
 
static const constexpr uint8_t TARE_PERSIST = 1
 See SH2 Ref. Manual 6.4.4.2.
 
static const constexpr uint8_t TARE_SET_REORIENTATION = 2
 See SH2 Ref. Manual 6.4.4.3.
 
static const constexpr char * TAG = "BNO08x"
 Class tag used for serial print statements.
 

Constructor & Destructor Documentation

◆ BNO08x()

BNO08x::BNO08x ( bno08x_config_t imu_config = default_imu_config)

BNO08x imu constructor.

Construct a BNO08x object for managing a BNO08x sensor. Initializes required GPIO pins, interrupts, SPI peripheral, and local task for SPI transactions.

Parameters
imu_configConfiguration settings (optional), default settings can be seen in bno08x_config_t
Returns
void, nothing to return

Member Function Documentation

◆ calibrate_accelerometer()

void BNO08x::calibrate_accelerometer ( )

Sends command to calibrate accelerometer.

Returns
void, nothing to return

◆ calibrate_all()

void BNO08x::calibrate_all ( )

Sends command to calibrate accelerometer, gyro, and magnetometer.

Returns
void, nothing to return

◆ calibrate_gyro()

void BNO08x::calibrate_gyro ( )

Sends command to calibrate gyro.

Returns
void, nothing to return

◆ calibrate_magnetometer()

void BNO08x::calibrate_magnetometer ( )

Sends command to calibrate magnetometer.

Returns
void, nothing to return

◆ calibrate_planar_accelerometer()

void BNO08x::calibrate_planar_accelerometer ( )

Sends command to calibrate planar accelerometer.

Returns
void, nothing to return

◆ calibration_complete()

bool BNO08x::calibration_complete ( )

Returns true if calibration has completed.

Returns
void, nothing to return

◆ clear_tare()

void BNO08x::clear_tare ( )

Sends command to clear persistent tare settings in non-volatile memory of BNO08x (See Ref. Manual 6.4.4.3)

Returns
void, nothing to return

◆ data_available()

bool BNO08x::data_available ( )

Checks if BNO08x has asserted interrupt and sent data.

Returns
true if new data has been parsed and saved

◆ enable_accelerometer()

void BNO08x::enable_accelerometer ( uint16_t time_between_reports)

Sends command to enable accelerometer reports (See Ref. Manual 6.5.9)

Parameters
time_between_reportsDesired time between reports in miliseconds.
Returns
void, nothing to return

◆ enable_activity_classifier()

void BNO08x::enable_activity_classifier ( uint16_t time_between_reports,
uint32_t activities_to_enable,
uint8_t(&) activity_confidence_vals[9] )

Sends command to enable activity classifier reports (See Ref. Manual 6.5.36)

Parameters
time_between_reportsDesired time between reports in miliseconds.
activities_to_enableDesired activities to enable (0x1F enables all).
activity_confidence_valsReturned activity level confidences.
Returns
void, nothing to return

◆ enable_ARVR_stabilized_game_rotation_vector()

void BNO08x::enable_ARVR_stabilized_game_rotation_vector ( uint16_t time_between_reports)

Sends command to enable ARVR stabilized game rotation vector reports (See Ref. Manual 6.5.43)

Parameters
time_between_reportsDesired time between reports in miliseconds.
Returns
void, nothing to return

◆ enable_ARVR_stabilized_rotation_vector()

void BNO08x::enable_ARVR_stabilized_rotation_vector ( uint16_t time_between_reports)

Sends command to enable ARVR stabilized rotation vector reports (See Ref. Manual 6.5.42)

Parameters
time_between_reportsDesired time between reports in miliseconds.
Returns
void, nothing to return

◆ enable_game_rotation_vector()

void BNO08x::enable_game_rotation_vector ( uint16_t time_between_reports)

Sends command to enable game rotation vector reports (See Ref. Manual 6.5.19)

Parameters
time_between_reportsDesired time between reports in miliseconds.
Returns
void, nothing to return

◆ enable_gravity()

void BNO08x::enable_gravity ( uint16_t time_between_reports)

Sends command to enable gravity reading reports (See Ref. Manual 6.5.11)

Parameters
time_between_reportsDesired time between reports in miliseconds.
Returns
void, nothing to return

◆ enable_gyro()

void BNO08x::enable_gyro ( uint16_t time_between_reports)

Sends command to enable gyro reports (See Ref. Manual 6.5.13)

Parameters
time_between_reportsDesired time between reports in miliseconds.
Returns
void, nothing to return

◆ enable_gyro_integrated_rotation_vector()

void BNO08x::enable_gyro_integrated_rotation_vector ( uint16_t time_between_reports)

Sends command to enable gyro integrated rotation vector reports (See Ref. Manual 6.5.44)

Parameters
time_between_reportsDesired time between reports in miliseconds.
Returns
void, nothing to return

◆ enable_linear_accelerometer()

void BNO08x::enable_linear_accelerometer ( uint16_t time_between_reports)

Sends command to enable linear accelerometer reports (See Ref. Manual 6.5.10)

Parameters
time_between_reportsDesired time between reports in miliseconds.
Returns
void, nothing to return

◆ enable_magnetometer()

void BNO08x::enable_magnetometer ( uint16_t time_between_reports)

Sends command to enable magnetometer reports (See Ref. Manual 6.5.16)

Parameters
time_between_reportsDesired time between reports in miliseconds.
Returns
void, nothing to return

◆ enable_raw_accelerometer()

void BNO08x::enable_raw_accelerometer ( uint16_t time_between_reports)

Sends command to enable raw accelerometer reports (See Ref. Manual 6.5.8)

Parameters
time_between_reportsDesired time between reports in miliseconds.
Returns
void, nothing to return

◆ enable_raw_gyro()

void BNO08x::enable_raw_gyro ( uint16_t time_between_reports)

Sends command to enable raw gyro reports (See Ref. Manual 6.5.12)

Parameters
time_between_reportsDesired time between reports in miliseconds.
Returns
void, nothing to return

◆ enable_raw_magnetometer()

void BNO08x::enable_raw_magnetometer ( uint16_t time_between_reports)

Sends command to enable raw magnetometer reports (See Ref. Manual 6.5.15)

Parameters
time_between_reportsDesired time between reports in miliseconds.
Returns
void, nothing to return

◆ enable_rotation_vector()

void BNO08x::enable_rotation_vector ( uint16_t time_between_reports)

Sends command to enable rotation vector reports (See Ref. Manual 6.5.18)

Parameters
time_between_reportsDesired time between reports in miliseconds.
Returns
void, nothing to return

◆ enable_stability_classifier()

void BNO08x::enable_stability_classifier ( uint16_t time_between_reports)

Sends command to enable activity stability classifier reports (See Ref. Manual 6.5.31)

Parameters
time_between_reportsDesired time between reports in miliseconds.
Returns
void, nothing to return

◆ enable_step_counter()

void BNO08x::enable_step_counter ( uint16_t time_between_reports)

Sends command to enable step counter reports (See Ref. Manual 6.5.29)

Parameters
time_between_reportsDesired time between reports in miliseconds.
Returns
void, nothing to return

◆ enable_tap_detector()

void BNO08x::enable_tap_detector ( uint16_t time_between_reports)

Sends command to enable tap detector reports (See Ref. Manual 6.5.27)

Parameters
time_between_reportsDesired time between reports in miliseconds.
Returns
void, nothing to return

◆ enable_uncalibrated_gyro()

void BNO08x::enable_uncalibrated_gyro ( uint16_t time_between_reports)

Sends command to enable uncalibrated gyro reports (See Ref. Manual 6.5.14)

Parameters
time_between_reportsDesired time between reports in miliseconds.
Returns
void, nothing to return

◆ end_calibration()

void BNO08x::end_calibration ( )

Sends command to end calibration procedure.

Returns
void, nothing to return

◆ FRS_read_data()

bool BNO08x::FRS_read_data ( uint16_t record_ID,
uint8_t start_location,
uint8_t words_to_read )

Read meta data from BNO08x FRS (flash record system) given the record ID. Contains Q points and other info. (See Ref. Manual 5.1 & 6.3.7)

Note that Q points from the data sheet can be used as well, using the ones stored in flash is optional.

Parameters
record_IDWhich record ID/ sensor to request meta data from.
start_locationStart byte location.
words_to_readLength of words to read.
Returns
True if meta data read successfully.

◆ FRS_read_request()

bool BNO08x::FRS_read_request ( uint16_t record_ID,
uint16_t read_offset,
uint16_t block_size )

Requests meta data from BNO08x FRS (flash record system) given the record ID. Contains Q points and other info. (See Ref. Manual 5.1 & 6.3.6)

Note that Q points from the data sheet can be used as well, using the ones stored in flash is optional.

Parameters
record_IDWhich record ID/ sensor to request meta data from.
start_locationStart byte location.
words_to_readLength of words to read.
Returns
True if read request acknowledged (HINT was asserted)

◆ FRS_read_word()

uint32_t BNO08x::FRS_read_word ( uint16_t record_ID,
uint8_t word_number )

Reads meta data word from BNO08x FRS (flash record system) given the record ID and word number. (See Ref. Manual 5.1 & 6.3.7)

Note that Q points from the data sheet can be used as well, using the ones stored in flash is optional.

Parameters
record_IDWhich record ID/ sensor to request meta data from.
word_numberDesired word to read.
Returns
Requested meta data word, 0 if failed.

◆ get_accel()

void BNO08x::get_accel ( float & x,
float & y,
float & z,
uint8_t & accuracy )

Get full acceleration (total acceleration of device, units in m/s^2).

Parameters
xReference variable to save X axis acceleration.
yReference variable to save Y axis acceleration.
zReference variable to save Z axis acceleration.
accuracyReference variable to save reported acceleration accuracy.
Returns
void, nothing to return

◆ get_accel_accuracy()

uint8_t BNO08x::get_accel_accuracy ( )

Get accuracy of linear acceleration.

Returns
Accuracy of linear acceleration.

◆ get_accel_X()

float BNO08x::get_accel_X ( )

Get x axis acceleration (total acceleration of device, units in m/s^2).

Returns
The angular reported x axis acceleration.

◆ get_accel_Y()

float BNO08x::get_accel_Y ( )

Get y axis acceleration (total acceleration of device, units in m/s^2).

Returns
The angular reported y axis acceleration.

◆ get_accel_Z()

float BNO08x::get_accel_Z ( )

Get z axis acceleration (total acceleration of device, units in m/s^2).

Returns
The angular reported z axis acceleration.

◆ get_activity_classifier()

uint8_t BNO08x::get_activity_classifier ( )

Get the current activity classifier (Seee Ref. Manual 6.5.36)

Returns
The current activity: 0 = unknown 1 = in vehicle 2 = on bicycle 3 = on foot 4 = still 5 = tilting 6 = walking 7 = runnning 8 = on stairs

◆ get_gravity()

void BNO08x::get_gravity ( float & x,
float & y,
float & z,
uint8_t & accuracy )

Get full reported gravity vector, units in m/s^2.

Parameters
xReference variable to save X axis gravity.
yReference variable to save Y axis axis gravity.
zReference variable to save Z axis axis gravity.
accuracyReference variable to save reported gravity accuracy.
Returns
void, nothing to return

◆ get_gravity_accuracy()

uint8_t BNO08x::get_gravity_accuracy ( )

Get the reported gravity accuracy.

Returns
Accuracy of reported gravity.

◆ get_gravity_X()

float BNO08x::get_gravity_X ( )

Get the reported x axis gravity.

Returns
x axis gravity in m/s^2

◆ get_gravity_Y()

float BNO08x::get_gravity_Y ( )

Get the reported y axis gravity.

Returns
y axis gravity in m/s^2

◆ get_gravity_Z()

float BNO08x::get_gravity_Z ( )

Get the reported z axis gravity.

Returns
z axis gravity in m/s^2

◆ get_gyro_accuracy()

uint8_t BNO08x::get_gyro_accuracy ( )

Get calibrated gyro accuracy.

Returns
Accuracy of calibrated gyro.

◆ get_gyro_calibrated_velocity()

void BNO08x::get_gyro_calibrated_velocity ( float & x,
float & y,
float & z,
uint8_t & accuracy )

Get full rotational velocity with drift compensation (units in Rad/s).

Parameters
xReference variable to save X axis angular velocity
yReference variable to save Y axis angular velocity
zReference variable to save Z axis angular velocity
accuracyReference variable to save reported gyro accuracy.
Returns
void, nothing to return

◆ get_gyro_calibrated_velocity_X()

float BNO08x::get_gyro_calibrated_velocity_X ( )

Get calibrated gyro x axis angular velocity measurement.

Returns
The angular reported x axis angular velocity from calibrated gyro (drift compensation applied).

◆ get_gyro_calibrated_velocity_Y()

float BNO08x::get_gyro_calibrated_velocity_Y ( )

Get calibrated gyro y axis angular velocity measurement.

Returns
The angular reported y axis angular velocity from calibrated gyro (drift compensation applied).

◆ get_gyro_calibrated_velocity_Z()

float BNO08x::get_gyro_calibrated_velocity_Z ( )

Get calibrated gyro z axis angular velocity measurement.

Returns
The angular reported z axis angular velocity from calibrated gyro (drift compensation applied).

◆ get_gyro_velocity()

void BNO08x::get_gyro_velocity ( float & x,
float & y,
float & z )

Full rotational velocity from gyro-integrated rotation vector (See Ref. Manual 6.5.44)

Parameters
xReference variable to save X axis angular velocity
yReference variable to save Y axis angular velocity
zReference variable to save Z axis angular velocity
Returns
void, nothing to return

◆ get_gyro_velocity_X()

float BNO08x::get_gyro_velocity_X ( )

Get x axis angular velocity from gyro-integrated rotation vector. (See Ref. Manual 6.5.44)

Returns
The reported x axis angular velocity.

◆ get_gyro_velocity_Y()

float BNO08x::get_gyro_velocity_Y ( )

Get y axis angular velocity from gyro-integrated rotation vector. (See Ref. Manual 6.5.44)

Returns
The reported y axis angular velocity.

◆ get_gyro_velocity_Z()

float BNO08x::get_gyro_velocity_Z ( )

Get z axis angular velocity from gyro-integrated rotation vector. (See Ref. Manual 6.5.44)

Returns
The reported Z axis angular velocity.

◆ get_linear_accel()

void BNO08x::get_linear_accel ( float & x,
float & y,
float & z,
uint8_t & accuracy )

Get full linear acceleration (acceleration of the device minus gravity, units in m/s^2).

Parameters
xReference variable to save X axis acceleration.
yReference variable to save Y axis acceleration.
zReference variable to save Z axis acceleration.
accuracyReference variable to save reported linear acceleration accuracy.
Returns
void, nothing to return

◆ get_linear_accel_accuracy()

uint8_t BNO08x::get_linear_accel_accuracy ( )

Get accuracy of linear acceleration.

Returns
Accuracy of linear acceleration.

◆ get_linear_accel_X()

float BNO08x::get_linear_accel_X ( )

Get x axis linear acceleration (acceleration of device minus gravity, units in m/s^2)

Returns
The angular reported x axis linear acceleration.

◆ get_linear_accel_Y()

float BNO08x::get_linear_accel_Y ( )

Get y axis linear acceleration (acceleration of device minus gravity, units in m/s^2)

Returns
The angular reported y axis linear acceleration.

◆ get_linear_accel_Z()

float BNO08x::get_linear_accel_Z ( )

Get z axis linear acceleration (acceleration of device minus gravity, units in m/s^2)

Returns
The angular reported z axis linear acceleration.

◆ get_magf()

void BNO08x::get_magf ( float & x,
float & y,
float & z,
uint8_t & accuracy )

Get the full magnetic field vector.

Parameters
xReference variable to save reported x magnitude.
yReference variable to save reported y magnitude.
xReference variable to save reported z magnitude.
accuracyReference variable save reported accuracy.
Returns
void, nothing to return

◆ get_magf_accuracy()

uint8_t BNO08x::get_magf_accuracy ( )

Get accuracy of reported magnetic field vector.

Returns
The accuracy of reported magnetic field vector.

◆ get_magf_X()

float BNO08x::get_magf_X ( )

Get X component of magnetic field vector.

Returns
The reported X component of magnetic field vector.

◆ get_magf_Y()

float BNO08x::get_magf_Y ( )

Get Y component of magnetic field vector.

Returns
The reported Y component of magnetic field vector.

◆ get_magf_Z()

float BNO08x::get_magf_Z ( )

Get Z component of magnetic field vector.

Returns
The reported Z component of magnetic field vector.

◆ get_pitch()

float BNO08x::get_pitch ( )

Get the reported rotation about y axis.

Returns
Rotation about the y axis in radians.

◆ get_pitch_deg()

float BNO08x::get_pitch_deg ( )

Get the reported rotation about y axis.

Returns
Rotation about the y axis in degrees.

◆ get_Q1()

int16_t BNO08x::get_Q1 ( uint16_t record_ID)

Gets Q1 point from BNO08x FRS (flash record system).

Note that Q points from the data sheet can be used as well, using the ones stored in flash is optional.

Parameters
record_IDWhich record ID/ sensor to get Q1 value for.
Returns
Q1 value for requested sensor.

◆ get_Q2()

int16_t BNO08x::get_Q2 ( uint16_t record_ID)

Gets Q2 point from BNO08x FRS (flash record system).

Note that Q points from the data sheet can be used as well, using the ones stored in flash is optional.

Parameters
record_IDWhich record ID/ sensor to get Q2 value for.
Returns
Q2 value for requested sensor.

◆ get_Q3()

int16_t BNO08x::get_Q3 ( uint16_t record_ID)

Gets Q3 point from BNO08x FRS (flash record system).

Note that Q points from the data sheet can be used as well, using the ones stored in flash is optional.

Parameters
record_IDWhich record ID/ sensor to get Q3 value for.
Returns
Q3 value for requested sensor.

◆ get_quat()

void BNO08x::get_quat ( float & i,
float & j,
float & k,
float & real,
float & rad_accuracy,
uint8_t & accuracy )

Get the full quaternion reading.

Parameters
iReference variable to save reported i component of quaternion.
jReference variable to save reported j component of quaternion.
kReference variable to save reported k component of quaternion.
realReference variable to save reported real component of quaternion.
rad_accuracyReference variable to save reported raw quaternion radian accuracy.
accuracyReference variable to save reported quaternion accuracy.
Returns
void, nothing to return

◆ get_quat_accuracy()

uint8_t BNO08x::get_quat_accuracy ( )

Get accuracy of reported quaternion.

Returns
The accuracy of reported quaternion.

◆ get_quat_I()

float BNO08x::get_quat_I ( )

Get I component of reported quaternion.

Returns
The I component of reported quaternion.

◆ get_quat_J()

float BNO08x::get_quat_J ( )

Get J component of reported quaternion.

Returns
The J component of reported quaternion.

◆ get_quat_K()

float BNO08x::get_quat_K ( )

Get K component of reported quaternion.

Returns
The K component of reported quaternion.

◆ get_quat_radian_accuracy()

float BNO08x::get_quat_radian_accuracy ( )

Get radian accuracy of reported quaternion.

Returns
The radian accuracy of reported quaternion.

◆ get_quat_real()

float BNO08x::get_quat_real ( )

Get real component of reported quaternion.

Returns
The real component of reported quaternion.

◆ get_range()

float BNO08x::get_range ( uint16_t record_ID)

Gets range from BNO08x FRS (flash record system).

Parameters
record_IDWhich record ID/ sensor to get range value for.
Returns
The range value for the requested sensor.

◆ get_raw_accel_X()

int16_t BNO08x::get_raw_accel_X ( )

Get raw accelerometer x axis reading from physical accelerometer MEMs sensor (See Ref. Manual 6.5.8)

Returns
Reported raw accelerometer x axis reading from physical MEMs sensor.

◆ get_raw_accel_Y()

int16_t BNO08x::get_raw_accel_Y ( )

Get raw accelerometer y axis reading from physical accelerometer MEMs sensor (See Ref. Manual 6.5.8)

Returns
Reported raw accelerometer y axis reading from physical MEMs sensor.

◆ get_raw_accel_Z()

int16_t BNO08x::get_raw_accel_Z ( )

Get raw accelerometer z axis reading from physical accelerometer MEMs sensor (See Ref. Manual 6.5.8)

Returns
Reported raw accelerometer z axis reading from physical MEMs sensor.

◆ get_raw_gyro_X()

int16_t BNO08x::get_raw_gyro_X ( )

Get raw gyroscope x axis reading from physical gyroscope MEMs sensor (See Ref. Manual 6.5.12)

Returns
Reported raw gyroscope x axis reading from physical MEMs sensor.

◆ get_raw_gyro_Y()

int16_t BNO08x::get_raw_gyro_Y ( )

Get raw gyroscope y axis reading from physical gyroscope MEMs sensor (See Ref. Manual 6.5.12)

Returns
Reported raw gyroscope y axis reading from physical MEMs sensor.

◆ get_raw_gyro_Z()

int16_t BNO08x::get_raw_gyro_Z ( )

Get raw gyroscope z axis reading from physical gyroscope MEMs sensor (See Ref. Manual 6.5.12)

Returns
Reported raw gyroscope z axis reading from physical MEMs sensor.

◆ get_raw_magf_X()

int16_t BNO08x::get_raw_magf_X ( )

Get raw magnetometer x axis reading from physical magnetometer sensor (See Ref. Manual 6.5.15)

Returns
Reported raw magnetometer x axis reading from physical magnetometer sensor.

◆ get_raw_magf_Y()

int16_t BNO08x::get_raw_magf_Y ( )

Get raw magnetometer y axis reading from physical magnetometer sensor (See Ref. Manual 6.5.15)

Returns
Reported raw magnetometer y axis reading from physical magnetometer sensor.

◆ get_raw_magf_Z()

int16_t BNO08x::get_raw_magf_Z ( )

Get raw magnetometer z axis reading from physical magnetometer sensor (See Ref. Manual 6.5.15)

Returns
Reported raw magnetometer z axis reading from physical magnetometer sensor.

◆ get_readings()

uint16_t BNO08x::get_readings ( )

Waits for BNO08x HINT pin to assert, and parses the received data.

Returns
void, nothing to return

◆ get_reset_reason()

uint8_t BNO08x::get_reset_reason ( )

Get the reason for the most recent reset.

Returns
The reason for the most recent recent reset ( 1 = POR (power on reset), 2 = internal reset, 3 = watchdog timer, 4 = external reset 5 = other)

◆ get_resolution()

float BNO08x::get_resolution ( uint16_t record_ID)

Gets resolution from BNO08x FRS (flash record system).

Parameters
record_IDWhich record ID/ sensor to get resolution value for.
Returns
The resolution value for the requested sensor.

◆ get_roll()

float BNO08x::get_roll ( )

Get the reported rotation about x axis.

Returns
Rotation about the x axis in radians.

◆ get_roll_deg()

float BNO08x::get_roll_deg ( )

Get the reported rotation about x axis.

Returns
Rotation about the x axis in degrees.

◆ get_stability_classifier()

int8_t BNO08x::get_stability_classifier ( )

Get the current stability classifier (Seee Ref. Manual 6.5.31)

Returns
The current stability (0 = unknown, 1 = on table, 2 = stationary)

◆ get_step_count()

uint16_t BNO08x::get_step_count ( )

Get the counted amount of steps.

Returns
The current amount of counted steps.

◆ get_tap_detector()

uint8_t BNO08x::get_tap_detector ( )

Get if tap has occured.

Returns
7 bit tap code indicated which axis taps have occurred. (See Ref. Manual 6.5.27)

◆ get_time_stamp()

uint32_t BNO08x::get_time_stamp ( )

Return timestamp of most recent report.

Returns
void, nothing to return

◆ get_uncalibrated_gyro()

void BNO08x::get_uncalibrated_gyro ( float & x,
float & y,
float & z,
float & b_x,
float & b_y,
float & b_z,
uint8_t & accuracy )

Get full rotational velocity without drift compensation (units in Rad/s). An estimate of drift is given but not applied.

Parameters
xReference variable to save X axis angular velocity
yReference variable to save Y axis angular velocity
zReference variable to save Z axis angular velocity
b_xReference variable to save X axis drift estimate
b_yReference variable to save Y axis drift estimate
b_zReference variable to save Z axis drift estimate
accuracyReference variable to save reported gyro accuracy.
Returns
void, nothing to return

◆ get_uncalibrated_gyro_accuracy()

uint8_t BNO08x::get_uncalibrated_gyro_accuracy ( )

Get uncalibrated gyro accuracy.

Returns
Accuracy of uncalibrated gyro.

◆ get_uncalibrated_gyro_bias_X()

float BNO08x::get_uncalibrated_gyro_bias_X ( )

Get uncalibrated gyro x axis drift estimate.

Returns
The angular reported x axis drift estimate.

◆ get_uncalibrated_gyro_bias_Y()

float BNO08x::get_uncalibrated_gyro_bias_Y ( )

Get uncalibrated gyro Y axis drift estimate.

Returns
The angular reported Y axis drift estimate.

◆ get_uncalibrated_gyro_bias_Z()

float BNO08x::get_uncalibrated_gyro_bias_Z ( )

Get uncalibrated gyro Z axis drift estimate.

Returns
The angular reported Z axis drift estimate.

◆ get_uncalibrated_gyro_X()

float BNO08x::get_uncalibrated_gyro_X ( )

Get uncalibrated gyro x axis angular velocity measurement.

Returns
The angular reported x axis angular velocity from uncalibrated gyro.

◆ get_uncalibrated_gyro_Y()

float BNO08x::get_uncalibrated_gyro_Y ( )

Get uncalibrated gyro Y axis angular velocity measurement.

Returns
The angular reported Y axis angular velocity from uncalibrated gyro.

◆ get_uncalibrated_gyro_Z()

float BNO08x::get_uncalibrated_gyro_Z ( )

Get uncalibrated gyro Z axis angular velocity measurement.

Returns
The angular reported Z axis angular velocity from uncalibrated gyro.

◆ get_yaw()

float BNO08x::get_yaw ( )

Get the reported rotation about z axis.

Returns
Rotation about the z axis in radians.

◆ get_yaw_deg()

float BNO08x::get_yaw_deg ( )

Get the reported rotation about z axis.

Returns
Rotation about the z axis in degrees.

◆ hard_reset()

bool BNO08x::hard_reset ( )

Hard resets BNO08x sensor.

Returns
void, nothing to return

◆ hint_handler()

void IRAM_ATTR BNO08x::hint_handler ( void * arg)
staticprivate

HINT interrupt service routine, handles falling edge of BNO08x HINT pin.

ISR that launches SPI task to perform transaction upon assertion of BNO08x interrupt pin.

Returns
void, nothing to return

◆ initialize()

bool BNO08x::initialize ( )

Initializes BNO08x sensor.

Resets sensor and goes through initializing process outlined in BNO08x datasheet.

Returns
void, nothing to return

◆ mode_on()

bool BNO08x::mode_on ( )

Turns on/ brings BNO08x sensor out of sleep mode using executable channel.

Returns
True if exiting sleep mode was success.

◆ mode_sleep()

bool BNO08x::mode_sleep ( )

Puts BNO08x sensor into sleep/low power mode using executable channel.

Returns
True if entering sleep mode was success.

◆ parse_command_report()

uint16_t BNO08x::parse_command_report ( )

Parses received command report sent by BNO08x (See Ref. Manual 6.3.9)

Returns
The command report ID, 0 if invalid.

◆ parse_input_report()

uint16_t BNO08x::parse_input_report ( )

Parses received input report sent by BNO08x.

Unit responds with packet that contains the following:

packet_header_rx[0:3]: First, a 4 byte header rx_buffer[0:4]: Then a 5 byte timestamp of microsecond ticks since reading was taken rx_buffer[5 + 0]: Then a feature report ID (0x01 for Accel, 0x05 for Rotation Vector, etc...) rx_buffer[5 + 1]: Sequence number (See Ref.Manual 6.5.8.2) rx_buffer[5 + 2]: Status rx_buffer[3]: Delay rx_buffer[4:5]: i/accel x/gyro x/etc rx_buffer[6:7]: j/accel y/gyro y/etc rx_buffer[8:9]: k/accel z/gyro z/etc rx_buffer[10:11]: real/gyro temp/etc rx_buffer[12:13]: Accuracy estimate

Returns
void, nothing to return

◆ print_header()

void BNO08x::print_header ( )

Prints the most recently received SHTP header to serial console with ESP_LOG statement.

Returns
void, nothing to return

◆ print_packet()

void BNO08x::print_packet ( )

◆ q_to_float()

float BNO08x::q_to_float ( int16_t fixed_point_value,
uint8_t q_point )

Converts a register value to a float using its associated Q point. (See https://en.wikipedia.org/wiki/Q_(number_format))

Parameters
q_pointQ point value associated with register.
fixed_point_valueThe fixed point value to convert.
Returns
void, nothing to return

◆ queue_calibrate_command()

void BNO08x::queue_calibrate_command ( uint8_t sensor_to_calibrate)
private

Queues a packet containing a command to calibrate the specified sensor.

Parameters
sensor_to_calibrateThe sensor to calibrate.
Returns
void, nothing to return

◆ queue_command()

void BNO08x::queue_command ( uint8_t command)
private

Queues a packet containing a command.

Parameters
commandThe command to be sent.
Returns
void, nothing to return

◆ queue_feature_command() [1/2]

void BNO08x::queue_feature_command ( uint8_t report_ID,
uint16_t time_between_reports )
private

Queues a packet containing a command with a request for sensor reports, reported periodically. (See Ref. Manual 6.5.4)

Parameters
report_IDID of sensor report being requested.
time_between_reportsDesired time between reports.
Returns
void, nothing to return

◆ queue_feature_command() [2/2]

void BNO08x::queue_feature_command ( uint8_t report_ID,
uint16_t time_between_reports,
uint32_t specific_config )
private

Queues a packet containing a command with a request for sensor reports, reported periodically. (See Ref. Manual 6.5.4)

Parameters
report_IDID of sensor report to be enabled.
time_between_reportsDesired time between reports in miliseconds.
specific_configSpecific config word (used with personal activity classifier)
Returns
void, nothing to return

◆ queue_packet()

void BNO08x::queue_packet ( uint8_t channel_number,
uint8_t data_length )
private

Queues an SHTP packet to be sent via SPI.

Returns
void, nothing to return

◆ queue_request_product_id_command()

void BNO08x::queue_request_product_id_command ( )
private

Queues a packet containing the request product ID command.

Returns
void, nothing to return

◆ queue_tare_command()

void BNO08x::queue_tare_command ( uint8_t command,
uint8_t axis = TARE_AXIS_ALL,
uint8_t rotation_vector_basis = TARE_ROTATION_VECTOR )
private

Queues a packet containing a command related to zeroing sensor's axes. (See Ref. Manual 6.4.4.1)

Parameters
commandTare command to be sent.
axisSpecified axis (can be z or all at once)
rotation_vector_basisWhich rotation vector type to zero axes of, BNO08x saves seperate data for Rotation Vector, Gaming Rotation Vector, etc..)
Returns
void, nothing to return

◆ receive_packet()

bool BNO08x::receive_packet ( )
private

Receives a SHTP packet via SPI.

Returns
void, nothing to return

◆ request_calibration_status()

void BNO08x::request_calibration_status ( )

Requests ME calibration status from BNO08x (see Ref. Manual 6.4.7.2)

Returns
void, nothing to return

◆ run_full_calibration_routine()

bool BNO08x::run_full_calibration_routine ( )

Runs full calibration routine.

Enables game rotation vector and magnetometer, starts ME calibration process. Waits for accuracy of returned quaternions and magnetic field vectors to be high, then saves calibration data and returns.

Returns
void, nothing to return

◆ save_calibration()

void BNO08x::save_calibration ( )

Sends command to save internal calibration data (See Ref. Manual 6.4.7).

Returns
void, nothing to return

◆ save_tare()

void BNO08x::save_tare ( )

Sends command to save tare into non-volatile memory of BNO08x (See Ref. Manual 6.4.4.2)

Returns
void, nothing to return

◆ send_packet()

void BNO08x::send_packet ( )
private

Sends a queued SHTP packet via SPI.

Returns
void, nothing to return

◆ soft_reset()

bool BNO08x::soft_reset ( )

Soft resets BNO08x sensor using executable channel.

Returns
True if reset was success.

◆ spi_task()

void BNO08x::spi_task ( )
private

Task responsible for SPI transactions. Executed when HINT in is asserted by BNO08x.

Returns
void, nothing to return

◆ spi_task_trampoline()

void BNO08x::spi_task_trampoline ( void * arg)
staticprivate

Static function used to launch spi task.

Used such that spi_task() can be non-static class member.

Returns
void, nothing to return

◆ tare_now()

void BNO08x::tare_now ( uint8_t axis_sel = TARE_AXIS_ALL,
uint8_t rotation_vector_basis = TARE_ROTATION_VECTOR )

Sends command to tare an axis (See Ref. Manual 6.4.4.1)

Parameters
axis_selWhich axes to zero, can be TARE_AXIS_ALL (all axes) or TARE_AXIS_Z (only yaw)
rotation_vector_basisWhich rotation vector type to zero axes can be TARE_ROTATION_VECTOR, TARE_GAME_ROTATION_VECTOR, TARE_GEOMAGNETIC_ROTATION_VECTOR, etc..
Returns
void, nothing to return

◆ wait_for_device_int()

bool BNO08x::wait_for_device_int ( )
private

Re-enables interrupts and waits for BNO08x to assert HINT pin.

Returns
void, nothing to return

Member Data Documentation

◆ accel_accuracy

uint16_t BNO08x::accel_accuracy
private

Raw acceleration readings (See SH-2 Ref. Manual 6.5.8)

◆ accel_lin_accuracy

uint16_t BNO08x::accel_lin_accuracy
private

Raw linear acceleration (See SH-2 Ref. Manual 6.5.10)

◆ ACCELEROMETER_Q1

const constexpr int16_t BNO08x::ACCELEROMETER_Q1 = 8
staticconstexpr

Acceleration Q point (See SH-2 Ref. Manual 6.5.9)

◆ activity_classifier

uint8_t BNO08x::activity_classifier
private

Activity status reading (See SH-2 Ref. Manual 6.5.36)

◆ activity_confidences

uint8_t* BNO08x::activity_confidences
private

Confidence of read activities (See SH-2 Ref. Manual 6.5.36)

◆ ANGULAR_VELOCITY_Q1

const constexpr int16_t BNO08x::ANGULAR_VELOCITY_Q1 = 10
staticconstexpr

Angular velocity Q point (See SH-2 Ref. Manual 6.5.44)

◆ bus_config

spi_bus_config_t BNO08x::bus_config {}
private

SPI bus GPIO configuration settings.

◆ CALIBRATE_ACCEL

const constexpr uint8_t BNO08x::CALIBRATE_ACCEL = 0
staticconstexprprivate

Calibrate accelerometer command used by queue_calibrate_command.

◆ CALIBRATE_ACCEL_GYRO_MAG

const constexpr uint8_t BNO08x::CALIBRATE_ACCEL_GYRO_MAG
staticconstexprprivate
Initial value:
=
4

Calibrate accelerometer, gyro, & magnetometer command used by queue_calibrate_command.

◆ CALIBRATE_GYRO

const constexpr uint8_t BNO08x::CALIBRATE_GYRO = 1
staticconstexprprivate

Calibrate gyro command used by queue_calibrate_command.

◆ CALIBRATE_MAG

const constexpr uint8_t BNO08x::CALIBRATE_MAG = 2
staticconstexprprivate

Calibrate magnetometer command used by queue_calibrate_command.

◆ CALIBRATE_PLANAR_ACCEL

const constexpr uint8_t BNO08x::CALIBRATE_PLANAR_ACCEL = 3
staticconstexprprivate

Calibrate planar acceleration command used by queue_calibrate_command.

◆ CALIBRATE_STOP

const constexpr uint8_t BNO08x::CALIBRATE_STOP = 5
staticconstexprprivate

Stop calibration command used by queue_calibrate_command.

◆ calibration_status

uint8_t BNO08x::calibration_status
private

Calibration status of device (See SH-2 Ref. Manual 6.4.7.1 & 6.4.7.2)

◆ COMMAND_CLEAR_DCD

const constexpr uint8_t BNO08x::COMMAND_CLEAR_DCD = 11
staticconstexprprivate

Clear DCD & Reset command (See SH2 Ref. Manual 6.4)

◆ COMMAND_COUNTER

const constexpr uint8_t BNO08x::COMMAND_COUNTER = 2
staticconstexprprivate

◆ COMMAND_DCD

const constexpr uint8_t BNO08x::COMMAND_DCD = 6
staticconstexprprivate

Save DCD command (See SH2 Ref. Manual 6.4.7)

◆ COMMAND_DCD_PERIOD_SAVE

const constexpr uint8_t BNO08x::COMMAND_DCD_PERIOD_SAVE = 9
staticconstexprprivate

Configure DCD periodic saving (See SH2 Ref. Manual 6.4)

◆ COMMAND_ERRORS

const constexpr uint8_t BNO08x::COMMAND_ERRORS = 1
staticconstexprprivate

◆ COMMAND_INITIALIZE

const constexpr uint8_t BNO08x::COMMAND_INITIALIZE = 4
staticconstexprprivate

Reinitialize sensor hub components See (SH2 Ref. Manual 6.4.5)

◆ COMMAND_ME_CALIBRATE

const constexpr uint8_t BNO08x::COMMAND_ME_CALIBRATE = 7
staticconstexprprivate

Command and response to configure ME calibration (See SH2 Ref. Manual 6.4.7)

◆ COMMAND_OSCILLATOR

const constexpr uint8_t BNO08x::COMMAND_OSCILLATOR = 10
staticconstexprprivate

Retrieve oscillator type command (See SH2 Ref. Manual 6.4)

◆ command_sequence_number

uint8_t BNO08x::command_sequence_number = 0
private

Sequence num of command, sent within command packet.

◆ COMMAND_TARE

const constexpr uint8_t BNO08x::COMMAND_TARE = 3
staticconstexprprivate

Command and response to tare command (See Sh2 Ref. Manual 6.4.4)

◆ commands

uint8_t BNO08x::commands[20]
private

Command to be sent with send_packet()

◆ default_imu_config

bno08x_config_t BNO08x::default_imu_config
staticprivate

default imu config settings

◆ FRS_RECORDID_ACCELEROMETER

const constexpr uint16_t BNO08x::FRS_RECORDID_ACCELEROMETER = 0xE302
staticconstexpr

◆ FRS_RECORDID_GYROSCOPE_CALIBRATED

const constexpr uint16_t BNO08x::FRS_RECORDID_GYROSCOPE_CALIBRATED = 0xE306
staticconstexpr

◆ FRS_RECORDID_MAGNETIC_FIELD_CALIBRATED

const constexpr uint16_t BNO08x::FRS_RECORDID_MAGNETIC_FIELD_CALIBRATED = 0xE309
staticconstexpr

◆ FRS_RECORDID_ROTATION_VECTOR

const constexpr uint16_t BNO08x::FRS_RECORDID_ROTATION_VECTOR = 0xE30B
staticconstexpr

◆ gravity_accuracy

uint16_t BNO08x::gravity_accuracy
private

Gravity reading in m/s^2 (See SH-2 Ref. Manual 6.5.11)

◆ GRAVITY_Q1

const constexpr int16_t BNO08x::GRAVITY_Q1 = 8
staticconstexpr

Gravity Q point (See SH-2 Ref. Manual 6.5.11)

◆ gravity_X

uint16_t BNO08x::gravity_X
private

◆ gravity_Y

uint16_t BNO08x::gravity_Y
private

◆ gravity_Z

uint16_t BNO08x::gravity_Z
private

◆ gyro_accuracy

uint16_t BNO08x::gyro_accuracy
private

Raw gyro reading (See SH-2 Ref. Manual 6.5.13)

◆ GYRO_Q1

const constexpr int16_t BNO08x::GYRO_Q1 = 9
staticconstexpr

Gyro Q point (See SH-2 Ref. Manual 6.5.13)

◆ HOST_INT_TIMEOUT_MS

const constexpr uint64_t BNO08x::HOST_INT_TIMEOUT_MS
staticconstexprprivate
Initial value:
=
150ULL

Max wait between HINT being asserted by BNO08x before transaction is considered failed (in miliseconds)

◆ imu_config

bno08x_config_t BNO08x::imu_config {}
private

IMU configuration settings.

◆ imu_spi_config

spi_device_interface_config_t BNO08x::imu_spi_config {}
private

SPI slave device settings.

◆ int_asserted_semaphore

SemaphoreHandle_t BNO08x::int_asserted_semaphore
private

Binary semaphore used to synchronize spi_task() calling wait_for_device_int(), given after hint_handler ISR launches SPI task and it has run to completion.

◆ isr_service_installed

bool BNO08x::isr_service_installed = {false}
staticprivate

true of the isr service has been installed, only has to be done once regardless of how many devices are used

◆ LINEAR_ACCELEROMETER_Q1

const constexpr int16_t BNO08x::LINEAR_ACCELEROMETER_Q1 = 8
staticconstexpr

Linear acceleration Q point (See SH-2 Ref. Manual 6.5.10)

◆ magf_accuracy

uint16_t BNO08x::magf_accuracy
private

Calibrated magnetic field reading in uTesla (See SH-2 Ref. Manual 6.5.16)

◆ MAGNETOMETER_Q1

const constexpr int16_t BNO08x::MAGNETOMETER_Q1 = 4
staticconstexpr

Magnetometer Q point (See SH-2 Ref. Manual 6.5.16)

◆ mems_raw_accel_X

uint16_t BNO08x::mems_raw_accel_X
private

◆ mems_raw_accel_Y

uint16_t BNO08x::mems_raw_accel_Y
private

◆ mems_raw_accel_Z

uint16_t BNO08x::mems_raw_accel_Z
private

Raw accelerometer readings from MEMS sensor (See SH2 Ref. Manual 6.5.8)

◆ mems_raw_gyro_X

uint16_t BNO08x::mems_raw_gyro_X
private

◆ mems_raw_gyro_Y

uint16_t BNO08x::mems_raw_gyro_Y
private

◆ mems_raw_gyro_Z

uint16_t BNO08x::mems_raw_gyro_Z
private

Raw gyro readings from MEMS sensor (See SH-2 Ref. Manual 6.5.12)

◆ mems_raw_magf_X

uint16_t BNO08x::mems_raw_magf_X
private

◆ mems_raw_magf_Y

uint16_t BNO08x::mems_raw_magf_Y
private

◆ mems_raw_magf_Z

uint16_t BNO08x::mems_raw_magf_Z
private

Raw magnetometer (compass) readings from MEMS sensor (See SH-2 Ref. Manual 6.5.15)

◆ meta_data

uint32_t BNO08x::meta_data[9]
private

First 9 bytes of meta data returned from FRS read operation (we don't really need the rest) (See Ref. Manual 5.1)

◆ packet_header_rx

uint8_t BNO08x::packet_header_rx[4]
private

SHTP header received with receive_packet()

◆ packet_length_rx

uint16_t BNO08x::packet_length_rx = 0
private

Packet length received (calculated from packet_header_rx)

◆ packet_length_tx

uint16_t BNO08x::packet_length_tx = 0
private

Packet length to be sent with send_packet()

◆ quat_accuracy

uint16_t BNO08x::quat_accuracy
private

Raw quaternion reading (See SH-2 Ref. Manual 6.5.44)

◆ raw_accel_X

uint16_t BNO08x::raw_accel_X
private

◆ raw_accel_Y

uint16_t BNO08x::raw_accel_Y
private

◆ raw_accel_Z

uint16_t BNO08x::raw_accel_Z
private

◆ raw_bias_X

uint16_t BNO08x::raw_bias_X
private

◆ raw_bias_Y

uint16_t BNO08x::raw_bias_Y
private

◆ raw_bias_Z

uint16_t BNO08x::raw_bias_Z
private

◆ raw_gyro_X

uint16_t BNO08x::raw_gyro_X
private

◆ raw_gyro_Y

uint16_t BNO08x::raw_gyro_Y
private

◆ raw_gyro_Z

uint16_t BNO08x::raw_gyro_Z
private

◆ raw_lin_accel_X

uint16_t BNO08x::raw_lin_accel_X
private

◆ raw_lin_accel_Y

uint16_t BNO08x::raw_lin_accel_Y
private

◆ raw_lin_accel_Z

uint16_t BNO08x::raw_lin_accel_Z
private

◆ raw_magf_X

uint16_t BNO08x::raw_magf_X
private

◆ raw_magf_Y

uint16_t BNO08x::raw_magf_Y
private

◆ raw_magf_Z

uint16_t BNO08x::raw_magf_Z
private

◆ raw_quat_I

uint16_t BNO08x::raw_quat_I
private

◆ raw_quat_J

uint16_t BNO08x::raw_quat_J
private

◆ raw_quat_K

uint16_t BNO08x::raw_quat_K
private

◆ raw_quat_radian_accuracy

uint16_t BNO08x::raw_quat_radian_accuracy
private

◆ raw_quat_real

uint16_t BNO08x::raw_quat_real
private

◆ raw_uncalib_gyro_X

uint16_t BNO08x::raw_uncalib_gyro_X
private

◆ raw_uncalib_gyro_Y

uint16_t BNO08x::raw_uncalib_gyro_Y
private

◆ raw_uncalib_gyro_Z

uint16_t BNO08x::raw_uncalib_gyro_Z
private

◆ raw_velocity_gyro_X

uint16_t BNO08x::raw_velocity_gyro_X
private

◆ raw_velocity_gyro_Y

uint16_t BNO08x::raw_velocity_gyro_Y
private

◆ raw_velocity_gyro_Z

uint16_t BNO08x::raw_velocity_gyro_Z
private

Raw gyro angular velocity reading (See SH-2 Ref. Manual 6.5.44)

◆ ROTATION_VECTOR_ACCURACY_Q1

const constexpr int16_t BNO08x::ROTATION_VECTOR_ACCURACY_Q1 = 12
staticconstexpr

Rotation vector accuracy estimate Q point (See SH-2 Ref. Manual 6.5.18)

◆ ROTATION_VECTOR_Q1

const constexpr int16_t BNO08x::ROTATION_VECTOR_Q1 = 14
staticconstexpr

Rotation vector Q point (See SH-2 Ref. Manual 6.5.18)

◆ rx_buffer

uint8_t BNO08x::rx_buffer[300]
private

buffer used to receive packet with receive_packet()

◆ SENSOR_REPORTID_ACCELEROMETER

const constexpr uint8_t BNO08x::SENSOR_REPORTID_ACCELEROMETER = 0x01
staticconstexprprivate

See SH2 Ref. Manual 6.5.9.

◆ SENSOR_REPORTID_AR_VR_STABILIZED_GAME_ROTATION_VECTOR

const constexpr uint8_t BNO08x::SENSOR_REPORTID_AR_VR_STABILIZED_GAME_ROTATION_VECTOR = 0x29
staticconstexprprivate

See SH2 Ref. Manual 6.5.43.

◆ SENSOR_REPORTID_AR_VR_STABILIZED_ROTATION_VECTOR

const constexpr uint8_t BNO08x::SENSOR_REPORTID_AR_VR_STABILIZED_ROTATION_VECTOR = 0x28
staticconstexprprivate

See SH2 Ref. Manual 6.5.42.

◆ SENSOR_REPORTID_GAME_ROTATION_VECTOR

const constexpr uint8_t BNO08x::SENSOR_REPORTID_GAME_ROTATION_VECTOR = 0x08
staticconstexprprivate

See SH2 Ref. Manual 6.5.19.

◆ SENSOR_REPORTID_GEOMAGNETIC_ROTATION_VECTOR

const constexpr uint8_t BNO08x::SENSOR_REPORTID_GEOMAGNETIC_ROTATION_VECTOR = 0x09
staticconstexprprivate

See SH2 Ref. Manual 6.5.20.

◆ SENSOR_REPORTID_GRAVITY

const constexpr uint8_t BNO08x::SENSOR_REPORTID_GRAVITY = 0x06
staticconstexprprivate

See SH2 Ref. Manual 6.5.11.

◆ SENSOR_REPORTID_GYRO_INTEGRATED_ROTATION_VECTOR

const constexpr uint8_t BNO08x::SENSOR_REPORTID_GYRO_INTEGRATED_ROTATION_VECTOR = 0x2A
staticconstexprprivate

See SH2 Ref. Manual 6.5.44.

◆ SENSOR_REPORTID_GYROSCOPE

const constexpr uint8_t BNO08x::SENSOR_REPORTID_GYROSCOPE = 0x02
staticconstexprprivate

See SH2 Ref. Manual 6.5.13.

◆ SENSOR_REPORTID_LINEAR_ACCELERATION

const constexpr uint8_t BNO08x::SENSOR_REPORTID_LINEAR_ACCELERATION = 0x04
staticconstexprprivate

See SH2 Ref. Manual 6.5.10.

◆ SENSOR_REPORTID_MAGNETIC_FIELD

const constexpr uint8_t BNO08x::SENSOR_REPORTID_MAGNETIC_FIELD = 0x03
staticconstexprprivate

See SH2 Ref. Manual 6.5.16.

◆ SENSOR_REPORTID_PERSONAL_ACTIVITY_CLASSIFIER

const constexpr uint8_t BNO08x::SENSOR_REPORTID_PERSONAL_ACTIVITY_CLASSIFIER = 0x1E
staticconstexprprivate

See SH2 Ref. Manual 6.5.36.

◆ SENSOR_REPORTID_RAW_ACCELEROMETER

const constexpr uint8_t BNO08x::SENSOR_REPORTID_RAW_ACCELEROMETER = 0x14
staticconstexprprivate

See SH2 Ref. Manual 6.5.8.

◆ SENSOR_REPORTID_RAW_GYROSCOPE

const constexpr uint8_t BNO08x::SENSOR_REPORTID_RAW_GYROSCOPE = 0x15
staticconstexprprivate

See SH2 Ref. Manual 6.5.12.

◆ SENSOR_REPORTID_RAW_MAGNETOMETER

const constexpr uint8_t BNO08x::SENSOR_REPORTID_RAW_MAGNETOMETER = 0x16
staticconstexprprivate

See SH2 Ref. Manual 6.5.15.

◆ SENSOR_REPORTID_ROTATION_VECTOR

const constexpr uint8_t BNO08x::SENSOR_REPORTID_ROTATION_VECTOR = 0x05
staticconstexprprivate

See SH2 Ref. Manual 6.5.18.

◆ SENSOR_REPORTID_STABILITY_CLASSIFIER

const constexpr uint8_t BNO08x::SENSOR_REPORTID_STABILITY_CLASSIFIER = 0x13
staticconstexprprivate

See SH2 Ref. Manual 6.5.31.

◆ SENSOR_REPORTID_STEP_COUNTER

const constexpr uint8_t BNO08x::SENSOR_REPORTID_STEP_COUNTER = 0x11
staticconstexprprivate

See SH2 Ref. Manual 6.5.29.

◆ SENSOR_REPORTID_TAP_DETECTOR

const constexpr uint8_t BNO08x::SENSOR_REPORTID_TAP_DETECTOR = 0x10
staticconstexprprivate

See SH2 Ref. Manual 6.5.27.

◆ SENSOR_REPORTID_UNCALIBRATED_GYRO

const constexpr uint8_t BNO08x::SENSOR_REPORTID_UNCALIBRATED_GYRO = 0x07
staticconstexprprivate

See SH2 Ref. Manual 6.5.14.

◆ sequence_number

uint8_t BNO08x::sequence_number[6]
private

Sequence num of each com channel, 6 in total.

◆ SHTP_REPORT_BASE_TIMESTAMP

const constexpr uint8_t BNO08x::SHTP_REPORT_BASE_TIMESTAMP = 0xFB
staticconstexprprivate

See SH2 Ref. Manual 7.2.1.

◆ SHTP_REPORT_COMMAND_REQUEST

const constexpr uint8_t BNO08x::SHTP_REPORT_COMMAND_REQUEST = 0xF2
staticconstexprprivate

See SH2 Ref. Manual 6.3.8.

◆ SHTP_REPORT_COMMAND_RESPONSE

const constexpr uint8_t BNO08x::SHTP_REPORT_COMMAND_RESPONSE = 0xF1
staticconstexprprivate

See SH2 Ref. Manual 6.3.9.

◆ SHTP_REPORT_FRS_READ_REQUEST

const constexpr uint8_t BNO08x::SHTP_REPORT_FRS_READ_REQUEST = 0xF4
staticconstexprprivate

See SH2 Ref. Manual 6.3.6.

◆ SHTP_REPORT_FRS_READ_RESPONSE

const constexpr uint8_t BNO08x::SHTP_REPORT_FRS_READ_RESPONSE = 0xF3
staticconstexprprivate

See SH2 Ref. Manual 6.3.7.

◆ SHTP_REPORT_PRODUCT_ID_REQUEST

const constexpr uint8_t BNO08x::SHTP_REPORT_PRODUCT_ID_REQUEST = 0xF9
staticconstexprprivate

See SH2 Ref. Manual 6.3.1.

◆ SHTP_REPORT_PRODUCT_ID_RESPONSE

const constexpr uint8_t BNO08x::SHTP_REPORT_PRODUCT_ID_RESPONSE = 0xF8
staticconstexprprivate

See SH2 Ref. Manual 6.3.2.

◆ SHTP_REPORT_SET_FEATURE_COMMAND

const constexpr uint8_t BNO08x::SHTP_REPORT_SET_FEATURE_COMMAND = 0xFD
staticconstexprprivate

See SH2 Ref. Manual 6.5.4.

◆ spi_hdl

spi_device_handle_t BNO08x::spi_hdl {}
private

SPI device handle.

◆ spi_task_hdl

TaskHandle_t BNO08x::spi_task_hdl
private

SPI task handle.

◆ spi_transaction

spi_transaction_t BNO08x::spi_transaction {}
private

SPI transaction handle.

◆ stability_classifier

uint8_t BNO08x::stability_classifier
private

Stability status reading (See SH-2 Ref. Manual 6.5.31)

◆ step_count

uint16_t BNO08x::step_count
private

Step counter reading (See SH-2 Ref. Manual 6.5.29)

◆ TAG

const constexpr char* BNO08x::TAG = "BNO08x"
staticconstexprprivate

Class tag used for serial print statements.

◆ tap_detector

uint8_t BNO08x::tap_detector
private

Tap detector reading (See SH-2 Ref. Manual 6.5.27)

◆ TARE_AR_VR_STABILIZED_GAME_ROTATION_VECTOR

const constexpr uint8_t BNO08x::TARE_AR_VR_STABILIZED_GAME_ROTATION_VECTOR = 5
staticconstexpr

Tare ARVR stabilized game rotation vector.

◆ TARE_AR_VR_STABILIZED_ROTATION_VECTOR

const constexpr uint8_t BNO08x::TARE_AR_VR_STABILIZED_ROTATION_VECTOR = 4
staticconstexpr

Tare ARVR stabilized rotation vector.

◆ TARE_AXIS_ALL

const constexpr uint8_t BNO08x::TARE_AXIS_ALL = 0x07
staticconstexpr

Tare all axes (used with tare now command)

◆ TARE_AXIS_Z

const constexpr uint8_t BNO08x::TARE_AXIS_Z = 0x04
staticconstexpr

Tar yaw axis only (used with tare now command)

◆ TARE_GAME_ROTATION_VECTOR

const constexpr uint8_t BNO08x::TARE_GAME_ROTATION_VECTOR = 1
staticconstexpr

Tare game rotation vector.

◆ TARE_GEOMAGNETIC_ROTATION_VECTOR

const constexpr uint8_t BNO08x::TARE_GEOMAGNETIC_ROTATION_VECTOR = 2
staticconstexpr

tare geomagnetic rotation vector

◆ TARE_GYRO_INTEGRATED_ROTATION_VECTOR

const constexpr uint8_t BNO08x::TARE_GYRO_INTEGRATED_ROTATION_VECTOR = 3
staticconstexpr

Tare gyro integrated rotation vector.

◆ TARE_NOW

const constexpr uint8_t BNO08x::TARE_NOW = 0
staticconstexprprivate

See SH2 Ref. Manual 6.4.4.1.

◆ TARE_PERSIST

const constexpr uint8_t BNO08x::TARE_PERSIST = 1
staticconstexprprivate

See SH2 Ref. Manual 6.4.4.2.

◆ TARE_ROTATION_VECTOR

const constexpr uint8_t BNO08x::TARE_ROTATION_VECTOR = 0
staticconstexpr

Tare rotation vector.

◆ TARE_SET_REORIENTATION

const constexpr uint8_t BNO08x::TARE_SET_REORIENTATION = 2
staticconstexprprivate

See SH2 Ref. Manual 6.4.4.3.

◆ time_stamp

uint32_t BNO08x::time_stamp
private

Report timestamp (see datasheet 1.3.5.3)

◆ tx_buffer

uint8_t BNO08x::tx_buffer[50]
private

buffer used for sending packet with send_packet()

◆ tx_packet_queued

volatile uint8_t BNO08x::tx_packet_queued
private

Whether or not a packet is currently waiting to be sent, a queued packet is sent on assertion of BNO08x HINT pin)

◆ tx_semaphore

SemaphoreHandle_t BNO08x::tx_semaphore
private

Mutex semaphore used to prevent sending or receiving of packets if packet is currently being queued.

◆ uncalib_gyro_accuracy

uint16_t BNO08x::uncalib_gyro_accuracy
private

Uncalibrated gyro reading (See SH-2 Ref. Manual 6.5.14)


The documentation for this class was generated from the following files: