/** * @file BNO08xPrivateTypes.hpp * @author Myles Parfeniuk */ #pragma once // etl includes #include #include // esp-idf includes #include #include #include // in-house includes #include "BNO08xGlobalTypes.hpp" #include "BNO08xCbParamRptID.hpp" #include "BNO08xCbParamVoid.hpp" namespace BNO08xPrivateTypes { using bno08x_cb_list_t = etl::vector, CONFIG_ESP32_BNO08X_CB_MAX>; ///< Alias for vector type to contain both cb flavors. /// @brief Holds info about which functionality has been successfully initialized (used by deconstructor during cleanup). typedef struct bno08x_init_status_t { bool gpio_outputs; ///< True if GPIO outputs have been initialized. bool gpio_inputs; ///< True if GPIO inputs have been initialized. bool isr_service; ///< True if global ISR service has been initialized. bool isr_handler; ///< True if HINT ISR handler has been initialized. bool spi_bus; ///< True if spi_bus_initialize() has been called successfully. bool spi_device; ///< True if spi_bus_add_device() has been called successfully. bool sh2_HAL; ///< True if sh2_open() has been called successfully. bool data_proc_task; ///< True if xTaskCreate has been called successfully for data_proc_task. bool sh2_HAL_service_task; ///< True if xTaskCreate has been called successfully for sh2_HAL_service_task. bool cb_task; ///< True if xTaskCreate has been called successfully for cb_task. bno08x_init_status_t() : gpio_outputs(false) , gpio_inputs(false) , isr_service(false) , isr_handler(false) , spi_bus(false) , spi_device(false) , data_proc_task(false) , sh2_HAL_service_task(false) , cb_task(false) { } } bno08x_init_status_t; /// @brief Holds info used to initialize report modules. typedef struct bno08x_report_info_t { uint8_t ID; EventBits_t rpt_bit; SemaphoreHandle_t* _sh2_HAL_lock; SemaphoreHandle_t* _data_lock; EventGroupHandle_t* _evt_grp_rpt_en; EventGroupHandle_t* _evt_grp_rpt_data_available; EventGroupHandle_t* _evt_grp_bno08x_task; etl::vector* _en_report_ids; bno08x_cb_list_t* _cb_list; bno08x_report_info_t(uint8_t ID, EventBits_t rpt_bit, SemaphoreHandle_t* _sh2_HAL_lock, SemaphoreHandle_t* _data_lock, EventGroupHandle_t* _evt_grp_rpt_en, EventGroupHandle_t* _evt_grp_rpt_data_available, EventGroupHandle_t* _evt_grp_bno08x_task, etl::vector* _en_report_ids, bno08x_cb_list_t* _cb_list) : ID(ID) , rpt_bit(rpt_bit) , _sh2_HAL_lock(_sh2_HAL_lock) , _data_lock(_data_lock) , _evt_grp_rpt_en(_evt_grp_rpt_en) , _evt_grp_rpt_data_available(_evt_grp_rpt_data_available) , _evt_grp_bno08x_task(_evt_grp_bno08x_task) , _en_report_ids(_en_report_ids) , _cb_list(_cb_list) { } } bno08x_report_info_t; inline static sh2_SensorConfig default_sensor_cfg = {.changeSensitivityEnabled = false, ///