# esp32_BNO08x: BNO08x Class Reference

Loading...
Searching...
No Matches
BNO08x Class Reference

BNO08x IMU driver class. More...

`#include <BNO08x.hpp>`

Collaboration diagram for BNO08x:
[legend]

## Classes

struct | bno08x_reports_t
| Contains report implementations. More...

## Public Types

typedef struct BNO08x::bno08x_reports_t | bno08x_reports_t
| Contains report implementations.

## Public Member Functions

| BNO08x (bno08x_config_t imu_config=bno08x_config_t())
| BNO08x imu constructor.
| ~BNO08x ()
| BNO08x imu deconstructor.
bool | initialize ()
| Initializes BNO08x sensor.
bool | hard_reset ()
| Hard resets BNO08x device.
bool | soft_reset ()
| Soft resets BNO08x device by sending RESET (1) command on "device" channel.
bool | disable_all_reports ()
| Disables all currently enabled reports.
BNO08xResetReason | get_reset_reason ()
| Returns reason for previous reset via product ID report.
bool | on ()
| Places BNO08x device in on state by sending ON (2) command on "device" channel.
bool | sleep ()
| Places BNO08x device in sleep state by sending SLEEP (3) command on "device" channel.
bool | calibration_start (uint32_t period_us)
| Starts simple calibration, see ref. manual 6.4.10.1.
bool | calibration_end (sh2_CalStatus_t &status)
| Ends turn-table calibration, see ref. manual 6.4.10.2.
bool | dynamic_calibration_enable (BNO08xCalSel sensor)
| Enables dynamic/motion engine calibration for specified sensor(s), see ref. manual 6.4.6.1.
bool | dynamic_calibration_disable (BNO08xCalSel sensor)
| Disables dynamic/motion engine calibration for specified sensor(s), see ref. manual 6.4.6.1.
bool | dynamic_calibration_autosave_enable ()
| Enables the automatic saving of dynamic/ME calibration data to BNO08x internal flash See ref manual 6.4.7.1.
bool | dynamic_calibration_autosave_disable ()
| Disables the automatic saving of dynamic/ME calibration data to BNO08x internal flash See ref manual 6.4.7.1.
bool | save_dynamic_calibration ()
| Saves dynamic/motion engine calibration data to BNO08x internal flash immediately. See ref manual 6.4.5.1.
bool | clear_dynamic_calibration ()
| Clears dynamic/motion engine calibration data and resets BNO08x device. See ref manual 6.4.9.1.
bool | get_frs (uint16_t frs_ID, uint32_t(&data)[16], uint16_t &rx_data_sz)
| Retrieves a record from flash record system (if your goal is to retrieve meta data use the BNO08xRpt:get_meta_data() method instead)
sh2_ProductIds_t | get_product_IDs ()
| Returns product ID info sent by IMU at initialization.
bool | data_available ()
| Polls for new data/report to become available.
bool | register_cb (std::function< void(void)> cb_fxn)
| Registers a callback to execute when new data from a report is received.
bool | register_cb (std::function< void(uint8_t report_ID)> cb_fxn)
| Registers a callback to execute when new data from a report is received, overloaded with callback param for most recent report ID.
void | print_product_ids ()
| Prints product IDs received at initialization.

## Static Public Member Functions

static const char * | activity_to_str (BNO08xActivity activity)
| Converts a BNO08xActivity enum to string.
static const char * | stability_to_str (BNO08xStability stability)
| Converts a BNO08xStability enum to string.
static const char * | accuracy_to_str (BNO08xAccuracy accuracy)

## Public Attributes

bno08x_reports_t | rpt

## Private Member Functions

