MetaWear C++ API  0.18.0
C++ implementation of the MetaWear protocol
Functions
accelerometer.h File Reference

Generic class providing high level access to an accelerometer. More...

#include "sensor_common.h"

Go to the source code of this file.

Functions

METAWEAR_API MblMwDataSignalmbl_mw_acc_get_acceleration_data_signal (const MblMwMetaWearBoard *board)
 Retrieves the data signal representing acceleration data. More...
 
METAWEAR_API MblMwDataSignalmbl_mw_acc_get_high_freq_acceleration_data_signal (const MblMwMetaWearBoard *board)
 
METAWEAR_API MblMwDataSignalmbl_mw_acc_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 float mbl_mw_acc_set_odr (MblMwMetaWearBoard *board, float odr)
 Sets the output data rate. More...
 
METAWEAR_API float mbl_mw_acc_set_range (MblMwMetaWearBoard *board, float range)
 Sets the full scale range. More...
 
METAWEAR_API void mbl_mw_acc_write_acceleration_config (const MblMwMetaWearBoard *board)
 Writes the acceleration settings to the board. More...
 
METAWEAR_API void mbl_mw_acc_read_config (const MblMwMetaWearBoard *board, void *context, MblMwFnBoardPtrInt completed)
 Pulls the current accelerometer output data rate and data range from the sensor. More...
 
METAWEAR_API void mbl_mw_acc_start (const MblMwMetaWearBoard *board)
 Switches the accelerometer to active mode. More...
 
METAWEAR_API void mbl_mw_acc_stop (const MblMwMetaWearBoard *board)
 Switches the accelerometer to standby mode. More...
 
METAWEAR_API void mbl_mw_acc_enable_acceleration_sampling (const MblMwMetaWearBoard *board)
 Enables acceleration sampling. More...
 
METAWEAR_API void mbl_mw_acc_disable_acceleration_sampling (const MblMwMetaWearBoard *board)
 Disables acceleration sampling. More...
 

Variables

const uint8_t MBL_MW_ACC_ACCEL_X_AXIS_INDEX = 0
 Indices for component values of the acceleration data signal, used with mbl_mw_datasignal_get_component.
 
const uint8_t MBL_MW_ACC_ACCEL_Y_AXIS_INDEX = 1
 Indices for component values of the acceleration data signal, used with mbl_mw_datasignal_get_component.
 
const uint8_t MBL_MW_ACC_ACCEL_Z_AXIS_INDEX = 2
 Indices for component values of the acceleration data signal, used with mbl_mw_datasignal_get_component.
 

Detailed Description

Generic class providing high level access to an accelerometer.

Function Documentation

◆ mbl_mw_acc_disable_acceleration_sampling()

METAWEAR_API void mbl_mw_acc_disable_acceleration_sampling ( const MblMwMetaWearBoard board)

Disables acceleration sampling.

Parameters
boardBoard to disable acceleration sampling on

◆ mbl_mw_acc_enable_acceleration_sampling()

METAWEAR_API void mbl_mw_acc_enable_acceleration_sampling ( const MblMwMetaWearBoard board)

Enables acceleration sampling.

Parameters
boardBoard to enable acceleration sampling on

◆ mbl_mw_acc_get_acceleration_data_signal()

METAWEAR_API MblMwDataSignal* mbl_mw_acc_get_acceleration_data_signal ( const MblMwMetaWearBoard board)

Retrieves the data signal representing acceleration data.

Parameters
boardBoard to retrieve the signal from
Returns
Pointer to the acceleration data signal

◆ mbl_mw_acc_get_high_freq_acceleration_data_signal()

METAWEAR_API MblMwDataSignal* mbl_mw_acc_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_get_packed_acceleration_data_signal instead.

◆ mbl_mw_acc_get_packed_acceleration_data_signal()

METAWEAR_API MblMwDataSignal* mbl_mw_acc_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.

Returns
Pointer to the data singal

◆ mbl_mw_acc_read_config()

METAWEAR_API void mbl_mw_acc_read_config ( const MblMwMetaWearBoard board,
void *  context,
MblMwFnBoardPtrInt  completed 
)

Pulls the current accelerometer output data rate and data range from the sensor.

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

◆ mbl_mw_acc_set_odr()

METAWEAR_API float mbl_mw_acc_set_odr ( MblMwMetaWearBoard board,
float  odr 
)

Sets the output data rate.

If an invalid odr is used, the closest valid value will be used.

Parameters
boardBoard to configure
odrOutput data rate, in Hz

◆ mbl_mw_acc_set_range()

METAWEAR_API float mbl_mw_acc_set_range ( MblMwMetaWearBoard board,
float  range 
)

Sets the full scale range.

IF an invalid range is used, the closet valid value will be used.

Parameters
boardBoard to configure
rangeSampling range, in g's

◆ mbl_mw_acc_start()

METAWEAR_API void mbl_mw_acc_start ( const MblMwMetaWearBoard board)

Switches the accelerometer to active mode.

Parameters
boardBoard the accelerometer is on

◆ mbl_mw_acc_stop()

METAWEAR_API void mbl_mw_acc_stop ( const MblMwMetaWearBoard board)

Switches the accelerometer to standby mode.

Parameters
boardBoard the accelerometer is on

◆ mbl_mw_acc_write_acceleration_config()

METAWEAR_API void mbl_mw_acc_write_acceleration_config ( const MblMwMetaWearBoard board)

Writes the acceleration settings to the board.

Parameters
boardBoard to configure