ChibiOS
0.0.0
|
LSM303AGR MEMS interface module header. More...
Go to the source code of this file.
Data Structures | |
struct | LSM303AGRConfig |
LSM303AGR configuration structure. More... | |
struct | LSM303AGRVMT |
LSM303AGR virtual methods table. More... | |
struct | LSM303AGRDriver |
LSM303AGR 6-axis accelerometer/compass class. More... | |
Macros | |
#define | lsm303agrAccelerometerGetAxesNumber(devp) accelerometerGetAxesNumber(&((devp)->acc_if)) |
Return the number of axes of the BaseAccelerometer. More... | |
#define | lsm303agrAccelerometerReadRaw(devp, axes) accelerometerReadRaw(&((devp)->acc_if), axes) |
Retrieves raw data from the BaseAccelerometer. More... | |
#define | lsm303agrAccelerometerReadCooked(devp, axes) accelerometerReadCooked(&((devp)->acc_if), axes) |
Retrieves cooked data from the BaseAccelerometer. More... | |
#define | lsm303agrAccelerometerSetBias(devp, bp) accelerometerSetBias(&((devp)->acc_if), bp) |
Set bias values for the BaseAccelerometer. More... | |
#define | lsm303agrAccelerometerResetBias(devp) accelerometerResetBias(&((devp)->acc_if)) |
Reset bias values for the BaseAccelerometer. More... | |
#define | lsm303agrAccelerometerSetSensitivity(devp, sp) accelerometerSetSensitivity(&((devp)->acc_if), sp) |
Set sensitivity values for the BaseAccelerometer. More... | |
#define | lsm303agrAccelerometerResetSensitivity(devp) accelerometerResetSensitivity(&((devp)->acc_if)) |
Reset sensitivity values for the BaseAccelerometer. More... | |
#define | lsm303agrAccelerometerSetFullScale(devp, fs) (devp)->vmt->acc_set_full_scale(devp, fs) |
Changes the LSM303AGRDriver accelerometer fullscale value. More... | |
#define | lsm303agrCompassGetAxesNumber(devp) compassGetAxesNumber(&((devp)->comp_if)) |
Return the number of axes of the BaseCompass. More... | |
#define | lsm303agrCompassReadRaw(devp, axes) compassReadRaw(&((devp)->comp_if), axes) |
Retrieves raw data from the BaseCompass. More... | |
#define | lsm303agrCompassReadCooked(devp, axes) compassReadCooked(&((devp)->comp_if), axes) |
Retrieves cooked data from the BaseCompass. More... | |
#define | lsm303agrCompassSetBias(devp, bp) compassSetBias(&((devp)->comp_if), bp) |
Set bias values for the BaseCompass. More... | |
#define | lsm303agrCompassResetBias(devp) compassResetBias(&((devp)->comp_if)) |
Reset bias values for the BaseCompass. More... | |
#define | lsm303agrCompassSetSensitivity(devp, sp) compassSetSensitivity(&((devp)->comp_if), sp) |
Set sensitivity values for the BaseCompass. More... | |
#define | lsm303agrCompassResetSensitivity(devp) compassResetSensitivity(&((devp)->comp_if)) |
Reset sensitivity values for the BaseCompass. More... | |
Version identification | |
#define | EX_LSM303AGR_VERSION "1.0.0" |
LSM303AGR driver version string. More... | |
#define | EX_LSM303AGR_MAJOR 1 |
LSM303AGR driver version major number. More... | |
#define | EX_LSM303AGR_MINOR 0 |
LSM303AGR driver version minor number. More... | |
#define | EX_LSM303AGR_PATCH 0 |
LSM303AGR driver version patch number. More... | |
#define | LSM303AGR_ACC_NUMBER_OF_AXES 3U |
LSM303AGR accelerometer subsystem characteristics. More... | |
#define | LSM303AGR_COMP_NUMBER_OF_AXES 3U |
LSM303AGR compass subsystem characteristics. More... | |
LSM303AGR communication interfaces related bit masks | |
#define | LSM303AGR_DI_MASK 0xFF |
#define | LSM303AGR_DI(n) (1 << n) |
#define | LSM303AGR_AD_MASK 0x7F |
#define | LSM303AGR_AD(n) (1 << n) |
#define | LSM303AGR_MS (1 << 7) |
LSM303AGR register addresses | |
#define | LSM303AGR_AD_STATUS_REG_AUX_A 0x07 |
#define | LSM303AGR_AD_OUT_TEMP_L_A 0x0C |
#define | LSM303AGR_AD_OUT_TEMP_H_A 0x0D |
#define | LSM303AGR_AD_INT_COUNTER_REG_A 0x0E |
#define | LSM303AGR_AD_WHO_AM_I_A 0x0F |
#define | LSM303AGR_AD_TEMP_CFG_REG_A 0x1F |
#define | LSM303AGR_AD_CTRL_REG1_A 0x20 |
#define | LSM303AGR_AD_CTRL_REG2_A 0x21 |
#define | LSM303AGR_AD_CTRL_REG3_A 0x22 |
#define | LSM303AGR_AD_CTRL_REG4_A 0x23 |
#define | LSM303AGR_AD_CTRL_REG5_A 0x24 |
#define | LSM303AGR_AD_CTRL_REG6_A 0x25 |
#define | LSM303AGR_AD_REFERENCE_A 0x26 |
#define | LSM303AGR_AD_STATUS_REG_A 0x27 |
#define | LSM303AGR_AD_OUT_X_L_A 0x28 |
#define | LSM303AGR_AD_OUT_X_H_A 0x29 |
#define | LSM303AGR_AD_OUT_Y_L_A 0x2A |
#define | LSM303AGR_AD_OUT_Y_H_A 0x2B |
#define | LSM303AGR_AD_OUT_Z_L_A 0x2C |
#define | LSM303AGR_AD_OUT_Z_H_A 0x2D |
#define | LSM303AGR_AD_FIFO_CTRL_REG_A 0x2E |
#define | LSM303AGR_AD_FIFO_SRC_REG_A 0x2F |
#define | LSM303AGR_AD_INT1_CFG_A 0x30 |
#define | LSM303AGR_AD_INT1_SRC_A 0x31 |
#define | LSM303AGR_AD_INT1_THS_A 0x32 |
#define | LSM303AGR_AD_INT1_DURATION_A 0x33 |
#define | LSM303AGR_AD_INT2_CFG_A 0x34 |
#define | LSM303AGR_AD_INT2_SRC_A 0x35 |
#define | LSM303AGR_AD_INT2_THS_A 0x36 |
#define | LSM303AGR_AD_INT2_DURATION_A 0x37 |
#define | LSM303AGR_AD_CLICK_CFG_A 0x38 |
#define | LSM303AGR_AD_CLICK_SRC_A 0x39 |
#define | LSM303AGR_AD_CLICK_THS_A 0x3A |
#define | LSM303AGR_AD_TIME_LIMIT_A 0x3B |
#define | LSM303AGR_AD_TIME_LATENCY_A 0x3C |
#define | LSM303AGR_AD_TIME_WINDOW_A 0x3D |
#define | LSM303AGR_AD_ACT_THS_A 0x3E |
#define | LSM303AGR_AD_ACT_DUR_A 0x3F |
#define | LSM303AGR_AD_OFFSET_X_REG_L_M 0x45 |
#define | LSM303AGR_AD_OFFSET_X_REG_H_M 0x46 |
#define | LSM303AGR_AD_OFFSET_Y_REG_L_M 0x47 |
#define | LSM303AGR_AD_OFFSET_Y_REG_H_M 0x48 |
#define | LSM303AGR_AD_OFFSET_Z_REG_L_M 0x49 |
#define | LSM303AGR_AD_OFFSET_Z_REG_H_M 0x4A |
#define | LSM303AGR_AD_WHO_AM_I_M 0x4F |
#define | LSM303AGR_AD_CFG_REG_A_M 0x60 |
#define | LSM303AGR_AD_CFG_REG_B_M 0x61 |
#define | LSM303AGR_AD_CFG_REG_C_M 0x62 |
#define | LSM303AGR_AD_INT_CRTL_REG_M 0x63 |
#define | LSM303AGR_AD_INT_SOURCE_REG_M 0x64 |
#define | LSM303AGR_AD_INT_THS_L_REG_M 0x65 |
#define | LSM303AGR_AD_INT_THS_H_REG_M 0x66 |
#define | LSM303AGR_AD_STATUS_REG_M 0x67 |
#define | LSM303AGR_AD_OUTX_L_REG_M 0x68 |
#define | LSM303AGR_AD_OUTX_H_REG_M 0x69 |
#define | LSM303AGR_AD_OUTY_L_REG_M 0x6A |
#define | LSM303AGR_AD_OUTY_H_REG_M 0x6B |
#define | LSM303AGR_AD_OUTZ_L_REG_M 0x6C |
#define | LSM303AGR_AD_OUTZ_H_REG_M 0x6D |
LSM303AGR_TEMP_CFG_REG_A register bits definitions | |
#define | LSM303AGR_TEMP_CFG_REG_A_TEMP_EN0 (1 << 0) |
#define | LSM303AGR_TEMP_CFG_REG_A_TEMP_EN1 (1 << 0) |
LSM303AGR_CTRL_REG1_A register bits definitions | |
#define | LSM303AGR_CTRL_REG1_A_XEN (1 << 0) |
#define | LSM303AGR_CTRL_REG1_A_YEN (1 << 1) |
#define | LSM303AGR_CTRL_REG1_A_ZEN (1 << 2) |
#define | LSM303AGR_CTRL_REG1_A_LPEN (1 << 3) |
#define | LSM303AGR_CTRL_REG1_A_ODR0 (1 << 4) |
#define | LSM303AGR_CTRL_REG1_A_ODR1 (1 << 5) |
#define | LSM303AGR_CTRL_REG1_A_ODR2 (1 << 6) |
#define | LSM303AGR_CTRL_REG1_A_ODR3 (1 << 7) |
LSM303AGR_CTRL_REG2_A register bits definitions | |
#define | LSM303AGR_CTRL_REG2_A_HPIS1 (1 << 0) |
#define | LSM303AGR_CTRL_REG2_A_HPIS2 (1 << 1) |
#define | LSM303AGR_CTRL_REG2_A_HPCLICK (1 << 2) |
#define | LSM303AGR_CTRL_REG2_A_FDS (1 << 3) |
#define | LSM303AGR_CTRL_REG2_A_HPCF1 (1 << 4) |
#define | LSM303AGR_CTRL_REG2_A_HPCF2 (1 << 5) |
#define | LSM303AGR_CTRL_REG2_A_HPM0 (1 << 6) |
#define | LSM303AGR_CTRL_REG2_A_HPM1 (1 << 7) |
LSM303AGR_CTRL_REG3_A register bits definitions | |
#define | LSM303AGR_CTRL_REG3_A_I1_OVERRUN (1 << 1) |
#define | LSM303AGR_CTRL_REG3_A_I1_WTM (1 << 2) |
#define | LSM303AGR_CTRL_REG3_A_I1_DRDY2 (1 << 3) |
#define | LSM303AGR_CTRL_REG3_A_I1_DRDY1 (1 << 4) |
#define | LSM303AGR_CTRL_REG3_A_I1_AOI2 (1 << 5) |
#define | LSM303AGR_CTRL_REG3_A_I1_AOI1 (1 << 6) |
#define | LSM303AGR_CTRL_REG3_A_I1_CLICK (1 << 7) |
LSM303AGR_CTRL_REG4_A register bits definitions | |
#define | LSM303AGR_CTRL_REG4_A_SPI_ENABLE (1 << 0) |
#define | LSM303AGR_CTRL_REG4_A_ST0 (1 << 1) |
#define | LSM303AGR_CTRL_REG4_A_ST1 (1 << 2) |
#define | LSM303AGR_CTRL_REG4_A_HR (1 << 3) |
#define | LSM303AGR_CTRL_REG4_A_FS_MASK 0x30 |
#define | LSM303AGR_CTRL_REG4_A_FS0 (1 << 4) |
#define | LSM303AGR_CTRL_REG4_A_FS1 (1 << 5) |
#define | LSM303AGR_CTRL_REG4_A_BLE (1 << 6) |
#define | LSM303AGR_CTRL_REG4_A_BDU (1 << 7) |
LSM303AGR_CTRL_REG5_A register bits definitions | |
#define | LSM303AGR_CTRL_REG5_A_D4D_INT2 (1 << 0) |
#define | LSM303AGR_CTRL_REG5_A_LIR_INT2 (1 << 1) |
#define | LSM303AGR_CTRL_REG5_A_D4D_INT1 (1 << 2) |
#define | LSM303AGR_CTRL_REG5_A_LIR_INT1 (1 << 3) |
#define | LSM303AGR_CTRL_REG5_A_FIFO_EN (1 << 6) |
#define | LSM303AGR_CTRL_REG5_A_BOOT (1 << 7) |
LSM303AGR_CTRL_REG6_A register bits definitions | |
#define | LSM303AGR_CTRL_REG6_A_H_LACTIVE (1 << 1) |
#define | LSM303AGR_CTRL_REG6_A_P2_ACT (1 << 3) |
#define | LSM303AGR_CTRL_REG6_A_BOOT_I2 (1 << 4) |
#define | LSM303AGR_CTRL_REG6_A_I2_INT2 (1 << 5) |
#define | LSM303AGR_CTRL_REG6_A_I2_INT1 (1 << 6) |
#define | LSM303AGR_CTRL_REG6_A_I2_CLICKEN (1 << 7) |
LSM303AGR_CFG_REG_A register bits definitions | |
#define | LSM303AGR_CFG_REG_A_M_MD0 (1 << 0) |
#define | LSM303AGR_CFG_REG_A_M_MD1 (1 << 1) |
#define | LSM303AGR_CFG_REG_A_M_ODR0 (1 << 2) |
#define | LSM303AGR_CFG_REG_A_M_ODR1 (1 << 3) |
#define | LSM303AGR_CFG_REG_A_M_LP (1 << 4) |
#define | LSM303AGR_CFG_REG_A_M_SOFT_RST (1 << 5) |
#define | LSM303AGR_CFG_REG_A_M_REBOOT (1 << 6) |
#define | LSM303AGR_CFG_REG_A_M_COMP_TEMP_EN (1 << 7) |
LSM303AGR_CFG_REG_B register bits definitions | |
#define | LSM303AGR_CFG_REG_B_M_LPF (1 << 0) |
#define | LSM303AGR_CFG_REG_B_M_OFF_CANC (1 << 1) |
#define | LSM303AGR_CFG_REG_B_M_SET_FREQ (1 << 2) |
#define | LSM303AGR_CFG_REG_B_M_INT_ON (1 << 3) |
#define | LSM303AGR_CFG_REG_B_M_OFF_CANC_OS (1 << 4) |
LSM303AGR_CFG_REG_C register bits definitions | |
#define | LSM303AGR_CFG_REG_C_M_INT_MAG (1 << 0) |
#define | LSM303AGR_CFG_REG_C_M_SELF_TEST (1 << 1) |
#define | LSM303AGR_CFG_REG_C_M_BLE (1 << 3) |
#define | LSM303AGR_CFG_REG_C_M_BDU (1 << 4) |
#define | LSM303AGR_CFG_REG_C_M_I2C_DIS (1 << 5) |
#define | LSM303AGR_CFG_REG_C_M_INT_MAG_PIN (1 << 6) |
Configuration options | |
#define | LSM303AGR_USE_SPI FALSE |
LSM303AGR SPI interface switch. More... | |
#define | LSM303AGR_SHARED_SPI FALSE |
LSM303AGR shared SPI switch. More... | |
#define | LSM303AGR_USE_I2C TRUE |
LSM303AGR I2C interface switch. More... | |
#define | LSM303AGR_SHARED_I2C FALSE |
LSM303AGR shared I2C switch. More... | |
#define | LSM303AGR_ACC_USE_ADVANCED FALSE |
LSM303AGR accelerometer subsystem advanced configurations switch. More... | |
#define | LSM303AGR_COMP_USE_ADVANCED FALSE |
LSM303AGR compass subsystem advanced configurations switch. More... | |
Enumerations | |
LSM303AGR compass subsystem data structures and types. |
Functions | |
void | lsm303agrObjectInit (LSM303AGRDriver *devp) |
Initializes an instance. More... | |
void | lsm303agrStart (LSM303AGRDriver *devp, const LSM303AGRConfig *config) |
Configures and activates LSM303AGR Complex Driver peripheral. More... | |
void | lsm303agrStop (LSM303AGRDriver *devp) |
Deactivates the LSM303AGR Complex Driver peripheral. More... | |
LSM303AGR accelerometer subsystem data structures and types. | |
| |
typedef struct LSM303AGRDriver | LSM303AGRDriver |
Structure representing a LSM303AGR driver. More... | |
LSM303AGR main system data structures and types. | |
#define | _lsm303agr_methods_alone |
LSM303AGR specific methods. More... | |
#define | _lsm303agr_methods |
LSM303AGR specific methods with inherited ones. More... | |
#define | _lsm303agr_data |
LSM303AGRDriver specific data. More... | |
LSM303AGR MEMS interface module header.
Definition in file lsm303agr.h.