ChibiOS 21.11.4

Detailed Description

Collaboration diagram for LSM303DLHC:

LSM303DLHC accelerometer subsystem data structures and types.

enum  lsm303dlhc_acc_fs_t { LSM303DLHC_ACC_FS_2G = 0x00 , LSM303DLHC_ACC_FS_4G = 0x10 , LSM303DLHC_ACC_FS_8G = 0x20 , LSM303DLHC_ACC_FS_16G = 0x30 }
 LSM303DLHC accelerometer subsystem full scale. More...
enum  lsm303dlhc_acc_odr_t {
  LSM303DLHC_ACC_ODR_PD = 0x00 , LSM303DLHC_ACC_ODR_1Hz = 0x10 , LSM303DLHC_ACC_ODR_10Hz = 0x20 , LSM303DLHC_ACC_ODR_25Hz = 0x30 ,
  LSM303DLHC_ACC_ODR_50Hz = 0x40 , LSM303DLHC_ACC_ODR_100Hz = 0x50 , LSM303DLHC_ACC_ODR_200Hz = 0x60 , LSM303DLHC_ACC_ODR_400Hz = 0x70 ,
  LSM303DLHC_ACC_ODR_1620Hz = 0x80 , LSM303DLHC_ACC_ODR_1344Hz = 0x90
}
 LSM303DLHC accelerometer subsystem output data rate. More...
enum  lsm303dlhc_acc_ae_t {
  LSM303DLHC_ACC_AE_DISABLED = 0x00 , LSM303DLHC_ACC_AE_X = 0x01 , LSM303DLHC_ACC_AE_Y = 0x02 , LSM303DLHC_ACC_AE_XY = 0x03 ,
  LSM303DLHC_ACC_AE_Z = 0x04 , LSM303DLHC_ACC_AE_XZ = 0x05 , LSM303DLHC_ACC_AE_YZ = 0x06 , LSM303DLHC_ACC_AE_XYZ = 0x07
}
 LSM303DLHC accelerometer subsystem axes enabling. More...
enum  lsm303dlhc_acc_lp_t { LSM303DLHC_ACC_LP_DISABLED = 0x00 , LSM303DLHC_ACC_LP_ENABLED = 0x40 }
 LSM303DLHC accelerometer subsystem low power mode. More...
enum  lsm303dlhc_acc_hr_t { LSM303DLHC_ACC_HR_DISABLED = 0x00 , LSM303DLHC_ACC_HR_ENABLED = 0x08 }
 LSM303DLHC accelerometer subsystem high resolution mode. More...
enum  lsm303dlhc_acc_bdu_t { LSM303DLHC_ACC_BDU_CONT = 0x00 , LSM303DLHC_ACC_BDU_BLOCK = 0x80 }
 LSM303DLHC accelerometer subsystem block data update. More...
enum  lsm303dlhc_acc_end_t { LSM303DLHC_ACC_END_LITTLE = 0x00 , LSM303DLHC_ACC_END_BIG = 0x40 }
 LSM303DLHC accelerometer endianness. More...
typedef struct LSM303DLHCDriver LSM303DLHCDriver
 Structure representing a LSM303DLHC driver.

LSM303DLHC compass subsystem data structures and types.

enum  lsm303dlhc_comp_fs_t {
  LSM303DLHC_COMP_FS_1P3GA = 0x20 , LSM303DLHC_COMP_FS_1P9GA = 0x40 , LSM303DLHC_COMP_FS_2P5GA = 0x60 , LSM303DLHC_COMP_FS_4P0GA = 0x80 ,
  LSM303DLHC_COMP_FS_4P7GA = 0xA0 , LSM303DLHC_COMP_FS_5P6GA = 0xC0 , LSM303DLHC_COMP_FS_8P1GA = 0xE0
}
 LSM303DLHC compass subsystem full scale. More...
enum  lsm303dlhc_comp_odr_t {
  LSM303DLHC_COMP_ODR_0P75HZ = 0x00 , LSM303DLHC_COMP_ODR_1P5HZ = 0x04 , LSM303DLHC_COMP_ODR_3P0HZ = 0x08 , LSM303DLHC_COMP_ODR_7P5HZ = 0x0C ,
  LSM303DLHC_COMP_ODR_15HZ = 0x10 , LSM303DLHC_COMP_ODR_30HZ = 0x14 , LSM303DLHC_COMP_ODR_75HZ = 0x18 , LSM303DLHC_COMP_ODR_220HZ = 0x1C
}
 LSM303DLHC compass subsystem output data rate. More...
enum  lsm303dlhc_comp_md_t { LSM303DLHC_COMP_MD_CONT = 0x00 , LSM303DLHC_COMP_MD_BLOCK = 0x01 , LSM303DLHC_COMP_MD_SLEEP = 0x02 }
 LSM303DLHC compass subsystem working mode. More...

LSM303DLHC main system data structures and types.

enum  lsm303dlhc_state_t { LSM303DLHC_UNINIT = 0 , LSM303DLHC_STOP = 1 , LSM303DLHC_READY = 2 }
 Driver state machine possible states. More...
#define _lsm303dlhc_methods_alone
 LSM303DLHC specific methods.
#define _lsm303dlhc_methods
 LSM303DLHC specific methods with inherited ones.
#define _lsm303dlhc_data
 LSM303DLHCDriver specific data.

Version identification

#define EX_LSM303DLHC_VERSION   "1.1.2"
 LSM303DLHC driver version string.
#define EX_LSM303DLHC_MAJOR   1
 LSM303DLHC driver version major number.
#define EX_LSM303DLHC_MINOR   1
 LSM303DLHC driver version minor number.
#define EX_LSM303DLHC_PATCH   2
 LSM303DLHC driver version patch number.
#define LSM303DLHC_ACC_NUMBER_OF_AXES   3U
 LSM303DLHC accelerometer subsystem characteristics.
#define LSM303DLHC_ACC_2G   2.0f
#define LSM303DLHC_ACC_4G   4.0f
#define LSM303DLHC_ACC_8G   8.0f
#define LSM303DLHC_ACC_16G   16.0f
#define LSM303DLHC_ACC_SENS_2G   0.0610f
#define LSM303DLHC_ACC_SENS_4G   0.1221f
#define LSM303DLHC_ACC_SENS_8G   0.2442f
#define LSM303DLHC_ACC_SENS_16G   0.4884f
#define LSM303DLHC_ACC_BIAS   0.0f
#define LSM303DLHC_COMP_NUMBER_OF_AXES   3U
 LSM303DLHC compass subsystem characteristics.
#define LSM303DLHC_COMP_1P3GA   1.3f
#define LSM303DLHC_COMP_1P9GA   1.9f
#define LSM303DLHC_COMP_2P5GA   2.5f
#define LSM303DLHC_COMP_4P0GA   4.0f
#define LSM303DLHC_COMP_4P7GA   4.7f
#define LSM303DLHC_COMP_5P6GA   5.6f
#define LSM303DLHC_COMP_8P1GA   8.1f
#define LSM303DLHC_COMP_SENS_XY_1P3GA   0.000909f
#define LSM303DLHC_COMP_SENS_XY_1P9GA   0.001169f
#define LSM303DLHC_COMP_SENS_XY_2P5GA   0.0014925f
#define LSM303DLHC_COMP_SENS_XY_4P0GA   0.0022222f
#define LSM303DLHC_COMP_SENS_XY_4P7GA   0.0025000f
#define LSM303DLHC_COMP_SENS_XY_5P6GA   0.0030303f
#define LSM303DLHC_COMP_SENS_XY_8P1GA   0.0043478f
#define LSM303DLHC_COMP_SENS_Z_1P3GA   0.0010204f
#define LSM303DLHC_COMP_SENS_Z_1P9GA   0.0013071f
#define LSM303DLHC_COMP_SENS_Z_2P5GA   0.0016666f
#define LSM303DLHC_COMP_SENS_Z_4P0GA   0.0025000f
#define LSM303DLHC_COMP_SENS_Z_4P7GA   0.0028169f
#define LSM303DLHC_COMP_SENS_Z_5P6GA   0.0033898f
#define LSM303DLHC_COMP_SENS_Z_8P1GA   0.0048780f
#define LSM303DLHC_COMP_BIAS   0.0f

LSM303DLHC communication interfaces related bit masks

#define LSM303DLHC_DI_MASK   0xFF
#define LSM303DLHC_DI(n)
#define LSM303DLHC_AD_MASK   0x7F
#define LSM303DLHC_AD(n)
#define LSM303DLHC_MS   (1 << 7)

LSM303DLHC register addresses

#define LSM303DLHC_AD_ACC_CTRL_REG1   0x20
#define LSM303DLHC_AD_ACC_CTRL_REG2   0x21
#define LSM303DLHC_AD_ACC_CTRL_REG3   0x22
#define LSM303DLHC_AD_ACC_CTRL_REG4   0x23
#define LSM303DLHC_AD_ACC_CTRL_REG5   0x24
#define LSM303DLHC_AD_ACC_CTRL_REG6   0x25
#define LSM303DLHC_AD_ACC_REFERENCE   0x26
#define LSM303DLHC_AD_ACC_STATUS_REG   0x27
#define LSM303DLHC_AD_ACC_OUT_X_L   0x28
#define LSM303DLHC_AD_ACC_OUT_X_H   0x29
#define LSM303DLHC_AD_ACC_OUT_Y_L   0x2A
#define LSM303DLHC_AD_ACC_OUT_Y_H   0x2B
#define LSM303DLHC_AD_ACC_OUT_Z_L   0x2C
#define LSM303DLHC_AD_ACC_OUT_Z_H   0x2D
#define LSM303DLHC_AD_ACC_FIFO_CTRL_REG   0x2E
#define LSM303DLHC_AD_ACC_FIFO_SRC_REG   0x2F
#define LSM303DLHC_AD_ACC_INT1_CFG   0x30
#define LSM303DLHC_AD_ACC_INT1_SRC   0x31
#define LSM303DLHC_AD_ACC_INT1_THS   0x32
#define LSM303DLHC_AD_ACC_INT1_DURATION   0x33
#define LSM303DLHC_AD_ACC_INT2_CFG   0x34
#define LSM303DLHC_AD_ACC_INT2_SRC   0x35
#define LSM303DLHC_AD_ACC_INT2_THS   0x36
#define LSM303DLHC_AD_ACC_INT2_DURATION   0x37
#define LSM303DLHC_AD_ACC_CLICK_CFG   0x38
#define LSM303DLHC_AD_ACC_CLICK_SRC   0x39
#define LSM303DLHC_AD_ACC_CLICK_THS   0x3A
#define LSM303DLHC_AD_ACC_TIME_LIMIT   0x3B
#define LSM303DLHC_AD_ACC_TIME_LATENCY   0x3C
#define LSM303DLHC_AD_ACC_TIME_WINDOW   0x3D
#define LSM303DLHC_AD_COMP_CRA_REG   0x00
#define LSM303DLHC_AD_COMP_CRB_REG   0x01
#define LSM303DLHC_AD_COMP_MR_REG   0x02
#define LSM303DLHC_AD_COMP_OUT_X_H   0x03
#define LSM303DLHC_AD_COMP_OUT_X_L   0x04
#define LSM303DLHC_AD_COMP_OUT_Z_H   0x05
#define LSM303DLHC_AD_COMP_OUT_Z_L   0x06
#define LSM303DLHC_AD_COMP_OUT_Y_H   0x07
#define LSM303DLHC_AD_COMP_OUT_Y_L   0x08
#define LSM303DLHC_AD_COMP_SR_REG   0x09
#define LSM303DLHC_AD_COMP_IRA_REG   0x0A
#define LSM303DLHC_AD_COMP_IRB_REG   0x0B
#define LSM303DLHC_AD_COMP_IRC_REG   0x0C
#define LSM303DLHC_AD_COMP_TEMP_OUT_H   0x31
#define LSM303DLHC_AD_COMP_TEMP_OUT_L   0x32