void | data_proc_task ()
| Task responsible for parsing/handling sensor events sent by SH2 HAL and updating data that is returned to user.
void | sh2_HAL_service_task ()
| Task responsible for calling shtp_service() when HINT is asserted to dispatch any sh2 HAL lib callbacks.
void | cb_task ()
| Task responsible for executing callbacks registered with register_cb().
void | lock_sh2_HAL ()
| Locks sh2 HAL lib to only allow the calling task to call its APIs.
void | unlock_sh2_HAL ()
| Unlocks sh2 HAL lib to allow other tasks to call its APIs.
void | lock_user_data ()
| Locks locks user data to only allow the calling task to read/modify it.
void | unlock_user_data ()
| Unlocks user data to allow other tasks to read/modify it.
void | handle_sensor_report (sh2_SensorValue_t *sensor_val)
| Parses receieved report and updates uer data with it.
void | handle_cb (uint8_t rpt_ID, BNO08xCbGeneric *cb_entry)
| Determines the flavor of a passed callback and executes it appropriately.
esp_err_t | init_config_args ()
| Initializes required esp-idf SPI data structures with values from user passed bno08x_config_t struct.
esp_err_t | init_gpio ()
| Initializes required gpio.
esp_err_t | init_gpio_inputs ()
| Initializes required gpio inputs.
esp_err_t | init_gpio_outputs ()
| Initializes required gpio outputs.
esp_err_t | init_hint_isr ()
| Initializes host interrupt ISR.
esp_err_t | init_spi ()
| Initializes SPI.
esp_err_t | init_tasks ()
| Initializes data_proc_task.
esp_err_t | init_sh2_HAL ()
| Initializes sh2 HAL.
esp_err_t | deinit_gpio ()
| Deinitializes GPIO, called from deconstructor.
esp_err_t | deinit_gpio_inputs ()
| Deinitializes GPIO inputs, called from deconstructor.
esp_err_t | deinit_gpio_outputs ()
| Deinitializes GPIO outputs, called from deconstructor.
esp_err_t | deinit_hint_isr ()
| Deinitializes host interrupt ISR, called from deconstructor.
esp_err_t | deinit_spi ()
| Deinitializes SPI.
esp_err_t | deinit_tasks ()
| Deinitializes tasks used by BNO08x driver.
esp_err_t | deinit_sh2_HAL ()
| Deinitializes sh2 HAL.
esp_err_t | wait_for_hint ()
| Waits for HINT pin assertion or HOST_INT_TIMEOUT_DEFAULT_MS to elapse.
esp_err_t | wait_for_reset ()
| Waits for SH2 HAL lib to detect reset or HOST_INT_TIMEOUT_DEFAULT_MS to elapse.
void | toggle_reset ()
| Toggles reset gpio pin for hard reset of BNO08x device.
esp_err_t | re_enable_reports ()
| Re-enables all reports enabled by user (called when BNO08x reset is detected by sh2 HAL lib).

## Static Private Member Functions

static void | data_proc_task_trampoline (void *arg)
| Static function used to launch data processing task.
static void | sh2_HAL_service_task_trampoline (void *arg)
| Static function used to launch sh2 HAL service task.
static void | cb_task_trampoline (void *arg)
| Static function used to launch cb_task task.
static void IRAM_ATTR | hint_handler (void *arg)
| HINT interrupt service routine, handles falling edge of BNO08x HINT pin.

## Private Attributes

TaskHandle_t | data_proc_task_hdl
| data_proc_task() task handle
TaskHandle_t | sh2_HAL_service_task_hdl
| sh2_HAL_service_task() task handle
TaskHandle_t | cb_task_hdl
| sh2_HAL_service_task() task handle
SemaphoreHandle_t | sem_kill_tasks
| Counting Semaphore to count amount of killed tasks.
sh2_Hal_t | sh2_HAL
| sh2 hardware abstraction layer struct for use with sh2 HAL lib.
QueueHandle_t | queue_rx_sensor_event
| Queue to send sensor events from sh2 HAL sensor event callback (BNO08xSH2HAL::sensor_event_cb()) to data_proc_task()
QueueHandle_t | queue_cb_report_id
| Queue to send report ID of most recent report to cb_task()
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.
BNO08xPrivateTypes::bno08x_init_status_t | init_status
| Initialization status of various functionality, used by deconstructor during cleanup, set during initialization.
BNO08xPrivateTypes::bno08x_sync_ctx_t | sync_ctx
| Holds context used to synchronize tasks and callback execution.
sh2_ProductIds_t | product_IDs
| Product ID info returned IMU at initialization, can be viewed with print_product_ids()
etl::map< uint8_t, BNO08xRpt *, TOTAL_RPT_COUNT, etl::less< uint8_t > > | usr_reports

