# esp32_BNO08x: include/report/BNO08xRptStepCounter.hpp Source File

Loading...
Searching...
No Matches
BNO08xRptStepCounter.hpp
Go to the documentation of this file.
#pragma once
#include "BNO08xRpt.hpp"
class BNO08xRptStepCounter : public BNO08xRpt
{
public:
BNO08xRptStepCounter(uint8_t ID, EventBits_t rpt_bit, BNO08xPrivateTypes::bno08x_sync_ctx_t* sync_ctx)
: BNO08xRpt(ID, rpt_bit, sync_ctx)
{
}
bool enable(
uint32_t time_between_reports, sh2_SensorConfig_t sensor_cfg = BNO08xPrivateTypes::default_sensor_cfg) override;
bno08x_step_counter_t get();
uint32_t get_total_steps();
private:
void update_data(sh2_SensorValue_t* sensor_val) override;
bno08x_step_counter_t data;
uint32_t step_accumulator =
0UL;
static const constexpr char* TAG = "BNO08xRptStepCounter";
};
BNO08xRpt.hpp
BNO08xRpt
Class to represent and manage reports returned from BNO08x.
Definition BNO08xRpt.hpp:26
BNO08xRpt::sync_ctx
BNO08xPrivateTypes::bno08x_sync_ctx_t * sync_ctx
Definition BNO08xRpt.hpp:42
BNO08xRpt::ID
uint8_t ID
Report ID, ex. SH2_ACCELERATION.
Definition BNO08xRpt.hpp:39
BNO08xRpt::rpt_bit
EventBits_t rpt_bit
Respective enable and data bit for report in evt_grp_rpt_en and evt_grp_rpt_data.
Definition BNO08xRpt.hpp:40
BNO08xRptStepCounter
Class to represent step counter reports. (See Ref. Manual 6.5.29)
Definition BNO08xRptStepCounter.hpp:16
BNO08xRptStepCounter::get_total_steps
uint32_t get_total_steps()
Grabs the total step count since boot, accounts for rollover in report data.
Definition BNO08xRptStepCounter.cpp:70
BNO08xRptStepCounter::BNO08xRptStepCounter
BNO08xRptStepCounter(uint8_t ID, EventBits_t rpt_bit, BNO08xPrivateTypes::bno08x_sync_ctx_t *sync_ctx)
Definition BNO08xRptStepCounter.hpp:18
BNO08xRptStepCounter::update_data
void update_data(sh2_SensorValue_t *sensor_val) override
Updates step counter data from decoded sensor event.
Definition BNO08xRptStepCounter.cpp:15
BNO08xRptStepCounter::TAG
static const constexpr char * TAG
Definition BNO08xRptStepCounter.hpp:33
BNO08xRptStepCounter::step_accumulator
uint32_t step_accumulator
Every time step count rolls over, the previous steps are accumulated here such that the total steps c...
Definition BNO08xRptStepCounter.hpp:31
BNO08xRptStepCounter::data
bno08x_step_counter_t data
Most recent report data, doesn't account for step rollover.
Definition BNO08xRptStepCounter.hpp:30
BNO08xRptStepCounter::enable
bool enable(uint32_t time_between_reports, sh2_SensorConfig_t sensor_cfg=BNO08xPrivateTypes::default_sensor_cfg) override
Enables step counter reports such that the BNO08x begins sending them.
Definition BNO08xRptStepCounter.cpp:46
BNO08xRptStepCounter::get
bno08x_step_counter_t get()
Grabs most recent step counter data (rollover not accounted for in step count, just most recent repor...
Definition BNO08xRptStepCounter.cpp:57
BNO08xPrivateTypes::default_sensor_cfg
static sh2_SensorConfig default_sensor_cfg
Definition BNO08xPrivateTypes.hpp:127
BNO08xPrivateTypes::bno08x_sync_ctx_t
Holds context used to synchronize tasks and callback execution.
Definition BNO08xPrivateTypes.hpp:57
bno08x_step_counter_t
Struct to represent step counter data from step counter reports.
Definition BNO08xGlobalTypes.hpp:568