LSM303DLHC_CTRL_REG1_A register bits definitions

#define LSM303DLHC_CTRL_REG1_A_MASK   0xFF
#define LSM303DLHC_CTRL_REG1_A_XEN   (1 << 0)
#define LSM303DLHC_CTRL_REG1_A_YEN   (1 << 1)
#define LSM303DLHC_CTRL_REG1_A_ZEN   (1 << 2)
#define LSM303DLHC_CTRL_REG1_A_LPEN   (1 << 3)
#define LSM303DLHC_CTRL_REG1_A_ODR0   (1 << 4)
#define LSM303DLHC_CTRL_REG1_A_ODR1   (1 << 5)
#define LSM303DLHC_CTRL_REG1_A_ODR2   (1 << 6)
#define LSM303DLHC_CTRL_REG1_A_ODR3   (1 << 7)

LSM303DLHC_CTRL_REG2_A register bits definitions

#define LSM303DLHC_CTRL_REG2_A_MASK   0xFF
#define LSM303DLHC_CTRL_REG2_A_HPIS1   (1 << 0)
#define LSM303DLHC_CTRL_REG2_A_HPIS2   (1 << 1)
#define LSM303DLHC_CTRL_REG2_A_HPCLICK   (1 << 2)
#define LSM303DLHC_CTRL_REG2_A_FDS   (1 << 3)
#define LSM303DLHC_CTRL_REG2_A_HPCF1   (1 << 4)
#define LSM303DLHC_CTRL_REG2_A_HPCF2   (1 << 5)
#define LSM303DLHC_CTRL_REG2_A_HPM0   (1 << 6)
#define LSM303DLHC_CTRL_REG2_A_HPM1   (1 << 7)

LSM303DLHC_CTRL_REG3_A register bits definitions

#define LSM303DLHC_CTRL_REG3_A_MASK   0xFD
#define LSM303DLHC_CTRL_REG3_A_I1_OVERRUN   (1 << 1)
#define LSM303DLHC_CTRL_REG3_A_I1_WTM   (1 << 2)
#define LSM303DLHC_CTRL_REG3_A_I1_DRDY2   (1 << 3)
#define LSM303DLHC_CTRL_REG3_A_I1_DRDY1   (1 << 4)
#define LSM303DLHC_CTRL_REG3_A_I1_AOI2   (1 << 5)
#define LSM303DLHC_CTRL_REG3_A_I1_AOI1   (1 << 6)
#define LSM303DLHC_CTRL_REG3_A_I1_CLICK   (1 << 7)

LSM303DLHC_CTRL_REG4_A register bits definitions

#define LSM303DLHC_CTRL_REG4_A_MASK   0xF9
#define LSM303DLHC_CTRL_REG4_A_SIM   (1 << 0)
#define LSM303DLHC_CTRL_REG4_A_HR   (1 << 3)
#define LSM303DLHC_CTRL_REG4_A_FS_MASK   0x30
#define LSM303DLHC_CTRL_REG4_A_FS0   (1 << 4)
#define LSM303DLHC_CTRL_REG4_A_FS1   (1 << 5)
#define LSM303DLHC_CTRL_REG4_A_BLE   (1 << 6)
#define LSM303DLHC_CTRL_REG4_A_BDU   (1 << 7)

LSM303DLHC_CTRL_REG5_A register bits definitions

#define LSM303DLHC_CTRL_REG5_A_MASK   0xCF
#define LSM303DLHC_CTRL_REG5_A_D4D_INT2   (1 << 0)
#define LSM303DLHC_CTRL_REG5_A_LIR_INT2   (1 << 1)
#define LSM303DLHC_CTRL_REG5_A_D4D_INT1   (1 << 2)
#define LSM303DLHC_CTRL_REG5_A_LIR_INT1   (1 << 3)
#define LSM303DLHC_CTRL_REG5_A_FIFO_EN   (1 << 6)
#define LSM303DLHC_CTRL_REG5_A_BOOT   (1 << 7)

LSM303DLHC_CTRL_REG6_A register bits definitions

#define LSM303DLHC_CTRL_REG6_A_MASK   0xFA
#define LSM303DLHC_CTRL_REG6_A_H_LACTIVE   (1 << 1)
#define LSM303DLHC_CTRL_REG6_A_P2_ACT   (1 << 3)
#define LSM303DLHC_CTRL_REG6_A_BOOT_I1   (1 << 4)
#define LSM303DLHC_CTRL_REG6_A_I2_INT2   (1 << 5)
#define LSM303DLHC_CTRL_REG6_A_I2_INT1   (1 << 6)
#define LSM303DLHC_CTRL_REG6_A_I2_CLICKEN   (1 << 7)

LSM303DLHC_CRA_REG_M register bits definitions

#define LSM303DLHC_CRA_REG_M_MASK   0x9C
#define LSM303DLHC_CRA_REG_M_DO0   (1 << 2)
#define LSM303DLHC_CRA_REG_M_DO1   (1 << 3)
#define LSM303DLHC_CRA_REG_M_DO2   (1 << 4)
#define LSM303DLHC_CRA_REG_M_TEMP_EN   (1 << 7)

LSM303DLHC_CRB_REG_M register bits definitions

#define LSM303DLHC_CRB_REG_M_MASK   0xE0
#define LSM303DLHC_CRB_REG_M_GN_MASK   0xE0
#define LSM303DLHC_CRB_REG_M_GN0   (1 << 5)
#define LSM303DLHC_CRB_REG_M_GN1   (1 << 6)
#define LSM303DLHC_CRB_REG_M_GN2   (1 << 7)
#define LSM303DLHC_MR_REG_M_MASK   0x03
#define LSM303DLHC_MR_REG_M_MD0   (1 << 0)
#define LSM303DLHC_MR_REG_M_MD1   (1 << 1)

Configuration options

#define LSM303DLHC_USE_SPI   FALSE
 LSM303DLHC SPI interface switch.
#define LSM303DLHC_SHARED_SPI   FALSE
 LSM303DLHC shared SPI switch.
#define LSM303DLHC_USE_I2C   TRUE
 LSM303DLHC I2C interface switch.
#define LSM303DLHC_SHARED_I2C   FALSE
 LSM303DLHC shared I2C switch.
#define LSM303DLHC_USE_ADVANCED   FALSE
 LSM303DLHC advanced configurations switch.

Data Structures

struct  LSM303DLHCConfig
 LSM303DLHC configuration structure. More...
struct  LSM303DLHCVMT
 LSM303DLHC virtual methods table. More...
struct  LSM303DLHCDriver
 LSM303DLHC 6-axis accelerometer/compass class. More...

Macros

#define lsm303dlhcAccelerometerGetAxesNumber(devp)
 Return the number of axes of the BaseAccelerometer.
#define lsm303dlhcAccelerometerReadRaw(devp, axes)
 Retrieves raw data from the BaseAccelerometer.
#define lsm303dlhcAccelerometerReadCooked(devp, axes)
 Retrieves cooked data from the BaseAccelerometer.
#define lsm303dlhcAccelerometerSetBias(devp, bp)
 Set bias values for the BaseAccelerometer.
#define lsm303dlhcAccelerometerResetBias(devp)
 Reset bias values for the BaseAccelerometer.
#define lsm303dlhcAccelerometerSetSensitivity(devp, sp)
 Set sensitivity values for the BaseAccelerometer.
#define lsm303dlhcAccelerometerResetSensitivity(devp)
 Reset sensitivity values for the BaseAccelerometer.
#define lsm303dlhcAccelerometerSetFullScale(devp, fs)
 Changes the LSM303DLHCDriver accelerometer fullscale value.
#define lsm303dlhcCompassGetAxesNumber(devp)
 Return the number of axes of the BaseCompass.
#define lsm303dlhcCompassReadRaw(devp, axes)
 Retrieves raw data from the BaseCompass.
#define lsm303dlhcCompassReadCooked(devp, axes)
 Retrieves cooked data from the BaseCompass.
#define lsm303dlhcCompassSetBias(devp, bp)
 Set bias values for the BaseCompass.
#define lsm303dlhcCompassResetBias(devp)
 Reset bias values for the BaseCompass.
#define lsm303dlhcCompassSetSensitivity(devp, sp)
 Set sensitivity values for the BaseCompass.
#define lsm303dlhcCompassResetSensitivity(devp)
 Reset sensitivity values for the BaseCompass.
#define lsm303dlhcCompassSetFullScale(devp, fs)
 Changes the LSM303DLHCDriver compass fullscale value.

Enumerations

enum  lsm303dlhc_sad_t { LSM303DLHC_SAD_ACC = 0x19 , LSM303DLHC_SAD_COMP = 0x1E }
 Accelerometer and Compass Slave Address. More...

Functions

static msg_t lsm303dlhcI2CReadRegister (I2CDriver *i2cp, lsm303dlhc_sad_t sad, uint8_t reg, uint8_t *rxbuf, size_t n)
 Reads registers value using I2C.
static msg_t lsm303dlhcI2CWriteRegister (I2CDriver *i2cp, lsm303dlhc_sad_t sad, uint8_t *txbuf, size_t n)
 Writes a value into a register using I2C.
static size_t acc_get_axes_number (void *ip)
 Return the number of axes of the BaseAccelerometer.
static msg_t acc_read_raw (void *ip, int32_t axes[])
 Retrieves raw data from the BaseAccelerometer.
static msg_t acc_read_cooked (void *ip, float axes[])
 Retrieves cooked data from the BaseAccelerometer.
static msg_t acc_set_bias (void *ip, float *bp)
 Set bias values for the BaseAccelerometer.
static msg_t acc_reset_bias (void *ip)
 Reset bias values for the BaseAccelerometer.
static msg_t acc_set_sensivity (void *ip, float *sp)
 Set sensitivity values for the BaseAccelerometer.
static msg_t acc_reset_sensivity (void *ip)
 Reset sensitivity values for the BaseAccelerometer.
static msg_t acc_set_full_scale (LSM303DLHCDriver *devp, lsm303dlhc_acc_fs_t fs)
 Changes the LSM303DLHCDriver accelerometer fullscale value.
static size_t comp_get_axes_number (void *ip)
 Return the number of axes of the BaseCompass.
static msg_t comp_read_raw (void *ip, int32_t axes[])
 Retrieves raw data from the BaseCompass.
static msg_t comp_read_cooked (void *ip, float axes[])
 Retrieves cooked data from the BaseCompass.
static msg_t comp_set_bias (void *ip, float *bp)
 Set bias values for the BaseCompass.
static msg_t comp_reset_bias (void *ip)
 Reset bias values for the BaseCompass.
static msg_t comp_set_sensivity (void *ip, float *sp)
 Set sensitivity values for the BaseCompass.
static msg_t comp_reset_sensivity (void *ip)
 Reset sensitivity values for the BaseCompass.
static msg_t comp_set_full_scale (LSM303DLHCDriver *devp, lsm303dlhc_comp_fs_t fs)
 Changes the LSM303DLHCDriver compass fullscale value.
