2024-11-27 23:54:47 +00:00
|
|
|
/**
|
|
|
|
|
* @file BNO08xRptStepCounter.hpp
|
|
|
|
|
* @author Myles Parfeniuk
|
|
|
|
|
*/
|
|
|
|
|
|
2024-11-24 03:22:06 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "BNO08xRpt.hpp"
|
|
|
|
|
|
|
|
|
|
/**
|
2024-12-01 04:34:58 +00:00
|
|
|
* @class BNO08xRptStepCounter
|
|
|
|
|
*
|
2024-11-24 03:22:06 +00:00
|
|
|
* @brief Class to represent step counter reports. (See Ref. Manual 6.5.29)
|
|
|
|
|
*/
|
|
|
|
|
class BNO08xRptStepCounter : public BNO08xRpt
|
|
|
|
|
{
|
|
|
|
|
public:
|
2024-12-05 06:09:15 +00:00
|
|
|
BNO08xRptStepCounter(uint8_t ID, EventBits_t rpt_bit, BNO08xPrivateTypes::bno08x_sync_ctx_t* sync_ctx)
|
|
|
|
|
: BNO08xRpt(ID, rpt_bit, sync_ctx)
|
2024-11-24 03:22:06 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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; ///< Most recent report data, doesn't account for step rollover.
|
|
|
|
|
uint32_t step_accumulator =
|
|
|
|
|
0UL; ///< Every time step count rolls over, the previous steps are accumulated here such that the total steps can always be calculated.
|
|
|
|
|
static const constexpr char* TAG = "BNO08xRptStepCounter";
|
|
|
|
|
};
|