MetaWear C++ API  0.18.0
C++ implementation of the MetaWear protocol
Enumerations | Functions
magnetometer_bmm150.h File Reference

Communicates with the BMM150 magnetometer. More...

#include "sensor_common.h"

Go to the source code of this file.

Enumerations

enum  MblMwMagBmm150Preset { MBL_MW_MAG_BMM150_PRESET_LOW_POWER = 0, MBL_MW_MAG_BMM150_PRESET_REGULAR, MBL_MW_MAG_BMM150_PRESET_ENHANCED_REGULAR, MBL_MW_MAG_BMM150_PRESET_HIGH_ACCURACY }
 Preset power modes recommended by Bosch. More...
 
enum  MblMwMagBmm150Odr {
  MBL_MW_MAG_BMM150_ODR_10Hz = 0, MBL_MW_MAG_BMM150_ODR_2Hz, MBL_MW_MAG_BMM150_ODR_6Hz, MBL_MW_MAG_BMM150_ODR_8Hz,
  MBL_MW_MAG_BMM150_ODR_15Hz, MBL_MW_MAG_BMM150_ODR_20Hz, MBL_MW_MAG_BMM150_ODR_25Hz, MBL_MW_MAG_BMM150_ODR_30Hz
}
 Available output data rates for the BMM150 magnetometer.
 

Functions

METAWEAR_API MblMwDataSignalmbl_mw_mag_bmm150_get_b_field_data_signal (const MblMwMetaWearBoard *board)
 Retrieves the data signal representing B field strength. More...
 
METAWEAR_API MblMwDataSignalmbl_mw_mag_bmm150_get_packed_b_field_data_signal (const MblMwMetaWearBoard *board)
 Variant of B field data that packs multiple data samples into 1 BLE packet to increase the data throughput. More...
 
METAWEAR_API void mbl_mw_mag_bmm150_configure (const MblMwMetaWearBoard *board, uint16_t xy_reps, uint16_t z_reps, MblMwMagBmm150Odr odr)
 Manually configure the sensor, only for advanced users. More...
 
METAWEAR_API void mbl_mw_mag_bmm150_set_preset (const MblMwMetaWearBoard *board, MblMwMagBmm150Preset preset)
 Sets the power mode to one of the recommended presets. More...
 
METAWEAR_API void mbl_mw_mag_bmm150_enable_b_field_sampling (const MblMwMetaWearBoard *board)
 Enable B field sampling. More...
 
METAWEAR_API void mbl_mw_mag_bmm150_disable_b_field_sampling (const MblMwMetaWearBoard *board)
 Disable B field sampling. More...
 
METAWEAR_API void mbl_mw_mag_bmm150_start (const MblMwMetaWearBoard *board)
 Switches the magnetometer into normal mode. More...
 
METAWEAR_API void mbl_mw_mag_bmm150_stop (const MblMwMetaWearBoard *board)
 Switches the magnetometer into sleep mode. More...
 
METAWEAR_API void mbl_mw_mag_bmm150_suspend (const MblMwMetaWearBoard *board)
 Puts the magnetometer in suspend mode. More...
 

Variables

const uint8_t MBL_MW_MAG_BFIELD_X_AXIS_INDEX = 0
 Indices for component values of the bfield data signal, used with mbl_mw_datasignal_get_component.
 
const uint8_t MBL_MW_MAG_BFIELD_Y_AXIS_INDEX = 1
 Indices for component values of the bfield data signal, used with mbl_mw_datasignal_get_component.
 
const uint8_t MBL_MW_MAG_BFIELD_Z_AXIS_INDEX = 2
 Indices for component values of the bfield data signal, used with mbl_mw_datasignal_get_component.
 

Detailed Description

Communicates with the BMM150 magnetometer.

Enumeration Type Documentation

◆ MblMwMagBmm150Preset

Preset power modes recommended by Bosch.

Setting ODR Average Current Noise
LOW_POWER 10Hz 170μA 1.0μT (xy axis), 1.4μT (z axis)
REGULAR 10Hz 0.5mA 0.6μT
ENHANCED_REGULAR 10Hz 0.8mA 0.5μT
HIGH_ACCURACY 20Hz 4.9mA 0.3μT

Function Documentation

◆ mbl_mw_mag_bmm150_configure()

METAWEAR_API void mbl_mw_mag_bmm150_configure ( const MblMwMetaWearBoard board,
uint16_t  xy_reps,
uint16_t  z_reps,
MblMwMagBmm150Odr  odr 
)

Manually configure the sensor, only for advanced users.

It is recommended that users use one of the preset configurations.

Parameters
boardCalling object
xy_repsRepetitions on the x/y-axis
z_repsRepetitions on the z-axis
odrSensor data rate

◆ mbl_mw_mag_bmm150_disable_b_field_sampling()

METAWEAR_API void mbl_mw_mag_bmm150_disable_b_field_sampling ( const MblMwMetaWearBoard board)

Disable B field sampling.

Parameters
boardCalling object

◆ mbl_mw_mag_bmm150_enable_b_field_sampling()

METAWEAR_API void mbl_mw_mag_bmm150_enable_b_field_sampling ( const MblMwMetaWearBoard board)

Enable B field sampling.

Parameters
boardCalling object

◆ mbl_mw_mag_bmm150_get_b_field_data_signal()

METAWEAR_API MblMwDataSignal* mbl_mw_mag_bmm150_get_b_field_data_signal ( const MblMwMetaWearBoard board)

Retrieves the data signal representing B field strength.

Parameters
boardCalling object
Returns
Pointer to the data signal

◆ mbl_mw_mag_bmm150_get_packed_b_field_data_signal()

METAWEAR_API MblMwDataSignal* mbl_mw_mag_bmm150_get_packed_b_field_data_signal ( const MblMwMetaWearBoard board)

Variant of B field 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.

Parameters
boardCalling object
Returns
Pointer to the data signal

◆ mbl_mw_mag_bmm150_set_preset()

METAWEAR_API void mbl_mw_mag_bmm150_set_preset ( const MblMwMetaWearBoard board,
MblMwMagBmm150Preset  preset 
)

Sets the power mode to one of the recommended presets.

Parameters
boardCalling object
presetNew preset power mode to use

◆ mbl_mw_mag_bmm150_start()

METAWEAR_API void mbl_mw_mag_bmm150_start ( const MblMwMetaWearBoard board)

Switches the magnetometer into normal mode.

Parameters
boardCalling object

◆ mbl_mw_mag_bmm150_stop()

METAWEAR_API void mbl_mw_mag_bmm150_stop ( const MblMwMetaWearBoard board)

Switches the magnetometer into sleep mode.

Parameters
boardCalling object

◆ mbl_mw_mag_bmm150_suspend()

METAWEAR_API void mbl_mw_mag_bmm150_suspend ( const MblMwMetaWearBoard board)

Puts the magnetometer in suspend mode.

This function will not issuee the command unless the board is running minimum firmware v1.3.4.

Parameters
boardCalling object