Loading...
Searching...
No Matches

Interface definition for the QMA6100P accelerometer driver. More...

Detailed Description

Interface definition for the QMA6100P accelerometer driver.

Author
Baptiste Le Duc bapti.nosp@m.ste..nosp@m.leduc.nosp@m.@eti.nosp@m.k.com
Léandre Le Duc leand.nosp@m.re.l.nosp@m.educ3.nosp@m.8@gm.nosp@m.ail.c.nosp@m.om

Definition in file qma6100p.h.

#include <stdbool.h>
#include <stdint.h>
#include "periph/gpio.h"
#include "periph/i2c.h"
+ Include dependency graph for qma6100p.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  qma6100p_params_t
 Configuration parameters. More...
 
struct  qma6100p_t
 Device descriptor for QMA6100P accelerometer. More...
 
struct  qma6100p_raw_data_t
 Raw 14-bit acceleration data (ADC counts) More...
 
struct  qma6100p_data_t
 Converted acceleration data in µg. More...
 

Typedefs

typedef void(* qma6100p_int_cb_t) (void *)
 QMA6100P interrupt callback.
 

Enumerations

enum  {
  QMA6100P_OK = 0 , QMA6100P_DATA_READY = 1 , QMA6100P_NO_NEW_DATA = 2 , QMA6100P_NOI2C = -1 ,
  QMA6100P_NODEV = -2 , QMA6100P_INVALID_ARG = -3 , QMA6100P_GPIO_ERROR = -4 , QMA6100P_TIMEOUT = -5
}
 Named return values. More...
 
enum  qma6100p_range_t {
  QMA6100P_RANGE_2G = 0x01 , QMA6100P_RANGE_4G = 0x02 , QMA6100P_RANGE_8G = 0x04 , QMA6100P_RANGE_16G = 0x08 ,
  QMA6100P_RANGE_32G = 0x0F
}
 Full-scale range selection for the QMA6100P accelerometer. More...
 
enum  qma6100p_odr_t {
  QMA6100P_ODR_100HZ = 0x00 , QMA6100P_ODR_200HZ = 0x01 , QMA6100P_ODR_400HZ = 0x02 , QMA6100P_ODR_800HZ = 0x03 ,
  QMA6100P_ODR_1600HZ = 0x04 , QMA6100P_ODR_50HZ = 0x05 , QMA6100P_ODR_25HZ = 0x06 , QMA6100P_ODR_12HZ5 = 0x07
}
 Output data rate selection. More...
 
enum  qma6100p_mclk_t { QMA6100P_PM_MCLK_51K2 = 4 , QMA6100P_PM_MCLK_25K6 = 5 , QMA6100P_PM_MCLK_12K8 = 6 , QMA6100P_PM_MCLK_6K4 = 7 }
 Master Clock selection. More...
 
enum  qma6100p_int_pin_mode_t { QMA6100P_INTPIN_PUSH_PULL = 0 , QMA6100P_INTPIN_OPEN_DRAIN = 1 }
 INT pin output mode (INTPIN_CONF, 0x20) More...
 
enum  qma6100p_int_active_level_t { QMA6100P_INTPIN_ACTIVE_LOW = 0 , QMA6100P_INTPIN_ACTIVE_HIGH = 1 }
 INT pin active level (INTPIN_CONF, 0x20) More...
 
enum  qma6100p_int_shadow_t { QMA6100P_INT_CFG_SHADOW_EN = 0 , QMA6100P_INT_CFG_SHADOW_DIS = 1 }
 Data shadowing mode (INT_CFG, 0x21) More...
 
enum  qma6100p_int_pin_num_t { QMA6100P_INT1 = 1 , QMA6100P_INT2 = 2 }
 Interrupt pin number selection (INT1_MAP1 0x1A / INT2_MAP1 0x1C) More...
 

Functions

int qma6100p_init (qma6100p_t *dev, const qma6100p_params_t *params)
 Initialize the QMA6100P accelerometer driver.
 
int qma6100p_set_low_power (qma6100p_t *dev)
 Enter Ultra-Low Power State (ULPS)
 
int qma6100p_set_active_mode (qma6100p_t *dev)
 Enter active mode.
 
int qma6100p_read_raw (const qma6100p_t *dev, qma6100p_raw_data_t *data)
 Read raw accelerometer data (ADC counts)
 
int qma6100p_read (const qma6100p_t *dev, qma6100p_data_t *data)
 Read accelerometer data converted to ug.
 
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.