Atmel Software Framework

bma250.h File Reference

Bosch BMA250 3-axis accelerometer driver.

This file contains functions for initializing and reading data from a Bosch BMA250 3-axis accelerometer.

Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.

#include <asf.h>

Macros

#define BMA250_DATA_RESOLUTION   (10) /* signed axis data size (bits) */
 
#define BMA250_SPI_MODE   (3)
 
#define BMA250_TEMP_OFFSET   (24) /* temperature center (Celsius) */
 
#define BMA250_TWI_ADDR   (0x18)
 
#define BMA250_ID_VAL   (0x03)
 BMA250 Register Bit Definitions. More...
 
#define BMA250_FLAT_INT   (1 << 7) /* flat interrupt status */
 
#define BMA250_ORIENT_INT   (1 << 6) /* orientation interrupt status */
 
#define BMA250_S_TAP_INT   (1 << 5) /* single tap interrupt status */
 
#define BMA250_D_TAP_INT   (1 << 4) /* double tap interrupt status */
 
#define BMA250_SLOPE_INT   (1 << 2) /* slope interrupt status */
 
#define BMA250_HIGH_INT   (1 << 1) /* high-g interrupt status */
 
#define BMA250_LOW_INT   (1 << 0) /* low-g interrupt status */
 
#define BMA250_DATA_INT   (1 << 7) /* new data interrupt status */
 
#define BMA250_TAP_SIGN_POS   (1 << 7) /* tap interrupt sign (0=negative) */
 
#define BMA250_TAP_FIRST_Z   (1 << 6) /* z-axis triggered tap interrupt */
 
#define BMA250_TAP_FIRST_Y   (1 << 5) /* y-axis triggered tap interrupt */
 
#define BMA250_TAP_FIRST_X   (1 << 4) /* x-axis triggered tap interrupt */
 
#define BMA250_SLOPE_SIGN_POS   (1 << 3) /* slope interrupt sign (0=negative) */
 
#define BMA250_SLOPE_FIRST_Z   (1 << 2) /* z-axis triggered slope interrupt */
 
#define BMA250_SLOPE_FIRST_Y   (1 << 1) /* y-axis triggered slope interrupt */
 
#define BMA250_SLOPE_FIRST_X   (1 << 0) /* x-axis triggered slope interrupt */
 
#define BMA250_FLAT   (1 << 7) /* flat condition is fulfilled */
 
#define BMA250_Z_DOWN   (1 << 6) /* z-axis orientation (0=upward) */
 
#define BMA250_XY_PORTRAIT_UP   (0 << 4) /* x-y plane portrait upright */
 
#define BMA250_XY_PORTRAIT_DOWN   (1 << 4) /* x-y plane portrait upside-down */
 
#define BMA250_XY_LANDSCAPE_L   (2 << 4) /* x-y plane landscape left */
 
#define BMA250_XY_LANDSCAPE_R   (3 << 4) /* x-y plane landscape right */
 
#define BMA250_HIGH_SIGN_NEG
 
#define BMA250_HIGH_FIRST_Z   (1 << 2) /* z-axis triggered high-g interrupt */
 
#define BMA250_HIGH_FIRST_Y   (1 << 1) /* y-axis triggered high-g interrupt */
 
#define BMA250_HIGH_FIRST_X   (1 << 0) /* x-axis triggered high-g interrupt */
 
#define BMA250_RANGE_2G   (0x03) /* +/- 2g range (default) */
 
#define BMA250_RANGE_4G   (0x05) /* +/- 4g range */
 
#define BMA250_RANGE_8G   (0x08) /* +/- 8g range */
 
#define BMA250_RANGE_16G   (0x0c) /* +/- 16g range */
 
#define BMA250_BANDWIDTH_8Hz   (0x08) /* 7.81 Hz filtered data bandwidth */
 
#define BMA250_BANDWIDTH_16Hz   (0x09) /* 15.63 Hz filtered data bandwidth */
 
#define BMA250_BANDWIDTH_31Hz   (0x0a) /* 31.25 Hz filtered data bandwidth */
 
#define BMA250_BANDWIDTH_63Hz   (0x0b) /* 62.5 Hz filtered data bandwidth */
 
#define BMA250_BANDWIDTH_125Hz   (0x0c) /* 125 Hz filtered data bandwidth */
 
