MetaWear C++ API  0.20.0
C++ implementation of the MetaWear protocol
Classes | Enumerations | Functions | Variables
accelerometer_bosch.h File Reference

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 MblMwDataSignalmbl_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 MblMwDataSignalmbl_mw_acc_bosch_get_high_freq_acceleration_data_signal (const MblMwMetaWearBoard *board)
 
METAWEAR_API MblMwDataSignalmbl_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 MblMwDataSignalmbl_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 MblMwDataSignalmbl_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 MblMwDataSignalmbl_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 MblMwDataSignalmbl_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 MblMwDataSignalmbl_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 MblMwDataSignalmbl_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 MblMwDataSignalmbl_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 MblMwDataSignalmbl_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 MblMwDataSignalmbl_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.
 

Detailed Description

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".

Enumeration Type Documentation

◆ MblMwAccBmi160StepCounterMode

Operation modes for the step counter algorithm.

Enumerator
MBL_MW_ACC_BMI160_STEP_COUNTER_MODE_NORMAL 

Recommended for most applications, well balanced between false positives and false negatives.

MBL_MW_ACC_BMI160_STEP_COUNTER_MODE_SENSITIVE 

Recommended for light weighted persons, gives few false negatives but eventually more false positives.

MBL_MW_ACC_BMI160_STEP_COUNTER_MODE_ROBUST 

Gives few false positives but eventually more false negatives.

◆ MblMwAccBoschGesture

Available wrist gestures on the BMI270.

Enumerator
MBL_MW_ACC_BOSCH_GESTURE_UNKNOWN 

Unknown gesture.

MBL_MW_ACC_BOSCH_GESTURE_PUSH_ARM_DOWN 

Arm pushed down gesture.

MBL_MW_ACC_BOSCH_GESTURE_PIVOT_UP 

Pivot up gesture.

MBL_MW_ACC_BOSCH_GESTURE_SHAKE 

Shake/jiggle gesture.

MBL_MW_ACC_BOSCH_GESTURE_ARM_FLICK_IN 

Arm flick in gesture.

MBL_MW_ACC_BOSCH_GESTURE_ARM_FLICK_OUT 

Arm flick out gesture.

◆ MblMwAccBoschMotion

Available motion detectors on the Bosch accelerometers.

Enumerator
MBL_MW_ACC_BOSCH_MOTION_SIGMOTION 

Significant motion detector.

MBL_MW_ACC_BOSCH_MOTION_NOMOTION 

No motion detector.

MBL_MW_ACC_BOSCH_MOTION_ANYMOTION 

Any motion detector.

◆ MblMwAccBoschOrientationMode

Calculation modes controlling the conditions that determine the sensor's orientation.

Author
Eric Tsai
Enumerator
MBL_MW_ACC_BOSCH_ORIENTATION_MODE_SYMMETRICAL 

Default mode.

◆ MblMwAccBoschRange

Available g-ranges on the Bosch accelerometers.

Enumerator
MBL_MW_ACC_BOSCH_RANGE_2G 

+/- 2g

MBL_MW_ACC_BOSCH_RANGE_4G 

+/- 4g

MBL_MW_ACC_BOSCH_RANGE_8G 

+/- 8g

MBL_MW_ACC_BOSCH_RANGE_16G 

+/- 16g

◆ MblMwAccBoschTapQuietTime

Available quiet times for tap detection.

Author
Eric Tsai

◆ MblMwAccBoschTapShockTime

Available shock times for tap detection.

Author
Eric Tsai

Function Documentation

◆ mbl_mw_acc_bma255_set_odr()

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.

Parameters
boardPointer to the board to modify
odrOutput data rate value to assign

◆ mbl_mw_acc_bmi160_disable_step_counter()

METAWEAR_API void mbl_mw_acc_bmi160_disable_step_counter ( MblMwMetaWearBoard board)

Disables the BMI160 step counter.

Parameters
boardBoard to modify

◆ mbl_mw_acc_bmi160_disable_step_detector()

METAWEAR_API void mbl_mw_acc_bmi160_disable_step_detector ( const MblMwMetaWearBoard board)

Disables the BMI160 step detector.

Parameters
boardPointer to the board to send the command to

◆ mbl_mw_acc_bmi160_enable_step_counter()

METAWEAR_API void mbl_mw_acc_bmi160_enable_step_counter ( MblMwMetaWearBoard board)

Enables the BMI160 step counter.

Parameters
boardBoard to modify

◆ mbl_mw_acc_bmi160_enable_step_detector()

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.

Parameters
boardPointer to the board to send the command to

◆ mbl_mw_acc_bmi160_get_step_counter_data_signal()

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.

Parameters
boardPointer to the board to retrieve the signal from
Returns
Pointer to the board's BMI160 step counter data signal UINT32 is return signal data type

