-
2#include <driver/gpio.h>
-
3#include <driver/spi_common.h>
-
4#include <driver/spi_master.h>
-
-
6#include <esp_rom_gpio.h>
-
-
8#include <freertos/FreeRTOS.h>
-
9#include <freertos/semphr.h>
-
10#include <freertos/task.h>
-
11#include <rom/ets_sys.h>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
51#ifdef ESP32C3_IMU_CONFIG
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
115 float q_to_float(int16_t fixed_point_value, uint8_t q_point);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
142 void enable_activity_classifier(uint32_t time_between_reports, uint32_t activities_to_enable, uint8_t (&activity_confidence_vals)[9]);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
177 void get_magf(
float& x,
float& y,
float& z, uint8_t& accuracy);
-
-
-
-
-
-
183 void get_gravity(
float& x,
float& y,
float& z, uint8_t& accuracy);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
197 void get_quat(
float& i,
float& j,
float& k,
float& real,
float& rad_accuracy, uint8_t& accuracy);
-
-
-
-
-
-
-
-
205 void get_accel(
float& x,
float& y,
float& z, uint8_t& accuracy);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
235 void get_uncalibrated_gyro(
float& x,
float& y,
float& z,
float& bx,
float& by,
float& bz, uint8_t& accuracy);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
258 int16_t
get_Q1(uint16_t record_ID);
-
259 int16_t
get_Q2(uint16_t record_ID);
-
260 int16_t
get_Q3(uint16_t record_ID);
-
-
-
263 uint32_t
FRS_read_word(uint16_t record_ID, uint8_t word_number);
-
264 bool FRS_read_request(uint16_t record_ID, uint16_t read_offset, uint16_t block_size);
-
265 bool FRS_read_data(uint16_t record_ID, uint8_t start_location, uint8_t words_to_read);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
298 void queue_packet(uint8_t channel_number, uint8_t data_length);
-
-
-
301 void queue_feature_command(uint8_t report_ID, uint32_t time_between_reports, uint32_t specific_config);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
425 static const constexpr char*
TAG =
"BNO08x";
-
-
-
struct bno08x_config_t bno08x_config_t
IMU configuration settings passed into constructor.
-
channels_t
SHTP protocol channels.
Definition BNO08x.hpp:20
-
@ CHANNEL_COMMAND
Definition BNO08x.hpp:21
-
@ CHANNEL_REPORTS
Definition BNO08x.hpp:24
-
@ CHANNEL_CONTROL
Definition BNO08x.hpp:23
-
@ CHANNEL_EXECUTABLE
Definition BNO08x.hpp:22
-
@ CHANNEL_WAKE_REPORTS
Definition BNO08x.hpp:25
-
@ CHANNEL_GYRO
Definition BNO08x.hpp:26
-
IMUAccuracy
Sensor accuracy returned during sensor calibration.
Definition BNO08x.hpp:31
-
-
-
-
Definition BNO08x.hpp:104
-
static const constexpr uint8_t SENSOR_REPORTID_PERSONAL_ACTIVITY_CLASSIFIER
See SH2 Ref. Manual 6.5.36.
Definition BNO08x.hpp:416
-
static const constexpr uint8_t SHTP_REPORT_PRODUCT_ID_RESPONSE
See SH2 Ref. Manual 6.3.2.
Definition BNO08x.hpp:394
-
void enable_gravity(uint32_t time_between_reports)
Sends command to enable gravity reading reports (See Ref. Manual 6.5.11)
Definition BNO08x.cpp:1086
-
uint16_t raw_quat_radian_accuracy
Definition BNO08x.hpp:334
-
uint16_t raw_gyro_Z
Definition BNO08x.hpp:333
-
static const constexpr int16_t ACCELEROMETER_Q1
Acceleration Q point (See SH-2 Ref. Manual 6.5.9)
Definition BNO08x.hpp:287
-
uint16_t uncalib_gyro_accuracy
Uncalibrated gyro reading (See SH-2 Ref. Manual 6.5.14)
Definition BNO08x.hpp:341
-
void print_header()
Prints the most recently received SHTP header to serial console with ESP_LOG statement.
Definition BNO08x.cpp:2287
-
uint16_t raw_bias_Z
Definition BNO08x.hpp:340
-
static const constexpr uint8_t SENSOR_REPORTID_AR_VR_STABILIZED_GAME_ROTATION_VECTOR
See SH2 Ref. Manual 6.5.43.
Definition BNO08x.hpp:418
-
static const constexpr uint8_t COMMAND_TARE
Command and response to tare command (See Sh2 Ref. Manual 6.4.4)
Definition BNO08x.hpp:381
-
float get_accel_Z()
Get z axis acceleration (total acceleration of device, units in m/s^2).
Definition BNO08x.cpp:1869
-
float get_uncalibrated_gyro_Z()
Get uncalibrated gyro Z axis angular velocity measurement.
Definition BNO08x.cpp:2140
-
static const constexpr int16_t ROTATION_VECTOR_Q1
Rotation vector Q point (See SH-2 Ref. Manual 6.5.18)
Definition BNO08x.hpp:285
-
static void spi_task_trampoline(void *arg)
Static function used to launch spi task.
Definition BNO08x.cpp:2624
-
int8_t get_stability_classifier()
Get the current stability classifier (Seee Ref. Manual 6.5.31)
Definition BNO08x.cpp:2258
-
void send_packet()
Sends a queued SHTP packet via SPI.
Definition BNO08x.cpp:408
-
void print_packet()
Definition BNO08x.cpp:2308
-
float get_range(uint16_t record_ID)
Gets range from BNO08x FRS (flash record system).
Definition BNO08x.cpp:2419
-
float get_linear_accel_Y()
Get y axis linear acceleration (acceleration of device minus gravity, units in m/s^2)
Definition BNO08x.cpp:1917
-
float get_magf_X()
Get X component of magnetic field vector.
Definition BNO08x.cpp:1530
-
static const constexpr uint8_t TARE_PERSIST
See SH2 Ref. Manual 6.4.4.2.
Definition BNO08x.hpp:422
-
uint8_t tap_detector
Tap detector reading (See SH-2 Ref. Manual 6.5.27)
Definition BNO08x.hpp:344
-
uint8_t get_reset_reason()
Get the reason for the most recent reset.
Definition BNO08x.cpp:263
-
float get_quat_I()
Get I component of reported quaternion.
Definition BNO08x.cpp:1766
-
void enable_raw_magnetometer(uint32_t time_between_reports)
Sends command to enable raw magnetometer reports (See Ref. Manual 6.5.15)
Definition BNO08x.cpp:1219
-
int16_t get_Q3(uint16_t record_ID)
Gets Q3 point from BNO08x FRS (flash record system).
Definition BNO08x.cpp:2389
-
float get_gyro_calibrated_velocity_Z()
Get calibrated gyro z axis angular velocity measurement.
Definition BNO08x.cpp:2075
-
void disable_tap_detector()
Sends command to disable tap detector reports by setting report interval to 0.
Definition BNO08x.cpp:1363
-
void disable_raw_accelerometer()
Sends command to disable raw accelerometer reports by setting report interval to 0.
Definition BNO08x.cpp:1411
-
void queue_command(uint8_t command)
Queues a packet containing a command.
Definition BNO08x.cpp:429
-
bool mode_sleep()
Puts BNO08x sensor into sleep/low power mode using executable channel.
Definition BNO08x.cpp:309
-
float get_uncalibrated_gyro_Y()
Get uncalibrated gyro Y axis angular velocity measurement.
Definition BNO08x.cpp:2130
-
uint16_t raw_gyro_X
Definition BNO08x.hpp:333
-
uint8_t stability_classifier
Stability status reading (See SH-2 Ref. Manual 6.5.31)
Definition BNO08x.hpp:346
-
float get_pitch()
Get the reported rotation about y axis.
Definition BNO08x.cpp:1658
-
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 giv...
Definition BNO08x.cpp:2104
-
void calibrate_planar_accelerometer()
Sends command to calibrate planar accelerometer.
Definition BNO08x.cpp:503
-
static const constexpr uint8_t SHTP_REPORT_SET_FEATURE_COMMAND
See SH2 Ref. Manual 6.5.4.
Definition BNO08x.hpp:397
-
float get_resolution(uint16_t record_ID)
Gets resolution from BNO08x FRS (flash record system).
Definition BNO08x.cpp:2402
-
int16_t get_raw_accel_X()
Get raw accelerometer x axis reading from physical accelerometer MEMs sensor (See Ref....
Definition BNO08x.cpp:1947
-
static const constexpr uint8_t SHTP_REPORT_COMMAND_RESPONSE
See SH2 Ref. Manual 6.3.9.
Definition BNO08x.hpp:390
-
void disable_rotation_vector()
Sends command to disable rotation vector reports by setting report interval to 0.
Definition BNO08x.cpp:1231
-
static const constexpr uint8_t TARE_AXIS_ALL
Tare all axes (used with tare now command)
Definition BNO08x.hpp:274
-
static const constexpr uint8_t TARE_GEOMAGNETIC_ROTATION_VECTOR
tare geomagnetic rotation vector
Definition BNO08x.hpp:280
-
uint8_t get_quat_accuracy()
Get accuracy of reported quaternion.
Definition BNO08x.cpp:1821
-
static const constexpr uint8_t SENSOR_REPORTID_AR_VR_STABILIZED_ROTATION_VECTOR
See SH2 Ref. Manual 6.5.42.
Definition BNO08x.hpp:417
-
void enable_accelerometer(uint32_t time_between_reports)
Sends command to enable accelerometer reports (See Ref. Manual 6.5.9)
Definition BNO08x.cpp:1060
-
static const constexpr uint8_t TARE_NOW
See SH2 Ref. Manual 6.4.4.1.
Definition BNO08x.hpp:421
-
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....
Definition BNO08x.cpp:2440
-
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....
Definition BNO08x.cpp:1490
-
float get_uncalibrated_gyro_X()
Get uncalibrated gyro x axis angular velocity measurement.
Definition BNO08x.cpp:2120
-
bool hard_reset()
Hard resets BNO08x sensor.
Definition BNO08x.cpp:215
-
static const constexpr uint8_t SENSOR_REPORTID_GYROSCOPE
See SH2 Ref. Manual 6.5.13.
Definition BNO08x.hpp:401
-
int16_t get_raw_magf_Y()
Get raw magnetometer y axis reading from physical magnetometer sensor (See Ref. Manual 6....
Definition BNO08x.cpp:2017
-
static const constexpr char * TAG
Class tag used for serial print statements.
Definition BNO08x.hpp:425
-
int16_t get_raw_gyro_Z()
Get raw gyroscope z axis reading from physical gyroscope MEMs sensor (See Ref. Manual 6....
Definition BNO08x.cpp:1997
-
void spi_task()
Task responsible for SPI transactions. Executed when HINT in is asserted by BNO08x.
Definition BNO08x.cpp:2635
-
void enable_raw_accelerometer(uint32_t time_between_reports)
Sends command to enable raw accelerometer reports (See Ref. Manual 6.5.8)
Definition BNO08x.cpp:1193
-
static const constexpr uint8_t COMMAND_OSCILLATOR
Retrieve oscillator type command (See SH2 Ref. Manual 6.4)
Definition BNO08x.hpp:386
-
static const constexpr uint8_t COMMAND_INITIALIZE
Reinitialize sensor hub components See (SH2 Ref. Manual 6.4.5)
Definition BNO08x.hpp:382
-
static const constexpr uint8_t TARE_AR_VR_STABILIZED_ROTATION_VECTOR
Tare ARVR stabilized rotation vector.
Definition BNO08x.hpp:282
-
uint8_t get_uncalibrated_gyro_accuracy()
Get uncalibrated gyro accuracy.
Definition BNO08x.cpp:2180
-
uint16_t accel_accuracy
Raw acceleration readings (See SH-2 Ref. Manual 6.5.8)
Definition BNO08x.hpp:330
-
SemaphoreHandle_t int_asserted_semaphore
Binary semaphore used to synchronize spi_task() calling wait_for_device_int(), given after hint_handl...
Definition BNO08x.hpp:310
-
uint8_t get_linear_accel_accuracy()
Get accuracy of linear acceleration.
Definition BNO08x.cpp:1937
-
void get_magf(float &x, float &y, float &z, uint8_t &accuracy)
Get the full magnetic field vector.
Definition BNO08x.cpp:1517
-
uint16_t accel_lin_accuracy
Raw linear acceleration (See SH-2 Ref. Manual 6.5.10)
Definition BNO08x.hpp:332
-
uint16_t quat_accuracy
Raw quaternion reading (See SH-2 Ref. Manual 6.5.44)
Definition BNO08x.hpp:335
-
bool data_available()
Checks if BNO08x has asserted interrupt and sent data.
Definition BNO08x.cpp:718
-
uint16_t parse_command_report()
Parses received command report sent by BNO08x (See Ref. Manual 6.3.9)
Definition BNO08x.cpp:965
-
static const constexpr uint8_t COMMAND_ERRORS
Definition BNO08x.hpp:379
-
void get_gravity(float &x, float &y, float &z, uint8_t &accuracy)
Get full reported gravity vector, units in m/s^2.
Definition BNO08x.cpp:1578
-
void enable_magnetometer(uint32_t time_between_reports)
Sends command to enable magnetometer reports (See Ref. Manual 6.5.16)
Definition BNO08x.cpp:1125
-
uint16_t mems_raw_gyro_X
Definition BNO08x.hpp:352
-
uint8_t get_accel_accuracy()
Get accuracy of linear acceleration.
Definition BNO08x.cpp:1879
-
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...
Definition BNO08x.cpp:2490
-
BNO08x(bno08x_config_t imu_config=default_imu_config)
BNO08x imu constructor.
Definition BNO08x.cpp:15
-
spi_device_interface_config_t imu_spi_config
SPI slave device settings.
Definition BNO08x.hpp:323
-
void disable_step_counter()
Sends command to disable step counter reports by setting report interval to 0.
Definition BNO08x.cpp:1375
-
static const constexpr uint8_t SENSOR_REPORTID_TAP_DETECTOR
See SH2 Ref. Manual 6.5.27.
Definition BNO08x.hpp:410
-
int16_t get_Q1(uint16_t record_ID)
Gets Q1 point from BNO08x FRS (flash record system).
Definition BNO08x.cpp:2359
-
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)
Definition BNO08x.cpp:1450
-
static const constexpr uint8_t SENSOR_REPORTID_ACCELEROMETER
See SH2 Ref. Manual 6.5.9.
Definition BNO08x.hpp:400
-
uint8_t get_tap_detector()
Get if tap has occured.
Definition BNO08x.cpp:2236
-
uint8_t get_magf_accuracy()
Get accuracy of reported magnetic field vector.
Definition BNO08x.cpp:1563
-
static bool isr_service_installed
true of the isr service has been installed, only has to be done once regardless of how many devices a...
Definition BNO08x.hpp:3
-
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....
Definition BNO08x.cpp:2588
-
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).
Definition BNO08x.cpp:2042
-
uint16_t raw_velocity_gyro_Y
Definition BNO08x.hpp:336
-
static const constexpr uint8_t COMMAND_CLEAR_DCD
Clear DCD & Reset command (See SH2 Ref. Manual 6.4)
Definition BNO08x.hpp:387
-
uint8_t get_activity_classifier()
Get the current activity classifier (Seee Ref. Manual 6.5.36)
Definition BNO08x.cpp:2277
-
void disable_activity_classifier()
Sends command to disable activity classifier reports by setting report interval to 0.
Definition BNO08x.cpp:1399
-
float get_uncalibrated_gyro_bias_Z()
Get uncalibrated gyro Z axis drift estimate.
Definition BNO08x.cpp:2170
-
void get_quat(float &i, float &j, float &k, float &real, float &rad_accuracy, uint8_t &accuracy)
Get the full quaternion reading.
Definition BNO08x.cpp:1751
-
static const constexpr uint8_t SENSOR_REPORTID_LINEAR_ACCELERATION
See SH2 Ref. Manual 6.5.10.
Definition BNO08x.hpp:403
-
static const constexpr uint8_t SHTP_REPORT_PRODUCT_ID_REQUEST
See SH2 Ref. Manual 6.3.1.
Definition BNO08x.hpp:395
-
float get_gravity_Z()
Get the reported z axis gravity.
Definition BNO08x.cpp:1611
-
void enable_ARVR_stabilized_game_rotation_vector(uint32_t time_between_reports)
Sends command to enable ARVR stabilized game rotation vector reports (See Ref. Manual 6....
Definition BNO08x.cpp:1034
-
static const constexpr uint8_t CALIBRATE_STOP
Stop calibration command used by queue_calibrate_command.
Definition BNO08x.hpp:376
-
static const constexpr uint16_t FRS_RECORDID_ROTATION_VECTOR
Definition BNO08x.hpp:272
-
uint16_t mems_raw_accel_Z
Raw accelerometer readings from MEMS sensor (See SH2 Ref. Manual 6.5.8)
Definition BNO08x.hpp:351
-
static const constexpr uint8_t TARE_SET_REORIENTATION
See SH2 Ref. Manual 6.4.4.3.
Definition BNO08x.hpp:423
-
void enable_step_counter(uint32_t time_between_reports)
Sends command to enable step counter reports (See Ref. Manual 6.5.29)
Definition BNO08x.cpp:1151
-
float get_quat_real()
Get real component of reported quaternion.
Definition BNO08x.cpp:1799
-
void disable_gravity()
Sends command to disable gravity reports by setting report interval to 0.
Definition BNO08x.cpp:1315
-
TaskHandle_t spi_task_hdl
SPI task handle.
Definition BNO08x.hpp:358
-
uint16_t raw_quat_J
Definition BNO08x.hpp:334
-
float get_quat_radian_accuracy()
Get radian accuracy of reported quaternion.
Definition BNO08x.cpp:1810
-
uint16_t raw_gyro_Y
Definition BNO08x.hpp:333
-
static bno08x_config_t default_imu_config
default imu config settings
Definition BNO08x.hpp:306
-
float get_yaw()
Get the reported rotation about z axis.
Definition BNO08x.cpp:1687
-
void disable_magnetometer()
Sends command to disable magnetometer reports by setting report interval to 0.
Definition BNO08x.cpp:1351
-
void queue_packet(uint8_t channel_number, uint8_t data_length)
Queues an SHTP packet to be sent via SPI.
Definition BNO08x.cpp:382
-
uint16_t raw_quat_I
Definition BNO08x.hpp:334
-
static const constexpr uint16_t FRS_RECORDID_GYROSCOPE_CALIBRATED
Definition BNO08x.hpp:270
-
static const constexpr uint8_t SENSOR_REPORTID_MAGNETIC_FIELD
See SH2 Ref. Manual 6.5.16.
Definition BNO08x.hpp:402
-
uint16_t packet_length_tx
Packet length to be sent with send_packet()
Definition BNO08x.hpp:318
-
float get_roll_deg()
Get the reported rotation about x axis.
Definition BNO08x.cpp:1714
-
int16_t get_raw_accel_Z()
Get raw accelerometer z axis reading from physical accelerometer MEMs sensor (See Ref....
Definition BNO08x.cpp:1967
-
bool calibration_complete()
Returns true if calibration has completed.
Definition BNO08x.cpp:580
-
static const constexpr uint16_t FRS_RECORDID_ACCELEROMETER
Definition BNO08x.hpp:269
-
void enable_gyro_integrated_rotation_vector(uint32_t time_between_reports)
Sends command to enable gyro integrated rotation vector reports (See Ref. Manual 6....
Definition BNO08x.cpp:1047
-
float get_uncalibrated_gyro_bias_Y()
Get uncalibrated gyro Y axis drift estimate.
Definition BNO08x.cpp:2160
-
static const constexpr uint8_t SHTP_REPORT_FRS_READ_REQUEST
See SH2 Ref. Manual 6.3.6.
Definition BNO08x.hpp:393
-
uint8_t tx_buffer[50]
buffer used for sending packet with send_packet()
Definition BNO08x.hpp:312
-
uint8_t activity_classifier
Activity status reading (See SH-2 Ref. Manual 6.5.36)
Definition BNO08x.hpp:347
-
void disable_raw_gyro()
Sends command to disable raw gyro reports by setting report interval to 0.
Definition BNO08x.cpp:1423
-
uint16_t raw_accel_X
Definition BNO08x.hpp:329
-
float get_linear_accel_X()
Get x axis linear acceleration (acceleration of device minus gravity, units in m/s^2)
Definition BNO08x.cpp:1907
-
void disable_game_rotation_vector()
Sends command to disable game rotation vector reports by setting report interval to 0.
Definition BNO08x.cpp:1243
-
uint16_t raw_quat_K
Definition BNO08x.hpp:334
-
static const constexpr uint8_t COMMAND_DCD_PERIOD_SAVE
Configure DCD periodic saving (See SH2 Ref. Manual 6.4)
Definition BNO08x.hpp:385
-
uint8_t rx_buffer[300]
buffer used to receive packet with receive_packet()
Definition BNO08x.hpp:311
-
uint16_t parse_input_report()
Parses received input report sent by BNO08x.
Definition BNO08x.cpp:784
-
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....
Definition BNO08x.hpp:316
-
void enable_uncalibrated_gyro(uint32_t time_between_reports)
Sends command to enable uncalibrated gyro reports (See Ref. Manual 6.5.14)
Definition BNO08x.cpp:1112
-
static void IRAM_ATTR hint_handler(void *arg)
HINT interrupt service routine, handles falling edge of BNO08x HINT pin.
Definition BNO08x.cpp:2665
-
uint8_t get_gyro_accuracy()
Get calibrated gyro accuracy.
Definition BNO08x.cpp:2085
-
void disable_gyro()
Sends command to disable gyro reports by setting report interval to 0.
Definition BNO08x.cpp:1327
-
float get_magf_Y()
Get Y component of magnetic field vector.
Definition BNO08x.cpp:1541
-
static const constexpr uint8_t COMMAND_ME_CALIBRATE
Command and response to configure ME calibration (See SH2 Ref. Manual 6.4.7)
Definition BNO08x.hpp:384
-
uint16_t raw_quat_real
Definition BNO08x.hpp:334
-
float get_gravity_X()
Get the reported x axis gravity.
Definition BNO08x.cpp:1591
-
float get_roll()
Get the reported rotation about x axis.
Definition BNO08x.cpp:1631
-
uint16_t raw_bias_X
Definition BNO08x.hpp:340
-
float get_gravity_Y()
Get the reported y axis gravity.
Definition BNO08x.cpp:1601
-
void enable_ARVR_stabilized_rotation_vector(uint32_t time_between_reports)
Sends command to enable ARVR stabilized rotation vector reports (See Ref. Manual 6....
Definition BNO08x.cpp:1021
-
static const constexpr uint8_t SENSOR_REPORTID_GYRO_INTEGRATED_ROTATION_VECTOR
See SH2 Ref. Manual 6.5.44.
Definition BNO08x.hpp:409
-
void enable_raw_gyro(uint32_t time_between_reports)
Sends command to enable raw gyro reports (See Ref. Manual 6.5.12)
Definition BNO08x.cpp:1206
-
static const constexpr uint8_t TARE_ROTATION_VECTOR
Tare rotation vector.
Definition BNO08x.hpp:278
-
uint8_t packet_header_rx[4]
SHTP header received with receive_packet()
Definition BNO08x.hpp:313
-
uint16_t mems_raw_magf_Z
Raw magnetometer (compass) readings from MEMS sensor (See SH-2 Ref. Manual 6.5.15)
Definition BNO08x.hpp:355
-
static const constexpr int16_t ROTATION_VECTOR_ACCURACY_Q1
Rotation vector accuracy estimate Q point (See SH-2 Ref. Manual 6.5.18)
Definition BNO08x.hpp:286
-
void get_accel(float &x, float &y, float &z, uint8_t &accuracy)
Get full acceleration (total acceleration of device, units in m/s^2).
Definition BNO08x.cpp:1836
-
uint16_t mems_raw_accel_X
Definition BNO08x.hpp:350
-
static const constexpr uint8_t COMMAND_COUNTER
Definition BNO08x.hpp:380
-
int16_t get_Q2(uint16_t record_ID)
Gets Q2 point from BNO08x FRS (flash record system).
Definition BNO08x.cpp:2374
-
static const constexpr uint8_t CALIBRATE_PLANAR_ACCEL
Calibrate planar acceleration command used by queue_calibrate_command.
Definition BNO08x.hpp:373
-
int16_t get_raw_accel_Y()
Get raw accelerometer y axis reading from physical accelerometer MEMs sensor (See Ref....
Definition BNO08x.cpp:1957
-
bool soft_reset()
Soft resets BNO08x sensor using executable channel.
Definition BNO08x.cpp:240
-
spi_bus_config_t bus_config
SPI bus GPIO configuration settings.
Definition BNO08x.hpp:322
-
bool wait_for_device_int()
Re-enables interrupts and waits for BNO08x to assert HINT pin.
Definition BNO08x.cpp:191
-
uint16_t gyro_accuracy
Raw gyro reading (See SH-2 Ref. Manual 6.5.13)
Definition BNO08x.hpp:333
-
int16_t get_raw_magf_Z()
Get raw magnetometer z axis reading from physical magnetometer sensor (See Ref. Manual 6....
Definition BNO08x.cpp:2027
-
void calibrate_gyro()
Sends command to calibrate gyro.
Definition BNO08x.cpp:479
-
uint16_t get_readings()
Waits for BNO08x HINT pin to assert, and parses the received data.
Definition BNO08x.cpp:728
-
static const constexpr uint8_t TARE_GYRO_INTEGRATED_ROTATION_VECTOR
Tare gyro integrated rotation vector.
Definition BNO08x.hpp:281
-
float get_quat_K()
Get K component of reported quaternion.
Definition BNO08x.cpp:1788
-
float get_quat_J()
Get J component of reported quaternion.
Definition BNO08x.cpp:1777
-
static const constexpr int16_t MAGNETOMETER_Q1
Magnetometer Q point (See SH-2 Ref. Manual 6.5.16)
Definition BNO08x.hpp:290
-
void save_calibration()
Sends command to save internal calibration data (See Ref. Manual 6.4.7).
Definition BNO08x.cpp:605
-
static const constexpr int16_t GYRO_Q1
Gyro Q point (See SH-2 Ref. Manual 6.5.13)
Definition BNO08x.hpp:289
-
void disable_ARVR_stabilized_rotation_vector()
Sends command to disable ARVR stabilized rotation vector reports by setting report interval to 0.
Definition BNO08x.cpp:1255
-
uint16_t raw_velocity_gyro_X
Definition BNO08x.hpp:336
-
uint16_t raw_magf_X
Definition BNO08x.hpp:342
-
uint8_t sequence_number[6]
Sequence num of each com channel, 6 in total.
Definition BNO08x.hpp:315
-
static const constexpr uint8_t SENSOR_REPORTID_RAW_ACCELEROMETER
See SH2 Ref. Manual 6.5.8.
Definition BNO08x.hpp:413
-
void disable_gyro_integrated_rotation_vector()
Sends command to disable gyro integrated rotation vector reports by setting report interval to 0.
Definition BNO08x.cpp:1279
-
uint16_t mems_raw_magf_Y
Definition BNO08x.hpp:354
-
static const constexpr uint8_t SENSOR_REPORTID_RAW_GYROSCOPE
See SH2 Ref. Manual 6.5.12.
Definition BNO08x.hpp:414
-
void disable_uncalibrated_gyro()
Sends command to disable uncalibrated gyro reports by setting report interval to 0.
Definition BNO08x.cpp:1339
-
static const constexpr int16_t ANGULAR_VELOCITY_Q1
Angular velocity Q point (See SH-2 Ref. Manual 6.5.44)
Definition BNO08x.hpp:291
-
static const constexpr uint8_t SENSOR_REPORTID_STEP_COUNTER
See SH2 Ref. Manual 6.5.29.
Definition BNO08x.hpp:411
-
static const constexpr uint8_t SENSOR_REPORTID_ROTATION_VECTOR
See SH2 Ref. Manual 6.5.18.
Definition BNO08x.hpp:404
-
static const constexpr uint8_t SHTP_REPORT_COMMAND_REQUEST
See SH2 Ref. Manual 6.3.8.
Definition BNO08x.hpp:391
-
void enable_stability_classifier(uint32_t time_between_reports)
Sends command to enable activity stability classifier reports (See Ref. Manual 6.5....
Definition BNO08x.cpp:1164
-
void disable_ARVR_stabilized_game_rotation_vector()
Sends command to disable ARVR stabilized game rotation vector reports by setting report interval to 0...
Definition BNO08x.cpp:1267
-
void disable_stability_classifier()
Sends command to disable stability reports by setting report interval to 0.
Definition BNO08x.cpp:1387
-
static const constexpr uint8_t SENSOR_REPORTID_GAME_ROTATION_VECTOR
See SH2 Ref. Manual 6.5.19.
Definition BNO08x.hpp:407
-
uint16_t raw_magf_Z
Definition BNO08x.hpp:342
-
uint16_t raw_velocity_gyro_Z
Raw gyro angular velocity reading (See SH-2 Ref. Manual 6.5.44)
Definition BNO08x.hpp:337
-
void enable_rotation_vector(uint32_t time_between_reports)
Sends command to enable rotation vector reports (See Ref. Manual 6.5.18)
Definition BNO08x.cpp:1008
-
float get_magf_Z()
Get Z component of magnetic field vector.
Definition BNO08x.cpp:1552
-
void enable_tap_detector(uint32_t time_between_reports)
Sends command to enable tap detector reports (See Ref. Manual 6.5.27)
Definition BNO08x.cpp:1138
-
uint16_t raw_accel_Y
Definition BNO08x.hpp:329
-
uint16_t mems_raw_magf_X
Definition BNO08x.hpp:354
-
void queue_request_product_id_command()
Queues a packet containing the request product ID command.
Definition BNO08x.cpp:443
-
uint16_t mems_raw_gyro_Y
Definition BNO08x.hpp:352
-
float get_gyro_calibrated_velocity_X()
Get calibrated gyro x axis angular velocity measurement.
Definition BNO08x.cpp:2055
-
static const constexpr uint8_t SENSOR_REPORTID_UNCALIBRATED_GYRO
See SH2 Ref. Manual 6.5.14.
Definition BNO08x.hpp:406
-
static const constexpr uint16_t FRS_RECORDID_MAGNETIC_FIELD_CALIBRATED
Definition BNO08x.hpp:271
-
static const constexpr uint8_t TARE_GAME_ROTATION_VECTOR
Tare game rotation vector.
Definition BNO08x.hpp:279
-
uint16_t raw_lin_accel_Z
Definition BNO08x.hpp:331
-
uint32_t time_stamp
Report timestamp (see datasheet 1.3.5.3)
Definition BNO08x.hpp:328
-
float get_accel_X()
Get x axis acceleration (total acceleration of device, units in m/s^2).
Definition BNO08x.cpp:1849
-
void enable_game_rotation_vector(uint32_t time_between_reports)
Sends command to enable game rotation vector reports (See Ref. Manual 6.5.19)
Definition BNO08x.cpp:995
-
static const constexpr uint8_t CALIBRATE_MAG
Calibrate magnetometer command used by queue_calibrate_command.
Definition BNO08x.hpp:372
-
spi_transaction_t spi_transaction
SPI transaction handle.
Definition BNO08x.hpp:325
-
bool mode_on()
Turns on/ brings BNO08x sensor out of sleep mode using executable channel.
Definition BNO08x.cpp:287
-
uint8_t command_sequence_number
Sequence num of command, sent within command packet.
Definition BNO08x.hpp:317
-
void calibrate_magnetometer()
Sends command to calibrate magnetometer.
Definition BNO08x.cpp:491
-
uint16_t mems_raw_gyro_Z
Raw gyro readings from MEMS sensor (See SH-2 Ref. Manual 6.5.12)
Definition BNO08x.hpp:353
-
uint16_t raw_bias_Y
Definition BNO08x.hpp:340
-
uint16_t magf_accuracy
Calibrated magnetic field reading in uTesla (See SH-2 Ref. Manual 6.5.16)
Definition BNO08x.hpp:343
-
static const constexpr uint8_t SENSOR_REPORTID_RAW_MAGNETOMETER
See SH2 Ref. Manual 6.5.15.
Definition BNO08x.hpp:415
-
void end_calibration()
Sends command to end calibration procedure.
Definition BNO08x.cpp:593
-
uint8_t commands[20]
Command to be sent with send_packet()
Definition BNO08x.hpp:314
-
spi_device_handle_t spi_hdl
SPI device handle.
Definition BNO08x.hpp:324
-
uint16_t raw_uncalib_gyro_Y
Definition BNO08x.hpp:340
-
uint8_t get_gravity_accuracy()
Get the reported gravity accuracy.
Definition BNO08x.cpp:1621
-
float get_gyro_velocity_Y()
Get y axis angular velocity from gyro-integrated rotation vector. (See Ref. Manual 6....
Definition BNO08x.cpp:2216
-
uint16_t raw_magf_Y
Definition BNO08x.hpp:342
-
float get_gyro_velocity_X()
Get x axis angular velocity from gyro-integrated rotation vector. (See Ref. Manual 6....
Definition BNO08x.cpp:2206
-
static const constexpr uint8_t CALIBRATE_ACCEL
Calibrate accelerometer command used by queue_calibrate_command.
Definition BNO08x.hpp:370
-
void queue_calibrate_command(uint8_t _to_calibrate)
Queues a packet containing a command to calibrate the specified sensor.
Definition BNO08x.cpp:516
-
static const constexpr int16_t LINEAR_ACCELEROMETER_Q1
Linear acceleration Q point (See SH-2 Ref. Manual 6.5.10)
Definition BNO08x.hpp:288
-
uint8_t calibration_status
Calibration status of device (See SH-2 Ref. Manual 6.4.7.1 & 6.4.7.2)
Definition BNO08x.hpp:349
-
float get_uncalibrated_gyro_bias_X()
Get uncalibrated gyro x axis drift estimate.
Definition BNO08x.cpp:2150
-
float get_gyro_calibrated_velocity_Y()
Get calibrated gyro y axis angular velocity measurement.
Definition BNO08x.cpp:2065
-
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).
Definition BNO08x.cpp:1894
-
void disable_accelerometer()
Sends command to disable accelerometer reports by setting report interval to 0.
Definition BNO08x.cpp:1291
-
void enable_gyro(uint32_t time_between_reports)
Sends command to enable gyro reports (See Ref. Manual 6.5.13)
Definition BNO08x.cpp:1099
-
void enable_activity_classifier(uint32_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)
Definition BNO08x.cpp:1179
-
uint16_t step_count
Step counter reading (See SH-2 Ref. Manual 6.5.29)
Definition BNO08x.hpp:345
-
uint16_t mems_raw_accel_Y
Definition BNO08x.hpp:350
-
uint32_t get_time_stamp()
Return timestamp of most recent report.
Definition BNO08x.cpp:1502
-
uint16_t get_step_count()
Get the counted amount of steps.
Definition BNO08x.cpp:2248
-
void disable_raw_magnetometer()
Sends command to disable raw magnetometer reports by setting report interval to 0.
Definition BNO08x.cpp:1435
-
int16_t get_raw_magf_X()
Get raw magnetometer x axis reading from physical magnetometer sensor (See Ref. Manual 6....
Definition BNO08x.cpp:2007
-
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 o...
Definition BNO08x.cpp:2460
-
uint16_t gravity_accuracy
Gravity reading in m/s^2 (See SH-2 Ref. Manual 6.5.11)
Definition BNO08x.hpp:339
-
static const constexpr int16_t GRAVITY_Q1
Gravity Q point (See SH-2 Ref. Manual 6.5.11)
Definition BNO08x.hpp:292
-
void enable_linear_accelerometer(uint32_t time_between_reports)
Sends command to enable linear accelerometer reports (See Ref. Manual 6.5.10)
Definition BNO08x.cpp:1073
-
uint16_t raw_lin_accel_X
Definition BNO08x.hpp:331
-
float get_gyro_velocity_Z()
Get z axis angular velocity from gyro-integrated rotation vector. (See Ref. Manual 6....
Definition BNO08x.cpp:2226
-
static const constexpr uint8_t SHTP_REPORT_BASE_TIMESTAMP
See SH2 Ref. Manual 7.2.1.
Definition BNO08x.hpp:396
-
bool receive_packet()
Receives a SHTP packet via SPI.
Definition BNO08x.cpp:331
-
bool run_full_calibration_routine()
Runs full calibration routine.
Definition BNO08x.cpp:624
-
static const constexpr uint64_t HOST_INT_TIMEOUT_MS
Max wait between HINT being asserted by BNO08x before transaction is considered failed (in milisecond...
Definition BNO08x.hpp:366
-
bool initialize()
Initializes BNO08x sensor.
Definition BNO08x.cpp:118
-
static const constexpr uint8_t CALIBRATE_GYRO
Calibrate gyro command used by queue_calibrate_command.
Definition BNO08x.hpp:371
-
static const constexpr uint8_t SHTP_REPORT_FRS_READ_RESPONSE
See SH2 Ref. Manual 6.3.7.
Definition BNO08x.hpp:392
-
static const constexpr uint8_t SENSOR_REPORTID_GEOMAGNETIC_ROTATION_VECTOR
See SH2 Ref. Manual 6.5.20.
Definition BNO08x.hpp:408
-
static const constexpr uint8_t TARE_AXIS_Z
Tar yaw axis only (used with tare now command)
Definition BNO08x.hpp:275
-
static const constexpr uint8_t TARE_AR_VR_STABILIZED_GAME_ROTATION_VECTOR
Tare ARVR stabilized game rotation vector.
Definition BNO08x.hpp:283
-
bno08x_config_t imu_config
IMU configuration settings.
Definition BNO08x.hpp:321
-
SemaphoreHandle_t tx_semaphore
Used to indicate to spi_task() whether or not a packet is currently waiting to be sent.
Definition BNO08x.hpp:308
-
static const constexpr uint8_t SENSOR_REPORTID_GRAVITY
See SH2 Ref. Manual 6.5.11.
Definition BNO08x.hpp:405
-
void calibrate_accelerometer()
Sends command to calibrate accelerometer.
Definition BNO08x.cpp:467
-
static const constexpr uint8_t COMMAND_DCD
Save DCD command (See SH2 Ref. Manual 6.4.7)
Definition BNO08x.hpp:383
-
int16_t get_raw_gyro_X()
Get raw gyroscope x axis reading from physical gyroscope MEMs sensor (See Ref. Manual 6....
Definition BNO08x.cpp:1977
-
uint16_t gravity_Y
Definition BNO08x.hpp:338
-
uint16_t raw_accel_Z
Definition BNO08x.hpp:329
-
void queue_feature_command(uint8_t report_ID, uint32_t time_between_reports)
Queues a packet containing a command with a request for sensor reports, reported periodically....
Definition BNO08x.cpp:2612
-
uint16_t gravity_X
Definition BNO08x.hpp:338
-
float get_pitch_deg()
Get the reported rotation about y axis.
Definition BNO08x.cpp:1724
-
static const constexpr uint8_t CALIBRATE_ACCEL_GYRO_MAG
Calibrate accelerometer, gyro, & magnetometer command used by queue_calibrate_command.
Definition BNO08x.hpp:374
-
uint16_t packet_length_rx
Packet length received (calculated from packet_header_rx)
Definition BNO08x.hpp:319
-
float get_yaw_deg()
Get the reported rotation about z axis.
Definition BNO08x.cpp:1734
-
uint8_t * activity_confidences
Confidence of read activities (See SH-2 Ref. Manual 6.5.36)
Definition BNO08x.hpp:348
-
uint16_t gravity_Z
Definition BNO08x.hpp:338
-
uint16_t raw_uncalib_gyro_Z
Definition BNO08x.hpp:340
-
static const constexpr uint8_t SENSOR_REPORTID_STABILITY_CLASSIFIER
See SH2 Ref. Manual 6.5.31.
Definition BNO08x.hpp:412
-
void save_tare()
Sends command to save tare into non-volatile memory of BNO08x (See Ref. Manual 6.4....
Definition BNO08x.cpp:1462
-
void disable_linear_accelerometer()
Sends command to disable linear accelerometer reports by setting report interval to 0.
Definition BNO08x.cpp:1303
-
void calibrate_all()
Sends command to calibrate accelerometer, gyro, and magnetometer.
Definition BNO08x.cpp:455
-
uint16_t raw_uncalib_gyro_X
Definition BNO08x.hpp:340
-
float get_accel_Y()
Get y axis acceleration (total acceleration of device, units in m/s^2).
Definition BNO08x.cpp:1859
-
float get_linear_accel_Z()
Get z axis linear acceleration (acceleration of device minus gravity, units in m/s^2)
Definition BNO08x.cpp:1927
-
void clear_tare()
Sends command to clear persistent tare settings in non-volatile memory of BNO08x (See Ref....
Definition BNO08x.cpp:1474
-
void get_gyro_velocity(float &x, float &y, float &z)
Full rotational velocity from gyro-integrated rotation vector (See Ref. Manual 6.5....
Definition BNO08x.cpp:2194
-
uint16_t raw_lin_accel_Y
Definition BNO08x.hpp:331
-
int16_t get_raw_gyro_Y()
Get raw gyroscope y axis reading from physical gyroscope MEMs sensor (See Ref. Manual 6....
Definition BNO08x.cpp:1987
-
void request_calibration_status()
Requests ME calibration status from BNO08x (see Ref. Manual 6.4.7.2)
Definition BNO08x.cpp:563
-
IMU configuration settings passed into constructor.
Definition BNO08x.hpp:39
-
spi_host_device_t spi_peripheral
SPI peripheral to be used.
Definition BNO08x.hpp:40
-
gpio_num_t io_int
Chip select pin (connects to BNO08x CS pin)
Definition BNO08x.hpp:45
-
gpio_num_t io_rst
Host interrupt pin (connects to BNO08x INT pin)
Definition BNO08x.hpp:46
-
gpio_num_t io_sclk
SCLK pin (connects to BNO08x SCL pin)
Definition BNO08x.hpp:43
-
uint64_t sclk_speed
Desired SPI SCLK speed in Hz (max 3MHz)
Definition BNO08x.hpp:48
-
bool debug_en
Whether or not debugging print statements are enabled.
Definition BNO08x.hpp:49
-
gpio_num_t io_mosi
MOSI GPIO pin (connects to BNO08x DI pin)
Definition BNO08x.hpp:41
-
gpio_num_t io_wake
Reset pin (connects to BNO08x RST pin)
Definition BNO08x.hpp:47
-
gpio_num_t io_miso
MISO GPIO pin (connects to BNO08x SDA pin)
Definition BNO08x.hpp:42
-
gpio_num_t io_cs
Definition BNO08x.hpp:44
-
bno08x_config_t()
Default IMU configuration settings constructor for ESP32.
Definition BNO08x.hpp:69
-
bno08x_config_t(spi_host_device_t spi_peripheral, gpio_num_t io_mosi, gpio_num_t io_miso, gpio_num_t io_sclk, gpio_num_t io_cs, gpio_num_t io_int, gpio_num_t io_rst, gpio_num_t io_wake, uint64_t sclk_speed, bool debug)
Overloaded IMU configuration settings constructor for custom pin settings.
Definition BNO08x.hpp:86
-