#define BMA250_BANDWIDTH_250Hz   (0x0d) /* 250 Hz filtered data bandwidth */
 
#define BMA250_BANDWIDTH_500Hz   (0x0e) /* 500 Hz filtered data bandwidth */
 
#define BMA250_BANDWIDTH_1000Hz   (0x0f) /* 1000 Hz filtered data bandwidth */
 
#define BMA250_SUSPEND   (1 << 7) /* set suspend mode (0=reset mode) */
 
#define BMA250_LOWPOWER_EN   (1 << 6) /* set low-power mode (0=reset mode) */
 
#define BMA250_SLEEP_DUR_0_5ms   (5 << 1) /* 0.5 ms sleep phase duration */
 
#define BMA250_SLEEP_DUR_1ms   (6 << 1) /* 1 ms sleep phase duration */
 
#define BMA250_SLEEP_DUR_2ms   (7 << 1) /* 2 ms sleep phase duration */
 
#define BMA250_SLEEP_DUR_4ms   (8 << 1) /* 4 ms sleep phase duration */
 
#define BMA250_SLEEP_DUR_6ms   (9 << 1) /* 6 ms sleep phase duration */
 
#define BMA250_SLEEP_DUR_10ms   (10 << 1) /* 6 ms sleep phase duration */
 
#define BMA250_SLEEP_DUR_25ms   (11 << 1) /* 25 ms sleep phase duration */
 
#define BMA250_SLEEP_DUR_50ms   (12 << 1) /* 50 ms sleep phase duration */
 
#define BMA250_SLEEP_DUR_100ms   (13 << 1) /* 100 ms sleep phase duration */
 
#define BMA250_SLEEP_DUR_500ms   (14 << 1) /* 500 ms sleep phase duration */
 
#define BMA250_SLEEP_DUR_1000ms   (15 << 1) /* 1 s sleep phase duration */
 
#define BMA250_DATA_UNFILTERED   (1 << 7) /* unfiltered accel data (0=filtered) */
 
#define BMA250_RESET   (0xb6) /* user-triggered reset write value */
 
#define BMA250_FLAT_EN   (1 << 7) /* flat interrupt enable */
 
#define BMA250_ORIENT_EN   (1 << 6) /* orientation interrupt enable */
 
#define BMA250_S_TAP_EN   (1 << 5) /* single tap interrupt enable */
 
#define BMA250_D_TAP_EN   (1 << 4) /* double tap interrupt enable */
 
#define BMA250_SLOPE_EN_Z   (1 << 2) /* z-axis slope interrupt enable */
 
#define BMA250_SLOPE_EN_Y   (1 << 1) /* y-axis slope interrupt enable */
 
#define BMA250_SLOPE_EN_X   (1 << 0) /* x-axis slope interrupt enable */
 
#define BMA250_DATA_EN   (1 << 4) /* new data interrupt enable */
 
#define BMA250_LOW_EN   (1 << 3) /* low-g interrupt enable */
 
#define BMA250_HIGH_EN_Z   (1 << 2) /* z-axis high-g interrupt enable */
 
#define BMA250_HIGH_EN_Y   (1 << 1) /* y-axis high-g interrupt enable */
 
#define BMA250_HIGH_EN_X   (1 << 0) /* x-axis high-g interrupt enable */
 
#define BMA250_INT1_FLAT   (1 << 7) /* map flat interrupt to INT1 */
 
#define BMA250_INT1_ORIENT   (1 << 6) /* map orientation interrupt to INT1 */
 
#define BMA250_INT1_S_TAP   (1 << 5) /* map single tap interrupt to INT1 */
 
#define BMA250_INT1_D_TAP   (1 << 4) /* map double tap interrupt to INT1 */
 
#define BMA250_INT1_SLOPE   (1 << 2) /* map slope interrupt to INT1 */
 
#define BMA250_INT1_HIGH   (1 << 1) /* map high-g interrupt to INT1 */
 
#define BMA250_INT1_LOW   (1 << 0) /* map low-g interrupt to INT1 */
 
#define BMA250_INT2_DATA   (1 << 7) /* map new data interrupt to INT2 */
 
#define BMA250_INT1_DATA   (1 << 0) /* map new data interrupt to INT1 */
 
#define BMA250_INT2_FLAT   (1 << 7) /* map flat interrupt to INT2 */
 
#define BMA250_INT2_ORIENT   (1 << 6) /* map orientation interrupt to INT2 */
 