void lsm303dlhcObjectInit (LSM303DLHCDriver *devp)
 Initializes an instance.
void lsm303dlhcStart (LSM303DLHCDriver *devp, const LSM303DLHCConfig *config)
 Configures and activates LSM303DLHC Complex Driver peripheral.
void lsm303dlhcStop (LSM303DLHCDriver *devp)
 Deactivates the LSM303DLHC Complex Driver peripheral.

Variables

static const struct LSM303DLHCVMT vmt_device
static const struct BaseAccelerometerVMT vmt_accelerometer
static const struct BaseCompassVMT vmt_compass

Macro Definition Documentation

◆ EX_LSM303DLHC_VERSION

#define EX_LSM303DLHC_VERSION   "1.1.2"

LSM303DLHC driver version string.

Definition at line 46 of file lsm303dlhc.h.

◆ EX_LSM303DLHC_MAJOR

#define EX_LSM303DLHC_MAJOR   1

LSM303DLHC driver version major number.

Definition at line 51 of file lsm303dlhc.h.

◆ EX_LSM303DLHC_MINOR

#define EX_LSM303DLHC_MINOR   1

LSM303DLHC driver version minor number.

Definition at line 56 of file lsm303dlhc.h.

◆ EX_LSM303DLHC_PATCH

#define EX_LSM303DLHC_PATCH   2

LSM303DLHC driver version patch number.

Definition at line 61 of file lsm303dlhc.h.

◆ LSM303DLHC_ACC_NUMBER_OF_AXES

#define LSM303DLHC_ACC_NUMBER_OF_AXES   3U

LSM303DLHC accelerometer subsystem characteristics.

Note
Sensitivity is expressed as milli-G/LSB whereas 1 milli-G = 0.00980665 m/s^2.
Bias is expressed as milli-G.

Definition at line 72 of file lsm303dlhc.h.

Referenced by acc_get_axes_number(), acc_read_cooked(), acc_read_raw(), acc_reset_bias(), acc_reset_sensivity(), acc_set_bias(), acc_set_full_scale(), acc_set_sensivity(), lsm303dlhcObjectInit(), and lsm303dlhcStart().

◆ LSM303DLHC_ACC_2G

#define LSM303DLHC_ACC_2G   2.0f

Definition at line 74 of file lsm303dlhc.h.

Referenced by acc_set_full_scale(), and lsm303dlhcStart().

◆ LSM303DLHC_ACC_4G

#define LSM303DLHC_ACC_4G   4.0f

Definition at line 75 of file lsm303dlhc.h.

Referenced by acc_set_full_scale(), and lsm303dlhcStart().

◆ LSM303DLHC_ACC_8G

#define LSM303DLHC_ACC_8G   8.0f

Definition at line 76 of file lsm303dlhc.h.

Referenced by acc_set_full_scale(), and lsm303dlhcStart().

◆ LSM303DLHC_ACC_16G

#define LSM303DLHC_ACC_16G   16.0f

Definition at line 77 of file lsm303dlhc.h.

Referenced by acc_set_full_scale(), and lsm303dlhcStart().

◆ LSM303DLHC_ACC_SENS_2G

#define LSM303DLHC_ACC_SENS_2G   0.0610f

Definition at line 79 of file lsm303dlhc.h.

Referenced by acc_reset_sensivity(), and lsm303dlhcStart().

◆ LSM303DLHC_ACC_SENS_4G

#define LSM303DLHC_ACC_SENS_4G   0.1221f

Definition at line 80 of file lsm303dlhc.h.

Referenced by acc_reset_sensivity(), and lsm303dlhcStart().

◆ LSM303DLHC_ACC_SENS_8G

#define LSM303DLHC_ACC_SENS_8G   0.2442f

Definition at line 81 of file lsm303dlhc.h.

Referenced by acc_reset_sensivity(), and lsm303dlhcStart().

◆ LSM303DLHC_ACC_SENS_16G

#define LSM303DLHC_ACC_SENS_16G   0.4884f

Definition at line 82 of file lsm303dlhc.h.

Referenced by acc_reset_sensivity(), and lsm303dlhcStart().

◆ LSM303DLHC_ACC_BIAS

#define LSM303DLHC_ACC_BIAS   0.0f

Definition at line 84 of file lsm303dlhc.h.

Referenced by acc_reset_bias(), and lsm303dlhcStart().

◆ LSM303DLHC_COMP_NUMBER_OF_AXES

#define LSM303DLHC_COMP_NUMBER_OF_AXES   3U

LSM303DLHC compass subsystem characteristics.

Note
Sensitivity is expressed as G/LSB whereas G stands for Gauss.
Bias is expressed as G.

Definition at line 94 of file lsm303dlhc.h.

Referenced by comp_get_axes_number(), comp_read_cooked(), comp_read_raw(), comp_reset_bias(), comp_reset_sensivity(), comp_set_bias(), comp_set_full_scale(), comp_set_sensivity(), lsm303dlhcObjectInit(), and lsm303dlhcStart().

◆ LSM303DLHC_COMP_1P3GA

#define LSM303DLHC_COMP_1P3GA   1.3f

Definition at line 96 of file lsm303dlhc.h.

Referenced by comp_set_full_scale(), and lsm303dlhcStart().

◆ LSM303DLHC_COMP_1P9GA

#define LSM303DLHC_COMP_1P9GA   1.9f

Definition at line 97 of file lsm303dlhc.h.

Referenced by comp_set_full_scale(), and lsm303dlhcStart().

◆ LSM303DLHC_COMP_2P5GA

#define LSM303DLHC_COMP_2P5GA   2.5f

Definition at line 98 of file lsm303dlhc.h.

Referenced by comp_set_full_scale(), and lsm303dlhcStart().

◆ LSM303DLHC_COMP_4P0GA

#define LSM303DLHC_COMP_4P0GA   4.0f

Definition at line 99 of file lsm303dlhc.h.

Referenced by comp_set_full_scale(), and lsm303dlhcStart().

◆ LSM303DLHC_COMP_4P7GA

#define LSM303DLHC_COMP_4P7GA   4.7f

Definition at line 100 of file lsm303dlhc.h.

Referenced by comp_set_full_scale(), and lsm303dlhcStart().

◆ LSM303DLHC_COMP_5P6GA

#define LSM303DLHC_COMP_5P6GA   5.6f

Definition at line 101 of file lsm303dlhc.h.

Referenced by comp_set_full_scale(), and lsm303dlhcStart().

◆ LSM303DLHC_COMP_8P1GA

#define LSM303DLHC_COMP_8P1GA   8.1f

Definition at line 102 of file lsm303dlhc.h.

Referenced by comp_set_full_scale(), and lsm303dlhcStart().

◆ LSM303DLHC_COMP_SENS_XY_1P3GA

#define LSM303DLHC_COMP_SENS_XY_1P3GA   0.000909f

Definition at line 104 of file lsm303dlhc.h.

Referenced by comp_reset_sensivity(), and lsm303dlhcStart().

◆ LSM303DLHC_COMP_SENS_XY_1P9GA

#define LSM303DLHC_COMP_SENS_XY_1P9GA   0.001169f

Definition at line 105 of file lsm303dlhc.h.

Referenced by comp_reset_sensivity(), and lsm303dlhcStart().

◆ LSM303DLHC_COMP_SENS_XY_2P5GA

#define LSM303DLHC_COMP_SENS_XY_2P5GA   0.0014925f

Definition at line 106 of file lsm303dlhc.h.

Referenced by comp_reset_sensivity(), and lsm303dlhcStart().

◆ LSM303DLHC_COMP_SENS_XY_4P0GA

#define LSM303DLHC_COMP_SENS_XY_4P0GA   0.0022222f

Definition at line 107 of file lsm303dlhc.h.

Referenced by comp_reset_sensivity(), and lsm303dlhcStart().

◆ LSM303DLHC_COMP_SENS_XY_4P7GA

#define LSM303DLHC_COMP_SENS_XY_4P7GA   0.0025000f

Definition at line 108 of file lsm303dlhc.h.

Referenced by comp_reset_sensivity(), and lsm303dlhcStart().

◆ LSM303DLHC_COMP_SENS_XY_5P6GA

#define LSM303DLHC_COMP_SENS_XY_5P6GA   0.0030303f

Definition at line 109 of file lsm303dlhc.h.

Referenced by comp_reset_sensivity(), and lsm303dlhcStart().

◆ LSM303DLHC_COMP_SENS_XY_8P1GA

#define LSM303DLHC_COMP_SENS_XY_8P1GA   0.0043478f

Definition at line 110 of file lsm303dlhc.h.

Referenced by comp_reset_sensivity(), and lsm303dlhcStart().

◆ LSM303DLHC_COMP_SENS_Z_1P3GA

#define LSM303DLHC_COMP_SENS_Z_1P3GA   0.0010204f

Definition at line 112 of file lsm303dlhc.h.

Referenced by comp_reset_sensivity(), and lsm303dlhcStart().

◆ LSM303DLHC_COMP_SENS_Z_1P9GA

#define LSM303DLHC_COMP_SENS_Z_1P9GA   0.0013071f

Definition at line 113 of file lsm303dlhc.h.

Referenced by comp_reset_sensivity(), and lsm303dlhcStart().

◆ LSM303DLHC_COMP_SENS_Z_2P5GA

#define LSM303DLHC_COMP_SENS_Z_2P5GA   0.0016666f

Definition at line 114 of file lsm303dlhc.h.

Referenced by comp_reset_sensivity(), and lsm303dlhcStart().

◆ LSM303DLHC_COMP_SENS_Z_4P0GA

#define LSM303DLHC_COMP_SENS_Z_4P0GA   0.0025000f

Definition at line 115 of file lsm303dlhc.h.

Referenced by comp_reset_sensivity(), and lsm303dlhcStart().

◆ LSM303DLHC_COMP_SENS_Z_4P7GA

#define LSM303DLHC_COMP_SENS_Z_4P7GA   0.0028169f

Definition at line 116 of file lsm303dlhc.h.

Referenced by comp_reset_sensivity(), and lsm303dlhcStart().

◆ LSM303DLHC_COMP_SENS_Z_5P6GA

#define LSM303DLHC_COMP_SENS_Z_5P6GA   0.0033898f

Definition at line 117 of file lsm303dlhc.h.

Referenced by comp_reset_sensivity(), and lsm303dlhcStart().

◆ LSM303DLHC_COMP_SENS_Z_8P1GA

#define LSM303DLHC_COMP_SENS_Z_8P1GA   0.0048780f

Definition at line 118 of file lsm303dlhc.h.

Referenced by comp_reset_sensivity(), and lsm303dlhcStart().

◆ LSM303DLHC_COMP_BIAS

#define LSM303DLHC_COMP_BIAS   0.0f

Definition at line 120 of file lsm303dlhc.h.

Referenced by comp_reset_bias(), and lsm303dlhcStart().

◆ LSM303DLHC_DI_MASK

#define LSM303DLHC_DI_MASK   0xFF

Definition at line 127 of file lsm303dlhc.h.

◆ LSM303DLHC_DI

#define LSM303DLHC_DI ( n)
Value:
(1 << n)

Definition at line 128 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_MASK

#define LSM303DLHC_AD_MASK   0x7F

Definition at line 129 of file lsm303dlhc.h.

◆ LSM303DLHC_AD

#define LSM303DLHC_AD ( n)
Value:
(1 << n)

