SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
SensorBHI360.cpp
Go to the documentation of this file.
1
30#include "../../../SensorBuildOpt.h"
31#if !SENSORLIB_EXCLUDE_BHI360
32
33#include "SensorBHI360.hpp"
34
36{
37 return BHI360_CHIP_ID;
38}
39
41{
42 int8_t rslt = bhi360_phy_sensor_ctrl_param_get_step_counter_config(&config, getDev());
43 if (rslt != BHY2_OK) {
44 SENSORLIB_LOG_E("Failed to get Step Counter configuration, error code: %d", rslt);
45 return false;
46 }
47 return true;
48}
49
51{
52 int8_t rslt = bhi360_phy_sensor_ctrl_param_set_step_counter_config(&config, getDev());
53 if (rslt != BHY2_OK) {
54 SENSORLIB_LOG_E("Failed to set Step Counter configuration, error code: %d", rslt);
55 return false;
56 }
57 return true;
58}
59
61{
62 int8_t rslt = bhi360_multi_tap_param_detector_get_config(&config, getDev());
63 if (rslt != BHY2_OK) {
64 SENSORLIB_LOG_E("Failed to get Multi Tap Detector configuration, error code: %d", rslt);
65 return false;
66 }
67 return true;
68}
69
71{
72 int8_t rslt = bhi360_multi_tap_param_detector_set_config(&config, getDev());
73 if (rslt != BHY2_OK) {
74 SENSORLIB_LOG_E("Failed to set Multi Tap Detector configuration, error code: %d", rslt);
75 return false;
76 }
77 return true;
78}
79
81{
82 int8_t rslt = bhi360_multi_tap_param_get_config(config, getDev());
83 if (rslt != BHY2_OK) {
84 SENSORLIB_LOG_E("Failed to get Multi Tap Param configuration, error code: %d", rslt);
85 return false;
86 }
87 return true;
88}
89
91{
92 int8_t rslt = bhi360_multi_tap_param_set_config(&config, getDev());
93 if (rslt != BHY2_OK) {
94 SENSORLIB_LOG_E("Failed to set Multi Tap Param configuration, error code: %d", rslt);
95 return false;
96 }
97 return true;
98}
99
100
101#endif
#define SENSORLIB_LOG_E(...)
bool getMultiTapDetectorConfig(MultiTapDetectorConfig &config)
Get the current configuration of the Multi Tap Detector algorithm.
bool setMultiTapDetectorConfig(const MultiTapDetectorConfig &config)
Set the configuration for the Multi Tap Detector algorithm.
uint16_t getConfirmationIDImpl() override
Get the confirmation ID for the sensor.
bool setStepCounterConfig(const StepCounterConfig &config)
Set the configuration for the Step Counter algorithm.
bool setMultiTapParamConfig(const MultiTapDataType &config)
Set the configuration for the Multi Tap parameters.
bool getStepCounterConfig(StepCounterConfig &config)
Get the current configuration of the Step Counter algorithm.
bool getMultiTapParamConfig(MultiTapDataType(&config)[8])
Get the current configuration of the Multi Tap parameters.
bhi360_multi_tap_param_detector MultiTapDetectorConfig
bhi360_event_data_multi_tap MultiTapDataType
bhi360_phy_sensor_ctrl_param_step_counter StepCounterConfig