#define BMA250_INT2_S_TAP   (1 << 5) /* map single tap interrupt to INT2 */
 
#define BMA250_INT2_D_TAP   (1 << 4) /* map double tap interrupt to INT2 */
 
#define BMA250_INT2_SLOPE   (1 << 2) /* map slope interrupt to INT2 */
 
#define BMA250_INT2_HIGH   (1 << 1) /* map high-g interrupt to INT2 */
 
#define BMA250_INT2_LOW   (1 << 0) /* map low-g interrupt to INT2 */
 
#define BMA250_INT_SRC_DATA
 
#define BMA250_INT_SRC_TAP   (1 << 4) /* unfiltered s/d tap interrupt data */
 
#define BMA250_INT_SRC_SLOPE   (1 << 2) /* unfiltered slope interrupt data */
 
#define BMA250_INT_SRC_HIGH   (1 << 1) /* unfiltered high-g interrupt data */
 
#define BMA250_INT_SRC_LOW   (1 << 0) /* unfiltered low-g interrupt data */
 
#define BMA250_INT2_OD   (1 << 3) /* open drive for INT2 pin */
 
#define BMA250_INT2_LVL_1   (1 << 2) /* active level 1 for INT2 (default) */
 
#define BMA250_INT1_OD   (1 << 1) /* open drive for INT1 pin */
 
#define BMA250_INT1_LVL_1   (1 << 0) /* active level 1 for INT1 (default) */
 
#define BMA250_RESET_INT   (0x80) /* reset any latched interrupt */
 
#define BMA250_INT_NON_LATCHED   (0x00) /* non-latched interrupt (default) */
 
#define BMA250_INT_TMP_250ms   (0x01) /* 250ms temporary latched interrupt */
 
#define BMA250_INT_TMP_500ms   (0x02) /* 500ms temporary latched interrupt */
 
#define BMA250_INT_TMP_1sec
 
#define BMA250_INT_TMP_2sec
 
#define BMA250_INT_TMP_4sec
 
#define BMA250_INT_TMP_8sec
 
#define BMA250_INT_TMP_500us   (0x0a) /* 500us temporary latched interrupt */
 
#define BMA250_INT_TMP_1ms   (0x0b) /* 1ms temporary latched interrupt */
 
#define BMA250_INT_TMP_12_5ms
 
#define BMA250_INT_TMP_25ms   (0x0d) /* 25ms temporary latched interrupt */
 
#define BMA250_INT_TMP_50ms   (0x0e) /* 50ms temporary latched interrupt */
 
#define BMA250_INT_LATCHED   (0x0f) /* latched interrupt mode */
 
#define BMA250_TAP_TH_FIELD   (0x1f) /* tap interrupt threshold field */
 BMA250_LOW_G_DURATION (0x22) More...
 
#define BMA250_TAP_SAMP_FIELD   (0xc0) /* tap wake-up samples count field */
 
#define BMA250_SELF_TEST_NONE   (0x00) /* no self-test (default) */
 
#define BMA250_SELF_TEST_AXIS_X   (0x01) /* self-test positive x-axis */
 
#define BMA250_SELF_TEST_AXIS_Y   (0x02) /* self-test positive y-axis */
 
#define BMA250_SELF_TEST_AXIS_Z   (0x03) /* self-test positive z-axis */
 

Enumerations

