MetaWear C++ API
0.20.0
C++ implementation of the MetaWear protocol
|
Interacts with the supported Bosch accelerometers, currently BMI270, BMI160 and BMA255. More...
#include "sensor_common.h"
Go to the source code of this file.
Classes | |
struct | MblMwBoschAnyMotion |
Wrapper class encapsulating responses from any motion detection. More... | |
struct | MblMwBoschGestureType |
Wrapper class encapsulating responses from any motion detection. More... | |
Enumerations | |
enum | MblMwAccBoschTypewrist { MBL_MW_ACC_BOSCH_TYPEWRIST_NONE = 0 , MBL_MW_ACC_BOSCH_TYPEWRIST_WEARK_WAKEUP , MBL_MW_ACC_BOSCH_TYPEWRIST_GESTURE } |
Available wrist gestures on the BMI270. | |
enum | MblMwAccBoschActivity { MBL_MW_ACC_BOSCH_ACTIVITY_STILL = 0 , MBL_MW_ACC_BOSCH_ACTIVITY_WALKING , MBL_MW_ACC_BOSCH_ACTIVITY_RUNNING , MBL_MW_ACC_BOSCH_ACTIVITY_UNKNOWN } |
Available activities on the BMI270. | |
enum | MblMwAccBoschGesture { MBL_MW_ACC_BOSCH_GESTURE_UNKNOWN = 0 , MBL_MW_ACC_BOSCH_GESTURE_PUSH_ARM_DOWN , MBL_MW_ACC_BOSCH_GESTURE_PIVOT_UP , MBL_MW_ACC_BOSCH_GESTURE_SHAKE , MBL_MW_ACC_BOSCH_GESTURE_ARM_FLICK_IN , MBL_MW_ACC_BOSCH_GESTURE_ARM_FLICK_OUT } |
Available wrist gestures on the BMI270. More... | |
enum | MblMwAccBoschMotion { MBL_MW_ACC_BOSCH_MOTION_SIGMOTION = 0 , MBL_MW_ACC_BOSCH_MOTION_NOMOTION , MBL_MW_ACC_BOSCH_MOTION_ANYMOTION } |
Available motion detectors on the Bosch accelerometers. More... | |
enum | MblMwAccBoschRange { MBL_MW_ACC_BOSCH_RANGE_2G = 0 , MBL_MW_ACC_BOSCH_RANGE_4G , MBL_MW_ACC_BOSCH_RANGE_8G , MBL_MW_ACC_BOSCH_RANGE_16G } |
Available g-ranges on the Bosch accelerometers. More... | |
enum | MblMwAccBmi160Odr { MBL_MW_ACC_BMI160_ODR_0_78125Hz = 0 , MBL_MW_ACC_BMI160_ODR_1_5625Hz , MBL_MW_ACC_BMI160_ODR_3_125Hz , MBL_MW_ACC_BMI160_ODR_6_25Hz , MBL_MW_ACC_BMI160_ODR_12_5Hz , MBL_MW_ACC_BMI160_ODR_25Hz , MBL_MW_ACC_BMI160_ODR_50Hz , MBL_MW_ACC_BMI160_ODR_100Hz , MBL_MW_ACC_BMI160_ODR_200Hz , MBL_MW_ACC_BMI160_ODR_400Hz , MBL_MW_ACC_BMI160_ODR_800Hz , MBL_MW_ACC_BMI160_ODR_1600Hz } |
Available ouput data rates on the BMI160 accelerometer. | |
enum | MblMwAccBma255Odr { MBL_MW_ACC_BMA255_ODR_15_62Hz = 0 , MBL_MW_ACC_BMA255_ODR_31_26Hz , MBL_MW_ACC_BMA255_ODR_62_5Hz , MBL_MW_ACC_BMA255_ODR_125Hz , MBL_MW_ACC_BMA255_ODR_250Hz , MBL_MW_ACC_BMA255_ODR_500Hz , MBL_MW_ACC_BMA255_ODR_1000Hz , MBL_MW_ACC_BMA255_ODR_2000Hz } |
Available ouput data rates on the BMA255 accelerometer. | |
enum | MblMwAccBmi270Odr { MBL_MW_ACC_BMI270_ODR_0_78125Hz = 0 , MBL_MW_ACC_BMI270_ODR_1_5625Hz , MBL_MW_ACC_BMI270_ODR_3_125Hz , MBL_MW_ACC_BMI270_ODR_6_25Hz , MBL_MW_ACC_BMI270_ODR_12_5Hz , MBL_MW_ACC_BMI270_ODR_25Hz , MBL_MW_ACC_BMI270_ODR_50Hz , MBL_MW_ACC_BMI270_ODR_100Hz , MBL_MW_ACC_BMI270_ODR_200Hz , MBL_MW_ACC_BMI270_ODR_400Hz , MBL_MW_ACC_BMI270_ODR_800Hz , MBL_MW_ACC_BMI270_ODR_1600Hz } |
Available ouput data rates on the BMI270 accelerometer. | |
enum | MblMwAccBmi160StepCounterMode { MBL_MW_ACC_BMI160_STEP_COUNTER_MODE_NORMAL = 0 , MBL_MW_ACC_BMI160_STEP_COUNTER_MODE_SENSITIVE , MBL_MW_ACC_BMI160_STEP_COUNTER_MODE_ROBUST } |
Operation modes for the step counter algorithm. More... | |
enum | MblMwAccBoschOrientationMode { MBL_MW_ACC_BOSCH_ORIENTATION_MODE_SYMMETRICAL , MBL_MW_ACC_BOSCH_ORIENTATION_MODE_HIGH_ASYMMETRICAL , MBL_MW_ACC_BOSCH_ORIENTATION_MODE_LOW_ASYMMETRICAL } |
Calculation modes controlling the conditions that determine the sensor's orientation. More... | |
enum | MblMwAccBoschTapQuietTime { MBL_MW_ACC_BOSCH_TAP_QUIET_TIME_30ms = 0 , MBL_MW_ACC_BOSCH_TAP_QUIET_TIME_20ms } |
Available quiet times for tap detection. More... | |
enum | MblMwAccBoschTapShockTime { MBL_MW_ACC_BOSCH_TAP_SHOCK_TIME_50ms = 0 , MBL_MW_ACC_BOSCH_TAP_SHOCK_TIME_75ms } |
Available shock times for tap detection. More... | |
enum | MblMwAccBoschDoubleTapWindow { MBL_MW_ACC_BOSCH_DOUBLE_TAP_WINDOW_50ms = 0 , MBL_MW_ACC_BOSCH_DOUBLE_TAP_WINDOW_100ms , MBL_MW_ACC_BOSCH_DOUBLE_TAP_WINDOW_150ms , MBL_MW_ACC_BOSCH_DOUBLE_TAP_WINDOW_200ms , MBL_MW_ACC_BOSCH_DOUBLE_TAP_WINDOW_250ms , MBL_MW_ACC_BOSCH_DOUBLE_TAP_WINDOW_375ms , MBL_MW_ACC_BOSCH_DOUBLE_TAP_WINDOW_500ms , MBL_MW_ACC_BOSCH_DOUBLE_TAP_WINDOW_700ms } |
Available windows for double tap detection. | |
enum | MblMwAccBoschAxisXyzRemap { MBL_MW_ACC_BOSCH_AXIS_XYZ_REMAP_XYZ = 0 , MBL_MW_ACC_BOSCH_AXIS_XYZ_REMAP_YZX , MBL_MW_ACC_BOSCH_AXIS_XYZ_REMAP_ZXY , MBL_MW_ACC_BOSCH_AXIS_XYZ_REMAP_XZY , MBL_MW_ACC_BOSCH_AXIS_XYZ_REMAP_YXZ , MBL_MW_ACC_BOSCH_AXIS_XYZ_REMAP_ZYX } |
Available windows for double tap detection. | |
enum | MblMwAccBoschAxisXyzSign { MBL_MW_ACC_BOSCH_AXIS_XYZ_SIGN_000 = 0 , MBL_MW_ACC_BOSCH_AXIS_XYZ_SIGN_100 , MBL_MW_ACC_BOSCH_AXIS_XYZ_SIGN_110 , MBL_MW_ACC_BOSCH_AXIS_XYZ_SIGN_101 , MBL_MW_ACC_BOSCH_AXIS_XYZ_SIGN_010 , MBL_MW_ACC_BOSCH_AXIS_XYZ_SIGN_011 , MBL_MW_ACC_BOSCH_AXIS_XYZ_SIGN_001 , MBL_MW_ACC_BOSCH_AXIS_XYZ_SIGN_111 } |
Available windows for double tap detection. | |
Functions | |
METAWEAR_API MblMwDataSignal * | mbl_mw_acc_bosch_get_acceleration_data_signal (const MblMwMetaWearBoard *board) |
Retrieves the data signal representing acceleration data from a Bosch accelerometer This signal is timestamp,x,y,z acc data. More... | |
METAWEAR_API MblMwDataSignal * | mbl_mw_acc_bosch_get_high_freq_acceleration_data_signal (const MblMwMetaWearBoard *board) |
METAWEAR_API MblMwDataSignal * | mbl_mw_acc_bosch_get_packed_acceleration_data_signal (const MblMwMetaWearBoard *board) |
Variant of acceleration data that packs multiple data samples into 1 BLE packet to increase the data throughput. More... | |
METAWEAR_API MblMwDataSignal * | mbl_mw_acc_bmi160_get_step_counter_data_signal (const MblMwMetaWearBoard *board) |
Retrieves the data signal representing data from the BMI160 step counter This signal represents the number of steps a user has taken. More... | |
METAWEAR_API MblMwDataSignal * | mbl_mw_acc_bmi270_get_step_counter_data_signal (const MblMwMetaWearBoard *board) |
Retrieves the data signal representing data from the BMI270 step counter This signal represents the number of steps a user has taken. More... | |
METAWEAR_API MblMwDataSignal * | mbl_mw_acc_bmi160_get_step_detector_data_signal (const MblMwMetaWearBoard *board) |
Retrieves the data signal representing data from the BMI160 step detector This signal simply detects a step, it does not count it. More... | |
METAWEAR_API MblMwDataSignal * | mbl_mw_acc_bmi270_get_step_detector_data_signal (const MblMwMetaWearBoard *board) |
Retrieves the data signal representing data from the BMI270 step detector This signal simply detects a step, it does not count it. More... | |
METAWEAR_API MblMwDataSignal * | mbl_mw_acc_bmi270_get_wrist_detector_data_signal (const MblMwMetaWearBoard *board) |
Retrieves the data signal representing data from the wrist gesture algorithm. More... | |
METAWEAR_API MblMwDataSignal * | mbl_mw_acc_bmi270_get_activity_detector_data_signal (const MblMwMetaWearBoard *board) |
Retrieves the data signal representing data from the activity detection algorithm. More... | |
METAWEAR_API MblMwDataSignal * | mbl_mw_acc_bosch_get_orientation_detection_data_signal (const MblMwMetaWearBoard *board) |
Retrieves the data signal representing data from the orientation detection algorithm This signal is identical to smartphone orientation (portrait, landscape) The BMI270 does not support this function. More... | |
METAWEAR_API MblMwDataSignal * | mbl_mw_acc_bosch_get_motion_data_signal (const MblMwMetaWearBoard *board) |
Retrieves the data signal representing data from the motion detection algorithm This signal retrieves either "no motion", "any motion" or "significant motion" depending on user settings. More... | |
METAWEAR_API MblMwDataSignal * | mbl_mw_acc_bosch_get_tap_data_signal (const MblMwMetaWearBoard *board) |
Retrieves the data signal representing data from the tap detection algorithm This signal retrieves the number of taps the board has been subjected to based on user settings The BMI270 does not support this function. More... | |
METAWEAR_API void | mbl_mw_acc_bmi160_set_odr (MblMwMetaWearBoard *board, MblMwAccBmi160Odr odr) |
Sets the output data rate for the BMI160 accelerometer The ODR sets the output data frequency in Hz. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_set_odr (MblMwMetaWearBoard *board, MblMwAccBmi270Odr odr) |
Sets the output data rate for the BMI160 accelerometer The ODR sets the output data frequency in Hz. More... | |
METAWEAR_API void | mbl_mw_acc_bma255_set_odr (MblMwMetaWearBoard *board, MblMwAccBma255Odr odr) |
Sets the output data rate for the BMI160 accelerometer The ODR sets the output data frequency in Hz. More... | |
METAWEAR_API void | mbl_mw_acc_bosch_set_range (MblMwMetaWearBoard *board, MblMwAccBoschRange range) |
Sets the acceleration range The range is in units of Gs between 2 and 16gs for Bosch sensors See MblMwAccBoschRange for allowed values. More... | |
METAWEAR_API void | mbl_mw_acc_bosch_write_acceleration_config (const MblMwMetaWearBoard *board) |
Writes the acceleration settings to the sensor Applies the ODR and RANGE values set in set_range() and set_odr(). More... | |
METAWEAR_API void | mbl_mw_acc_bmi160_set_step_counter_mode (MblMwMetaWearBoard *board, MblMwAccBmi160StepCounterMode mode) |
Sets the operational mode of the step counter. More... | |
METAWEAR_API void | mbl_mw_acc_bmi160_enable_step_counter (MblMwMetaWearBoard *board) |
Enables the BMI160 step counter. More... | |
METAWEAR_API void | mbl_mw_acc_bmi160_disable_step_counter (MblMwMetaWearBoard *board) |
Disables the BMI160 step counter. More... | |
METAWEAR_API void | mbl_mw_acc_bmi160_write_step_counter_config (const MblMwMetaWearBoard *board) |
Writes the step counter configuration to the sensor Applies the MODE set by set_step_counter_mode() More... | |
METAWEAR_API void | mbl_mw_acc_bmi160_reset_step_counter (const MblMwMetaWearBoard *board) |
Resets the BMI160 step counter (step counter = 0) Does not disable the step counter. More... | |
METAWEAR_API void | mbl_mw_acc_bmi160_enable_step_detector (const MblMwMetaWearBoard *board) |
Enables the BMI160 step detector A callback will notify the user when a step is detected but will NOT count steps. More... | |
METAWEAR_API void | mbl_mw_acc_bmi160_disable_step_detector (const MblMwMetaWearBoard *board) |
Disables the BMI160 step detector. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_set_step_counter_trigger (MblMwMetaWearBoard *board, uint16_t trigger) |
Sets the watermark level of the step counter The Step-counter will trigger output every time this number of steps are counted. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_enable_step_counter (const MblMwMetaWearBoard *board) |
Enables the BMI270 step counter The trigger count will trigger the callback signal with the # of steps. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_disable_step_counter (const MblMwMetaWearBoard *board) |
Disables the BMI270 step counter. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_write_step_counter_config (const MblMwMetaWearBoard *board) |
Writes the step counter configuration to the sensor Applies the TRIGGER set by set_step_counter_trigger() More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_reset_step_counter (const MblMwMetaWearBoard *board) |
Resets the BMI270 step counter (step counter = 0) Does not disable the step counter. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_read_step_counter (MblMwMetaWearBoard *board, void *context, MblMwFnBoardPtrInt handler) |
Reads the current step count. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_wrist_gesture_armside (const MblMwMetaWearBoard *board, uint8_t side) |
Sets the arm side the MetaWear is worn on for gesture recognition Device in left (0 - false) or right (1 - true) arm. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_wrist_gesture_peak (const MblMwMetaWearBoard *board, uint16_t peak) |
Sets the tilt angle for gesture recognition Sine of the minimum tilt angle in portrait down direction of the device when wrist is rolled away (roll-out) from user. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_wrist_gesture_samples (const MblMwMetaWearBoard *board, uint16_t samples) |
Value of minimum time difference between wrist roll-out and roll-in movement during flick gesture. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_wrist_gesture_duration (const MblMwMetaWearBoard *board, uint16_t duration) |
Sets the maximum time for the gesture recognition Maximum time within which gesture movement has to be completed. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_write_wrist_gesture_config (const MblMwMetaWearBoard *board) |
Writes the wrist gesture recognition configuration to the sensor Applies the ARM SIDE, PEAK, SAMPLE and DURATION set by set_wrist_gesture_*() More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_enable_wrist_gesture (const MblMwMetaWearBoard *board) |
Enables the BMI270 wrist gesture recognition. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_disable_wrist_gesture (const MblMwMetaWearBoard *board) |
Disables the BMI270 wrist gesture recognition. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_wrist_wakeup_angle_focus (const MblMwMetaWearBoard *board, uint16_t angle) |
Sets the minimum angle change for wrist wakeup Cosine of minimum expected attitude change of the device within 1 second time window when moving within focus position. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_wrist_wakeup_angle_nonfocus (const MblMwMetaWearBoard *board, uint16_t angle) |
Sets the maximum angle change for wrist wakeup Cosine of minimum expected attitude change of the device within 1 second time window when moving from non-focus to focus position. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_wrist_wakeup_tilt_lr (const MblMwMetaWearBoard *board, uint16_t angle) |
Sets the Sine of the maximum allowed downward tilt angle in landscape right direction of the device, when it is in focus position. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_wrist_wakeup_tilt_ll (const MblMwMetaWearBoard *board, uint16_t angle) |
Sets the Sine of the maximum allowed downward tilt angle in landscape left direction of the device, when it is in focus position. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_wrist_wakeup_tilt_pd (const MblMwMetaWearBoard *board, uint16_t angle) |
Sets the Sine of the maximum allowed backward tilt angle in portrait down direction of the device, when it is in focus position. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_wrist_wakeup_tilt_pu (const MblMwMetaWearBoard *board, uint16_t angle) |
Sets the Sine of the maximum allowed forward tilt angle in portrait up direction of the device, when it is in focus position. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_write_wrist_wakeup_config (const MblMwMetaWearBoard *board) |
Writes the wrist gesture recognition configuration to the sensor Applies the ARM SIDE, PEAK, SAMPLE and DURATION set by set_wrist_gesture_*() More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_enable_wrist_wakeup (const MblMwMetaWearBoard *board) |
Enables the BMI270 wrist wakeup recognition. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_disable_wrist_wakeup (const MblMwMetaWearBoard *board) |
Disables the BMI270 wrist wakeup recognition. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_enable_activity_detection (const MblMwMetaWearBoard *board) |
Enables the BMI270 activity detector A callback will notify the user when an activity is detected (walking, running, still) More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_disable_activity_detection (const MblMwMetaWearBoard *board) |
Disables the BMI270 activity detector. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_enable_step_detector (const MblMwMetaWearBoard *board) |
Enables the BMI270 step detector A callback will notify the user when a step is detected but will NOT count steps. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_disable_step_detector (const MblMwMetaWearBoard *board) |
Disables the BMI270 step detector. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_fifo_downs (const MblMwMetaWearBoard *board, uint8_t gyro_downs, uint8_t gyro_data, uint8_t acc_downs, uint8_t acc_data) |
Downsampling for the BMI270 acc See BMI270 datasheet for more details. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_acc_offsets (const MblMwMetaWearBoard *board, uint16_t x_offset, uint16_t y_offset, uint16_t z_offset) |
Manual compensation for the BMI270 acc The offset compensation registers have a width of 8 bit using two’s complement notation. More... | |
METAWEAR_API void | mbl_mw_acc_bmi270_axis_remap (const MblMwMetaWearBoard *board, MblMwAccBoschAxisXyzRemap map, MblMwAccBoschAxisXyzSign sign) |
Remaps the BMI270 axis If the coordinate system of the MetaWear differs from the sensor coordinate system described in the BMI270 datasheet, the sensor axis must be remapped to use the orientation dependent features properly. More... | |
METAWEAR_API void | mbl_mw_acc_bosch_set_orientation_hysteresis (MblMwMetaWearBoard *board, float hysteresis) |
Set the hysteresis offset (degrees) for portrait/landscape detection Upside/downside recognition hysteresis is not configurable. More... | |
METAWEAR_API void | mbl_mw_acc_bosch_set_orientation_mode (MblMwMetaWearBoard *board, MblMwAccBoschOrientationMode mode) |
Set the orientation calculation mode Options include: Symmetrical, High asymmetrical, Low asymmetrical See the BMI160 datasheet for more information. More... | |
METAWEAR_API void | mbl_mw_acc_bosch_write_orientation_config (const MblMwMetaWearBoard *board) |
Writes the orientation detection settings to the board Applies MODE and HYSTERESIS from set_orientation_hysteresis() and set_orientation_mode() Not supported by the BMI270. More... | |
METAWEAR_API void | mbl_mw_acc_bosch_enable_orientation_detection (const MblMwMetaWearBoard *board) |
Enables orientation detection Not supported by the BMI270. More... | |
METAWEAR_API void | mbl_mw_acc_bosch_disable_orientation_detection (const MblMwMetaWearBoard *board) |
Disables orientation detection Not supported by the BMI270. More... | |
METAWEAR_API void | mbl_mw_acc_bosch_set_quiet_time (MblMwMetaWearBoard *board, MblMwAccBoschTapQuietTime time) |
Sets the tap detector's quiet time parameter Selects a tap quiet duration of ‘0’->30 ms, ‘1’->20 ms (i.e how long to wait for another tap) The criteria for a double-tap are fulfilled if the second tap occurs after the time quiet time and within the tap window. More... | |
METAWEAR_API void | mbl_mw_acc_bosch_set_shock_time (MblMwMetaWearBoard *board, MblMwAccBoschTapShockTime time) |
Sets the tap detector's shock time parameter Selects a tap shock duration of ‘0’->50ms, ‘1’->75ms (i.e how long a tap can be) This is the time it take the tap to "settle". More... | |
METAWEAR_API void | mbl_mw_acc_bosch_set_double_tap_window (MblMwMetaWearBoard *board, MblMwAccBoschDoubleTapWindow window) |
Sets the tap detector's double tap window The time window between two taps is between 12.5ms and 500ms. More... | |
METAWEAR_API void | mbl_mw_acc_bosch_set_threshold (MblMwMetaWearBoard *board, float threshold) |
Sets the tap detector's threshold Threshold of the single/double-tap interrupt corresponding to an acceleration difference. More... | |
METAWEAR_API void | mbl_mw_acc_bosch_write_tap_config (const MblMwMetaWearBoard *board) |
Sets the tap detector's double tap window Applies the duration, quiet window, shock, and threshold from set_threshold(), set_double_tap_window(), set_shock_time(), set_quiet_time(). More... | |
METAWEAR_API void | mbl_mw_acc_bosch_enable_tap_detection (const MblMwMetaWearBoard *board, uint8_t enable_single, uint8_t enable_double) |
Enables the tap detector Not supported by the BMI270. More... | |
METAWEAR_API void | mbl_mw_acc_bosch_disable_tap_detection (const MblMwMetaWearBoard *board) |
Disable the tap detector Not supported by the BMI270. More... | |
METAWEAR_API void | mbl_mw_acc_bosch_set_any_motion_count (MblMwMetaWearBoard *board, uint8_t count) |
Sets the any motion detector's count parameter Any-motion generates an interrupt when the absolute value of the acceleration exceeds a "threshold" for a certain "count" of consecutive data points. More... | |
METAWEAR_API void | mbl_mw_acc_bosch_set_any_motion_threshold (MblMwMetaWearBoard *board, float threshold) |
Sets the any motion detector's threshold parameter Any-motion generates an interrupt when the absolute value of the acceleration exceeds a "threshold" for a certain "count" of consecutive data points. More... | |
METAWEAR_API void | mbl_mw_acc_bosch_set_no_motion_count (MblMwMetaWearBoard *board, uint8_t count) |
Sets the no motion detector's count parameter. More... | |
METAWEAR_API void | mbl_mw_acc_bosch_set_no_motion_threshold (MblMwMetaWearBoard *board, float threshold) |
Sets the no motion detector's threshold parameter. More... | |
METAWEAR_API void | mbl_mw_acc_bosch_set_sig_motion_blocksize (MblMwMetaWearBoard *board, uint16_t blocksize) |
Sets the sig motion detector's blocksize parameter. More... | |
METAWEAR_API void | mbl_mw_acc_bosch_write_motion_config (const MblMwMetaWearBoard *board, MblMwAccBoschMotion type) |
Writes the motion configuration to the remote device Applies the threshold and count parameter or blocksize depending on motion type and settings from set_*_*() For the BMI270, types include no motion, significant motion, and any motion. More... | |
METAWEAR_API void | mbl_mw_acc_bosch_enable_motion_detection (const MblMwMetaWearBoard *board, MblMwAccBoschMotion type) |
Enables motion detection The signal will callback if any motion is sensed based on the motion config For the BMI270, signals include no motion, significant motion, and any motion. More... | |
METAWEAR_API void | mbl_mw_acc_bosch_disable_motion_detection (const MblMwMetaWearBoard *board, MblMwAccBoschMotion type) |
Disables motion detection. More... | |
METAWEAR_API void | mbl_mw_acc_bosch_start (const MblMwMetaWearBoard *board) |
Switches the accelerometer to active mode When in active mode, the accelerometer cannot be configured. More... | |
METAWEAR_API void | mbl_mw_acc_bosch_stop (const MblMwMetaWearBoard *board) |
Switches the accelerometer to standby mode (low power state) More... | |
METAWEAR_API void | mbl_mw_acc_bosch_enable_acceleration_sampling (const MblMwMetaWearBoard *board) |
Enables acceleration sampling The board will start gathering data from the accelerometer. More... | |
METAWEAR_API void | mbl_mw_acc_bosch_disable_acceleration_sampling (const MblMwMetaWearBoard *board) |
Disables acceleration sampling The board will stop gathering data from the accelerometer. More... | |
Variables | |
const uint8_t | MBL_MW_MODULE_ACC_TYPE_BMI160 = 1 |
Constant identifying the BMI160 accelerometer module type. | |
const uint8_t | MBL_MW_MODULE_ACC_TYPE_BMA255 = 3 |
Constant identifying the BMA255 accelerometer module type. | |
const uint8_t | MBL_MW_MODULE_ACC_TYPE_BMI270 = 4 |
Constant identifying the BMI270 accelerometer module type. | |
Interacts with the supported Bosch accelerometers, currently BMI270, BMI160 and BMA255.
The BMI160 and BMA255 sensors are identical except for the output data rates. Functions that are generic for both accelerometers have "bosch" in the name whereas functions specific to either accelerometer are contain their model i.e. "bmi160" or "bma255".
Operation modes for the step counter algorithm.
enum MblMwAccBoschGesture |
Available wrist gestures on the BMI270.
enum MblMwAccBoschMotion |
enum MblMwAccBoschRange |
Available quiet times for tap detection.
Available shock times for tap detection.
METAWEAR_API void mbl_mw_acc_bma255_set_odr | ( | MblMwMetaWearBoard * | board, |
MblMwAccBma255Odr | odr | ||
) |
Sets the output data rate for the BMI160 accelerometer The ODR sets the output data frequency in Hz.
See MblMwAccBmi160Odr for allowed values.
board | Pointer to the board to modify |
odr | Output data rate value to assign |
METAWEAR_API void mbl_mw_acc_bmi160_disable_step_counter | ( | MblMwMetaWearBoard * | board | ) |
Disables the BMI160 step counter.
board | Board to modify |
METAWEAR_API void mbl_mw_acc_bmi160_disable_step_detector | ( | const MblMwMetaWearBoard * | board | ) |
Disables the BMI160 step detector.
board | Pointer to the board to send the command to |
METAWEAR_API void mbl_mw_acc_bmi160_enable_step_counter | ( | MblMwMetaWearBoard * | board | ) |
Enables the BMI160 step counter.
board | Board to modify |
METAWEAR_API void mbl_mw_acc_bmi160_enable_step_detector | ( | const MblMwMetaWearBoard * | board | ) |
Enables the BMI160 step detector A callback will notify the user when a step is detected but will NOT count steps.
board | Pointer to the board to send the command to |
METAWEAR_API MblMwDataSignal* mbl_mw_acc_bmi160_get_step_counter_data_signal | ( | const MblMwMetaWearBoard * | board | ) |
Retrieves the data signal representing data from the BMI160 step counter This signal represents the number of steps a user has taken.
board | Pointer to the board to retrieve the signal from |
METAWEAR_API MblMwDataSignal* mbl_mw_acc_bmi160_get_step_detector_data_signal | ( | const MblMwMetaWearBoard * | board | ) |
Retrieves the data signal representing data from the BMI160 step detector This signal simply detects a step, it does not count it.
board | Pointer to the board to retrieve the signal from |
METAWEAR_API void mbl_mw_acc_bmi160_reset_step_counter | ( | const MblMwMetaWearBoard * | board | ) |
Resets the BMI160 step counter (step counter = 0) Does not disable the step counter.
board | Board to reset |
METAWEAR_API void mbl_mw_acc_bmi160_set_odr | ( | MblMwMetaWearBoard * | board, |
MblMwAccBmi160Odr | odr | ||
) |
Sets the output data rate for the BMI160 accelerometer The ODR sets the output data frequency in Hz.
See MblMwAccBmi160Odr for allowed values.
board | Pointer to the board to modify |
odr | Output data rate value to assign |
METAWEAR_API void mbl_mw_acc_bmi160_set_step_counter_mode | ( | MblMwMetaWearBoard * | board, |
MblMwAccBmi160StepCounterMode | mode | ||
) |
Sets the operational mode of the step counter.
board | Board to modify |
mode | New operation mode |
METAWEAR_API void mbl_mw_acc_bmi160_write_step_counter_config | ( | const MblMwMetaWearBoard * | board | ) |
Writes the step counter configuration to the sensor Applies the MODE set by set_step_counter_mode()
board | Board to write to |
METAWEAR_API void mbl_mw_acc_bmi270_acc_offsets | ( | const MblMwMetaWearBoard * | board, |
uint16_t | x_offset, | ||
uint16_t | y_offset, | ||
uint16_t | z_offset | ||
) |
Manual compensation for the BMI270 acc The offset compensation registers have a width of 8 bit using two’s complement notation.
The offset resolution (LSB) is 3.9 mg and the offset range is +- 0.5 g
board | Pointer to the board to send the command to |
x_offset | Offset compensation for Accelerometer X-axis |
y_offset | Offset compensation for Accelerometer Y-axis |
z_offset | Offset compensation for Accelerometer Z-axis |
METAWEAR_API void mbl_mw_acc_bmi270_axis_remap | ( | const MblMwMetaWearBoard * | board, |
MblMwAccBoschAxisXyzRemap | map, | ||
MblMwAccBoschAxisXyzSign | sign | ||
) |
Remaps the BMI270 axis If the coordinate system of the MetaWear differs from the sensor coordinate system described in the BMI270 datasheet, the sensor axis must be remapped to use the orientation dependent features properly.
Axis remapping register allows the host to freely map individual axis to the coordinate system of the used platform. Individual axis can be mapped to any other defined axis. The sign value of the axis can be also configured.
board | Pointer to the board to send the command to |
map | X,Y,Z axis remap |
sign | X,Y,Z axis flip/sign |
METAWEAR_API void mbl_mw_acc_bmi270_disable_activity_detection | ( | const MblMwMetaWearBoard * | board | ) |
Disables the BMI270 activity detector.
board | Pointer to the board to send the command to |
METAWEAR_API void mbl_mw_acc_bmi270_disable_step_counter | ( | const MblMwMetaWearBoard * | board | ) |
Disables the BMI270 step counter.
board | Board to modify |
METAWEAR_API void mbl_mw_acc_bmi270_disable_step_detector | ( | const MblMwMetaWearBoard * | board | ) |
Disables the BMI270 step detector.
board | Pointer to the board to send the command to |
METAWEAR_API void mbl_mw_acc_bmi270_disable_wrist_gesture | ( | const MblMwMetaWearBoard * | board | ) |
Disables the BMI270 wrist gesture recognition.
board | Board to modify |
METAWEAR_API void mbl_mw_acc_bmi270_disable_wrist_wakeup | ( | const MblMwMetaWearBoard * | board | ) |
Disables the BMI270 wrist wakeup recognition.
board | Board to modify |
METAWEAR_API void mbl_mw_acc_bmi270_enable_activity_detection | ( | const MblMwMetaWearBoard * | board | ) |
Enables the BMI270 activity detector A callback will notify the user when an activity is detected (walking, running, still)
board | Pointer to the board to send the command to |
METAWEAR_API void mbl_mw_acc_bmi270_enable_step_counter | ( | const MblMwMetaWearBoard * | board | ) |
Enables the BMI270 step counter The trigger count will trigger the callback signal with the # of steps.
board | Board to modify |
METAWEAR_API void mbl_mw_acc_bmi270_enable_step_detector | ( | const MblMwMetaWearBoard * | board | ) |
Enables the BMI270 step detector A callback will notify the user when a step is detected but will NOT count steps.
board | Pointer to the board to send the command to |
METAWEAR_API void mbl_mw_acc_bmi270_enable_wrist_gesture | ( | const MblMwMetaWearBoard * | board | ) |
Enables the BMI270 wrist gesture recognition.
board | Board to modify |
METAWEAR_API void mbl_mw_acc_bmi270_enable_wrist_wakeup | ( | const MblMwMetaWearBoard * | board | ) |
Enables the BMI270 wrist wakeup recognition.
board | Board to modify |
METAWEAR_API void mbl_mw_acc_bmi270_fifo_downs | ( | const MblMwMetaWearBoard * | board, |
uint8_t | gyro_downs, | ||
uint8_t | gyro_data, | ||
uint8_t | acc_downs, | ||
uint8_t | acc_data | ||
) |
Downsampling for the BMI270 acc See BMI270 datasheet for more details.
board | Pointer to the board to send the command to |
gyro_downs | Downsampling for Gyroscope (2**downs_gyro) |
gyro_data | Selects filtered or unfiltered Gyroscope data for fifo |
acc_downs | Downsampling for Accelerometer (2**downs_accel) |
acc_data | Selects filtered or unfiltered Accelerometer data for fifo |
METAWEAR_API MblMwDataSignal* mbl_mw_acc_bmi270_get_activity_detector_data_signal | ( | const MblMwMetaWearBoard * | board | ) |
Retrieves the data signal representing data from the activity detection algorithm.
board | Pointer to the board to retrieve the signal from |
METAWEAR_API MblMwDataSignal* mbl_mw_acc_bmi270_get_step_counter_data_signal | ( | const MblMwMetaWearBoard * | board | ) |
Retrieves the data signal representing data from the BMI270 step counter This signal represents the number of steps a user has taken.
board | Pointer to the board to retrieve the signal from |
METAWEAR_API MblMwDataSignal* mbl_mw_acc_bmi270_get_step_detector_data_signal | ( | const MblMwMetaWearBoard * | board | ) |
Retrieves the data signal representing data from the BMI270 step detector This signal simply detects a step, it does not count it.
board | Pointer to the board to retrieve the signal from |
METAWEAR_API MblMwDataSignal* mbl_mw_acc_bmi270_get_wrist_detector_data_signal | ( | const MblMwMetaWearBoard * | board | ) |
Retrieves the data signal representing data from the wrist gesture algorithm.
board | Pointer to the board to retrieve the signal from |
METAWEAR_API void mbl_mw_acc_bmi270_read_step_counter | ( | MblMwMetaWearBoard * | board, |
void * | context, | ||
MblMwFnBoardPtrInt | handler | ||
) |
Reads the current step count.
The callback function will be called with:
board | Calling object |
context | Pointer to additional data for the callback function |
handler | Callback function that is executed when the task is finished |
METAWEAR_API void mbl_mw_acc_bmi270_reset_step_counter | ( | const MblMwMetaWearBoard * | board | ) |
Resets the BMI270 step counter (step counter = 0) Does not disable the step counter.
board | Board to reset |
METAWEAR_API void mbl_mw_acc_bmi270_set_odr | ( | MblMwMetaWearBoard * | board, |
MblMwAccBmi270Odr | odr | ||
) |
Sets the output data rate for the BMI160 accelerometer The ODR sets the output data frequency in Hz.
See MblMwAccBmi160Odr for allowed values.
board | Pointer to the board to modify |
odr | Output data rate value to assign |
METAWEAR_API void mbl_mw_acc_bmi270_set_step_counter_trigger | ( | MblMwMetaWearBoard * | board, |
uint16_t | trigger | ||
) |
Sets the watermark level of the step counter The Step-counter will trigger output every time this number of steps are counted.
Holds implicitly a 20x factor, so the range is 0 to 20460, with resolution of 20 steps. If 0, the output is disabled. If 1, it will count to 20 steps.
board | Board to modify |
trigger | Number of steps |
METAWEAR_API void mbl_mw_acc_bmi270_wrist_gesture_armside | ( | const MblMwMetaWearBoard * | board, |
uint8_t | side | ||
) |
Sets the arm side the MetaWear is worn on for gesture recognition Device in left (0 - false) or right (1 - true) arm.
By default, the wearable device is assumed to be in left arm i.e. default value is 0 - false.
board | Pointer to the board to send the command to |
side | 1 = Right arm, 0 = Left arm |
METAWEAR_API void mbl_mw_acc_bmi270_wrist_gesture_duration | ( | const MblMwMetaWearBoard * | board, |
uint16_t | duration | ||
) |
Sets the maximum time for the gesture recognition Maximum time within which gesture movement has to be completed.
Range is 150 to 250 samples at 50Hz (i.e. 3 to 5 seconds). Defualt value is 200 (i.e. 4 seconds).
board | Pointer to the board to send the command to |
duration |
METAWEAR_API void mbl_mw_acc_bmi270_wrist_gesture_peak | ( | const MblMwMetaWearBoard * | board, |
uint16_t | peak | ||
) |
Sets the tilt angle for gesture recognition Sine of the minimum tilt angle in portrait down direction of the device when wrist is rolled away (roll-out) from user.
The configuration parameter is scaled by 2048 i.e. 2048 * sin(angle). Range is 1448 to 1774. Default value is 1774.
board | Pointer to the board to send the command to |
peak | Tilt Angle |
METAWEAR_API void mbl_mw_acc_bmi270_wrist_gesture_samples | ( | const MblMwMetaWearBoard * | board, |
uint16_t | samples | ||
) |
Value of minimum time difference between wrist roll-out and roll-in movement during flick gesture.
Range is 3 to 5 samples at 50Hz (i.e. 0.06 to 0.1 seconds). Default value is 4 (i.e. 0.08 seconds).
board | Pointer to the board to send the command to |
sample |
METAWEAR_API void mbl_mw_acc_bmi270_wrist_wakeup_angle_focus | ( | const MblMwMetaWearBoard * | board, |
uint16_t | angle | ||
) |
Sets the minimum angle change for wrist wakeup Cosine of minimum expected attitude change of the device within 1 second time window when moving within focus position.
The parameter is scaled by 2048 i.e. 2048 * cos(angle). Range is 1024 to 1774. Default is 1448.
board | Pointer to the board to send the command to |
angle | Minimum angle |
METAWEAR_API void mbl_mw_acc_bmi270_wrist_wakeup_angle_nonfocus | ( | const MblMwMetaWearBoard * | board, |
uint16_t | angle | ||
) |
Sets the maximum angle change for wrist wakeup Cosine of minimum expected attitude change of the device within 1 second time window when moving from non-focus to focus position.
The parameter is scaled by 2048 i.e. 2048 * cos(angle). Range is 1448 to 1856. Default value is 1774.
board | Pointer to the board to send the command to |
angle | Maximum angle |
METAWEAR_API void mbl_mw_acc_bmi270_wrist_wakeup_tilt_ll | ( | const MblMwMetaWearBoard * | board, |
uint16_t | angle | ||
) |
Sets the Sine of the maximum allowed downward tilt angle in landscape left direction of the device, when it is in focus position.
The configuration parameter is scaled by 2048 i.e. 2048 * sin(angle). Range is 700 to 1024. Default value is 700.
board | Pointer to the board to send the command to |
angle | Maximum tilt angle in Landscape Left mode |
METAWEAR_API void mbl_mw_acc_bmi270_wrist_wakeup_tilt_lr | ( | const MblMwMetaWearBoard * | board, |
uint16_t | angle | ||
) |
Sets the Sine of the maximum allowed downward tilt angle in landscape right direction of the device, when it is in focus position.
The configuration parameter is scaled by 2048 i.e. 2048 * sin(angle). Range is 700 to 1024. Default value is 1024.
board | Pointer to the board to send the command to |
angle | Maximum tilt angle in Landscape Right mode |
METAWEAR_API void mbl_mw_acc_bmi270_wrist_wakeup_tilt_pd | ( | const MblMwMetaWearBoard * | board, |
uint16_t | angle | ||
) |
Sets the Sine of the maximum allowed backward tilt angle in portrait down direction of the device, when it is in focus position.
The configuration parameter is scaled by 2048 i.e. 2048 * sin(angle). Range is 0 to179. Default value is 179.
board | Pointer to the board to send the command to |
angle | Maximum tilt angle in Portrait Down mode |
METAWEAR_API void mbl_mw_acc_bmi270_wrist_wakeup_tilt_pu | ( | const MblMwMetaWearBoard * | board, |
uint16_t | angle | ||
) |
Sets the Sine of the maximum allowed forward tilt angle in portrait up direction of the device, when it is in focus position.
The configuration parameter is scaled by 2048 i.e. 2048 * sin(angle). Range is 1774 to 1978. Default value is 1925.
board | Pointer to the board to send the command to |
angle | Maximum tilt angle in Portrait Up mode |
METAWEAR_API void mbl_mw_acc_bmi270_write_step_counter_config | ( | const MblMwMetaWearBoard * | board | ) |
Writes the step counter configuration to the sensor Applies the TRIGGER set by set_step_counter_trigger()
board | Board to write to |
METAWEAR_API void mbl_mw_acc_bmi270_write_wrist_gesture_config | ( | const MblMwMetaWearBoard * | board | ) |
Writes the wrist gesture recognition configuration to the sensor Applies the ARM SIDE, PEAK, SAMPLE and DURATION set by set_wrist_gesture_*()
board | Board to write to |
METAWEAR_API void mbl_mw_acc_bmi270_write_wrist_wakeup_config | ( | const MblMwMetaWearBoard * | board | ) |
Writes the wrist gesture recognition configuration to the sensor Applies the ARM SIDE, PEAK, SAMPLE and DURATION set by set_wrist_gesture_*()
board | Board to write to |
METAWEAR_API void mbl_mw_acc_bosch_disable_acceleration_sampling | ( | const MblMwMetaWearBoard * | board | ) |
Disables acceleration sampling The board will stop gathering data from the accelerometer.
board | Pointer to the board to send the command to |
METAWEAR_API void mbl_mw_acc_bosch_disable_motion_detection | ( | const MblMwMetaWearBoard * | board, |
MblMwAccBoschMotion | type | ||
) |
Disables motion detection.
board | Calling object |
type | Type of motion requested |
METAWEAR_API void mbl_mw_acc_bosch_disable_orientation_detection | ( | const MblMwMetaWearBoard * | board | ) |
Disables orientation detection Not supported by the BMI270.
board | Calling object |
METAWEAR_API void mbl_mw_acc_bosch_disable_tap_detection | ( | const MblMwMetaWearBoard * | board | ) |
Disable the tap detector Not supported by the BMI270.
board | Calling object |
window | New double tap window time |
METAWEAR_API void mbl_mw_acc_bosch_enable_acceleration_sampling | ( | const MblMwMetaWearBoard * | board | ) |
Enables acceleration sampling The board will start gathering data from the accelerometer.
board | Pointer to the board to send the command to |
METAWEAR_API void mbl_mw_acc_bosch_enable_motion_detection | ( | const MblMwMetaWearBoard * | board, |
MblMwAccBoschMotion | type | ||
) |
Enables motion detection The signal will callback if any motion is sensed based on the motion config For the BMI270, signals include no motion, significant motion, and any motion.
Ignored for other Bosch sensors.
board | Calling object |
type | Type of motion requested |
METAWEAR_API void mbl_mw_acc_bosch_enable_orientation_detection | ( | const MblMwMetaWearBoard * | board | ) |
Enables orientation detection Not supported by the BMI270.
board | Calling object |
METAWEAR_API void mbl_mw_acc_bosch_enable_tap_detection | ( | const MblMwMetaWearBoard * | board, |
uint8_t | enable_single, | ||
uint8_t | enable_double | ||
) |
Enables the tap detector Not supported by the BMI270.
board | Calling object |
enable_single | 0 to ignore single tap detection, non-zero to detect |
enable_double | 0 to ignore double tap detection, non-zero to detect |
METAWEAR_API MblMwDataSignal* mbl_mw_acc_bosch_get_acceleration_data_signal | ( | const MblMwMetaWearBoard * | board | ) |
Retrieves the data signal representing acceleration data from a Bosch accelerometer This signal is timestamp,x,y,z acc data.
board | Pointer to the board to retrieve the signal from |
METAWEAR_API MblMwDataSignal* mbl_mw_acc_bosch_get_high_freq_acceleration_data_signal | ( | const MblMwMetaWearBoard * | board | ) |
Use mbl_mw_acc_bosch_get_packed_acceleration_data_signal instead.
METAWEAR_API MblMwDataSignal* mbl_mw_acc_bosch_get_motion_data_signal | ( | const MblMwMetaWearBoard * | board | ) |
Retrieves the data signal representing data from the motion detection algorithm This signal retrieves either "no motion", "any motion" or "significant motion" depending on user settings.
board | Calling object |
METAWEAR_API MblMwDataSignal* mbl_mw_acc_bosch_get_orientation_detection_data_signal | ( | const MblMwMetaWearBoard * | board | ) |
Retrieves the data signal representing data from the orientation detection algorithm This signal is identical to smartphone orientation (portrait, landscape) The BMI270 does not support this function.
board | Calling object |
METAWEAR_API MblMwDataSignal* mbl_mw_acc_bosch_get_packed_acceleration_data_signal | ( | const MblMwMetaWearBoard * | board | ) |
Variant of acceleration data that packs multiple data samples into 1 BLE packet to increase the data throughput.
This data signal cannot be used with data processing or logging, only with streaming. This signal is timestamp,x,y,z,x,y,z,x,y,z acc data (it packs three acc data points in one timestamp)
METAWEAR_API MblMwDataSignal* mbl_mw_acc_bosch_get_tap_data_signal | ( | const MblMwMetaWearBoard * | board | ) |
Retrieves the data signal representing data from the tap detection algorithm This signal retrieves the number of taps the board has been subjected to based on user settings The BMI270 does not support this function.
board | Calling object |
METAWEAR_API void mbl_mw_acc_bosch_set_any_motion_count | ( | MblMwMetaWearBoard * | board, |
uint8_t | count | ||
) |
Sets the any motion detector's count parameter Any-motion generates an interrupt when the absolute value of the acceleration exceeds a "threshold" for a certain "count" of consecutive data points.
For the BMI160, it is a simple counter. For the BMI270, it is expressed in 50 Hz samples (20 ms). Range is 0 to 163sec. Default value is 5=100ms.
board | Calling object |
count | Number of consecutive slope data points that must be above the threshold |
METAWEAR_API void mbl_mw_acc_bosch_set_any_motion_threshold | ( | MblMwMetaWearBoard * | board, |
float | threshold | ||
) |
Sets the any motion detector's threshold parameter Any-motion generates an interrupt when the absolute value of the acceleration exceeds a "threshold" for a certain "count" of consecutive data points.
For the BMI160, it is range-dependent (see datasheet). Default value is 0x14 = 5.11mg in 2g mode. For the BMI270, range is 0 to 1g. Default value is 0xAA = 83mg.
board | Calling object |
threshold | Value that the slope data points must be above |
METAWEAR_API void mbl_mw_acc_bosch_set_double_tap_window | ( | MblMwMetaWearBoard * | board, |
MblMwAccBoschDoubleTapWindow | window | ||
) |
Sets the tap detector's double tap window The time window between two taps is between 12.5ms and 500ms.
The criteria for a double-tap are fulfilled if the second tap occurs after the quiet time and within the tap window. Not supported by the BMI270.
board | Calling object |
window | New double tap window time |
METAWEAR_API void mbl_mw_acc_bosch_set_no_motion_count | ( | MblMwMetaWearBoard * | board, |
uint8_t | count | ||
) |
Sets the no motion detector's count parameter.
board | Calling object |
count | Number of consecutive slope data points that must be above the threshold |
METAWEAR_API void mbl_mw_acc_bosch_set_no_motion_threshold | ( | MblMwMetaWearBoard * | board, |
float | threshold | ||
) |
Sets the no motion detector's threshold parameter.
board | Calling object |
threshold | Value that the slope data points must be above |
METAWEAR_API void mbl_mw_acc_bosch_set_orientation_hysteresis | ( | MblMwMetaWearBoard * | board, |
float | hysteresis | ||
) |
Set the hysteresis offset (degrees) for portrait/landscape detection Upside/downside recognition hysteresis is not configurable.
See the BMI160 datasheet for more information. Not supported by the BMI270.
board | Calling object |
hysteresis | New calculation mode |
METAWEAR_API void mbl_mw_acc_bosch_set_orientation_mode | ( | MblMwMetaWearBoard * | board, |
MblMwAccBoschOrientationMode | mode | ||
) |
Set the orientation calculation mode Options include: Symmetrical, High asymmetrical, Low asymmetrical See the BMI160 datasheet for more information.
Not supported by the BMI270.
board | Calling object |
mode | New calculation mode |
METAWEAR_API void mbl_mw_acc_bosch_set_quiet_time | ( | MblMwMetaWearBoard * | board, |
MblMwAccBoschTapQuietTime | time | ||
) |
Sets the tap detector's quiet time parameter Selects a tap quiet duration of ‘0’->30 ms, ‘1’->20 ms (i.e how long to wait for another tap) The criteria for a double-tap are fulfilled if the second tap occurs after the time quiet time and within the tap window.
If during the quiet time period (30/20ms) a tap occurs, it will be considered as a new tap. Not supported by the BMI270.
board | Calling object |
time | New quiet time |
METAWEAR_API void mbl_mw_acc_bosch_set_range | ( | MblMwMetaWearBoard * | board, |
MblMwAccBoschRange | range | ||
) |
Sets the acceleration range The range is in units of Gs between 2 and 16gs for Bosch sensors See MblMwAccBoschRange for allowed values.
board | Pointer to the board to modify |
range | Acceleration range to assign |
METAWEAR_API void mbl_mw_acc_bosch_set_shock_time | ( | MblMwMetaWearBoard * | board, |
MblMwAccBoschTapShockTime | time | ||
) |
Sets the tap detector's shock time parameter Selects a tap shock duration of ‘0’->50ms, ‘1’->75ms (i.e how long a tap can be) This is the time it take the tap to "settle".
Not supported by the BMI270.
board | Calling object |
time | New shock time |
METAWEAR_API void mbl_mw_acc_bosch_set_sig_motion_blocksize | ( | MblMwMetaWearBoard * | board, |
uint16_t | blocksize | ||
) |
Sets the sig motion detector's blocksize parameter.
board | Calling object |
threshold | Value that the slope data points must be above |
METAWEAR_API void mbl_mw_acc_bosch_set_threshold | ( | MblMwMetaWearBoard * | board, |
float | threshold | ||
) |
Sets the tap detector's threshold Threshold of the single/double-tap interrupt corresponding to an acceleration difference.
The threshold is typically between 0.7g and 1.5g in 2g measurement range. Not supported by the BMI270.
board | Calling object |
window | New threshold level |
METAWEAR_API void mbl_mw_acc_bosch_start | ( | const MblMwMetaWearBoard * | board | ) |
Switches the accelerometer to active mode When in active mode, the accelerometer cannot be configured.
board | Pointer to the board to send the command to |
METAWEAR_API void mbl_mw_acc_bosch_stop | ( | const MblMwMetaWearBoard * | board | ) |
Switches the accelerometer to standby mode (low power state)
board | Pointer to the board to send the command to |
METAWEAR_API void mbl_mw_acc_bosch_write_acceleration_config | ( | const MblMwMetaWearBoard * | board | ) |
Writes the acceleration settings to the sensor Applies the ODR and RANGE values set in set_range() and set_odr().
board | Pointer to the board to send the command to |
METAWEAR_API void mbl_mw_acc_bosch_write_motion_config | ( | const MblMwMetaWearBoard * | board, |
MblMwAccBoschMotion | type | ||
) |
Writes the motion configuration to the remote device Applies the threshold and count parameter or blocksize depending on motion type and settings from set_*_*() For the BMI270, types include no motion, significant motion, and any motion.
Ignored for other Bosch sensors.
board | Calling object |
type | Type of motion requested |
METAWEAR_API void mbl_mw_acc_bosch_write_orientation_config | ( | const MblMwMetaWearBoard * | board | ) |
Writes the orientation detection settings to the board Applies MODE and HYSTERESIS from set_orientation_hysteresis() and set_orientation_mode() Not supported by the BMI270.
board | Calling object |
METAWEAR_API void mbl_mw_acc_bosch_write_tap_config | ( | const MblMwMetaWearBoard * | board | ) |
Sets the tap detector's double tap window Applies the duration, quiet window, shock, and threshold from set_threshold(), set_double_tap_window(), set_shock_time(), set_quiet_time().
Not supported by the BMI270.
board | Calling object |
window | New double tap window time |