Definition at line 130 of file lsm303dlhc.h.

◆ LSM303DLHC_MS

#define LSM303DLHC_MS   (1 << 7)

Definition at line 131 of file lsm303dlhc.h.

Referenced by lsm303dlhcI2CReadRegister(), and lsm303dlhcI2CWriteRegister().

◆ LSM303DLHC_AD_ACC_CTRL_REG1

#define LSM303DLHC_AD_ACC_CTRL_REG1   0x20

Definition at line 138 of file lsm303dlhc.h.

Referenced by lsm303dlhcStart(), and lsm303dlhcStop().

◆ LSM303DLHC_AD_ACC_CTRL_REG2

#define LSM303DLHC_AD_ACC_CTRL_REG2   0x21

Definition at line 139 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_CTRL_REG3

#define LSM303DLHC_AD_ACC_CTRL_REG3   0x22

Definition at line 140 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_CTRL_REG4

#define LSM303DLHC_AD_ACC_CTRL_REG4   0x23

Definition at line 141 of file lsm303dlhc.h.

Referenced by acc_set_full_scale().

◆ LSM303DLHC_AD_ACC_CTRL_REG5

#define LSM303DLHC_AD_ACC_CTRL_REG5   0x24

Definition at line 142 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_CTRL_REG6

#define LSM303DLHC_AD_ACC_CTRL_REG6   0x25

Definition at line 143 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_REFERENCE

#define LSM303DLHC_AD_ACC_REFERENCE   0x26

Definition at line 144 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_STATUS_REG

#define LSM303DLHC_AD_ACC_STATUS_REG   0x27

Definition at line 145 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_OUT_X_L

#define LSM303DLHC_AD_ACC_OUT_X_L   0x28

Definition at line 146 of file lsm303dlhc.h.

Referenced by acc_read_raw().

◆ LSM303DLHC_AD_ACC_OUT_X_H

#define LSM303DLHC_AD_ACC_OUT_X_H   0x29

Definition at line 147 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_OUT_Y_L

#define LSM303DLHC_AD_ACC_OUT_Y_L   0x2A

Definition at line 148 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_OUT_Y_H

#define LSM303DLHC_AD_ACC_OUT_Y_H   0x2B

Definition at line 149 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_OUT_Z_L

#define LSM303DLHC_AD_ACC_OUT_Z_L   0x2C

Definition at line 150 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_OUT_Z_H

#define LSM303DLHC_AD_ACC_OUT_Z_H   0x2D

Definition at line 151 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_FIFO_CTRL_REG

#define LSM303DLHC_AD_ACC_FIFO_CTRL_REG   0x2E

Definition at line 152 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_FIFO_SRC_REG

#define LSM303DLHC_AD_ACC_FIFO_SRC_REG   0x2F

Definition at line 153 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_INT1_CFG

#define LSM303DLHC_AD_ACC_INT1_CFG   0x30

Definition at line 154 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_INT1_SRC

#define LSM303DLHC_AD_ACC_INT1_SRC   0x31

Definition at line 155 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_INT1_THS

#define LSM303DLHC_AD_ACC_INT1_THS   0x32

Definition at line 156 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_INT1_DURATION

#define LSM303DLHC_AD_ACC_INT1_DURATION   0x33

Definition at line 157 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_INT2_CFG

#define LSM303DLHC_AD_ACC_INT2_CFG   0x34

Definition at line 158 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_INT2_SRC

#define LSM303DLHC_AD_ACC_INT2_SRC   0x35

Definition at line 159 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_INT2_THS

#define LSM303DLHC_AD_ACC_INT2_THS   0x36

Definition at line 160 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_INT2_DURATION

#define LSM303DLHC_AD_ACC_INT2_DURATION   0x37

Definition at line 161 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_CLICK_CFG

#define LSM303DLHC_AD_ACC_CLICK_CFG   0x38

Definition at line 162 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_CLICK_SRC

#define LSM303DLHC_AD_ACC_CLICK_SRC   0x39

Definition at line 163 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_CLICK_THS

#define LSM303DLHC_AD_ACC_CLICK_THS   0x3A

Definition at line 164 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_TIME_LIMIT

#define LSM303DLHC_AD_ACC_TIME_LIMIT   0x3B

Definition at line 165 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_TIME_LATENCY

#define LSM303DLHC_AD_ACC_TIME_LATENCY   0x3C

Definition at line 166 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_ACC_TIME_WINDOW

#define LSM303DLHC_AD_ACC_TIME_WINDOW   0x3D

Definition at line 167 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_COMP_CRA_REG

#define LSM303DLHC_AD_COMP_CRA_REG   0x00

Definition at line 168 of file lsm303dlhc.h.

Referenced by lsm303dlhcStart().

◆ LSM303DLHC_AD_COMP_CRB_REG

#define LSM303DLHC_AD_COMP_CRB_REG   0x01

Definition at line 169 of file lsm303dlhc.h.

Referenced by comp_set_full_scale().

◆ LSM303DLHC_AD_COMP_MR_REG

#define LSM303DLHC_AD_COMP_MR_REG   0x02

Definition at line 170 of file lsm303dlhc.h.

Referenced by lsm303dlhcStop().

◆ LSM303DLHC_AD_COMP_OUT_X_H

#define LSM303DLHC_AD_COMP_OUT_X_H   0x03

Definition at line 171 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_COMP_OUT_X_L

#define LSM303DLHC_AD_COMP_OUT_X_L   0x04

Definition at line 172 of file lsm303dlhc.h.

Referenced by comp_read_raw().

◆ LSM303DLHC_AD_COMP_OUT_Z_H

#define LSM303DLHC_AD_COMP_OUT_Z_H   0x05

Definition at line 173 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_COMP_OUT_Z_L

#define LSM303DLHC_AD_COMP_OUT_Z_L   0x06

Definition at line 174 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_COMP_OUT_Y_H

#define LSM303DLHC_AD_COMP_OUT_Y_H   0x07

Definition at line 175 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_COMP_OUT_Y_L

#define LSM303DLHC_AD_COMP_OUT_Y_L   0x08

Definition at line 176 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_COMP_SR_REG

#define LSM303DLHC_AD_COMP_SR_REG   0x09

Definition at line 177 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_COMP_IRA_REG

#define LSM303DLHC_AD_COMP_IRA_REG   0x0A

Definition at line 178 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_COMP_IRB_REG

#define LSM303DLHC_AD_COMP_IRB_REG   0x0B

Definition at line 179 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_COMP_IRC_REG

#define LSM303DLHC_AD_COMP_IRC_REG   0x0C

Definition at line 180 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_COMP_TEMP_OUT_H

#define LSM303DLHC_AD_COMP_TEMP_OUT_H   0x31

Definition at line 181 of file lsm303dlhc.h.

◆ LSM303DLHC_AD_COMP_TEMP_OUT_L

#define LSM303DLHC_AD_COMP_TEMP_OUT_L   0x32

Definition at line 182 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG1_A_MASK

#define LSM303DLHC_CTRL_REG1_A_MASK   0xFF

Definition at line 189 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG1_A_XEN

#define LSM303DLHC_CTRL_REG1_A_XEN   (1 << 0)

Definition at line 190 of file lsm303dlhc.h.

Referenced by lsm303dlhcStart().

◆ LSM303DLHC_CTRL_REG1_A_YEN

#define LSM303DLHC_CTRL_REG1_A_YEN   (1 << 1)

Definition at line 191 of file lsm303dlhc.h.

Referenced by lsm303dlhcStart().

◆ LSM303DLHC_CTRL_REG1_A_ZEN

#define LSM303DLHC_CTRL_REG1_A_ZEN   (1 << 2)

Definition at line 192 of file lsm303dlhc.h.

Referenced by lsm303dlhcStart().

◆ LSM303DLHC_CTRL_REG1_A_LPEN

#define LSM303DLHC_CTRL_REG1_A_LPEN   (1 << 3)

Definition at line 193 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG1_A_ODR0

#define LSM303DLHC_CTRL_REG1_A_ODR0   (1 << 4)

Definition at line 194 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG1_A_ODR1

#define LSM303DLHC_CTRL_REG1_A_ODR1   (1 << 5)

Definition at line 195 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG1_A_ODR2

#define LSM303DLHC_CTRL_REG1_A_ODR2   (1 << 6)

Definition at line 196 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG1_A_ODR3

#define LSM303DLHC_CTRL_REG1_A_ODR3   (1 << 7)

Definition at line 197 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG2_A_MASK

#define LSM303DLHC_CTRL_REG2_A_MASK   0xFF

Definition at line 204 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG2_A_HPIS1

#define LSM303DLHC_CTRL_REG2_A_HPIS1   (1 << 0)

Definition at line 205 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG2_A_HPIS2

#define LSM303DLHC_CTRL_REG2_A_HPIS2   (1 << 1)

Definition at line 206 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG2_A_HPCLICK

#define LSM303DLHC_CTRL_REG2_A_HPCLICK   (1 << 2)

Definition at line 207 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG2_A_FDS

#define LSM303DLHC_CTRL_REG2_A_FDS   (1 << 3)

Definition at line 208 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG2_A_HPCF1

#define LSM303DLHC_CTRL_REG2_A_HPCF1   (1 << 4)

Definition at line 209 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG2_A_HPCF2

#define LSM303DLHC_CTRL_REG2_A_HPCF2   (1 << 5)

Definition at line 210 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG2_A_HPM0

#define LSM303DLHC_CTRL_REG2_A_HPM0   (1 << 6)

Definition at line 211 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG2_A_HPM1

#define LSM303DLHC_CTRL_REG2_A_HPM1   (1 << 7)

Definition at line 212 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG3_A_MASK

#define LSM303DLHC_CTRL_REG3_A_MASK   0xFD

Definition at line 219 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG3_A_I1_OVERRUN

#define LSM303DLHC_CTRL_REG3_A_I1_OVERRUN   (1 << 1)

Definition at line 220 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG3_A_I1_WTM

#define LSM303DLHC_CTRL_REG3_A_I1_WTM   (1 << 2)

Definition at line 221 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG3_A_I1_DRDY2

#define LSM303DLHC_CTRL_REG3_A_I1_DRDY2   (1 << 3)

Definition at line 222 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG3_A_I1_DRDY1

#define LSM303DLHC_CTRL_REG3_A_I1_DRDY1   (1 << 4)

Definition at line 223 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG3_A_I1_AOI2

#define LSM303DLHC_CTRL_REG3_A_I1_AOI2   (1 << 5)

Definition at line 224 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG3_A_I1_AOI1

#define LSM303DLHC_CTRL_REG3_A_I1_AOI1   (1 << 6)

Definition at line 225 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG3_A_I1_CLICK

#define LSM303DLHC_CTRL_REG3_A_I1_CLICK   (1 << 7)

Definition at line 226 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG4_A_MASK

#define LSM303DLHC_CTRL_REG4_A_MASK   0xF9

Definition at line 233 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG4_A_SIM

#define LSM303DLHC_CTRL_REG4_A_SIM   (1 << 0)

Definition at line 234 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG4_A_HR

#define LSM303DLHC_CTRL_REG4_A_HR   (1 << 3)

Definition at line 235 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG4_A_FS_MASK

#define LSM303DLHC_CTRL_REG4_A_FS_MASK   0x30

Definition at line 236 of file lsm303dlhc.h.

Referenced by acc_set_full_scale().

◆ LSM303DLHC_CTRL_REG4_A_FS0