enum  bma250_register_t {
  BMA250_CHIP_ID = 0,
  BMA250_01_RSVD,
  BMA250_NEW_DATA_X,
  BMA250_ACC_X,
  BMA250_NEW_DATA_Y,
  BMA250_ACC_Y,
  BMA250_NEW_DATA_Z,
  BMA250_ACC_Z,
  BMA250_TEMP,
  BMA250_INTR_STATUS,
  BMA250_NEW_DATA_STATUS,
  BMA250_TAP_SLOPE_STATUS,
  BMA250_ORIENTATION_STATUS,
  BMA250_0D_RSVD,
  BMA250_0E_RSVD,
  BMA250_G_RANGE,
  BMA250_BANDWIDTH,
  BMA250_POWER_MODES,
  BMA250_12_RSVD,
  BMA250_DATA_HIGH_BW,
  BMA250_SOFTRESET,
  BMA250_15_RSVD,
  BMA250_16_INTR_EN,
  BMA250_17_INTR_EN,
  BMA250_18_RSVD,
  BMA250_19_INTR_MAP,
  BMA250_1A_INTR_MAP,
  BMA250_1B_INTR_MAP,
  BMA250_1C_RSVD,
  BMA250_1D_RSVD,
  BMA250_INTR_DATA_SRC,
  BMA250_1F_RSVD,
  BMA250_INTR_PIN_CONFIG,
  BMA250_INTR_PIN_MODE,
  BMA250_LOW_G_DURATION,
  BMA250_LOW_G_THRESHOLD,
  BMA250_EVENT_HYSTERESIS,
  BMA250_HIGH_G_DURATION,
  BMA250_HIGH_G_THRESHOLD,
  BMA250_SLOPE_DURATION,
  BMA250_SLOPE_THRESHOLD,
  BMA250_29_RSVD,
  BMA250_TAP_TIMING,
  BMA250_TAP_CONFIG,
  BMA250_ORIENTATION_CONFIG,
  BMA250_ORIENTATION_THETA,
  BMA250_FLAT_THETA,
  BMA250_FLAT_HOLD_TIME,
  BMA250_30_RSVD,
  BMA250_31_RSVD,
  BMA250_SENSOR_SELF_TEST,
  BMA250_EEPROM_CONTROL,
  BMA250_DIGITAL_IO_CONTROL,
  BMA250_35_RSVD,
  BMA250_FAST_OFFSET_COMP,
  BMA250_SLOW_OFFSET_COMP,
  BMA250_OFFSET_FILT_X,
  BMA250_OFFSET_FILT_Y,
  BMA250_OFFSET_FILT_Z,
  BMA250_OFFSET_UNFILT_X,
  BMA250_OFFSET_UNFILT_Y,
  BMA250_OFFSET_UNFILT_Z
}
 Standard Register Addresses (TWI & SPI) More...
 

Functions

bool bma250_init (sensor_t *, int)
 Bosch BMA250 accelerometer driver initialization. More...
 

#define BMA250_BANDWIDTH_1000Hz   (0x0f) /* 1000 Hz filtered data bandwidth */
#define BMA250_BANDWIDTH_125Hz   (0x0c) /* 125 Hz filtered data bandwidth */
#define BMA250_BANDWIDTH_16Hz   (0x09) /* 15.63 Hz filtered data bandwidth */
#define BMA250_BANDWIDTH_250Hz   (0x0d) /* 250 Hz filtered data bandwidth */
#define BMA250_BANDWIDTH_31Hz   (0x0a) /* 31.25 Hz filtered data bandwidth */
#define BMA250_BANDWIDTH_500Hz   (0x0e) /* 500 Hz filtered data bandwidth */
#define BMA250_BANDWIDTH_63Hz   (0x0b) /* 62.5 Hz filtered data bandwidth */
#define BMA250_BANDWIDTH_8Hz   (0x08) /* 7.81 Hz filtered data bandwidth */
#define BMA250_D_TAP_EN   (1 << 4) /* double tap interrupt enable */

Referenced by bma250_event().

#define BMA250_D_TAP_INT   (1 << 4) /* double tap interrupt status */
#define BMA250_DATA_EN   (1 << 4) /* new data interrupt enable */

Referenced by bma250_event().

#define BMA250_DATA_INT   (1 << 7) /* new data interrupt status */
#define BMA250_DATA_RESOLUTION   (10) /* signed axis data size (bits) */

Referenced by bma250_init().

#define BMA250_DATA_UNFILTERED   (1 << 7) /* unfiltered accel data (0=filtered) */
#define BMA250_FLAT   (1 << 7) /* flat condition is fulfilled */
#define BMA250_FLAT_EN   (1 << 7) /* flat interrupt enable */
#define BMA250_FLAT_INT   (1 << 7) /* flat interrupt status */
#define BMA250_HIGH_EN_X   (1 << 0) /* x-axis high-g interrupt enable */

Referenced by bma250_event().

#define BMA250_HIGH_EN_Y   (1 << 1) /* y-axis high-g interrupt enable */

Referenced by bma250_event().

#define BMA250_HIGH_EN_Z   (1 << 2) /* z-axis high-g interrupt enable */

Referenced by bma250_event().