◆ mbl_mw_acc_bmi160_get_step_detector_data_signal()

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.

Parameters
boardPointer to the board to retrieve the signal from
Returns
Pointer to the board's BMI160 step detector data signal No return data type

◆ mbl_mw_acc_bmi160_reset_step_counter()

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.

Parameters
boardBoard to reset

◆ mbl_mw_acc_bmi160_set_odr()

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.

Parameters
boardPointer to the board to modify
odrOutput data rate value to assign

◆ mbl_mw_acc_bmi160_set_step_counter_mode()

METAWEAR_API void mbl_mw_acc_bmi160_set_step_counter_mode ( MblMwMetaWearBoard board,
MblMwAccBmi160StepCounterMode  mode 
)

Sets the operational mode of the step counter.

  • Normal mode (default setting, recommended for most applications)
  • Sensitive mode (can be used for light weighted, small persons)
  • Robust mode (can be used, if many false positive detections are observed)
    Parameters
    boardBoard to modify
    modeNew operation mode

◆ mbl_mw_acc_bmi160_write_step_counter_config()

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()

Parameters
boardBoard to write to

◆ mbl_mw_acc_bmi270_acc_offsets()

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

Parameters
boardPointer to the board to send the command to
x_offsetOffset compensation for Accelerometer X-axis
y_offsetOffset compensation for Accelerometer Y-axis
z_offsetOffset compensation for Accelerometer Z-axis

◆ mbl_mw_acc_bmi270_axis_remap()

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.

Parameters
boardPointer to the board to send the command to
mapX,Y,Z axis remap
signX,Y,Z axis flip/sign

◆ mbl_mw_acc_bmi270_disable_activity_detection()

METAWEAR_API void mbl_mw_acc_bmi270_disable_activity_detection ( const MblMwMetaWearBoard board)

Disables the BMI270 activity detector.

Parameters
boardPointer to the board to send the command to

◆ mbl_mw_acc_bmi270_disable_step_counter()

METAWEAR_API void mbl_mw_acc_bmi270_disable_step_counter ( const MblMwMetaWearBoard board)

Disables the BMI270 step counter.

Parameters
boardBoard to modify

◆ mbl_mw_acc_bmi270_disable_step_detector()

METAWEAR_API void mbl_mw_acc_bmi270_disable_step_detector ( const MblMwMetaWearBoard board)

Disables the BMI270 step detector.

Parameters
boardPointer to the board to send the command to

◆ mbl_mw_acc_bmi270_disable_wrist_gesture()

METAWEAR_API void mbl_mw_acc_bmi270_disable_wrist_gesture ( const MblMwMetaWearBoard board)

Disables the BMI270 wrist gesture recognition.

Parameters
boardBoard to modify

◆ mbl_mw_acc_bmi270_disable_wrist_wakeup()

METAWEAR_API void mbl_mw_acc_bmi270_disable_wrist_wakeup ( const MblMwMetaWearBoard board)

Disables the BMI270 wrist wakeup recognition.

Parameters
boardBoard to modify

◆ mbl_mw_acc_bmi270_enable_activity_detection()

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)

Parameters
boardPointer to the board to send the command to

◆ mbl_mw_acc_bmi270_enable_step_counter()

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.

Parameters
boardBoard to modify

◆ mbl_mw_acc_bmi270_enable_step_detector()

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.

Parameters
boardPointer to the board to send the command to

◆ mbl_mw_acc_bmi270_enable_wrist_gesture()

METAWEAR_API void mbl_mw_acc_bmi270_enable_wrist_gesture ( const MblMwMetaWearBoard board)

Enables the BMI270 wrist gesture recognition.

Parameters
boardBoard to modify

◆ mbl_mw_acc_bmi270_enable_wrist_wakeup()

METAWEAR_API void mbl_mw_acc_bmi270_enable_wrist_wakeup ( const MblMwMetaWearBoard board)

Enables the BMI270 wrist wakeup recognition.

Parameters
boardBoard to modify

◆ mbl_mw_acc_bmi270_fifo_downs()

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.

Parameters
boardPointer to the board to send the command to
gyro_downsDownsampling for Gyroscope (2**downs_gyro)
gyro_dataSelects filtered or unfiltered Gyroscope data for fifo
acc_downsDownsampling for Accelerometer (2**downs_accel)
acc_dataSelects filtered or unfiltered Accelerometer data for fifo

◆ mbl_mw_acc_bmi270_get_activity_detector_data_signal()

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.

Parameters
boardPointer to the board to retrieve the signal from
Returns
Pointer to the board's BMI270 step detector data signal UINT32 is return signal data type represented by MblMwAccActivityCode

◆ mbl_mw_acc_bmi270_get_step_counter_data_signal()

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.

Parameters
boardPointer to the board to retrieve the signal from
Returns
Pointer to the board's BMI270 step counter data signal UINT32 is return signal data type