#define LSM303DLHC_CTRL_REG4_A_FS0   (1 << 4)

Definition at line 237 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG4_A_FS1

#define LSM303DLHC_CTRL_REG4_A_FS1   (1 << 5)

Definition at line 238 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG4_A_BLE

#define LSM303DLHC_CTRL_REG4_A_BLE   (1 << 6)

Definition at line 239 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG4_A_BDU

#define LSM303DLHC_CTRL_REG4_A_BDU   (1 << 7)

Definition at line 240 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG5_A_MASK

#define LSM303DLHC_CTRL_REG5_A_MASK   0xCF

Definition at line 247 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG5_A_D4D_INT2

#define LSM303DLHC_CTRL_REG5_A_D4D_INT2   (1 << 0)

Definition at line 248 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG5_A_LIR_INT2

#define LSM303DLHC_CTRL_REG5_A_LIR_INT2   (1 << 1)

Definition at line 249 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG5_A_D4D_INT1

#define LSM303DLHC_CTRL_REG5_A_D4D_INT1   (1 << 2)

Definition at line 250 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG5_A_LIR_INT1

#define LSM303DLHC_CTRL_REG5_A_LIR_INT1   (1 << 3)

Definition at line 251 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG5_A_FIFO_EN

#define LSM303DLHC_CTRL_REG5_A_FIFO_EN   (1 << 6)

Definition at line 252 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG5_A_BOOT

#define LSM303DLHC_CTRL_REG5_A_BOOT   (1 << 7)

Definition at line 253 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG6_A_MASK

#define LSM303DLHC_CTRL_REG6_A_MASK   0xFA

Definition at line 260 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG6_A_H_LACTIVE

#define LSM303DLHC_CTRL_REG6_A_H_LACTIVE   (1 << 1)

Definition at line 261 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG6_A_P2_ACT

#define LSM303DLHC_CTRL_REG6_A_P2_ACT   (1 << 3)

Definition at line 262 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG6_A_BOOT_I1

#define LSM303DLHC_CTRL_REG6_A_BOOT_I1   (1 << 4)

Definition at line 263 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG6_A_I2_INT2

#define LSM303DLHC_CTRL_REG6_A_I2_INT2   (1 << 5)

Definition at line 264 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG6_A_I2_INT1

#define LSM303DLHC_CTRL_REG6_A_I2_INT1   (1 << 6)

Definition at line 265 of file lsm303dlhc.h.

◆ LSM303DLHC_CTRL_REG6_A_I2_CLICKEN

#define LSM303DLHC_CTRL_REG6_A_I2_CLICKEN   (1 << 7)

Definition at line 266 of file lsm303dlhc.h.

◆ LSM303DLHC_CRA_REG_M_MASK

#define LSM303DLHC_CRA_REG_M_MASK   0x9C

Definition at line 273 of file lsm303dlhc.h.

◆ LSM303DLHC_CRA_REG_M_DO0

#define LSM303DLHC_CRA_REG_M_DO0   (1 << 2)

Definition at line 274 of file lsm303dlhc.h.

◆ LSM303DLHC_CRA_REG_M_DO1

#define LSM303DLHC_CRA_REG_M_DO1   (1 << 3)

Definition at line 275 of file lsm303dlhc.h.

◆ LSM303DLHC_CRA_REG_M_DO2

#define LSM303DLHC_CRA_REG_M_DO2   (1 << 4)

Definition at line 276 of file lsm303dlhc.h.

◆ LSM303DLHC_CRA_REG_M_TEMP_EN

#define LSM303DLHC_CRA_REG_M_TEMP_EN   (1 << 7)

Definition at line 277 of file lsm303dlhc.h.

◆ LSM303DLHC_CRB_REG_M_MASK

#define LSM303DLHC_CRB_REG_M_MASK   0xE0

Definition at line 284 of file lsm303dlhc.h.

◆ LSM303DLHC_CRB_REG_M_GN_MASK

#define LSM303DLHC_CRB_REG_M_GN_MASK   0xE0

Definition at line 285 of file lsm303dlhc.h.

Referenced by comp_set_full_scale().

◆ LSM303DLHC_CRB_REG_M_GN0

#define LSM303DLHC_CRB_REG_M_GN0   (1 << 5)

Definition at line 286 of file lsm303dlhc.h.

◆ LSM303DLHC_CRB_REG_M_GN1

#define LSM303DLHC_CRB_REG_M_GN1   (1 << 6)

Definition at line 287 of file lsm303dlhc.h.

◆ LSM303DLHC_CRB_REG_M_GN2

#define LSM303DLHC_CRB_REG_M_GN2   (1 << 7)

Definition at line 288 of file lsm303dlhc.h.

◆ LSM303DLHC_MR_REG_M_MASK

#define LSM303DLHC_MR_REG_M_MASK   0x03

Definition at line 295 of file lsm303dlhc.h.

◆ LSM303DLHC_MR_REG_M_MD0

#define LSM303DLHC_MR_REG_M_MD0   (1 << 0)

Definition at line 296 of file lsm303dlhc.h.

◆ LSM303DLHC_MR_REG_M_MD1

#define LSM303DLHC_MR_REG_M_MD1   (1 << 1)

Definition at line 297 of file lsm303dlhc.h.

◆ LSM303DLHC_USE_SPI

#define LSM303DLHC_USE_SPI   FALSE

LSM303DLHC SPI interface switch.

If set to TRUE the support for SPI is included.

Note
The default is FALSE.

Definition at line 314 of file lsm303dlhc.h.

◆ LSM303DLHC_SHARED_SPI

#define LSM303DLHC_SHARED_SPI   FALSE

LSM303DLHC shared SPI switch.

If set to TRUE the device acquires SPI bus ownership on each transaction.

Note
The default is FALSE. Requires SPI_USE_MUTUAL_EXCLUSION.

Definition at line 324 of file lsm303dlhc.h.

◆ LSM303DLHC_USE_I2C

#define LSM303DLHC_USE_I2C   TRUE

LSM303DLHC I2C interface switch.

If set to TRUE the support for I2C is included.

Note
The default is TRUE.

Definition at line 333 of file lsm303dlhc.h.

◆ LSM303DLHC_SHARED_I2C

#define LSM303DLHC_SHARED_I2C   FALSE

LSM303DLHC shared I2C switch.

If set to TRUE the device acquires I2C bus ownership on each transaction.

Note
The default is FALSE. Requires I2C_USE_MUTUAL_EXCLUSION.

Definition at line 343 of file lsm303dlhc.h.

◆ LSM303DLHC_USE_ADVANCED

#define LSM303DLHC_USE_ADVANCED   FALSE

LSM303DLHC advanced configurations switch.

If set to TRUE more configurations are available.

Note
The default is FALSE.

Definition at line 352 of file lsm303dlhc.h.

◆ _lsm303dlhc_methods_alone

#define _lsm303dlhc_methods_alone
Value:
/* Change full scale value of LSM303DLHC accelerometer subsystem.*/ \
/* Change full scale value of LSM303DLHC compass subsystem.*/ \
static msg_t acc_set_full_scale(ADXL355Driver *devp, adxl355_acc_fs_t fs)
Changes the ADXL355Driver accelerometer fullscale value.
Definition adxl355.c:301
static msg_t comp_set_full_scale(LIS3MDLDriver *devp, lis3mdl_comp_fs_t fs)
Changes the LIS3MDLDriver compass fullscale value.
Definition lis3mdl.c:345
lsm303dlhc_comp_fs_t
LSM303DLHC compass subsystem full scale.
Definition lsm303dlhc.h:480
lsm303dlhc_acc_fs_t
LSM303DLHC accelerometer subsystem full scale.
Definition lsm303dlhc.h:403
LSM303DLHC 6-axis accelerometer/compass class.
Definition lsm303dlhc.h:653

LSM303DLHC specific methods.

Definition at line 600 of file lsm303dlhc.h.

◆ _lsm303dlhc_methods

#define _lsm303dlhc_methods
Value:
_base_object_methods \
_lsm303dlhc_methods_alone

LSM303DLHC specific methods with inherited ones.

Definition at line 611 of file lsm303dlhc.h.

◆ _lsm303dlhc_data

#define _lsm303dlhc_data
Value:
/* Driver state.*/ \
/* Current configuration data.*/ \
const LSM303DLHCConfig *config; \
/* Accelerometer subsystem axes number.*/ \
size_t accaxes; \
/* Accelerometer subsystem current sensitivity.*/ \
float accsensitivity[LSM303DLHC_ACC_NUMBER_OF_AXES]; \
/* Accelerometer subsystem current bias .*/ \
/* Accelerometer subsystem current full scale value.*/ \
float accfullscale; \
/* Compass subsystem axes number.*/ \
size_t compaxes; \
/* Compass subsystem current sensitivity.*/ \
float compsensitivity[LSM303DLHC_COMP_NUMBER_OF_AXES];\
/* Compass subsystem current bias.*/ \
float compbias[LSM303DLHC_COMP_NUMBER_OF_AXES]; \
/* Compass subsystem current full scale value.*/ \
float compfullscale;
#define _base_sensor_data
BaseSensor specific data.
Definition ex_sensors.h:74
#define LSM303DLHC_ACC_NUMBER_OF_AXES
LSM303DLHC accelerometer subsystem characteristics.
Definition lsm303dlhc.h:72
lsm303dlhc_state_t
Driver state machine possible states.
Definition lsm303dlhc.h:521
#define LSM303DLHC_COMP_NUMBER_OF_AXES
LSM303DLHC compass subsystem characteristics.
Definition lsm303dlhc.h:94
LSM303DLHC configuration structure.
Definition lsm303dlhc.h:530

LSM303DLHCDriver specific data.

Definition at line 627 of file lsm303dlhc.h.

◆ lsm303dlhcAccelerometerGetAxesNumber

#define lsm303dlhcAccelerometerGetAxesNumber ( devp)
Value:
accelerometerGetAxesNumber(&((devp)->acc_if))
#define accelerometerGetAxesNumber(ip)
Accelerometer get axes number.

Return the number of axes of the BaseAccelerometer.

Parameters
[in]devppointer to LSM303DLHCDriver.
Returns
the number of axes.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 677 of file lsm303dlhc.h.

◆ lsm303dlhcAccelerometerReadRaw

#define lsm303dlhcAccelerometerReadRaw ( devp,
axes )
Value:
accelerometerReadRaw(&((devp)->acc_if), axes)
#define accelerometerReadRaw(ip, dp)
Accelerometer read raw data.

Retrieves raw data from the BaseAccelerometer.

Note
This data is retrieved from MEMS register without any algebraical manipulation.
The axes array must be at least the same size of the BaseAccelerometer axes number.
Parameters
[in]devppointer to LSM303DLHCDriver.
[out]axesa buffer which would be filled with raw data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 698 of file lsm303dlhc.h.

◆ lsm303dlhcAccelerometerReadCooked

#define lsm303dlhcAccelerometerReadCooked ( devp,
axes )
Value:
accelerometerReadCooked(&((devp)->acc_if), axes)
#define accelerometerReadCooked(ip, dp)
Accelerometer read cooked data.

Retrieves cooked data from the BaseAccelerometer.

Note
This data is manipulated according to the formula cooked = (raw * sensitivity) - bias.
Final data is expressed as milli-G.
The axes array must be at least the same size of the BaseAccelerometer axes number.
Parameters
[in]devppointer to LSM303DLHCDriver.
[out]axesa buffer which would be filled with cooked data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 720 of file lsm303dlhc.h.