#define BMA250_HIGH_FIRST_X   (1 << 0) /* x-axis triggered high-g interrupt */
#define BMA250_HIGH_FIRST_Y   (1 << 1) /* y-axis triggered high-g interrupt */
#define BMA250_HIGH_FIRST_Z   (1 << 2) /* z-axis triggered high-g interrupt */
#define BMA250_HIGH_INT   (1 << 1) /* high-g interrupt status */
#define BMA250_HIGH_SIGN_NEG
Value:
(1 << 3) /* high-g interrupt sign
* (0=positive) */
#define BMA250_ID_VAL   (0x03)

BMA250 Register Bit Definitions.

Referenced by bma250_init().

#define BMA250_INT1_D_TAP   (1 << 4) /* map double tap interrupt to INT1 */
#define BMA250_INT1_DATA   (1 << 0) /* map new data interrupt to INT1 */
#define BMA250_INT1_FLAT   (1 << 7) /* map flat interrupt to INT1 */
#define BMA250_INT1_HIGH   (1 << 1) /* map high-g interrupt to INT1 */
#define BMA250_INT1_LOW   (1 << 0) /* map low-g interrupt to INT1 */
#define BMA250_INT1_LVL_1   (1 << 0) /* active level 1 for INT1 (default) */
#define BMA250_INT1_OD   (1 << 1) /* open drive for INT1 pin */
#define BMA250_INT1_ORIENT   (1 << 6) /* map orientation interrupt to INT1 */
#define BMA250_INT1_S_TAP   (1 << 5) /* map single tap interrupt to INT1 */
#define BMA250_INT1_SLOPE   (1 << 2) /* map slope interrupt to INT1 */
#define BMA250_INT2_D_TAP   (1 << 4) /* map double tap interrupt to INT2 */
#define BMA250_INT2_DATA   (1 << 7) /* map new data interrupt to INT2 */
#define BMA250_INT2_FLAT   (1 << 7) /* map flat interrupt to INT2 */
#define BMA250_INT2_HIGH   (1 << 1) /* map high-g interrupt to INT2 */
#define BMA250_INT2_LOW   (1 << 0) /* map low-g interrupt to INT2 */
#define BMA250_INT2_LVL_1   (1 << 2) /* active level 1 for INT2 (default) */
#define BMA250_INT2_OD   (1 << 3) /* open drive for INT2 pin */
#define BMA250_INT2_ORIENT   (1 << 6) /* map orientation interrupt to INT2 */
#define BMA250_INT2_S_TAP   (1 << 5) /* map single tap interrupt to INT2 */
#define BMA250_INT2_SLOPE   (1 << 2) /* map slope interrupt to INT2 */
#define BMA250_INT_LATCHED   (0x0f) /* latched interrupt mode */
#define BMA250_INT_NON_LATCHED   (0x00) /* non-latched interrupt (default) */
#define BMA250_INT_SRC_DATA
Value:
(1 << 5) /* unfiltered new data interrupt
* data */
#define BMA250_INT_SRC_HIGH   (1 << 1) /* unfiltered high-g interrupt data */
#define BMA250_INT_SRC_LOW   (1 << 0) /* unfiltered low-g interrupt data */
#define BMA250_INT_SRC_SLOPE   (1 << 2) /* unfiltered slope interrupt data */
#define BMA250_INT_SRC_TAP   (1 << 4) /* unfiltered s/d tap interrupt data */
#define BMA250_INT_TMP_12_5ms
Value:
(0x0c) /* 12.5ms temporary latched
* interrupt */
#define BMA250_INT_TMP_1ms   (0x0b) /* 1ms temporary latched interrupt */
#define BMA250_INT_TMP_1sec
Value:
(0x03) /* 1000ms temporary latched
* interrupt */
#define BMA250_INT_TMP_250ms   (0x01) /* 250ms temporary latched interrupt */
#define BMA250_INT_TMP_25ms   (0x0d) /* 25ms temporary latched interrupt */
#define BMA250_INT_TMP_2sec
Value:
(0x04) /* 2000ms temporary latched
* interrupt */
#define BMA250_INT_TMP_4sec
Value:
(0x05) /* 4000ms temporary latched
* interrupt */
#define BMA250_INT_TMP_500ms   (0x02) /* 500ms temporary latched interrupt */
#define BMA250_INT_TMP_500us   (0x0a) /* 500us temporary latched interrupt */
#define BMA250_INT_TMP_50ms   (0x0e) /* 50ms temporary latched interrupt */
#define BMA250_INT_TMP_8sec
Value:
(0x06) /* 8000ms temporary latched
* interrupt */
#define BMA250_LOW_EN   (1 << 3) /* low-g interrupt enable */

