SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
SensorBMA4XX.hpp File Reference

@license MIT License More...

Include dependency graph for sensor/accelerometer/bma/SensorBMA4XX.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  SensorBMA4XX
 
struct  SensorBMA4XX::MotionAxesConfig
 Motion axes configuration. More...
 

Namespaces

namespace  BMA4XXCapability
 BMA4XX Capability Flags.
 

Enumerations

enum class  AccelBandwidth : uint8_t {
  OSR4_AVG1 = 0 , OSR2_AVG2 = 1 , NORMAL_AVG4 = 2 , CIC_AVG8 = 3 ,
  RES_AVG16 = 4 , RES_AVG32 = 5 , RES_AVG64 = 6 , RES_AVG128 = 7
}
 BMA4 Accelerometer averaging filter configuration These values configure the internal averaging filter to reduce noise. More...
 
enum class  AccelPerfMode : uint8_t { CIC_AVG_MODE = 0 , CONTINUOUS_MODE = 1 }
 BMA4 Accelerometer performance mode configuration Configures the internal filter behavior for sample averaging. More...
 
enum class  TapType { NO_TAP = 0 , SINGLE_TAP = 1 , DOUBLE_TAP = 2 , TRIPLE_TAP = 3 }
 Tap detection type. More...
 
enum class  ActivityType { STATIONARY = 0 , WALKING = 1 , RUNNING = 2 , UNKNOWN = 3 }
 Activity detection type. More...
 
enum class  BMA4XXCapability::Capability : uint32_t {
  BMA4XXCapability::None = 0 , BMA4XXCapability::SupportDataReady = (1 << 0) , BMA4XXCapability::SupportAnyMotion = (1 << 1) , BMA4XXCapability::SupportNoMotion = (1 << 2) ,
  BMA4XXCapability::SupportTap = (1 << 3) , BMA4XXCapability::SupportStepDetector = (1 << 4) , BMA4XXCapability::SupportStepCounter = (1 << 5) , BMA4XXCapability::SupportActivity = (1 << 6) ,
  BMA4XXCapability::SupportTilt = (1 << 7) , BMA4XXCapability::SupportAxisRemap = (1 << 8)
}
 

Functions

constexpr Capability BMA4XXCapability::operator| (Capability a, Capability b)
 
constexpr bool BMA4XXCapability::operator& (Capability a, Capability b)
 

Detailed Description

@license MIT License

Copyright (c) 2026 lewis he

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Author
Lewis He (lewis.nosp@m.he@o.nosp@m.utloo.nosp@m.k.co.nosp@m.m)
Date
2026-01-28
Note
BMA4XX class based on BMA456 Sensor API Simplification for Arduino

Definition in file sensor/accelerometer/bma/SensorBMA4XX.hpp.

Enumeration Type Documentation

◆ AccelBandwidth

enum class AccelBandwidth : uint8_t
strong

BMA4 Accelerometer averaging filter configuration These values configure the internal averaging filter to reduce noise.

Higher averaging provides better noise reduction but increases power consumption.

Enumerator
OSR4_AVG1 

OSR4 mode with 1 sample averaging (lowest power, highest noise)

OSR2_AVG2 

OSR2 mode with 2 samples averaged.

NORMAL_AVG4 

Normal mode with 4 samples averaged.

CIC_AVG8 

CIC filter with 8 samples averaged.

RES_AVG16 

Resolution mode with 16 samples averaged.

RES_AVG32 

Resolution mode with 32 samples averaged.

RES_AVG64 

Resolution mode with 64 samples averaged.

RES_AVG128 

Resolution mode with 128 samples averaged (best noise reduction, highest power)

Examples
/home/runner/work/SensorLib/SensorLib/src/sensor/accelerometer/bma/SensorBMA4XX.hpp.

Definition at line 55 of file sensor/accelerometer/bma/SensorBMA4XX.hpp.

◆ AccelPerfMode

enum class AccelPerfMode : uint8_t
strong

BMA4 Accelerometer performance mode configuration Configures the internal filter behavior for sample averaging.

Enumerator
CIC_AVG_MODE 

Averaging filter mode: samples are averaged based on configured bandwidth and ODR.

CONTINUOUS_MODE 

Continuous mode: no averaging, raw samples with lower latency.

Examples
/home/runner/work/SensorLib/SensorLib/src/sensor/accelerometer/bma/SensorBMA4XX.hpp.

Definition at line 70 of file sensor/accelerometer/bma/SensorBMA4XX.hpp.

◆ ActivityType

enum class ActivityType
strong

Activity detection type.

Note
This enum defines the different types of activity events that can be detected by the sensor.
Whether or not such attributes exist depends on the specific sensor or the different feature configurations.
Enumerator
STATIONARY 
WALKING 
RUNNING 
UNKNOWN 

Definition at line 92 of file sensor/accelerometer/bma/SensorBMA4XX.hpp.

◆ TapType

enum class TapType
strong

Tap detection type.

Note
This enum defines the different types of tap events that can be detected by the sensor.
Whether or not such attributes exist depends on the specific sensor or the different feature configurations.
Enumerator
NO_TAP 
SINGLE_TAP 
DOUBLE_TAP 
TRIPLE_TAP 

Definition at line 80 of file sensor/accelerometer/bma/SensorBMA4XX.hpp.