## Static Private Attributes

static const constexpr configSTACK_DEPTH_TYPE | DATA_PROC_TASK_SZ
| Size of data_proc_task() stack in bytes.
static const constexpr configSTACK_DEPTH_TYPE | SH2_HAL_SERVICE_TASK_SZ
| Size of sh2_HAL_service_task() stack in bytes.
static const constexpr configSTACK_DEPTH_TYPE | CB_TASK_SZ
| Size of sh2_HAL_service_task() stack in bytes.
static const constexpr uint16_t | RX_DATA_LENGTH = 300U
| length buffer containing data received over spi
static const constexpr TickType_t | HOST_INT_TIMEOUT_DEFAULT_MS
| Max wait between HINT being asserted by BNO08x before transaction is considered failed (in miliseconds).
static const constexpr TickType_t | DATA_AVAILABLE_TIMEOUT_MS
| Max wait between data_available() being called and no new data/report being detected.
static const constexpr TickType_t | HARD_RESET_DELAY_MS
| How long RST pin is held low during hard reset (min 10ns according to datasheet, but should be longer for stable operation)
static const constexpr uint32_t | SCLK_MAX_SPEED = 3000000UL
| Max SPI SCLK speed BNO08x is capable of.
static const constexpr char * | TAG = "BNO08x"
| Class tag used for serial print statements.

## Friends

class | BNO08xSH2HAL
class | BNO08xTestHelper

## Detailed Description

BNO08x IMU driver class.

## Member Typedef Documentation

## bno08x_reports_t

typedef struct BNO08x::bno08x_reports_t BNO08x::bno08x_reports_t

Contains report implementations.

## Constructor & Destructor Documentation

## BNO08x()

BNO08x::BNO08x | ( | bno08x_config_t | imu_config = bno08x_config_t() | ) |

BNO08x imu constructor.

Construct a BNO08x object for managing a BNO08x sensor.

Parameters

  imu_config | Configuration settings (optional), default settings can be seen in bno08x_config_t

Returns
  void, nothing to return

## ~BNO08x()

BNO08x::~BNO08x | ( |  | ) |

BNO08x imu deconstructor.

Deconstructs a BNO08x object and releases any utilized resources.

Returns
  void, nothing to return.

Here is the call graph for this function:

## Member Function Documentation

## accuracy_to_str()

const char * BNO08x::accuracy_to_str | ( | BNO08xAccuracy | accuracy | ) |

static

Here is the caller graph for this function:

## activity_to_str()

const char * BNO08x::activity_to_str | ( | BNO08xActivity | activity | ) |

static

Converts a BNO08xActivity enum to string.

Returns
  The resulting string conversion of the enum.

## calibration_end()

bool BNO08x::calibration_end | ( | sh2_CalStatus_t & | status | ) |

Ends turn-table calibration, see ref. manual 6.4.10.2.

Parameters

  status | Returned status bits indicating result of turntable calibration.

Returns
  True if enable start turn-table calibration operation succeeded.

Here is the call graph for this function:

## calibration_start()

bool BNO08x::calibration_start | ( | uint32_t | period_us | ) |

Starts simple calibration, see ref. manual 6.4.10.1.

Parameters

  period_us | This interval should be set to whatever rate the sensor hub is expected to run at after calibration.

After the calibration is started, the IMU should be rotated 180 degrees. After the IMU has been rotated call calibration_end(). See ref. manual 6.4.10 for more detailed instructions.