Referenced by bma250_event().

#define BMA250_LOW_INT   (1 << 0) /* low-g interrupt status */
#define BMA250_LOWPOWER_EN   (1 << 6) /* set low-power mode (0=reset mode) */

Referenced by bma250_sleep_en().

#define BMA250_ORIENT_EN   (1 << 6) /* orientation interrupt enable */
#define BMA250_ORIENT_INT   (1 << 6) /* orientation interrupt status */
#define BMA250_RANGE_16G   (0x0c) /* +/- 16g range */
#define BMA250_RANGE_2G   (0x03) /* +/- 2g range (default) */
#define BMA250_RANGE_4G   (0x05) /* +/- 4g range */
#define BMA250_RANGE_8G   (0x08) /* +/- 8g range */
#define BMA250_RESET   (0xb6) /* user-triggered reset write value */

Referenced by bma250_set_state().

#define BMA250_RESET_INT   (0x80) /* reset any latched interrupt */
#define BMA250_S_TAP_EN   (1 << 5) /* single tap interrupt enable */

Referenced by bma250_event().

#define BMA250_S_TAP_INT   (1 << 5) /* single tap interrupt status */
#define BMA250_SELF_TEST_AXIS_X   (0x01) /* self-test positive x-axis */
#define BMA250_SELF_TEST_AXIS_Y   (0x02) /* self-test positive y-axis */
#define BMA250_SELF_TEST_AXIS_Z   (0x03) /* self-test positive z-axis */
#define BMA250_SELF_TEST_NONE   (0x00) /* no self-test (default) */
#define BMA250_SLEEP_DUR_0_5ms   (5 << 1) /* 0.5 ms sleep phase duration */
#define BMA250_SLEEP_DUR_1000ms   (15 << 1) /* 1 s sleep phase duration */
#define BMA250_SLEEP_DUR_100ms   (13 << 1) /* 100 ms sleep phase duration */
#define BMA250_SLEEP_DUR_10ms   (10 << 1) /* 6 ms sleep phase duration */
#define BMA250_SLEEP_DUR_1ms   (6 << 1) /* 1 ms sleep phase duration */

Referenced by bma250_sleep_en().

#define BMA250_SLEEP_DUR_25ms   (11 << 1) /* 25 ms sleep phase duration */
#define BMA250_SLEEP_DUR_2ms   (7 << 1) /* 2 ms sleep phase duration */
#define BMA250_SLEEP_DUR_4ms   (8 << 1) /* 4 ms sleep phase duration */
#define BMA250_SLEEP_DUR_500ms   (14 << 1) /* 500 ms sleep phase duration */
#define BMA250_SLEEP_DUR_50ms   (12 << 1) /* 50 ms sleep phase duration */
#define BMA250_SLEEP_DUR_6ms   (9 << 1) /* 6 ms sleep phase duration */
#define BMA250_SLOPE_EN_X   (1 << 0) /* x-axis slope interrupt enable */

Referenced by bma250_event().

#define BMA250_SLOPE_EN_Y   (1 << 1) /* y-axis slope interrupt enable */

Referenced by bma250_event().

#define BMA250_SLOPE_EN_Z   (1 << 2) /* z-axis slope interrupt enable */

Referenced by bma250_event().

#define BMA250_SLOPE_FIRST_X   (1 << 0) /* x-axis triggered slope interrupt */
#define BMA250_SLOPE_FIRST_Y   (1 << 1) /* y-axis triggered slope interrupt */
#define BMA250_SLOPE_FIRST_Z   (1 << 2) /* z-axis triggered slope interrupt */
#define BMA250_SLOPE_INT   (1 << 2) /* slope interrupt status */
#define BMA250_SLOPE_SIGN_POS   (1 << 3) /* slope interrupt sign (0=negative) */
#define BMA250_SPI_MODE   (3)
#define BMA250_SUSPEND   (1 << 7) /* set suspend mode (0=reset mode) */

Referenced by bma250_set_state().

