|
esp32_BNO08x 1.31
C++ BNO08x IMU driver component for esp-idf.
|
Class to represent and manage reports returned from BNO08x. More...
#include <BNO08xRpt.hpp>


Public Member Functions | |
| bool | disable (sh2_SensorConfig_t sensor_cfg=BNO08xPrivateTypes::default_sensor_cfg) |
| Disables a sensor report by setting its period to 0us such that the BNO08x stops sending it. | |
| bool | register_cb (std::function< void(void)> cb_fxn) |
| Registers a callback to execute when new data from a specific report is received. | |
| bool | has_new_data () |
| Checks if a new report has been received since the last time this function was called. | |
| bool | flush () |
| Flush all buffered reports for this sensor/report module. | |
| bool | get_sample_counts (bno08x_sample_counts_t &sample_counts) |
| Gets sample counts for this sensor (see SH-2 ref manual 6.4.3.1) | |
| bool | clear_sample_counts () |
| Clears BNO08x internal sample counts for this sensor. (see SH-2 ref manual 6.4.3.1) | |
| bool | get_meta_data (bno08x_meta_data_t &meta_data) |
| Retrieves meta data for this sensor/report by reading respective record in FRS (flash record system). | |
| virtual bool | enable (uint32_t time_between_reports, sh2_SensorConfig_t sensor_cfg=BNO08xPrivateTypes::default_sensor_cfg)=0 |
Protected Member Functions | |
| bool | rpt_enable (uint32_t time_between_reports, sh2_SensorConfig_t sensor_cfg=BNO08xPrivateTypes::default_sensor_cfg) |
| Enables a sensor report such that the BNO08x begins sending it. | |
| virtual void | update_data (sh2_SensorValue_t *sensor_val)=0 |
| BNO08xRpt (uint8_t ID, EventBits_t rpt_bit, BNO08xPrivateTypes::bno08x_sync_ctx_t *sync_ctx) | |
| BNO08xRpt report constructor. | |
| void | unlock_sh2_HAL () |
| Unlocks sh2 HAL lib to allow other tasks to call its APIs. | |
| void | lock_sh2_HAL () |
| Locks sh2 HAL lib to only allow the calling task to call its APIs. | |
| void | unlock_user_data () |
| Unlocks user data to allow other tasks to read/modify it. | |
| void | lock_user_data () |
| Locks locks user data to only allow the calling task to read/modify it. | |
| void | signal_data_available () |
| Signals to BNO08x::data_available() that a new report has arrived. | |
Protected Attributes | |
| uint8_t | ID |
| Report ID, ex. SH2_ACCELERATION. | |
| EventBits_t | rpt_bit |
| Respective enable and data bit for report in evt_grp_rpt_en and evt_grp_rpt_data. | |
| uint32_t | period_us |
| The period/interval of the report in microseconds. | |
| BNO08xPrivateTypes::bno08x_sync_ctx_t * | sync_ctx |
Static Protected Attributes | |
| static const constexpr float | RAD_2_DEG |
| Constant for radian to degree conversions, sed in quaternion to euler function conversions. | |
| static const constexpr char * | TAG = "BNO08xRpt" |
Friends | |
| class | BNO08x |
Class to represent and manage reports returned from BNO08x.
|
inlineprotected |
BNO08xRpt report constructor.
Construct a BNO08xRpt object for managing a BNO08x sensor report.
| imu | Pointer to BNO08x imu object. |
| report_ID | Report ID, ex. SH2_ACCELERATION. |
| rpt_bit | Respective enable bit for report in BNO08x::evt_grp_report_en. |
| period_us | The period/interval of the report in microseconds. |
| bool BNO08xRpt::clear_sample_counts | ( | ) |
Clears BNO08x internal sample counts for this sensor. (see SH-2 ref manual 6.4.3.1)

| bool BNO08xRpt::disable | ( | sh2_SensorConfig_t | sensor_cfg = BNO08xPrivateTypes::default_sensor_cfg | ) |
Disables a sensor report by setting its period to 0us such that the BNO08x stops sending it.
| sensor_ID | The ID of the sensor for the respective report to be disabled. |
| sensor_cfg | Sensor special configuration. |


|
pure virtual |
Implemented in BNO08xRptAcceleration, BNO08xRptActivityClassifier, BNO08xRptCalGyro, BNO08xRptCalMagnetometer, BNO08xRptGravity, BNO08xRptLinearAcceleration, BNO08xRptRawMEMSAccelerometer, BNO08xRptRawMEMSGyro, BNO08xRptRawMEMSMagnetometer, BNO08xRptRVGeneric, BNO08xRptShakeDetector, BNO08xRptStabilityClassifier, BNO08xRptStepCounter, BNO08xRptTapDetector, BNO08xRptUncalGyro, and BNO08xRptUncalMagnetometer.
| bool BNO08xRpt::flush | ( | ) |
Flush all buffered reports for this sensor/report module.

| bool BNO08xRpt::get_meta_data | ( | bno08x_meta_data_t & | meta_data | ) |
Retrieves meta data for this sensor/report by reading respective record in FRS (flash record system).
Can be used to retrieve the minimum period, maximum period, actual Q points, resolution, and other info for a given sensor.


| bool BNO08xRpt::get_sample_counts | ( | bno08x_sample_counts_t & | sample_counts | ) |
Gets sample counts for this sensor (see SH-2 ref manual 6.4.3.1)
| Struct | to store requested data. |


| bool BNO08xRpt::has_new_data | ( | ) |
Checks if a new report has been received since the last time this function was called.

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

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

| bool BNO08xRpt::register_cb | ( | std::function< void(void)> | cb_fxn | ) |
Registers a callback to execute when new data from a specific report is received.
| cb_fxn | Pointer to the call-back function should be of void return type void input param. |

|
protected |
Enables a sensor report such that the BNO08x begins sending it.
| report_period_us | The period/interval of the report in microseconds. |
| sensor_cfg | Sensor special configuration (optional, see BNO08xPrivateTypes::default_sensor_cfg for defaults). |


|
protected |
Signals to BNO08x::data_available() that a new report has arrived.

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

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

|
protectedpure virtual |
Implemented in BNO08xRptAcceleration, BNO08xRptActivityClassifier, BNO08xRptARVRStabilizedGameRV, BNO08xRptARVRStabilizedRV, BNO08xRptCalGyro, BNO08xRptCalMagnetometer, BNO08xRptGameRV, BNO08xRptGravity, BNO08xRptIGyroRV, BNO08xRptLinearAcceleration, BNO08xRptRawMEMSAccelerometer, BNO08xRptRawMEMSGyro, BNO08xRptRawMEMSMagnetometer, BNO08xRptRV, BNO08xRptRVGeomag, BNO08xRptShakeDetector, BNO08xRptStabilityClassifier, BNO08xRptStepCounter, BNO08xRptTapDetector, BNO08xRptUncalGyro, and BNO08xRptUncalMagnetometer.
|
friend |
|
protected |
Report ID, ex. SH2_ACCELERATION.
|
protected |
The period/interval of the report in microseconds.
|
staticconstexprprotected |
Constant for radian to degree conversions, sed in quaternion to euler function conversions.
|
protected |
Respective enable and data bit for report in evt_grp_rpt_en and evt_grp_rpt_data.
|
protected |
|
staticconstexprprotected |