Returns
  True if start simple calibration operation succeeded.

Here is the call graph for this function:

## cb_task()

void BNO08x::cb_task | ( |  | ) |

private

Task responsible for executing callbacks registered with register_cb().

Returns
  void, nothing to return

Here is the call graph for this function:
Here is the caller graph for this function:

## cb_task_trampoline()

void BNO08x::cb_task_trampoline | ( | void * | arg | ) |

staticprivate

Static function used to launch cb_task task.

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

Parameters

  arg | void pointer to BNO08x imu object

Returns
  void, nothing to return

Here is the call graph for this function:
Here is the caller graph for this function:

## clear_dynamic_calibration()

bool BNO08x::clear_dynamic_calibration | ( |  | ) |

Clears dynamic/motion engine calibration data and resets BNO08x device. See ref manual 6.4.9.1.

Returns
  True if save dynamic/ME calibration data succeeded.

Here is the call graph for this function:
Here is the caller graph for this function:

## data_available()

bool BNO08x::data_available | ( |  | ) |

Polls for new data/report to become available.

Returns
  True if new data/report became available before DATA_AVAILABLE_TIMEOUT_MS.

Here is the caller graph for this function:

## data_proc_task()

void BNO08x::data_proc_task | ( |  | ) |

private

Task responsible for parsing/handling sensor events sent by SH2 HAL and updating data that is returned to user.

Returns
  void, nothing to return

Here is the call graph for this function:
Here is the caller graph for this function:

## data_proc_task_trampoline()

void BNO08x::data_proc_task_trampoline | ( | void * | arg | ) |

staticprivate

Static function used to launch data processing task.

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

Parameters

  arg | void pointer to BNO08x imu object

Returns
  void, nothing to return

Here is the call graph for this function:
Here is the caller graph for this function:

## deinit_gpio()

esp_err_t BNO08x::deinit_gpio | ( |  | ) |

private

Deinitializes GPIO, called from deconstructor.

Returns
  ESP_OK if deinitialization was success.

Here is the call graph for this function:
Here is the caller graph for this function:

## deinit_gpio_inputs()

esp_err_t BNO08x::deinit_gpio_inputs | ( |  | ) |

private

Deinitializes GPIO inputs, called from deconstructor.

Returns
  ESP_OK if deinitialization was success.

Here is the caller graph for this function:

## deinit_gpio_outputs()

esp_err_t BNO08x::deinit_gpio_outputs | ( |  | ) |

private

Deinitializes GPIO outputs, called from deconstructor.

Returns
  ESP_OK if deinitialization was success.

Here is the caller graph for this function:

## deinit_hint_isr()

esp_err_t BNO08x::deinit_hint_isr | ( |  | ) |

private

Deinitializes host interrupt ISR, called from deconstructor.

Returns
  ESP_OK if deinitialization was success.

Here is the caller graph for this function:

## deinit_sh2_HAL()

esp_err_t BNO08x::deinit_sh2_HAL | ( |  | ) |

private

Deinitializes sh2 HAL.

Returns
  ESP_OK if deinitialization was success.

Here is the caller graph for this function:

## deinit_spi()

esp_err_t BNO08x::deinit_spi | ( |  | ) |

private

Deinitializes SPI.

Returns
  ESP_OK if deinitialization was success.

Here is the caller graph for this function:

## deinit_tasks()

esp_err_t BNO08x::deinit_tasks | ( |  | ) |

private

Deinitializes tasks used by BNO08x driver.

Returns
  ESP_OK if deinitialization was success.

Here is the caller graph for this function:

## disable_all_reports()

bool BNO08x::disable_all_reports | ( |  | ) |

Disables all currently enabled reports.

Returns
  True if all currently enabled reports were disabled successfully.

Here is the caller graph for this function:

## dynamic_calibration_autosave_disable()

bool BNO08x::dynamic_calibration_autosave_disable | ( |  | ) |

