Merge branch 'bhuvanchandra-dvb-patch1'

This commit is contained in:
myles-parfeniuk 2023-11-16 12:21:08 -08:00
commit 8f89501e17
3 changed files with 1489 additions and 1610 deletions

32
.clang-format Normal file
View File

@ -0,0 +1,32 @@
---
BasedOnStyle: Google
Standard: Cpp11
UseTab: Never
IndentWidth: 4
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 8
AccessModifierOffset: -4
AlwaysBreakTemplateDeclarations: true
BreakConstructorInitializersBeforeComma: true
ConstructorInitializerAllOnOneLineOrOnePerLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlignAfterOpenBracket: DontAlign
DerivePointerAlignment: false
PointerAlignment: Left
SortIncludes: false
SpaceAfterCStyleCast: true
CommentPragmas: '^[/!]<'
ColumnLimit: 120

File diff suppressed because it is too large Load Diff

View File

@ -1,26 +1,23 @@
#pragma once #pragma once
//standard library includes #include <driver/gpio.h>
#include <stdio.h> #include <driver/spi_common.h>
#include <cstring> #include <driver/spi_master.h>
#include <esp_log.h>
#include <esp_rom_gpio.h>
#include <esp_timer.h>
#include <freertos/FreeRTOS.h>
#include <freertos/semphr.h>
#include <freertos/task.h>
#include <rom/ets_sys.h>
#include <inttypes.h> #include <inttypes.h>
#include <math.h> #include <math.h>
#include <stdio.h>
//esp-idf includes #include <cstring>
#include "driver/gpio.h"
#include "esp_rom_gpio.h"
#include "driver/spi_common.h"
#include "driver/spi_master.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "esp_log.h"
#include "esp_timer.h"
#include "rom/ets_sys.h"
/// @brief SHTP protocol channels /// @brief SHTP protocol channels
enum channels_t enum channels_t {
{
CHANNEL_COMMAND, CHANNEL_COMMAND,
CHANNEL_EXECUTABLE, CHANNEL_EXECUTABLE,
CHANNEL_CONTROL, CHANNEL_CONTROL,
@ -30,16 +27,10 @@ enum channels_t
}; };
/// @brief Sensor accuracy returned during sensor calibration /// @brief Sensor accuracy returned during sensor calibration
enum sensor_accuracy_t enum sensor_accuracy_t { LOW_ACCURACY = 1, MED_ACCURACY, HIGH_ACCURACY };
{
LOW_ACCURACY = 1,
MED_ACCURACY,
HIGH_ACCURACY
};
/// @brief IMU configuration settings passed into constructor /// @brief IMU configuration settings passed into constructor
typedef struct bno08x_config_t typedef struct bno08x_config_t {
{
spi_host_device_t spi_peripheral; ///<SPI peripheral to be used spi_host_device_t spi_peripheral; ///<SPI peripheral to be used
gpio_num_t io_mosi; ///<MOSI GPIO pin (connects to BNO08x DI pin) gpio_num_t io_mosi; ///<MOSI GPIO pin (connects to BNO08x DI pin)
gpio_num_t io_miso; ///<MISO GPIO pin (connects to BNO08x SDA pin) gpio_num_t io_miso; ///<MISO GPIO pin (connects to BNO08x SDA pin)
@ -52,26 +43,26 @@ typedef struct bno08x_config_t
bool debug_en; ///<Whether or not debugging print statements are enabled bool debug_en; ///<Whether or not debugging print statements are enabled
/// @brief Default IMU configuration settings /// @brief Default IMU configuration settings
bno08x_config_t() : bno08x_config_t()
spi_peripheral(SPI3_HOST), : spi_peripheral(SPI3_HOST)
io_mosi(GPIO_NUM_23), , io_mosi(GPIO_NUM_23)
io_miso(GPIO_NUM_19), , io_miso(GPIO_NUM_19)
io_sclk(GPIO_NUM_18), , io_sclk(GPIO_NUM_18)
io_cs(GPIO_NUM_33), , io_cs(GPIO_NUM_33)
io_int(GPIO_NUM_26), , io_int(GPIO_NUM_26)
io_rst(GPIO_NUM_32), , io_rst(GPIO_NUM_32)
io_wake(GPIO_NUM_4), , io_wake(GPIO_NUM_4)
,
// sclk_speed(10000U), //clock slowed to see on AD2 // sclk_speed(10000U), //clock slowed to see on AD2
sclk_speed(2000000U), //1MHz SCLK speed sclk_speed(2000000U)
, // 1MHz SCLK speed
debug_en(false) debug_en(false)
{ {}
}
} bno08x_config_t; } bno08x_config_t;
class BNO08x class BNO08x {
{
public: public:
BNO08x(bno08x_config_t imu_config = default_imu_config); BNO08x(bno08x_config_t imu_config = default_imu_config);
bool initialize(); bool initialize();
@ -79,9 +70,9 @@ class BNO08x
bool hard_reset(); bool hard_reset();
bool soft_reset(); bool soft_reset();
uint8_t get_reset_reason(); uint8_t get_reset_reason();
bool mode_sleep(); bool mode_sleep();
bool mode_on(); bool mode_on();
float q_to_float(int16_t fixed_point_value, uint8_t q_point); float q_to_float(int16_t fixed_point_value, uint8_t q_point);
bool run_full_calibration_routine(); bool run_full_calibration_routine();
@ -109,7 +100,8 @@ class BNO08x
void enable_tap_detector(uint16_t time_between_reports); void enable_tap_detector(uint16_t time_between_reports);
void enable_step_counter(uint16_t time_between_reports); void enable_step_counter(uint16_t time_between_reports);
void enable_stability_classifier(uint16_t time_between_reports); void enable_stability_classifier(uint16_t time_between_reports);
void enable_activity_classifier(uint16_t time_between_reports, uint32_t activities_to_enable, uint8_t (&activity_confidence_vals)[9]); void enable_activity_classifier(
uint16_t time_between_reports, uint32_t activities_to_enable, uint8_t (&activity_confidence_vals)[9]);
void enable_raw_accelerometer(uint16_t time_between_reports); void enable_raw_accelerometer(uint16_t time_between_reports);
void enable_raw_gyro(uint16_t time_between_reports); void enable_raw_gyro(uint16_t time_between_reports);
void enable_raw_magnetometer(uint16_t time_between_reports); void enable_raw_magnetometer(uint16_t time_between_reports);
@ -222,7 +214,6 @@ class BNO08x
static const constexpr uint16_t FRS_RECORDID_MAGNETIC_FIELD_CALIBRATED = 0xE309; static const constexpr uint16_t FRS_RECORDID_MAGNETIC_FIELD_CALIBRATED = 0xE309;
static const constexpr uint16_t FRS_RECORDID_ROTATION_VECTOR = 0xE30B; static const constexpr uint16_t FRS_RECORDID_ROTATION_VECTOR = 0xE30B;
private: private:
bool wait_for_device_int(); bool wait_for_device_int();
bool receive_packet(); bool receive_packet();
@ -232,19 +223,23 @@ class BNO08x
void queue_feature_command(uint8_t report_ID, uint16_t time_between_reports); void queue_feature_command(uint8_t report_ID, uint16_t time_between_reports);
void queue_feature_command(uint8_t report_ID, uint16_t time_between_reports, uint32_t specific_config); void queue_feature_command(uint8_t report_ID, uint16_t time_between_reports, uint32_t specific_config);
void queue_calibrate_command(uint8_t _to_calibrate); void queue_calibrate_command(uint8_t _to_calibrate);
void queue_tare_command(uint8_t command, uint8_t axis = TARE_AXIS_ALL, uint8_t rotation_vector_basis = TARE_ROTATION_VECTOR); void queue_tare_command(
uint8_t command, uint8_t axis = TARE_AXIS_ALL, uint8_t rotation_vector_basis = TARE_ROTATION_VECTOR);
void queue_request_product_id_command(); void queue_request_product_id_command();
static bno08x_config_t default_imu_config; ///< default imu config settings static bno08x_config_t default_imu_config; ///< default imu config settings
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) volatile uint8_t
SemaphoreHandle_t tx_semaphore; ///<Mutex semaphore used to prevent sending or receiving of packets if packet is currently being queued 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
uint8_t rx_buffer[300]; ///<buffer used to receive packet with receive_packet() 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 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 packet_header_rx[4]; ///<SHTP header received with receive_packet()
uint8_t commands[20]; ///<Command to be sent with send_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 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) 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. 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_tx = 0; ///<Packet length to be sent with send_packet()
uint16_t packet_length_rx = 0; ///<Packet length received (calculated from packet_header_rx) uint16_t packet_length_rx = 0; ///<Packet length received (calculated from packet_header_rx)
@ -257,62 +252,86 @@ class BNO08x
// These are the raw sensor values (without Q applied) pulled from the user requested Input Report // These are the raw sensor values (without Q applied) pulled from the user requested Input Report
uint32_t time_stamp; ///<Report timestamp (see datasheet 1.3.5.3) uint32_t time_stamp; ///<Report timestamp (see datasheet 1.3.5.3)
uint16_t raw_accel_X, raw_accel_Y, raw_accel_Z, accel_accuracy; ///<Raw acceleration readings (See SH-2 Ref. Manual 6.5.8) uint16_t raw_accel_X, raw_accel_Y, raw_accel_Z,
uint16_t raw_lin_accel_X, raw_lin_accel_Y, raw_lin_accel_Z, accel_lin_accuracy; ///<Raw linear acceleration (See SH-2 Ref. Manual 6.5.10) accel_accuracy; ///<Raw acceleration readings (See SH-2 Ref. Manual 6.5.8)
uint16_t raw_lin_accel_X, raw_lin_accel_Y, raw_lin_accel_Z,
accel_lin_accuracy; ///<Raw linear acceleration (See SH-2 Ref. Manual 6.5.10)
uint16_t raw_gyro_X, raw_gyro_Y, raw_gyro_Z, gyro_accuracy; ///<Raw gyro reading (See SH-2 Ref. Manual 6.5.13) uint16_t raw_gyro_X, raw_gyro_Y, raw_gyro_Z, gyro_accuracy; ///<Raw gyro reading (See SH-2 Ref. Manual 6.5.13)
uint16_t raw_quat_I, raw_quat_J, raw_quat_K, raw_quat_real, raw_quat_radian_accuracy, quat_accuracy; ///<Raw quaternion reading (See SH-2 Ref. Manual 6.5.44) uint16_t raw_quat_I, raw_quat_J, raw_quat_K, raw_quat_real, raw_quat_radian_accuracy,
uint16_t raw_velocity_gyro_X, raw_velocity_gyro_Y, raw_velocity_gyro_Z;///<Raw gyro angular velocity reading (See SH-2 Ref. Manual 6.5.44) quat_accuracy; ///<Raw quaternion reading (See SH-2 Ref. Manual 6.5.44)
uint16_t gravity_X, gravity_Y, gravity_Z, gravity_accuracy; ///<Gravity reading in m/s^2 (See SH-2 Ref. Manual 6.5.11) uint16_t raw_velocity_gyro_X, raw_velocity_gyro_Y,
uint16_t raw_uncalib_gyro_X, raw_uncalib_gyro_Y, raw_uncalib_gyro_Z, raw_bias_X, raw_bias_Y, raw_bias_Z, uncalib_gyro_accuracy; ///<Uncalibrated gyro reading (See SH-2 Ref. Manual 6.5.14) raw_velocity_gyro_Z; ///<Raw gyro angular velocity reading (See SH-2 Ref. Manual 6.5.44)
uint16_t raw_magf_X, raw_magf_Y, raw_magf_Z, magf_accuracy; ///<Calibrated magnetic field reading in uTesla (See SH-2 Ref. Manual 6.5.16) uint16_t gravity_X, gravity_Y, gravity_Z,
gravity_accuracy; ///<Gravity reading in m/s^2 (See SH-2 Ref. Manual 6.5.11)
uint16_t raw_uncalib_gyro_X, raw_uncalib_gyro_Y, raw_uncalib_gyro_Z, raw_bias_X, raw_bias_Y, raw_bias_Z,
uncalib_gyro_accuracy; ///<Uncalibrated gyro reading (See SH-2 Ref. Manual 6.5.14)
uint16_t raw_magf_X, raw_magf_Y, raw_magf_Z,
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) 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) 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 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_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* 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) 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, mems_raw_accel_Y, mems_raw_accel_Z; ///<Raw accelerometer readings from MEMS sensor (See SH2 Ref. Manual 6.5.8) uint16_t mems_raw_accel_X, mems_raw_accel_Y,
uint16_t mems_raw_gyro_X, mems_raw_gyro_Y, mems_raw_gyro_Z; ///<Raw gyro readings from MEMS sensor (See SH-2 Ref. Manual 6.5.12) mems_raw_accel_Z; ///<Raw accelerometer readings from MEMS sensor (See SH2 Ref. Manual 6.5.8)
uint16_t mems_raw_magf_X, mems_raw_magf_Y, mems_raw_magf_Z; ///<Raw magnetometer (compass) readings from MEMS sensor (See SH-2 Ref. Manual 6.5.15) uint16_t mems_raw_gyro_X, mems_raw_gyro_Y,
mems_raw_gyro_Z; ///<Raw gyro readings from MEMS sensor (See SH-2 Ref. Manual 6.5.12)
uint16_t mems_raw_magf_X, mems_raw_magf_Y,
mems_raw_magf_Z; ///<Raw magnetometer (compass) readings from MEMS sensor (See SH-2 Ref. Manual 6.5.15)
// spi task // spi task
TaskHandle_t spi_task_hdl; ///<SPI task handle TaskHandle_t spi_task_hdl; ///<SPI task handle
static void spi_task_trampoline(void* arg); static void spi_task_trampoline(void* arg);
void spi_task(); void spi_task();
volatile bool int_asserted; ///<Interrupt asserted flag, sets true after hint_handler ISR launches SPI task and it has run to completion volatile bool
int_asserted; ///<Interrupt asserted flag, sets true after hint_handler ISR launches SPI task and it has run to completion
static void IRAM_ATTR hint_handler(void* arg); static void IRAM_ATTR hint_handler(void* arg);
static bool isr_service_installed; ///<true of the isr service has been installed, only has to be done once regardless of how many devices are used static bool
isr_service_installed; ///<true of the isr service has been installed, only has to be done once regardless of how many devices are used
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_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 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 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 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 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 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 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) static const constexpr int16_t GRAVITY_Q1 = 8; ///< Gravity Q point (See SH-2 Ref. Manual 6.5.11)
static const constexpr uint64_t HOST_INT_TIMEOUT_US = 150000ULL; ///<Max wait between HINT being asserted by BNO08x before transaction is considered failed. static const constexpr uint64_t HOST_INT_TIMEOUT_US =
150000ULL; ///<Max wait between HINT being asserted by BNO08x before transaction is considered failed.
// Higher level calibration commands, used by queue_calibrate_command // Higher level calibration commands, used by queue_calibrate_command
static const constexpr uint8_t CALIBRATE_ACCEL = 0; ///<Calibrate accelerometer command used by queue_calibrate_command 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_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_MAG =
static const constexpr uint8_t CALIBRATE_PLANAR_ACCEL = 3; ///<Calibrate planar acceleration command used by queue_calibrate_command 2; ///<Calibrate magnetometer command used by queue_calibrate_command
static const constexpr uint8_t CALIBRATE_ACCEL_GYRO_MAG = 4; ///<Calibrate accelerometer, gyro, & 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 =
4; ///<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 CALIBRATE_STOP = 5; ///<Stop calibration command used by queue_calibrate_command
// Command IDs (see Ref. Manual 6.4) // Command IDs (see Ref. Manual 6.4)
static const constexpr uint8_t COMMAND_ERRORS = 1; static const constexpr uint8_t COMMAND_ERRORS = 1;
static const constexpr uint8_t COMMAND_COUNTER = 2; 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_TARE =
static const constexpr uint8_t COMMAND_INITIALIZE = 4; ///<Reinitialize sensor hub components See (SH2 Ref. Manual 6.4.5) 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_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_ME_CALIBRATE =
static const constexpr uint8_t COMMAND_DCD_PERIOD_SAVE = 9; ///<Configure DCD periodic saving (See SH2 Ref. Manual 6.4) 7; ///<Command and response to configure ME calibration (See SH2 Ref. Manual 6.4.7)
static const constexpr uint8_t COMMAND_OSCILLATOR = 10; ///<Retrieve oscillator type command (See SH2 Ref. Manual 6.4) 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 COMMAND_CLEAR_DCD = 11; ///<Clear DCD & Reset command (See SH2 Ref. Manual 6.4)
// SHTP channel 2 control report IDs, used in communication with sensor (See Ref. Manual 6.2) // SHTP channel 2 control report IDs, used in communication with sensor (See Ref. Manual 6.2)
@ -325,7 +344,6 @@ class BNO08x
static const constexpr uint8_t SHTP_REPORT_BASE_TIMESTAMP = 0xFB; ///< See SH2 Ref. Manual 7.2.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 SHTP_REPORT_SET_FEATURE_COMMAND = 0xFD; ///< See SH2 Ref. Manual 6.5.4
// Sensor report IDs, used when enabling and reading BNO08x reports // Sensor report IDs, used when enabling and reading BNO08x reports
static const constexpr uint8_t SENSOR_REPORTID_ACCELEROMETER = 0x01; ///< See SH2 Ref. Manual 6.5.9 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_GYROSCOPE = 0x02; ///< See SH2 Ref. Manual 6.5.13
@ -336,7 +354,8 @@ class BNO08x
static const constexpr uint8_t SENSOR_REPORTID_UNCALIBRATED_GYRO = 0x07; ///< See SH2 Ref. Manual 6.5.14 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_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_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_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_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_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_STABILITY_CLASSIFIER = 0x13; ///< See SH2 Ref. Manual 6.5.31
@ -344,8 +363,10 @@ class BNO08x
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_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_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_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_ROTATION_VECTOR =
static const constexpr uint8_t SENSOR_REPORTID_AR_VR_STABILIZED_GAME_ROTATION_VECTOR = 0x29; ///< See SH2 Ref. Manual 6.5.43 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
// Tare commands used by queue_tare_command // Tare commands used by queue_tare_command
static const constexpr uint8_t TARE_NOW = 0; ///< See SH2 Ref. Manual 6.4.4.1 static const constexpr uint8_t TARE_NOW = 0; ///< See SH2 Ref. Manual 6.4.4.1
@ -361,7 +382,8 @@ class BNO08x
static const constexpr uint8_t TARE_GEOMAGNETIC_ROTATION_VECTOR = 2; ///< tare geomagnetic 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_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_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 uint8_t TARE_AR_VR_STABILIZED_GAME_ROTATION_VECTOR =
5; ///<Tare ARVR stabilized game rotation vector
static const constexpr char* TAG = "BNO08x"; ///< Class tag used for serial print statements static const constexpr char* TAG = "BNO08x"; ///< Class tag used for serial print statements
}; };