◆ lsm303dlhcAccelerometerSetBias

#define lsm303dlhcAccelerometerSetBias ( devp,
bp )
Value:
accelerometerSetBias(&((devp)->acc_if), bp)
#define accelerometerSetBias(ip, bp)
Updates accelerometer bias data from received buffer.

Set bias values for the BaseAccelerometer.

Note
Bias must be expressed as milli-G.
The bias buffer must be at least the same size of the BaseAccelerometer axes number.
Parameters
[in]devppointer to LSM303DLHCDriver.
[in]bpa buffer which contains biases.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 737 of file lsm303dlhc.h.

◆ lsm303dlhcAccelerometerResetBias

#define lsm303dlhcAccelerometerResetBias ( devp)
Value:
accelerometerResetBias(&((devp)->acc_if))
#define accelerometerResetBias(ip)
Reset accelerometer bias data restoring it to zero.

Reset bias values for the BaseAccelerometer.

Note
Default biases value are obtained from device datasheet when available otherwise they are considered zero.
Parameters
[in]devppointer to LSM303DLHCDriver.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 752 of file lsm303dlhc.h.

◆ lsm303dlhcAccelerometerSetSensitivity

#define lsm303dlhcAccelerometerSetSensitivity ( devp,
sp )
Value:
accelerometerSetSensitivity(&((devp)->acc_if), sp)
#define accelerometerSetSensitivity(ip, sp)
Updates accelerometer sensitivity data from received buffer.

Set sensitivity values for the BaseAccelerometer.

Note
Sensitivity must be expressed as milli-G/LSB.
The sensitivity buffer must be at least the same size of the BaseAccelerometer axes number.
Parameters
[in]devppointer to LSM303DLHCDriver.
[in]spa buffer which contains sensitivities.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 769 of file lsm303dlhc.h.

◆ lsm303dlhcAccelerometerResetSensitivity

#define lsm303dlhcAccelerometerResetSensitivity ( devp)
Value:
accelerometerResetSensitivity(&((devp)->acc_if))
#define accelerometerResetSensitivity(ip)
Reset accelerometer sensitivity data restoring it to its typical value.

Reset sensitivity values for the BaseAccelerometer.

Note
Default sensitivities value are obtained from device datasheet.
Parameters
[in]devppointer to LSM303DLHCDriver.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETotherwise.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 784 of file lsm303dlhc.h.

◆ lsm303dlhcAccelerometerSetFullScale

#define lsm303dlhcAccelerometerSetFullScale ( devp,
fs )
Value:
(devp)->vmt->acc_set_full_scale(devp, fs)
static const struct EFlashDriverVMT vmt
Definition hal_efl.c:71

Changes the LSM303DLHCDriver accelerometer fullscale value.

Note
This function also rescale sensitivities and biases based on previous and next fullscale value.
A recalibration is highly suggested after calling this function.
Parameters
[in]devppointer to LSM303DLHCDriver.
[in]fsnew fullscale value.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETotherwise.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 802 of file lsm303dlhc.h.

◆ lsm303dlhcCompassGetAxesNumber

#define lsm303dlhcCompassGetAxesNumber ( devp)
Value:
compassGetAxesNumber(&((devp)->comp_if))
#define compassGetAxesNumber(ip)
Compass get axes number.
Definition ex_compass.h:107

Return the number of axes of the BaseCompass.

Parameters
[in]devppointer to LSM303DLHCDriver.
Returns
the number of axes.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 814 of file lsm303dlhc.h.

◆ lsm303dlhcCompassReadRaw

#define lsm303dlhcCompassReadRaw ( devp,
axes )
Value:
compassReadRaw(&((devp)->comp_if), axes)
#define compassReadRaw(ip, dp)
Compass read raw data.
Definition ex_compass.h:122

Retrieves raw data from the BaseCompass.

Note
This data is retrieved from MEMS register without any algebraical manipulation.
The axes array must be at least the same size of the BaseCompass axes number.
Parameters
[in]devppointer to BaseCompass interface.
[out]axesa buffer which would be filled with raw data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 835 of file lsm303dlhc.h.

◆ lsm303dlhcCompassReadCooked

#define lsm303dlhcCompassReadCooked ( devp,
axes )
Value:
compassReadCooked(&((devp)->comp_if), axes)
#define compassReadCooked(ip, dp)
Compass read cooked data.
Definition ex_compass.h:137

Retrieves cooked data from the BaseCompass.

Note
This data is manipulated according to the formula cooked = (raw * sensitivity) - bias.
Final data is expressed as G.
The axes array must be at least the same size of the BaseCompass axes number.
Parameters
[in]devppointer to BaseCompass interface.
[out]axesa buffer which would be filled with cooked data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 857 of file lsm303dlhc.h.

◆ lsm303dlhcCompassSetBias

#define lsm303dlhcCompassSetBias ( devp,
bp )
Value:
compassSetBias(&((devp)->comp_if), bp)
#define compassSetBias(ip, bp)
Updates compass bias data from received buffer.
Definition ex_compass.h:154

Set bias values for the BaseCompass.

Note
Bias must be expressed as G.
The bias buffer must be at least the same size of the BaseCompass axes number.
Parameters
[in]devppointer to BaseCompass interface.
[in]bpa buffer which contains biases.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 874 of file lsm303dlhc.h.

◆ lsm303dlhcCompassResetBias

#define lsm303dlhcCompassResetBias ( devp)
Value:
compassResetBias(&((devp)->comp_if))
#define compassResetBias(ip)
Reset compass bias data restoring it to zero.
Definition ex_compass.h:168

Reset bias values for the BaseCompass.

Note
Default biases value are obtained from device datasheet when available otherwise they are considered zero.
Parameters
[in]devppointer to LSM303DLHCDriver.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 889 of file lsm303dlhc.h.

◆ lsm303dlhcCompassSetSensitivity

#define lsm303dlhcCompassSetSensitivity ( devp,
sp )
Value:
compassSetSensitivity(&((devp)->comp_if), sp)
#define compassSetSensitivity(ip, sp)
Updates compass sensitivity data from received buffer.
Definition ex_compass.h:185

Set sensitivity values for the BaseCompass.

Note
Sensitivity must be expressed as G/LSB.
The sensitivity buffer must be at least the same size of the BaseCompass axes number.
Parameters
[in]devppointer to LSM303DLHCDriver.
[in]spa buffer which contains sensitivities.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 906 of file lsm303dlhc.h.

◆ lsm303dlhcCompassResetSensitivity

#define lsm303dlhcCompassResetSensitivity ( devp)
Value:
compassResetSensitivity(&((devp)->comp_if))
#define compassResetSensitivity(ip)
Reset compass sensitivity data restoring it to its typical value.
Definition ex_compass.h:200

Reset sensitivity values for the BaseCompass.

Note
Default sensitivities value are obtained from device datasheet.
Parameters
[in]devppointer to LSM303DLHCDriver.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETotherwise.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 921 of file lsm303dlhc.h.

◆ lsm303dlhcCompassSetFullScale

#define lsm303dlhcCompassSetFullScale ( devp,
fs )
Value:
(devp)->vmt->comp_set_full_scale(devp, fs)

Changes the LSM303DLHCDriver compass fullscale value.

Note
This function also rescale sensitivities and biases based on previous and next fullscale value.
A recalibration is highly suggested after calling this function.
Parameters
[in]devppointer to LSM303DLHCDriver.
[in]fsnew fullscale value.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETotherwise.
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 939 of file lsm303dlhc.h.

Typedef Documentation

◆ LSM303DLHCDriver

typedef struct LSM303DLHCDriver LSM303DLHCDriver

Structure representing a LSM303DLHC driver.

Definition at line 398 of file lsm303dlhc.h.

Enumeration Type Documentation

◆ lsm303dlhc_sad_t

Accelerometer and Compass Slave Address.

Enumerator
LSM303DLHC_SAD_ACC 

SAD for accelerometer.

LSM303DLHC_SAD_COMP 

SAD for compass.

Definition at line 48 of file lsm303dlhc.c.

◆ lsm303dlhc_acc_fs_t

LSM303DLHC accelerometer subsystem full scale.

Enumerator
LSM303DLHC_ACC_FS_2G 

Full scale �2g.

LSM303DLHC_ACC_FS_4G 

Full scale �4g.

LSM303DLHC_ACC_FS_8G 

Full scale �8g.

LSM303DLHC_ACC_FS_16G 

Full scale �16g.

Definition at line 403 of file lsm303dlhc.h.

◆ lsm303dlhc_acc_odr_t

LSM303DLHC accelerometer subsystem output data rate.

Enumerator
LSM303DLHC_ACC_ODR_PD 

Power down

LSM303DLHC_ACC_ODR_1Hz 

ODR 1 Hz

LSM303DLHC_ACC_ODR_10Hz 

ODR 10 Hz

LSM303DLHC_ACC_ODR_25Hz 

ODR 25 Hz

LSM303DLHC_ACC_ODR_50Hz 

ODR 50 Hz

LSM303DLHC_ACC_ODR_100Hz 

ODR 100 Hz

LSM303DLHC_ACC_ODR_200Hz 

ODR 200 Hz

LSM303DLHC_ACC_ODR_400Hz 

ODR 400 Hz

LSM303DLHC_ACC_ODR_1620Hz 

ODR 1620 Hz (LP only)

LSM303DLHC_ACC_ODR_1344Hz 

ODR 1344 Hz or 5376 Hz in LP

Definition at line 413 of file lsm303dlhc.h.

◆ lsm303dlhc_acc_ae_t

LSM303DLHC accelerometer subsystem axes enabling.

Enumerator
LSM303DLHC_ACC_AE_DISABLED 

All axes disabled.

LSM303DLHC_ACC_AE_X 

Only X-axis enabled.

LSM303DLHC_ACC_AE_Y 

Only Y-axis enabled.

LSM303DLHC_ACC_AE_XY 

X and Y axes enabled.

LSM303DLHC_ACC_AE_Z 

Only Z-axis enabled.

LSM303DLHC_ACC_AE_XZ 

X and Z axes enabled.

LSM303DLHC_ACC_AE_YZ 

Y and Z axes enabled.

LSM303DLHC_ACC_AE_XYZ 

All axes enabled.

Definition at line 429 of file lsm303dlhc.h.

◆ lsm303dlhc_acc_lp_t

LSM303DLHC accelerometer subsystem low power mode.

Enumerator
LSM303DLHC_ACC_LP_DISABLED 

Low power mode disabled.

LSM303DLHC_ACC_LP_ENABLED 

Low power mode enabled.

Definition at line 443 of file lsm303dlhc.h.

◆ lsm303dlhc_acc_hr_t

LSM303DLHC accelerometer subsystem high resolution mode.

Enumerator
LSM303DLHC_ACC_HR_DISABLED 

High resolution mode disabled.

LSM303DLHC_ACC_HR_ENABLED 

High resolution mode enabled.

Definition at line 451 of file lsm303dlhc.h.

◆ lsm303dlhc_acc_bdu_t

LSM303DLHC accelerometer subsystem block data update.

Enumerator
LSM303DLHC_ACC_BDU_CONT 

Continuous update

LSM303DLHC_ACC_BDU_BLOCK 

Update blocked

Definition at line 459 of file lsm303dlhc.h.

◆ lsm303dlhc_acc_end_t

LSM303DLHC accelerometer endianness.