◆ mbl_mw_acc_bmi270_get_step_detector_data_signal()

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.

Parameters
boardPointer to the board to retrieve the signal from
Returns
Pointer to the board's BMI270 step detector data signal No return data type

◆ mbl_mw_acc_bmi270_get_wrist_detector_data_signal()

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.

Parameters
boardPointer to the board to retrieve the signal from
Returns
Pointer to the board's BMI270 step detector data signal UINT32 is return signal data type represented by MblMwAccGestureCode

◆ mbl_mw_acc_bmi270_read_step_counter()

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:

Parameters
boardCalling object
contextPointer to additional data for the callback function
handlerCallback function that is executed when the task is finished

◆ mbl_mw_acc_bmi270_reset_step_counter()

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.

Parameters
boardBoard to reset

◆ mbl_mw_acc_bmi270_set_odr()

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.

Parameters
boardPointer to the board to modify
odrOutput data rate value to assign

◆ mbl_mw_acc_bmi270_set_step_counter_trigger()

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.

Parameters
boardBoard to modify
triggerNumber of steps

◆ mbl_mw_acc_bmi270_wrist_gesture_armside()

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.

Parameters
boardPointer to the board to send the command to
side1 = Right arm, 0 = Left arm

◆ mbl_mw_acc_bmi270_wrist_gesture_duration()

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).

Parameters
boardPointer to the board to send the command to
duration

◆ mbl_mw_acc_bmi270_wrist_gesture_peak()

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.

Parameters
boardPointer to the board to send the command to
peakTilt Angle

◆ mbl_mw_acc_bmi270_wrist_gesture_samples()

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).

Parameters
boardPointer to the board to send the command to
sample

◆ mbl_mw_acc_bmi270_wrist_wakeup_angle_focus()

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.

Parameters
boardPointer to the board to send the command to
angleMinimum angle

◆ mbl_mw_acc_bmi270_wrist_wakeup_angle_nonfocus()

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.

Parameters
boardPointer to the board to send the command to
angleMaximum angle

◆ mbl_mw_acc_bmi270_wrist_wakeup_tilt_ll()

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.

Parameters
boardPointer to the board to send the command to
angleMaximum tilt angle in Landscape Left mode

◆ mbl_mw_acc_bmi270_wrist_wakeup_tilt_lr()

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.

Parameters
boardPointer to the board to send the command to
angleMaximum tilt angle in Landscape Right mode

◆ mbl_mw_acc_bmi270_wrist_wakeup_tilt_pd()

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.

Parameters
boardPointer to the board to send the command to
angleMaximum tilt angle in Portrait Down mode

◆ mbl_mw_acc_bmi270_wrist_wakeup_tilt_pu()

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.

Parameters
boardPointer to the board to send the command to
angleMaximum tilt angle in Portrait Up mode

◆ mbl_mw_acc_bmi270_write_step_counter_config()

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()

Parameters
boardBoard to write to

◆ mbl_mw_acc_bmi270_write_wrist_gesture_config()

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_*()

Parameters
boardBoard to write to

◆ mbl_mw_acc_bmi270_write_wrist_wakeup_config()

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_*()

Parameters
boardBoard to write to

◆ mbl_mw_acc_bosch_disable_acceleration_sampling()

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.

Parameters
boardPointer to the board to send the command to

◆ mbl_mw_acc_bosch_disable_motion_detection()

METAWEAR_API void mbl_mw_acc_bosch_disable_motion_detection ( const MblMwMetaWearBoard board,
MblMwAccBoschMotion  type 
)

Disables motion detection.

Parameters
boardCalling object
typeType of motion requested

◆ mbl_mw_acc_bosch_disable_orientation_detection()

METAWEAR_API void mbl_mw_acc_bosch_disable_orientation_detection ( const MblMwMetaWearBoard board)

Disables orientation detection Not supported by the BMI270.

Parameters
boardCalling object

◆ mbl_mw_acc_bosch_disable_tap_detection()

METAWEAR_API void mbl_mw_acc_bosch_disable_tap_detection ( const MblMwMetaWearBoard board)

Disable the tap detector Not supported by the BMI270.

Parameters
boardCalling object
windowNew double tap window time

◆ mbl_mw_acc_bosch_enable_acceleration_sampling()

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.

Parameters
boardPointer to the board to send the command to

◆ mbl_mw_acc_bosch_enable_motion_detection()

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.

Parameters
boardCalling object
typeType of motion requested

◆ mbl_mw_acc_bosch_enable_orientation_detection()

METAWEAR_API void mbl_mw_acc_bosch_enable_orientation_detection ( const MblMwMetaWearBoard board)

Enables orientation detection Not supported by the BMI270.

Parameters
boardCalling object

◆ mbl_mw_acc_bosch_enable_tap_detection()

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.