Disables the automatic saving of dynamic/ME calibration data to BNO08x internal flash See ref manual 6.4.7.1.

Returns
  True if dynamic/ME calibration autosave data enable succeeded.

Here is the call graph for this function:
Here is the caller graph for this function:

## dynamic_calibration_autosave_enable()

bool BNO08x::dynamic_calibration_autosave_enable | ( |  | ) |

Enables the automatic saving of dynamic/ME calibration data to BNO08x internal flash See ref manual 6.4.7.1.

Returns
  True if dynamic/ME calibration autosave data enable succeeded.

Here is the call graph for this function:
Here is the caller graph for this function:

## dynamic_calibration_disable()

bool BNO08x::dynamic_calibration_disable | ( | BNO08xCalSel | sensor | ) |

Disables dynamic/motion engine calibration for specified sensor(s), see ref. manual 6.4.6.1.

Parameters

  sensor | The sensor(s) to disable dynamic/ME calibration for.

Returns
  True if disable dynamic/ME calibration succeeded.

Here is the call graph for this function:
Here is the caller graph for this function:

## dynamic_calibration_enable()

bool BNO08x::dynamic_calibration_enable | ( | BNO08xCalSel | sensor | ) |

Enables dynamic/motion engine calibration for specified sensor(s), see ref. manual 6.4.6.1.

Parameters

  sensor | The sensor(s) to enable dynamic/ME calibration for.

Returns
  True if enable dynamic/ME calibration succeeded.

Here is the call graph for this function:
Here is the caller graph for this function:

## get_frs()

bool BNO08x::get_frs | ( | uint16_t | frs_ID,
|  | uint32_t(&) | data[16],
|  | uint16_t & | rx_data_sz )

Retrieves a record from flash record system (if your goal is to retrieve meta data use the BNO08xRpt:get_meta_data() method instead)

For more details on returned and data and frs_ID see ref. manual 6.3.7 & 4.3

Parameters

  frs_ID | The ID of the desired record to retrieve from flash.
  data | Buffer of 16 uint32_t to store retrieved data.
  rx_data_sz | Reference to store number of 32 bit words retrieved from flash.

Returns
  True if get flash record system operation succeeded.

Here is the call graph for this function:

## get_product_IDs()

sh2_ProductIds_t BNO08x::get_product_IDs | ( |  | ) |

Returns product ID info sent by IMU at initialization.

Returns
  The product ID info returned at initialization.

## get_reset_reason()

BNO08xResetReason BNO08x::get_reset_reason | ( |  | ) |

Returns reason for previous reset via product ID report.

Returns
  Enum object containing reset reason, BNO08xResetReason::UNDEFINED if failure.

Here is the call graph for this function:
Here is the caller graph for this function:

## handle_cb()

void BNO08x::handle_cb | ( | uint8_t | rpt_ID,
|  | BNO08xCbGeneric * | cb_entry )

private

Determines the flavor of a passed callback and executes it appropriately.

Returns
  void, nothing to return

Here is the call graph for this function:
Here is the caller graph for this function:

## handle_sensor_report()

void BNO08x::handle_sensor_report | ( | sh2_SensorValue_t * | sensor_val | ) |

private

Parses receieved report and updates uer data with it.

Returns
  void, nothing to return

Here is the caller graph for this function:

## hard_reset()

bool BNO08x::hard_reset | ( |  | ) |

Hard resets BNO08x device.

Returns
  True if reset was success.

Here is the call graph for this function:
Here is the caller graph for this function:

## 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

Here is the caller graph for this function:

## init_config_args()

esp_err_t BNO08x::init_config_args | ( |  | ) |

private

Initializes required esp-idf SPI data structures with values from user passed bno08x_config_t struct.

Returns
  ESP_OK if initialization was success.

Here is the caller graph for this function:

## init_gpio()

esp_err_t BNO08x::init_gpio | ( |  | ) |

private

Initializes required gpio.