Enumerator
LSM303DLHC_ACC_END_LITTLE 

Little Endian

LSM303DLHC_ACC_END_BIG 

Big Endian

Definition at line 467 of file lsm303dlhc.h.

◆ lsm303dlhc_comp_fs_t

LSM303DLHC compass subsystem full scale.

Enumerator
LSM303DLHC_COMP_FS_1P3GA 

Full scale �1.3 Gauss

LSM303DLHC_COMP_FS_1P9GA 

Full scale �1.9 Gauss

LSM303DLHC_COMP_FS_2P5GA 

Full scale �2.5 Gauss

LSM303DLHC_COMP_FS_4P0GA 

Full scale �4.0 Gauss

LSM303DLHC_COMP_FS_4P7GA 

Full scale �4.7 Gauss

LSM303DLHC_COMP_FS_5P6GA 

Full scale �5.6 Gauss

LSM303DLHC_COMP_FS_8P1GA 

Full scale �8.1 Gauss

Definition at line 480 of file lsm303dlhc.h.

◆ lsm303dlhc_comp_odr_t

LSM303DLHC compass subsystem output data rate.

Enumerator
LSM303DLHC_COMP_ODR_0P75HZ 

ODR 0.75 Hz

LSM303DLHC_COMP_ODR_1P5HZ 

ODR 1.5 Hz

LSM303DLHC_COMP_ODR_3P0HZ 

ODR 3 Hz

LSM303DLHC_COMP_ODR_7P5HZ 

ODR 7.5 Hz

LSM303DLHC_COMP_ODR_15HZ 

ODR 15 Hz

LSM303DLHC_COMP_ODR_30HZ 

ODR 30 Hz

LSM303DLHC_COMP_ODR_75HZ 

ODR 75 Hz

LSM303DLHC_COMP_ODR_220HZ 

ODR 220 Hz

Definition at line 493 of file lsm303dlhc.h.

◆ lsm303dlhc_comp_md_t

LSM303DLHC compass subsystem working mode.

Enumerator
LSM303DLHC_COMP_MD_CONT 

Continuous-Conversion Mode

LSM303DLHC_COMP_MD_BLOCK 

Single-Conversion Mode

LSM303DLHC_COMP_MD_SLEEP 

Sleep Mode

Definition at line 507 of file lsm303dlhc.h.

◆ lsm303dlhc_state_t

Driver state machine possible states.

Enumerator
LSM303DLHC_UNINIT 

Not initialized.

LSM303DLHC_STOP 

Stopped.

LSM303DLHC_READY 

Ready.

Definition at line 521 of file lsm303dlhc.h.

Function Documentation

◆ lsm303dlhcI2CReadRegister()

msg_t lsm303dlhcI2CReadRegister ( I2CDriver * i2cp,
lsm303dlhc_sad_t sad,
uint8_t reg,
uint8_t * rxbuf,
size_t n )
static

Reads registers value using I2C.

Precondition
The I2C interface must be initialized and the driver started.
Note
IF_ADD_INC bit must be 1 in CTRL_REG8.
Parameters
[in]i2cppointer to the I2C interface.
[in]sadslave address without R bit.
[in]regfirst sub-register address.
[in]rxbufreceiving buffer.
[in]nsize of rxbuf.
Returns
the operation status.

Definition at line 69 of file lsm303dlhc.c.

References i2cMasterTransmitTimeout(), LSM303DLHC_MS, and TIME_INFINITE.

Referenced by acc_read_raw(), acc_set_full_scale(), comp_read_raw(), and comp_set_full_scale().

Here is the call graph for this function:

◆ lsm303dlhcI2CWriteRegister()

msg_t lsm303dlhcI2CWriteRegister ( I2CDriver * i2cp,
lsm303dlhc_sad_t sad,
uint8_t * txbuf,
size_t n )
static

Writes a value into a register using I2C.

Precondition
The I2C interface must be initialized and the driver started.
Parameters
[in]i2cppointer to the I2C interface.
[in]sadslave address without R bit.
[in]txbufbuffer containing sub-address value in first position and values to write.
[in]nsize of txbuf less one (not considering the first element).
Returns
the operation status.

Definition at line 89 of file lsm303dlhc.c.

References i2cMasterTransmitTimeout(), LSM303DLHC_MS, and TIME_INFINITE.

Referenced by acc_set_full_scale(), comp_set_full_scale(), lsm303dlhcStart(), and lsm303dlhcStop().

Here is the call graph for this function:

◆ acc_get_axes_number()

size_t acc_get_axes_number ( void * ip)
static

Return the number of axes of the BaseAccelerometer.

Parameters
[in]ippointer to BaseAccelerometer interface.
Returns
the number of axes.

Definition at line 104 of file lsm303dlhc.c.

References LSM303DLHC_ACC_NUMBER_OF_AXES.

◆ acc_read_raw()

msg_t acc_read_raw ( void * ip,
int32_t axes[] )
static

Retrieves raw data from the BaseAccelerometer.

Note
This data is retrieved from MEMS register without any algebraical manipulation.
The axes array must be at least the same size of the BaseAccelerometer axes number.
Parameters
[in]ippointer to BaseAccelerometer interface.
[out]axesa buffer which would be filled with raw data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.

Definition at line 126 of file lsm303dlhc.c.

References I2C_READY, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), LSM303DLHC_ACC_NUMBER_OF_AXES, LSM303DLHC_AD_ACC_OUT_X_L, LSM303DLHC_READY, LSM303DLHC_SAD_ACC, lsm303dlhcI2CReadRegister(), MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

Referenced by acc_read_cooked().

Here is the call graph for this function:

◆ acc_read_cooked()

msg_t acc_read_cooked ( void * ip,
float axes[] )
static

Retrieves cooked data from the BaseAccelerometer.

Note
This data is manipulated according to the formula cooked = (raw * sensitivity) - bias.
Final data is expressed as milli-G.
The axes array must be at least the same size of the BaseAccelerometer axes number.
Parameters
[in]ippointer to BaseAccelerometer interface.
[out]axesa buffer which would be filled with cooked data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.

Definition at line 181 of file lsm303dlhc.c.

References acc_read_raw(), LSM303DLHC_ACC_NUMBER_OF_AXES, LSM303DLHC_READY, objGetInstance, osalDbgAssert, and osalDbgCheck.

Here is the call graph for this function:

◆ acc_set_bias()

msg_t acc_set_bias ( void * ip,
float * bp )
static

Set bias values for the BaseAccelerometer.

Note
Bias must be expressed as milli-G.
The bias buffer must be at least the same size of the BaseAccelerometer axes number.
Parameters
[in]ippointer to BaseAccelerometer interface.
[in]bpa buffer which contains biases.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.

Definition at line 214 of file lsm303dlhc.c.

References LSM303DLHC_ACC_NUMBER_OF_AXES, LSM303DLHC_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ acc_reset_bias()

msg_t acc_reset_bias ( void * ip)
static

Reset bias values for the BaseAccelerometer.

Note
Default biases value are obtained from device datasheet when available otherwise they are considered zero.
Parameters
[in]ippointer to BaseAccelerometer interface.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.

Definition at line 243 of file lsm303dlhc.c.

References LSM303DLHC_ACC_BIAS, LSM303DLHC_ACC_NUMBER_OF_AXES, LSM303DLHC_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ acc_set_sensivity()

msg_t acc_set_sensivity ( void * ip,
float * sp )
static

Set sensitivity values for the BaseAccelerometer.

Note
Sensitivity must be expressed as milli-G/LSB.
The sensitivity buffer must be at least the same size of the BaseAccelerometer axes number.
Parameters
[in]ippointer to BaseAccelerometer interface.
[in]spa buffer which contains sensitivities.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.

Definition at line 273 of file lsm303dlhc.c.

References LSM303DLHC_ACC_NUMBER_OF_AXES, LSM303DLHC_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ acc_reset_sensivity()

msg_t acc_reset_sensivity ( void * ip)
static

Reset sensitivity values for the BaseAccelerometer.

Note
Default sensitivities value are obtained from device datasheet.
Parameters
[in]ippointer to BaseAccelerometer interface.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETotherwise.

Definition at line 302 of file lsm303dlhc.c.

References FALSE, LSM303DLHC_ACC_FS_16G, LSM303DLHC_ACC_FS_2G, LSM303DLHC_ACC_FS_4G, LSM303DLHC_ACC_FS_8G, LSM303DLHC_ACC_NUMBER_OF_AXES, LSM303DLHC_ACC_SENS_16G, LSM303DLHC_ACC_SENS_2G, LSM303DLHC_ACC_SENS_4G, LSM303DLHC_ACC_SENS_8G, LSM303DLHC_READY, MSG_OK, MSG_RESET, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ acc_set_full_scale()

msg_t acc_set_full_scale ( LSM303DLHCDriver * devp,
lsm303dlhc_acc_fs_t fs )
static

Changes the LSM303DLHCDriver accelerometer fullscale value.

Note
This function also rescale sensitivities and biases based on previous and next fullscale value.
A recalibration is highly suggested after calling this function.
Parameters
[in]devppointer to LSM303DLHCDriver interface.
[in]fsnew fullscale value.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETotherwise.

Definition at line 347 of file lsm303dlhc.c.

References I2C_READY, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), LSM303DLHC_ACC_16G, LSM303DLHC_ACC_2G, LSM303DLHC_ACC_4G, LSM303DLHC_ACC_8G, LSM303DLHC_ACC_FS_16G, LSM303DLHC_ACC_FS_2G, LSM303DLHC_ACC_FS_4G, LSM303DLHC_ACC_FS_8G, LSM303DLHC_ACC_NUMBER_OF_AXES, LSM303DLHC_AD_ACC_CTRL_REG4, LSM303DLHC_CTRL_REG4_A_FS_MASK, LSM303DLHC_READY, LSM303DLHC_SAD_ACC, lsm303dlhcI2CReadRegister(), lsm303dlhcI2CWriteRegister(), MSG_OK, MSG_RESET, osalDbgAssert, and osalDbgCheck.

Here is the call graph for this function:

◆ comp_get_axes_number()

size_t comp_get_axes_number ( void * ip)
static

Return the number of axes of the BaseCompass.

Parameters
[in]ippointer to BaseCompass interface
Returns
the number of axes.

Definition at line 440 of file lsm303dlhc.c.

References LSM303DLHC_COMP_NUMBER_OF_AXES, and osalDbgCheck.

◆ comp_read_raw()

msg_t comp_read_raw ( void * ip,
int32_t axes[] )
static

Retrieves raw data from the BaseCompass.

Note
This data is retrieved from MEMS register without any algebraical manipulation.
The axes array must be at least the same size of the BaseCompass axes number.
Parameters
[in]ippointer to BaseCompass interface.
[out]axesa buffer which would be filled with raw data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.

Definition at line 462 of file lsm303dlhc.c.

References I2C_READY, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), LSM303DLHC_AD_COMP_OUT_X_L, LSM303DLHC_COMP_NUMBER_OF_AXES, LSM303DLHC_READY, LSM303DLHC_SAD_COMP, lsm303dlhcI2CReadRegister(), MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

Referenced by comp_read_cooked().

Here is the call graph for this function:

◆ comp_read_cooked()

msg_t comp_read_cooked ( void * ip,
float axes[] )
static

Retrieves cooked data from the BaseCompass.

