MetaWear C++ API  0.20.0
C++ implementation of the MetaWear protocol
gyro_bosch.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 #include "sensor_common.h"
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 const uint8_t MBL_MW_MODULE_GYRO_TYPE_BMI160 = 0;
16 const uint8_t MBL_MW_MODULE_GYRO_TYPE_BMI270 = 1;
17 
19 
21  MBL_MW_GYRO_ROTATION_Y_AXIS_INDEX = 1,
22  MBL_MW_GYRO_ROTATION_Z_AXIS_INDEX = 2;
24 
28 typedef enum {
29  MBL_MW_GYRO_BOSCH_ODR_25Hz= 6,
30  MBL_MW_GYRO_BOSCH_ODR_50Hz,
31  MBL_MW_GYRO_BOSCH_ODR_100Hz,
32  MBL_MW_GYRO_BOSCH_ODR_200Hz,
33  MBL_MW_GYRO_BOSCH_ODR_400Hz,
34  MBL_MW_GYRO_BOSCH_ODR_800Hz,
35  MBL_MW_GYRO_BOSCH_ODR_1600Hz,
36  MBL_MW_GYRO_BOSCH_ODR_3200Hz
38 
42 typedef enum {
49 
199 METAWEAR_API void mbl_mw_gyro_bmi270_acc_offsets(const MblMwMetaWearBoard* board, uint8_t x_offset, uint8_t y_offset, uint8_t z_offset);
200 
201 #ifdef __cplusplus
202 }
203 #endif
struct MblMwDataSignal MblMwDataSignal
A event fired from the MetaWear board that also contains data.
Definition: datasignal_fwd.h:15
#define METAWEAR_API
Indicates the function should be exported to the symbol table
Definition: dllmarker.h:27
METAWEAR_API void mbl_mw_gyro_bmi270_acc_offsets(const MblMwMetaWearBoard *board, uint8_t x_offset, uint8_t y_offset, uint8_t z_offset)
Manual compensation for the BMI270 gyro The offset compensation field for each axis has a width of 10...
METAWEAR_API void mbl_mw_gyro_bmi270_read_config(const MblMwMetaWearBoard *board, void *context, MblMwFnBoardPtrInt completed)
Pulls the current gyro output data rate and data range from the sensor.
METAWEAR_API MblMwDataSignal * mbl_mw_gyro_bmi160_get_rotation_data_signal(const MblMwMetaWearBoard *board)
Retrieves the data signal representing BMI160 rotation data This signal is timestamp,...
METAWEAR_API MblMwDataSignal * mbl_mw_gyro_bmi270_get_packed_rotation_data_signal(const MblMwMetaWearBoard *board)
Variant of rotation data that packs multiple data samples into 1 BLE packet to increase the data thro...
const uint8_t MBL_MW_MODULE_GYRO_TYPE_BMI270
Constant identifying the BMI270 accelerometer module type.
Definition: gyro_bosch.h:16
METAWEAR_API void mbl_mw_gyro_bmi160_read_config(const MblMwMetaWearBoard *board, void *context, MblMwFnBoardPtrInt completed)
Pulls the current gyro output data rate and data range from the sensor.
METAWEAR_API MblMwDataSignal * mbl_mw_gyro_bmi160_get_high_freq_rotation_data_signal(const MblMwMetaWearBoard *board)
METAWEAR_API void mbl_mw_gyro_bmi270_enable_rotation_sampling(const MblMwMetaWearBoard *board)
Enables rotation sampling The board will start gathering data from the gyroscope.
METAWEAR_API void mbl_mw_gyro_bmi270_write_config(const MblMwMetaWearBoard *board)
Writes the configuration to the sendor Applies the ODR and RANGE values set in set_range() and set_od...
MblMwGyroBoschRange
Available degrees per second ranges on the BMI160 gyro.
Definition: gyro_bosch.h:42
@ MBL_MW_GYRO_BOSCH_RANGE_500dps
+/-500 degrees per second
Definition: gyro_bosch.h:45
@ MBL_MW_GYRO_BOSCH_RANGE_1000dps
+/-1000 degrees per second
Definition: gyro_bosch.h:44
@ MBL_MW_GYRO_BOSCH_RANGE_250dps
+/-250 degrees per second
Definition: gyro_bosch.h:46
@ MBL_MW_GYRO_BOSCH_RANGE_125dps
+/-125 degrees per second
Definition: gyro_bosch.h:47
@ MBL_MW_GYRO_BOSCH_RANGE_2000dps
+/-2000 degrees per second
Definition: gyro_bosch.h:43
METAWEAR_API void mbl_mw_gyro_bmi160_enable_rotation_sampling(const MblMwMetaWearBoard *board)
Enables rotation sampling The board will start gathering data from the gyroscope.
const uint8_t MBL_MW_MODULE_GYRO_TYPE_BMI160
Constant identifying the BMI160 accelerometer module type.
Definition: gyro_bosch.h:15
METAWEAR_API void mbl_mw_gyro_bmi160_disable_rotation_sampling(const MblMwMetaWearBoard *board)
Disables rotation sampling The board will stop gathering data from the gyroscope.
const uint8_t MBL_MW_GYRO_ROTATION_X_AXIS_INDEX
Indices for component values of the rotation data signal, used with mbl_mw_datasignal_get_component.
Definition: gyro_bosch.h:20
METAWEAR_API void mbl_mw_gyro_bmi270_set_odr(MblMwMetaWearBoard *board, MblMwGyroBoschOdr odr)
Sets the output data rate for the BMI270 gyroscope The ODR sets the output data frequency in Hz.
METAWEAR_API MblMwDataSignal * mbl_mw_gyro_bmi270_get_rotation_data_signal(const MblMwMetaWearBoard *board)
Retrieves the data signal representing BMI270 rotation data This signal is timestamp,...
METAWEAR_API void mbl_mw_gyro_bmi160_set_odr(MblMwMetaWearBoard *board, MblMwGyroBoschOdr odr)
Sets the output data rate for the BMI160 gyroscope The ODR sets the output data frequency in Hz.
METAWEAR_API void mbl_mw_gyro_bmi270_stop(const MblMwMetaWearBoard *board)
Switches the gyro to standby mode.
METAWEAR_API void mbl_mw_gyro_bmi160_set_range(MblMwMetaWearBoard *board, MblMwGyroBoschRange range)
Sets the rotation range The range is in units of degrees per second (dps) for Bosch sensors See MblMw...
METAWEAR_API MblMwDataSignal * mbl_mw_gyro_bmi160_get_packed_rotation_data_signal(const MblMwMetaWearBoard *board)
Variant of rotation data that packs multiple data samples into 1 BLE packet to increase the data thro...
METAWEAR_API void mbl_mw_gyro_bmi270_set_range(MblMwMetaWearBoard *board, MblMwGyroBoschRange range)
Sets the rotation range for the BMI270 gyroscope The range is in units of degrees per second (dps) fo...
METAWEAR_API void mbl_mw_gyro_bmi160_start(const MblMwMetaWearBoard *board)
Switches the gyro to active mode.
METAWEAR_API void mbl_mw_gyro_bmi160_stop(const MblMwMetaWearBoard *board)
Switches the gyro to standby mode.
MblMwGyroBoschOdr
Available output data rates on the BMI160 gyro.
Definition: gyro_bosch.h:28
METAWEAR_API void mbl_mw_gyro_bmi160_write_config(const MblMwMetaWearBoard *board)
Writes the configuration to the sendor Applies the ODR and RANGE values set in set_range() and set_od...
METAWEAR_API void mbl_mw_gyro_bmi270_disable_rotation_sampling(const MblMwMetaWearBoard *board)
Disables rotation sampling The board will stop gathering data from the gyroscope.
METAWEAR_API void mbl_mw_gyro_bmi270_start(const MblMwMetaWearBoard *board)
Switches the gyro to active mode.
struct MblMwMetaWearBoard MblMwMetaWearBoard
Software representation of a physical MetaWear board.
Definition: metawearboard_fwd.h:17
void(* MblMwFnBoardPtrInt)(void *context, MblMwMetaWearBoard *board, int32_t value)
Definition for callback functions that accept an MblMwMetaWearBoard pointer and an int32.
Definition: metawearboard_fwd.h:26