#define BMA250_TAP_FIRST_X   (1 << 4) /* x-axis triggered tap interrupt */
#define BMA250_TAP_FIRST_Y   (1 << 5) /* y-axis triggered tap interrupt */
#define BMA250_TAP_FIRST_Z   (1 << 6) /* z-axis triggered tap interrupt */
#define BMA250_TAP_SAMP_FIELD   (0xc0) /* tap wake-up samples count field */
#define BMA250_TAP_SIGN_POS   (1 << 7) /* tap interrupt sign (0=negative) */
#define BMA250_TAP_TH_FIELD   (0x1f) /* tap interrupt threshold field */

BMA250_LOW_G_DURATION (0x22)

Low-G interrupt delay time constants where the physical delay time is computed as: delay[ms] = [low_dur + 1] * 2ms. The default value is 0x09 corresponding to a delay of 20ms. BMA250_LOW_G_THRESHOLD (0x23)

The log-g interrupt threshold value LSB corresponds to an acceleration of 7.81mg with range 0 to 1.992g. The default value is 0x30 corresponding to 375mg.

Referenced by bma250_get_threshold(), and bma250_set_threshold().

#define BMA250_TEMP_OFFSET   (24) /* temperature center (Celsius) */

Referenced by bma250_get_temperature().

#define BMA250_TWI_ADDR   (0x18)
#define BMA250_XY_LANDSCAPE_L   (2 << 4) /* x-y plane landscape left */
#define BMA250_XY_LANDSCAPE_R   (3 << 4) /* x-y plane landscape right */
#define BMA250_XY_PORTRAIT_DOWN   (1 << 4) /* x-y plane portrait upside-down */
#define BMA250_XY_PORTRAIT_UP   (0 << 4) /* x-y plane portrait upright */
#define BMA250_Z_DOWN   (1 << 6) /* z-axis orientation (0=upward) */

Standard Register Addresses (TWI & SPI)

w/r=write/read, wo=write only, ro=read only

Enumerator
BMA250_CHIP_ID 
BMA250_01_RSVD 
BMA250_NEW_DATA_X 
BMA250_ACC_X 
BMA250_NEW_DATA_Y 
BMA250_ACC_Y 
BMA250_NEW_DATA_Z 
BMA250_ACC_Z 
BMA250_TEMP 
BMA250_INTR_STATUS 
BMA250_NEW_DATA_STATUS 
BMA250_TAP_SLOPE_STATUS 
BMA250_ORIENTATION_STATUS 
BMA250_0D_RSVD 
BMA250_0E_RSVD 
BMA250_G_RANGE 
BMA250_BANDWIDTH 
BMA250_POWER_MODES 
BMA250_12_RSVD 
BMA250_DATA_HIGH_BW 
BMA250_SOFTRESET 
BMA250_15_RSVD 
BMA250_16_INTR_EN 
BMA250_17_INTR_EN 
BMA250_18_RSVD 
BMA250_19_INTR_MAP 
BMA250_1A_INTR_MAP 
BMA250_1B_INTR_MAP 
BMA250_1C_RSVD 
BMA250_1D_RSVD 
BMA250_INTR_DATA_SRC 
BMA250_1F_RSVD 
BMA250_INTR_PIN_CONFIG 
BMA250_INTR_PIN_MODE 
BMA250_LOW_G_DURATION 
BMA250_LOW_G_THRESHOLD 
BMA250_EVENT_HYSTERESIS 
BMA250_HIGH_G_DURATION 
BMA250_HIGH_G_THRESHOLD 
BMA250_SLOPE_DURATION 
BMA250_SLOPE_THRESHOLD 
BMA250_29_RSVD 
BMA250_TAP_TIMING 
BMA250_TAP_CONFIG 
BMA250_ORIENTATION_CONFIG 
BMA250_ORIENTATION_THETA 
BMA250_FLAT_THETA 
BMA250_FLAT_HOLD_TIME 
BMA250_30_RSVD 
BMA250_31_RSVD 
BMA250_SENSOR_SELF_TEST 
BMA250_EEPROM_CONTROL 
BMA250_DIGITAL_IO_CONTROL 
BMA250_35_RSVD 
BMA250_FAST_OFFSET_COMP 
BMA250_SLOW_OFFSET_COMP 
BMA250_OFFSET_FILT_X 
BMA250_OFFSET_FILT_Y 
BMA250_OFFSET_FILT_Z 
BMA250_OFFSET_UNFILT_X 
BMA250_OFFSET_UNFILT_Y 
BMA250_OFFSET_UNFILT_Z