Note
This data is manipulated according to the formula cooked = (raw * sensitivity) - bias.
Final data is expressed as G.
The axes array must be at least the same size of the BaseCompass axes number.
Parameters
[in]ippointer to BaseCompass interface.
[out]axesa buffer which would be filled with cooked data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.

Definition at line 516 of file lsm303dlhc.c.

References comp_read_raw(), LSM303DLHC_COMP_NUMBER_OF_AXES, LSM303DLHC_READY, objGetInstance, osalDbgAssert, and osalDbgCheck.

Here is the call graph for this function:

◆ comp_set_bias()

msg_t comp_set_bias ( void * ip,
float * bp )
static

Set bias values for the BaseCompass.

Note
Bias must be expressed as G.
The bias buffer must be at least the same size of the BaseCompass axes number.
Parameters
[in]ippointer to BaseCompass interface.
[in]bpa buffer which contains biases.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.

Definition at line 550 of file lsm303dlhc.c.

References LSM303DLHC_COMP_NUMBER_OF_AXES, LSM303DLHC_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ comp_reset_bias()

msg_t comp_reset_bias ( void * ip)
static

Reset bias values for the BaseCompass.

Note
Default biases value are obtained from device datasheet when available otherwise they are considered zero.
Parameters
[in]ippointer to BaseCompass interface.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.

Definition at line 579 of file lsm303dlhc.c.

References LSM303DLHC_COMP_BIAS, LSM303DLHC_COMP_NUMBER_OF_AXES, LSM303DLHC_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ comp_set_sensivity()

msg_t comp_set_sensivity ( void * ip,
float * sp )
static

Set sensitivity values for the BaseCompass.

Note
Sensitivity must be expressed as G/LSB.
The sensitivity buffer must be at least the same size of the BaseCompass axes number.
Parameters
[in]ippointer to BaseCompass interface.
[in]spa buffer which contains sensitivities.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.

Definition at line 609 of file lsm303dlhc.c.

References LSM303DLHC_COMP_NUMBER_OF_AXES, LSM303DLHC_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ comp_reset_sensivity()

◆ comp_set_full_scale()

msg_t comp_set_full_scale ( LSM303DLHCDriver * devp,
lsm303dlhc_comp_fs_t fs )
static

Changes the LSM303DLHCDriver compass fullscale value.

Note
This function also rescale sensitivities and biases based on previous and next fullscale value.
A recalibration is highly suggested after calling this function.
Parameters
[in]devppointer to LSM303DLHCDriver interface.
[in]fsnew fullscale value.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETotherwise.

Definition at line 734 of file lsm303dlhc.c.

References I2C_READY, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), LSM303DLHC_AD_COMP_CRB_REG, LSM303DLHC_COMP_1P3GA, LSM303DLHC_COMP_1P9GA, LSM303DLHC_COMP_2P5GA, LSM303DLHC_COMP_4P0GA, LSM303DLHC_COMP_4P7GA, LSM303DLHC_COMP_5P6GA, LSM303DLHC_COMP_8P1GA, LSM303DLHC_COMP_FS_1P3GA, LSM303DLHC_COMP_FS_1P9GA, LSM303DLHC_COMP_FS_2P5GA, LSM303DLHC_COMP_FS_4P0GA, LSM303DLHC_COMP_FS_4P7GA, LSM303DLHC_COMP_FS_5P6GA, LSM303DLHC_COMP_FS_8P1GA, LSM303DLHC_COMP_NUMBER_OF_AXES, LSM303DLHC_CRB_REG_M_GN_MASK, LSM303DLHC_READY, LSM303DLHC_SAD_COMP, lsm303dlhcI2CReadRegister(), lsm303dlhcI2CWriteRegister(), MSG_OK, MSG_RESET, osalDbgAssert, and osalDbgCheck.

Here is the call graph for this function:

◆ lsm303dlhcObjectInit()

void lsm303dlhcObjectInit ( LSM303DLHCDriver * devp)

Initializes an instance.

Parameters
[out]devppointer to the LSM303DLHCDriver object
Function Class:
Object or module nitializer function.

Definition at line 850 of file lsm303dlhc.c.

References LSM303DLHCDriver::acc_if, LSM303DLHCDriver::comp_if, LSM303DLHC_ACC_NUMBER_OF_AXES, LSM303DLHC_COMP_NUMBER_OF_AXES, LSM303DLHC_STOP, BaseAccelerometer::vmt, BaseCompass::vmt, LSM303DLHCDriver::vmt, vmt_accelerometer, vmt_compass, and vmt_device.

◆ lsm303dlhcStart()

void lsm303dlhcStart ( LSM303DLHCDriver * devp,
const LSM303DLHCConfig * config )

Configures and activates LSM303DLHC Complex Driver peripheral.

Parameters
[in]devppointer to the LSM303DLHCDriver object
[in]configpointer to the LSM303DLHCConfig object
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 871 of file lsm303dlhc.c.

References hal_i2c_driver::config, FALSE, i2cAcquireBus(), LSM303DLHCConfig::i2cp, i2cReleaseBus(), i2cStart(), LSM303DLHC_ACC_16G, LSM303DLHC_ACC_2G, LSM303DLHC_ACC_4G, LSM303DLHC_ACC_8G, LSM303DLHC_ACC_BIAS, LSM303DLHC_ACC_FS_16G, LSM303DLHC_ACC_FS_2G, LSM303DLHC_ACC_FS_4G, LSM303DLHC_ACC_FS_8G, LSM303DLHC_ACC_NUMBER_OF_AXES, LSM303DLHC_ACC_SENS_16G, LSM303DLHC_ACC_SENS_2G, LSM303DLHC_ACC_SENS_4G, LSM303DLHC_ACC_SENS_8G, LSM303DLHC_AD_ACC_CTRL_REG1, LSM303DLHC_AD_COMP_CRA_REG, LSM303DLHC_COMP_1P3GA, LSM303DLHC_COMP_1P9GA, LSM303DLHC_COMP_2P5GA, LSM303DLHC_COMP_4P0GA, LSM303DLHC_COMP_4P7GA, LSM303DLHC_COMP_5P6GA, LSM303DLHC_COMP_8P1GA, LSM303DLHC_COMP_BIAS, LSM303DLHC_COMP_FS_1P3GA, LSM303DLHC_COMP_FS_1P9GA, LSM303DLHC_COMP_FS_2P5GA, LSM303DLHC_COMP_FS_4P0GA, LSM303DLHC_COMP_FS_4P7GA, LSM303DLHC_COMP_FS_5P6GA, LSM303DLHC_COMP_FS_8P1GA, LSM303DLHC_COMP_NUMBER_OF_AXES, LSM303DLHC_COMP_SENS_XY_1P3GA, LSM303DLHC_COMP_SENS_XY_1P9GA, LSM303DLHC_COMP_SENS_XY_2P5GA, LSM303DLHC_COMP_SENS_XY_4P0GA, LSM303DLHC_COMP_SENS_XY_4P7GA, LSM303DLHC_COMP_SENS_XY_5P6GA, LSM303DLHC_COMP_SENS_XY_8P1GA, LSM303DLHC_COMP_SENS_Z_1P3GA, LSM303DLHC_COMP_SENS_Z_1P9GA, LSM303DLHC_COMP_SENS_Z_2P5GA, LSM303DLHC_COMP_SENS_Z_4P0GA, LSM303DLHC_COMP_SENS_Z_4P7GA, LSM303DLHC_COMP_SENS_Z_5P6GA, LSM303DLHC_COMP_SENS_Z_8P1GA, LSM303DLHC_CTRL_REG1_A_XEN, LSM303DLHC_CTRL_REG1_A_YEN, LSM303DLHC_CTRL_REG1_A_ZEN, LSM303DLHC_READY, LSM303DLHC_SAD_ACC, LSM303DLHC_SAD_COMP, LSM303DLHC_STOP, lsm303dlhcI2CWriteRegister(), osalDbgAssert, osalDbgCheck, and osalThreadSleepMilliseconds.

Here is the call graph for this function:

◆ lsm303dlhcStop()

void lsm303dlhcStop ( LSM303DLHCDriver * devp)

Deactivates the LSM303DLHC Complex Driver peripheral.

Parameters
[in]devppointer to the LSM303DLHCDriver object
Function Class:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 1145 of file lsm303dlhc.c.

References i2cAcquireBus(), i2cReleaseBus(), i2cStart(), i2cStop(), LSM303DLHC_ACC_AE_DISABLED, LSM303DLHC_ACC_ODR_PD, LSM303DLHC_AD_ACC_CTRL_REG1, LSM303DLHC_AD_COMP_MR_REG, LSM303DLHC_COMP_MD_SLEEP, LSM303DLHC_READY, LSM303DLHC_SAD_ACC, LSM303DLHC_SAD_COMP, LSM303DLHC_STOP, lsm303dlhcI2CWriteRegister(), osalDbgAssert, and osalDbgCheck.

Here is the call graph for this function:

Variable Documentation

◆ vmt_device

const struct LSM303DLHCVMT vmt_device
static
Initial value:

Definition at line 822 of file lsm303dlhc.c.

◆ vmt_accelerometer

const struct BaseAccelerometerVMT vmt_accelerometer
static
Initial value:
= {
sizeof(struct LSM303DLHCVMT*),
}
static size_t acc_get_axes_number(void *ip)
Return the number of axes of the BaseAccelerometer.
Definition adxl317.c:115
static msg_t acc_reset_sensivity(void *ip)
Reset sensitivity values for the BaseAccelerometer.
Definition adxl317.c:310
static msg_t acc_set_bias(void *ip, float *bp)
Set bias values for the BaseAccelerometer.
Definition adxl317.c:222
static msg_t acc_reset_bias(void *ip)
Reset bias values for the BaseAccelerometer.
Definition adxl317.c:251
static msg_t acc_set_sensivity(void *ip, float *sp)
Set sensitivity values for the BaseAccelerometer.
Definition adxl317.c:281
static msg_t acc_read_cooked(void *ip, float axes[])
Retrieves cooked data from the BaseAccelerometer.
Definition adxl317.c:185
static msg_t acc_read_raw(void *ip, int32_t axes[])
Retrieves raw data from the BaseAccelerometer.
Definition adxl317.c:137
LSM303DLHC virtual methods table.
Definition lsm303dlhc.h:620

Definition at line 827 of file lsm303dlhc.c.

◆ vmt_compass

const struct BaseCompassVMT vmt_compass
static
Initial value:
= {
sizeof(struct LSM303DLHCVMT*) + sizeof(BaseAccelerometer),
}
static size_t comp_get_axes_number(void *ip)
Return the number of axes of the BaseCompass.
Definition lis3mdl.c:102
static msg_t comp_set_sensivity(void *ip, float *sp)
Set sensitivity values for the BaseCompass.
Definition lis3mdl.c:271
static msg_t comp_reset_bias(void *ip)
Reset bias values for the BaseCompass.
Definition lis3mdl.c:241
static msg_t comp_set_bias(void *ip, float *bp)
Set bias values for the BaseCompass.
Definition lis3mdl.c:212
static msg_t comp_reset_sensivity(void *ip)
Reset sensitivity values for the BaseCompass.
Definition lis3mdl.c:300
static msg_t comp_read_cooked(void *ip, float axes[])
Retrieves cooked data from the BaseCompass.
Definition lis3mdl.c:178
static msg_t comp_read_raw(void *ip, int32_t axes[])
Retrieves raw data from the BaseCompass.
Definition lis3mdl.c:124
Base accelerometer class.

Definition at line 833 of file lsm303dlhc.c.