Class to represent and manage reports returned from BNO08x.
More...
#include <report/BNO08xRpt.hpp>
|
| 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. More...
|
| |
| bool | register_cb (std::function< void(void)> cb_fxn) |
| | Registers a callback to execute when new data from a specific report is received. More...
|
| |
| bool | has_new_data () |
| | Checks if a new report has been received since the last time this function was called. More...
|
| |
| bool | flush () |
| | Flush all buffered reports for this sensor/report module. More...
|
| |
| 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) More...
|
| |
| bool | clear_sample_counts () |
| | Clears BNO08x internal sample counts for this sensor. (see SH-2 ref manual 6.4.3.1) More...
|
| |
| 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). More...
|
| |
| virtual bool | enable (uint32_t time_between_reports, sh2_SensorConfig_t sensor_cfg=BNO08xPrivateTypes::default_sensor_cfg)=0 |
| |
|
| static const constexpr float | RAD_2_DEG |
| | Constant for radian to degree conversions, sed in quaternion to euler function conversions. More...
|
| |
| static const constexpr char * | TAG = "BNO08xRpt" |
| |
Class to represent and manage reports returned from BNO08x.
◆ BNO08xRpt()
BNO08xRpt report constructor.
Construct a BNO08xRpt object for managing a BNO08x sensor report.
- Parameters
-
| 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. |
- Returns
- void, nothing to return
◆ clear_sample_counts()
| bool BNO08xRpt::clear_sample_counts |
( |
| ) |
|
Clears BNO08x internal sample counts for this sensor. (see SH-2 ref manual 6.4.3.1)
- Returns
- True clear counts operation succeeded.
◆ disable()
| 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.
- Parameters
-
| sensor_ID | The ID of the sensor for the respective report to be disabled. |
| sensor_cfg | Sensor special configuration. |
- Returns
- ESP_OK if report was successfully disabled.
◆ enable()
| virtual bool BNO08xRpt::enable |
( |
uint32_t |
time_between_reports, |
|
|
sh2_SensorConfig_t |
sensor_cfg = BNO08xPrivateTypes::default_sensor_cfg |
|
) |
| |
|
pure virtual |
Implemented in BNO08xRptAcceleration, BNO08xRptActivityClassifier, BNO08xRptCalGyro, BNO08xRptCalMagnetometer, BNO08xRptGravity, BNO08xRptLinearAcceleration, BNO08xRptRawMEMSAccelerometer, BNO08xRptRawMEMSGyro, BNO08xRptRawMEMSMagnetometer, BNO08xRptRVGeneric, BNO08xRptShakeDetector, BNO08xRptStabilityClassifier, BNO08xRptStepCounter, BNO08xRptTapDetector, BNO08xRptUncalGyro, and BNO08xRptUncalMagnetometer.
◆ flush()
| bool BNO08xRpt::flush |
( |
| ) |
|
Flush all buffered reports for this sensor/report module.
- Returns
- True if flush operation succeeded.
◆ get_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.
- Returns
- True clear get meta data operation succeeded.
◆ get_sample_counts()
Gets sample counts for this sensor (see SH-2 ref manual 6.4.3.1)
- Parameters
-
| Struct | to store requested data. |
- Returns
- True get counts operation succeeded.
◆ has_new_data()
| bool BNO08xRpt::has_new_data |
( |
| ) |
|
Checks if a new report has been received since the last time this function was called.
- Returns
- True if a new report was received since the last time this function was called.
◆ lock_sh2_HAL()
| void BNO08xRpt::lock_sh2_HAL |
( |
| ) |
|
|
protected |
Locks sh2 HAL lib to only allow the calling task to call its APIs.
- Returns
- void, nothing to return
◆ lock_user_data()
| void BNO08xRpt::lock_user_data |
( |
| ) |
|
|
protected |
Locks locks user data to only allow the calling task to read/modify it.
- Returns
- void, nothing to return
◆ register_cb()
| bool BNO08xRpt::register_cb |
( |
std::function< void(void)> |
cb_fxn | ) |
|
Registers a callback to execute when new data from a specific 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
◆ rpt_enable()
| bool BNO08xRpt::rpt_enable |
( |
uint32_t |
time_between_reports, |
|
|
sh2_SensorConfig_t |
sensor_cfg = BNO08xPrivateTypes::default_sensor_cfg |
|
) |
| |
|
protected |
Enables a sensor report such that the BNO08x begins sending it.
- Parameters
-
| report_period_us | The period/interval of the report in microseconds. |
| sensor_cfg | Sensor special configuration (optional, see BNO08xPrivateTypes::default_sensor_cfg for defaults). |
- Returns
- True if report was successfully enabled.
◆ signal_data_available()
| void BNO08xRpt::signal_data_available |
( |
| ) |
|
|
protected |
◆ unlock_sh2_HAL()
| void BNO08xRpt::unlock_sh2_HAL |
( |
| ) |
|
|
protected |
Unlocks sh2 HAL lib to allow other tasks to call its APIs.
- Returns
- void, nothing to return
◆ unlock_user_data()
| void BNO08xRpt::unlock_user_data |
( |
| ) |
|
|
protected |
Unlocks user data to allow other tasks to read/modify it.
- Returns
- void, nothing to return
◆ update_data()
| virtual void BNO08xRpt::update_data |
( |
sh2_SensorValue_t * |
sensor_val | ) |
|
|
protectedpure virtual |
◆ BNO08x
◆ ID
Report ID, ex. SH2_ACCELERATION.
◆ period_us
| uint32_t BNO08xRpt::period_us |
|
protected |
The period/interval of the report in microseconds.
◆ RAD_2_DEG
| const constexpr float BNO08xRpt::RAD_2_DEG |
|
staticconstexprprotected |
Initial value:
Constant for radian to degree conversions, sed in quaternion to euler function conversions.
◆ rpt_bit
| EventBits_t BNO08xRpt::rpt_bit |
|
protected |
Respective enable and data bit for report in evt_grp_rpt_en and evt_grp_rpt_data.
◆ sync_ctx
◆ TAG
| const constexpr char* BNO08xRpt::TAG = "BNO08xRpt" |
|
staticconstexprprotected |
The documentation for this class was generated from the following files: