MetaWear C++ API  0.20.0
C++ implementation of the MetaWear protocol
accelerometer_mma8452q.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 
16 
17 /*
18 typedef enum {
19  MBL_MW_ACC_MMA8452Q_AXIS_X,
20  MBL_MW_ACC_MMA8452Q_AXIS_Y,
21  MBL_MW_ACC_MMA8452Q_AXIS_Z
22 } MblMWMma8452qAxis;
23 
24 typedef enum {
25  MBL_MW_ACC_MMA8452Q_FREE_FALL,
26  MBL_MW_ACC_MMA8452Q_MOTION
27 } MblMwAccMma8452qMovementType;
28 */
29 
33 typedef enum {
38 
42 typedef enum {
43  MBL_MW_ACC_MMA8452Q_ODR_800Hz= 0,
44  MBL_MW_ACC_MMA8452Q_ODR_400Hz,
45  MBL_MW_ACC_MMA8452Q_ODR_200Hz,
46  MBL_MW_ACC_MMA8452Q_ODR_100Hz,
47  MBL_MW_ACC_MMA8452Q_ODR_50Hz,
48  MBL_MW_ACC_MMA8452Q_ODR_12_5Hz,
49  MBL_MW_ACC_MMA8452Q_ODR_6_25Hz,
50  MBL_MW_ACC_MMA8452Q_ODR_1_56Hz
52 
56 typedef enum {
57  MBL_MW_ACC_MMA8452Q_CUTOFF_FREQ_HIGHEST = 0,
58  MBL_MW_ACC_MMA8452Q_CUTOFF_FREQ_HIGH = 1,
59  MBL_MW_ACC_MMA8452Q_CUTOFF_FREQ_MEDIUM = 2,
60  MBL_MW_ACC_MMA8452Q_CUTOFF_FREQ_LOW = 3
62 
161 
162 #ifdef __cplusplus
163 }
164 #endif
METAWEAR_API MblMwDataSignal * mbl_mw_acc_mma8452q_get_acceleration_data_signal(const MblMwMetaWearBoard *board)
Retrieves the data signal representing acceleration data for the MMA8452Q accelerometer This signal i...
METAWEAR_API void mbl_mw_acc_mma8452q_write_acceleration_config(const MblMwMetaWearBoard *board)
Writes the acceleration settings to the sensor Applies the ODR and RANGE values set in set_range() an...
METAWEAR_API void mbl_mw_acc_mma8452q_set_high_pass_cutoff(MblMwMetaWearBoard *board, float frequency)
Sets the cutoff frequency for the high-pass filter The high-pass filter cutoff frequency can be set b...
METAWEAR_API void mbl_mw_acc_mma8452q_stop(const MblMwMetaWearBoard *board)
Switches the accelerometer to standby mode.
METAWEAR_API void mbl_mw_acc_mma8452q_set_orientation_delay(MblMwMetaWearBoard *board, uint16_t delay)
Set the orientation calculation mode.
METAWEAR_API MblMwDataSignal * mbl_mw_acc_mma8452q_get_high_freq_acceleration_data_signal(const MblMwMetaWearBoard *board)
METAWEAR_API void mbl_mw_acc_mma8452q_set_range(MblMwMetaWearBoard *board, MblMwAccMma8452qRange range)
Sets the acceleration range The range is in units of Gs.
METAWEAR_API void mbl_mw_acc_mma8452q_disable_orientation_detection(const MblMwMetaWearBoard *board)
Disables orientation detection The board will stop gathering orientation data from the accelerometer.
METAWEAR_API MblMwDataSignal * mbl_mw_acc_mma8452q_get_orientation_detection_data_signal(const MblMwMetaWearBoard *board)
Retrieves the data signal representing data from the orientation detection algorithm This signal is s...
METAWEAR_API MblMwDataSignal * mbl_mw_acc_mma8452q_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 ...
METAWEAR_API void mbl_mw_acc_mma8452q_enable_orientation_detection(const MblMwMetaWearBoard *board)
Enables orientation detection The board will start gathering orientation data from the accelerometer.
MblMwAccMma8452qOdr
Available output data rates on the MMA8452Q accelerometer.
Definition: accelerometer_mma8452q.h:42
MblMwAccMma8452qCutoffFreq
Available cutoff frequencies for the MMA8452Q high pass filter.
Definition: accelerometer_mma8452q.h:56
METAWEAR_API void mbl_mw_acc_mma8452q_set_odr(MblMwMetaWearBoard *board, MblMwAccMma8452qOdr odr)
Sets the output data rate The ODR sets the output data frequency in Hz.
MblMwAccMma8452qRange
Available g-ranges on the MMA8452Q accelerometer.
Definition: accelerometer_mma8452q.h:33
@ MBL_MW_ACC_MMA8452Q_RANGE_4G
+/- 4g
Definition: accelerometer_mma8452q.h:35
@ MBL_MW_ACC_MMA8452Q_RANGE_8G
+/- 8g
Definition: accelerometer_mma8452q.h:36
@ MBL_MW_ACC_MMA8452Q_RANGE_2G
+/- 2g
Definition: accelerometer_mma8452q.h:34
METAWEAR_API void mbl_mw_acc_mma8452q_enable_acceleration_sampling(const MblMwMetaWearBoard *board)
Enables acceleration sampling The board will start gathering data from the accelerometer.
METAWEAR_API void mbl_mw_acc_mma8452q_start(const MblMwMetaWearBoard *board)
Switches the accelerometer to active mode.
const uint8_t MBL_MW_MODULE_ACC_TYPE_MMA8452Q
Constant identifying the MMA8452Q accelerometer type.
Definition: accelerometer_mma8452q.h:15
METAWEAR_API void mbl_mw_acc_mma8452q_disable_acceleration_sampling(const MblMwMetaWearBoard *board)
Disables acceleration sampling The board will stop gathering data from the accelerometer.
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
struct MblMwMetaWearBoard MblMwMetaWearBoard
Software representation of a physical MetaWear board.
Definition: metawearboard_fwd.h:17