Low-level GPIO peripheral driver interface definitions.
uint_fast8_t i2c_t
Default i2c_t type definition.
void(* qma6100p_int_cb_t)(void *)
QMA6100P interrupt callback.
int qma6100p_set_data_ready_int(qma6100p_t *dev, qma6100p_int_pin_num_t line, qma6100p_int_cb_t cb, void *arg)
Configure data-ready interrupt.
int qma6100p_read_raw(const qma6100p_t *dev, qma6100p_raw_data_t *data)
Read raw accelerometer data (ADC counts)
int qma6100p_set_active_mode(qma6100p_t *dev)
Enter active mode.
int qma6100p_read(const qma6100p_t *dev, qma6100p_data_t *data)
Read accelerometer data converted to ug.
qma6100p_odr_t
Output data rate selection.
qma6100p_int_active_level_t
INT pin active level (INTPIN_CONF, 0x20)
qma6100p_range_t
Full-scale range selection for the QMA6100P accelerometer.
qma6100p_int_pin_mode_t
INT pin output mode (INTPIN_CONF, 0x20)
qma6100p_int_pin_num_t
Interrupt pin number selection (INT1_MAP1 0x1A / INT2_MAP1 0x1C)
int qma6100p_set_low_power(qma6100p_t *dev)
Enter Ultra-Low Power State (ULPS)
qma6100p_mclk_t
Master Clock selection.
qma6100p_int_shadow_t
Data shadowing mode (INT_CFG, 0x21)
int qma6100p_init(qma6100p_t *dev, const qma6100p_params_t *params)
Initialize the QMA6100P accelerometer driver.
@ QMA6100P_NO_NEW_DATA
no new data available (normal polling state)
@ QMA6100P_DATA_READY
new data ready to be read
@ QMA6100P_TIMEOUT
operation timed out
@ QMA6100P_GPIO_ERROR
GPIO error.
@ QMA6100P_NODEV
no QMA6100P device found on the bus
@ QMA6100P_NOI2C
I2C communication failed.
@ QMA6100P_INVALID_ARG
invalid argument
@ QMA6100P_OK
everything was fine
@ QMA6100P_ODR_12HZ5
12.5 Hz
@ QMA6100P_ODR_200HZ
200 Hz
@ QMA6100P_ODR_800HZ
800 Hz
@ QMA6100P_ODR_400HZ
400 Hz
@ QMA6100P_ODR_1600HZ
1600 Hz
@ QMA6100P_ODR_100HZ
100 Hz (default)
@ QMA6100P_INTPIN_ACTIVE_HIGH
INT pin active HIGH on interrupt.
@ QMA6100P_INTPIN_ACTIVE_LOW
INT pin active LOW on interrupt.
@ QMA6100P_RANGE_16G
±16g - sensitivity 512 LSB/g
@ QMA6100P_RANGE_2G
±2g - sensitivity 4096 LSB/g
@ QMA6100P_RANGE_8G
±8g - sensitivity 1024 LSB/g
@ QMA6100P_RANGE_32G
±32g - sensitivity 256 LSB/g
@ QMA6100P_RANGE_4G
±4g - sensitivity 2048 LSB/g
@ QMA6100P_INTPIN_OPEN_DRAIN
INT pin open-drain mode.
@ QMA6100P_INTPIN_PUSH_PULL
INT pin push-pull mode.
@ QMA6100P_INT1
Use INT1 pin for interrupt output.
@ QMA6100P_INT2
Use INT2 pin for interrupt output.
@ QMA6100P_PM_MCLK_12K8
12.8 kHz
@ QMA6100P_PM_MCLK_25K6
25.6 kHz
@ QMA6100P_PM_MCLK_51K2
51.2 kHz (default)
@ QMA6100P_PM_MCLK_6K4
6.4 kHz
Low-level I2C peripheral driver interface definition.
#define QMA6100P_INT_CFG_SHADOW_EN
shadowing enabled (default)
#define QMA6100P_INT_CFG_SHADOW_DIS
shadowing disabled
Converted acceleration data in µg.
int32_t z
acceleration in Z direction [µg]
int32_t x
acceleration in X direction [µg]
int32_t y
acceleration in Y direction [µg]
Configuration parameters.
uint8_t addr
I2C address (QMA6100P_I2C_ADDR_LOW or _HIGH)
gpio_t int2_pin
MCU GPIO connected to the QMA6100P INT2 pin (GPIO_UNDEF if unused)
qma6100p_int_shadow_t interrupt_shadow
acceleration data shadow mode
qma6100p_mclk_t mclk
master clock
i2c_t i2c
I2C bus the device is connected to.
gpio_t int1_pin
MCU GPIO connected to the QMA6100P INT1 pin (GPIO_UNDEF if unused)
qma6100p_range_t range
full-scale range
qma6100p_odr_t rate
output data rate
Raw 14-bit acceleration data (ADC counts)
int16_t x
raw ADC counts in X direction
int16_t y
raw ADC counts in Y direction
int16_t z
raw ADC counts in Z direction
Device descriptor for QMA6100P accelerometer.
qma6100p_params_t params
Device configuration parameters.