Parameters
boardCalling object
enable_single0 to ignore single tap detection, non-zero to detect
enable_double0 to ignore double tap detection, non-zero to detect

◆ mbl_mw_acc_bosch_get_acceleration_data_signal()

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.

Parameters
boardPointer to the board to retrieve the signal from
Returns
Pointer to the board's BMI160 acceleration data signal MblMwCartesianFloat is return signal data type

◆ mbl_mw_acc_bosch_get_high_freq_acceleration_data_signal()

METAWEAR_API MblMwDataSignal* mbl_mw_acc_bosch_get_high_freq_acceleration_data_signal ( const MblMwMetaWearBoard board)
Deprecated:
As of v0.8.0 and will be removed in v1.0.0.

Use mbl_mw_acc_bosch_get_packed_acceleration_data_signal instead.

◆ mbl_mw_acc_bosch_get_motion_data_signal()

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.

Parameters
boardCalling object
Returns
Pointer to Bosch's motion detection data signal UINT32 is return signal data type represented by MblMwAccMotionTypes

◆ mbl_mw_acc_bosch_get_orientation_detection_data_signal()

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.

Parameters
boardCalling object
Returns
Pointer to Bosch's orientation detection data signal MblMwSensorOrientation is return signal data type

◆ mbl_mw_acc_bosch_get_packed_acceleration_data_signal()

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)

Returns
Pointer to the data signal [MblMwCartesianFloat, MblMwCartesianFloat, MblMwCartesianFloat] is return signal data type

◆ mbl_mw_acc_bosch_get_tap_data_signal()

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.

Parameters
boardCalling object
Returns
Pointer to Bosch's tap detection data signal MblMwBoschTap is return signal data type

◆ mbl_mw_acc_bosch_set_any_motion_count()

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.

Parameters
boardCalling object
countNumber of consecutive slope data points that must be above the threshold

◆ mbl_mw_acc_bosch_set_any_motion_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.

Parameters
boardCalling object
thresholdValue that the slope data points must be above

◆ mbl_mw_acc_bosch_set_double_tap_window()

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.

Parameters
boardCalling object
windowNew double tap window time

◆ mbl_mw_acc_bosch_set_no_motion_count()

METAWEAR_API void mbl_mw_acc_bosch_set_no_motion_count ( MblMwMetaWearBoard board,
uint8_t  count 
)

Sets the no motion detector's count parameter.

Parameters
boardCalling object
countNumber of consecutive slope data points that must be above the threshold

◆ mbl_mw_acc_bosch_set_no_motion_threshold()

METAWEAR_API void mbl_mw_acc_bosch_set_no_motion_threshold ( MblMwMetaWearBoard board,
float  threshold 
)

Sets the no motion detector's threshold parameter.

Parameters
boardCalling object
thresholdValue that the slope data points must be above

◆ mbl_mw_acc_bosch_set_orientation_hysteresis()

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.

Parameters
boardCalling object
hysteresisNew calculation mode

◆ mbl_mw_acc_bosch_set_orientation_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.

Parameters
boardCalling object
modeNew calculation mode

◆ mbl_mw_acc_bosch_set_quiet_time()

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.

Parameters
boardCalling object
timeNew quiet time

◆ mbl_mw_acc_bosch_set_range()

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.

Parameters
boardPointer to the board to modify
rangeAcceleration range to assign

◆ mbl_mw_acc_bosch_set_shock_time()

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.

Parameters
boardCalling object
timeNew shock time

◆ mbl_mw_acc_bosch_set_sig_motion_blocksize()

METAWEAR_API void mbl_mw_acc_bosch_set_sig_motion_blocksize ( MblMwMetaWearBoard board,
uint16_t  blocksize 
)

Sets the sig motion detector's blocksize parameter.

Parameters
boardCalling object
thresholdValue that the slope data points must be above

◆ mbl_mw_acc_bosch_set_threshold()

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.

Parameters
boardCalling object
windowNew threshold level

◆ mbl_mw_acc_bosch_start()

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.

Parameters
boardPointer to the board to send the command to

◆ mbl_mw_acc_bosch_stop()

METAWEAR_API void mbl_mw_acc_bosch_stop ( const MblMwMetaWearBoard board)

Switches the accelerometer to standby mode (low power state)

Parameters
boardPointer to the board to send the command to

◆ mbl_mw_acc_bosch_write_acceleration_config()

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().

Parameters
boardPointer to the board to send the command to

◆ mbl_mw_acc_bosch_write_motion_config()

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.

Parameters
boardCalling object
typeType of motion requested

◆ mbl_mw_acc_bosch_write_orientation_config()

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.

Parameters
boardCalling object

◆ mbl_mw_acc_bosch_write_tap_config()

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.

Parameters
boardCalling object
windowNew double tap window time