Returns
  ESP_OK if initialization was success.

Here is the call graph for this function:
Here is the caller graph for this function:

## init_gpio_inputs()

esp_err_t BNO08x::init_gpio_inputs | ( |  | ) |

private

Initializes required gpio inputs.

Returns
  ESP_OK if initialization was success.

Here is the caller graph for this function:

## init_gpio_outputs()

esp_err_t BNO08x::init_gpio_outputs | ( |  | ) |

private

Initializes required gpio outputs.

Returns
  ESP_OK if initialization was success.

Here is the caller graph for this function:

## init_hint_isr()

esp_err_t BNO08x::init_hint_isr | ( |  | ) |

private

Initializes host interrupt ISR.

Returns
  ESP_OK if initialization was success.

Here is the call graph for this function:
Here is the caller graph for this function:

## init_sh2_HAL()

esp_err_t BNO08x::init_sh2_HAL | ( |  | ) |

private

Initializes sh2 HAL.

Returns
  ESP_OK if initialization was success.

Here is the call graph for this function:
Here is the caller graph for this function:

## init_spi()

esp_err_t BNO08x::init_spi | ( |  | ) |

private

Initializes SPI.

Returns
  ESP_OK if initialization was success.

Here is the caller graph for this function:

## init_tasks()

esp_err_t BNO08x::init_tasks | ( |  | ) |

private

Initializes data_proc_task.

Returns
  ESP_OK if initialization was success.

Here is the call graph for this function:
Here is the caller graph for this function:

## initialize()

bool BNO08x::initialize | ( |  | ) |

Initializes BNO08x sensor.

Resets sensor and goes through initialization process. Configures GPIO, required ISRs, and launches two tasks, one to manage SPI transactions, another to process any received data.

Returns
  True if initialization was success, false if otherwise.

Here is the call graph for this function:
Here is the caller graph for this function:

## lock_sh2_HAL()

void BNO08x::lock_sh2_HAL | ( |  | ) |

private

Locks sh2 HAL lib to only allow the calling task to call its APIs.

Returns
  void, nothing to return

Here is the caller graph for this function:

## lock_user_data()

void BNO08x::lock_user_data | ( |  | ) |

private

Locks locks user data to only allow the calling task to read/modify it.

Returns
  void, nothing to return

## on()

bool BNO08x::on | ( |  | ) |

Places BNO08x device in on state by sending ON (2) command on "device" channel.

Returns
  True if on operation succeeded.

Here is the call graph for this function:
Here is the caller graph for this function:

## print_product_ids()

void BNO08x::print_product_ids | ( |  | ) |

Prints product IDs received at initialization.

Returns
  void, nothing to return

Here is the caller graph for this function:

## re_enable_reports()

esp_err_t BNO08x::re_enable_reports | ( |  | ) |

private

Re-enables all reports enabled by user (called when BNO08x reset is detected by sh2 HAL lib).

Returns
  ESP_OK if enabled reports were successfuly re-enabled.

Here is the caller graph for this function:

## register_cb() [1/2]

bool BNO08x::register_cb | ( | std::function< void(uint8_t report_ID)> | cb_fxn | ) |

Registers a callback to execute when new data from a report is received, overloaded with callback param for most recent report ID.

Parameters

  cb_fxn | Pointer to the call-back function should be of void return type with single input param of uint8_t for most recent report ID.

Returns
  void, nothing to return

## register_cb() [2/2]

bool BNO08x::register_cb | ( | std::function< void(void)> | cb_fxn | ) |

Registers a callback to execute when new data from a report is received.

Parameters

  cb_fxn | Pointer to the call-back function should be of void return type void input param.

Returns
  void, nothing to return

Here is the caller graph for this function:

## save_dynamic_calibration()

bool BNO08x::save_dynamic_calibration | ( |  | ) |

Saves dynamic/motion engine calibration data to BNO08x internal flash immediately. See ref manual 6.4.5.1.

Returns
  True if save dynamic/ME calibration data succeeded.

Here is the call graph for this function:
Here is the caller graph for this function:

## sh2_HAL_service_task()

void BNO08x::sh2_HAL_service_task | ( |  | ) |

private

Task responsible for calling shtp_service() when HINT is asserted to dispatch any sh2 HAL lib callbacks.

Returns
  void, nothing to return

Here is the call graph for this function:
Here is the caller graph for this function:

## sh2_HAL_service_task_trampoline()

void BNO08x::sh2_HAL_service_task_trampoline | ( | void * | arg | ) |

staticprivate

Static function used to launch sh2 HAL service task.

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

Parameters

  arg | void pointer to BNO08x imu object

Returns
  void, nothing to return

Here is the call graph for this function:
Here is the caller graph for this function:

## sleep()

bool BNO08x::sleep | ( |  | ) |

Places BNO08x device in sleep state by sending SLEEP (3) command on "device" channel.

Returns
  True if sleep operation succeeded.

Here is the call graph for this function:
Here is the caller graph for this function:

## soft_reset()

bool BNO08x::soft_reset | ( |  | ) |

Soft resets BNO08x device by sending RESET (1) command on "device" channel.

Returns
  True if soft reset operation succeeded.

Here is the call graph for this function:
Here is the caller graph for this function:

## stability_to_str()

const char * BNO08x::stability_to_str | ( | BNO08xStability | stability | ) |

static

Converts a BNO08xStability enum to string.

Returns
  The resulting string conversion of the enum.

## toggle_reset()

void BNO08x::toggle_reset | ( |  | ) |

private

Toggles reset gpio pin for hard reset of BNO08x device.

Returns
  void, nothing to return

Here is the caller graph for this function:

## unlock_sh2_HAL()

void BNO08x::unlock_sh2_HAL | ( |  | ) |

private

Unlocks sh2 HAL lib to allow other tasks to call its APIs.

Returns
  void, nothing to return

Here is the caller graph for this function:

## unlock_user_data()

void BNO08x::unlock_user_data | ( |  | ) |

private

Unlocks user data to allow other tasks to read/modify it.

Returns
  void, nothing to return

## wait_for_hint()

esp_err_t BNO08x::wait_for_hint | ( |  | ) |

private

Waits for HINT pin assertion or HOST_INT_TIMEOUT_DEFAULT_MS to elapse.

Returns
  ESP_OK if HINT was asserted.

Here is the caller graph for this function:

## wait_for_reset()

esp_err_t BNO08x::wait_for_reset | ( |  | ) |

private

Waits for SH2 HAL lib to detect reset or HOST_INT_TIMEOUT_DEFAULT_MS to elapse.

Returns
  ESP_OK if reset was detected by SH2 HAL lib.

Here is the caller graph for this function:

## Friends And Related Symbol Documentation

## BNO08xSH2HAL

friend class BNO08xSH2HAL

friend

## BNO08xTestHelper

friend class BNO08xTestHelper

friend

## Member Data Documentation

## bus_config

spi_bus_config_t BNO08x::bus_config {}

private

SPI bus GPIO configuration settings.

## cb_task_hdl

TaskHandle_t BNO08x::cb_task_hdl

private

sh2_HAL_service_task() task handle

## CB_TASK_SZ

const constexpr configSTACK_DEPTH_TYPE BNO08x::CB_TASK_SZ

staticconstexprprivate

Initial value:
=
CONFIG_ESP32_BNO08X_CB_TASK_SZ

Size of sh2_HAL_service_task() stack in bytes.

## DATA_AVAILABLE_TIMEOUT_MS

const constexpr TickType_t BNO08x::DATA_AVAILABLE_TIMEOUT_MS

staticconstexprprivate

Initial value:
=
CONFIG_ESP32_BNO08X_DATA_AVAILABLE_TIMEOUT_MS /
portTICK_PERIOD_MS

Max wait between data_available() being called and no new data/report being detected.

## data_proc_task_hdl

TaskHandle_t BNO08x::data_proc_task_hdl

private

data_proc_task() task handle

## DATA_PROC_TASK_SZ

const constexpr configSTACK_DEPTH_TYPE BNO08x::DATA_PROC_TASK_SZ

staticconstexprprivate

Initial value:
=
CONFIG_ESP32_BNO08X_DATA_PROC_TASK_SZ

Size of data_proc_task() stack in bytes.

## HARD_RESET_DELAY_MS

const constexpr TickType_t BNO08x::HARD_RESET_DELAY_MS

staticconstexprprivate

Initial value:
=
CONFIG_ESP32_BNO08X_HARD_RESET_DELAY_MS /
portTICK_PERIOD_MS

How long RST pin is held low during hard reset (min 10ns according to datasheet, but should be longer for stable operation)

## HOST_INT_TIMEOUT_DEFAULT_MS

const constexpr TickType_t BNO08x::HOST_INT_TIMEOUT_DEFAULT_MS

staticconstexprprivate

Initial value:
=
CONFIG_ESP32_BNO08X_HINT_TIMEOUT_MS /
portTICK_PERIOD_MS

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.

## init_status

BNO08xPrivateTypes::bno08x_init_status_t BNO08x::init_status

private

Initialization status of various functionality, used by deconstructor during cleanup, set during initialization.

## product_IDs

sh2_ProductIds_t BNO08x::product_IDs

private

Product ID info returned IMU at initialization, can be viewed with print_product_ids()

## queue_cb_report_id

QueueHandle_t BNO08x::queue_cb_report_id

private

Queue to send report ID of most recent report to cb_task()

## queue_rx_sensor_event

QueueHandle_t BNO08x::queue_rx_sensor_event

private

Queue to send sensor events from sh2 HAL sensor event callback (BNO08xSH2HAL::sensor_event_cb()) to data_proc_task()

## rpt

bno08x_reports_t BNO08x::rpt

## RX_DATA_LENGTH

const constexpr uint16_t BNO08x::RX_DATA_LENGTH = 300U

staticconstexprprivate

length buffer containing data received over spi

## SCLK_MAX_SPEED

const constexpr uint32_t BNO08x::SCLK_MAX_SPEED = 3000000UL

staticconstexprprivate

Max SPI SCLK speed BNO08x is capable of.

## sem_kill_tasks

SemaphoreHandle_t BNO08x::sem_kill_tasks

private

Counting Semaphore to count amount of killed tasks.

## sh2_HAL

sh2_Hal_t BNO08x::sh2_HAL

private

sh2 hardware abstraction layer struct for use with sh2 HAL lib.

## sh2_HAL_service_task_hdl

TaskHandle_t BNO08x::sh2_HAL_service_task_hdl

private

sh2_HAL_service_task() task handle

## SH2_HAL_SERVICE_TASK_SZ

const constexpr configSTACK_DEPTH_TYPE BNO08x::SH2_HAL_SERVICE_TASK_SZ

staticconstexprprivate

Initial value:
=
CONFIG_ESP32_BNO08X_SH2_HAL_SERVICE_TASK_SZ

Size of sh2_HAL_service_task() stack in bytes.

## spi_hdl

spi_device_handle_t BNO08x::spi_hdl {}

private

SPI device handle.

## spi_transaction

spi_transaction_t BNO08x::spi_transaction {}

private

SPI transaction handle.

## sync_ctx

BNO08xPrivateTypes::bno08x_sync_ctx_t BNO08x::sync_ctx

private

Holds context used to synchronize tasks and callback execution.

## TAG

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

staticconstexprprivate

Class tag used for serial print statements.

## usr_reports

etl::map<uint8_t, BNO08xRpt*, TOTAL_RPT_COUNT, etl::less<uint8_t> > BNO08x::usr_reports

private

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

- include/BNO08x.hpp
- source/BNO08x.cpp