ChibiOS 21.11.4
|
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. |
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_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 |
#define EX_LSM303DLHC_VERSION "1.1.2" |
LSM303DLHC driver version string.
Definition at line 46 of file lsm303dlhc.h.
#define EX_LSM303DLHC_MAJOR 1 |
LSM303DLHC driver version major number.
Definition at line 51 of file lsm303dlhc.h.
#define EX_LSM303DLHC_MINOR 1 |
LSM303DLHC driver version minor number.
Definition at line 56 of file lsm303dlhc.h.
#define EX_LSM303DLHC_PATCH 2 |
LSM303DLHC driver version patch number.
Definition at line 61 of file lsm303dlhc.h.
#define LSM303DLHC_ACC_NUMBER_OF_AXES 3U |
LSM303DLHC accelerometer subsystem characteristics.
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().
#define LSM303DLHC_ACC_2G 2.0f |
Definition at line 74 of file lsm303dlhc.h.
Referenced by acc_set_full_scale(), and lsm303dlhcStart().
#define LSM303DLHC_ACC_4G 4.0f |
Definition at line 75 of file lsm303dlhc.h.
Referenced by acc_set_full_scale(), and lsm303dlhcStart().
#define LSM303DLHC_ACC_8G 8.0f |
Definition at line 76 of file lsm303dlhc.h.
Referenced by acc_set_full_scale(), and lsm303dlhcStart().
#define LSM303DLHC_ACC_16G 16.0f |
Definition at line 77 of file lsm303dlhc.h.
Referenced by acc_set_full_scale(), and lsm303dlhcStart().
#define LSM303DLHC_ACC_SENS_2G 0.0610f |
Definition at line 79 of file lsm303dlhc.h.
Referenced by acc_reset_sensivity(), and lsm303dlhcStart().
#define LSM303DLHC_ACC_SENS_4G 0.1221f |
Definition at line 80 of file lsm303dlhc.h.
Referenced by acc_reset_sensivity(), and lsm303dlhcStart().
#define LSM303DLHC_ACC_SENS_8G 0.2442f |
Definition at line 81 of file lsm303dlhc.h.
Referenced by acc_reset_sensivity(), and lsm303dlhcStart().
#define LSM303DLHC_ACC_SENS_16G 0.4884f |
Definition at line 82 of file lsm303dlhc.h.
Referenced by acc_reset_sensivity(), and lsm303dlhcStart().
#define LSM303DLHC_ACC_BIAS 0.0f |
Definition at line 84 of file lsm303dlhc.h.
Referenced by acc_reset_bias(), and lsm303dlhcStart().
#define LSM303DLHC_COMP_NUMBER_OF_AXES 3U |
LSM303DLHC compass subsystem characteristics.
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().
#define LSM303DLHC_COMP_1P3GA 1.3f |
Definition at line 96 of file lsm303dlhc.h.
Referenced by comp_set_full_scale(), and lsm303dlhcStart().
#define LSM303DLHC_COMP_1P9GA 1.9f |
Definition at line 97 of file lsm303dlhc.h.
Referenced by comp_set_full_scale(), and lsm303dlhcStart().
#define LSM303DLHC_COMP_2P5GA 2.5f |
Definition at line 98 of file lsm303dlhc.h.
Referenced by comp_set_full_scale(), and lsm303dlhcStart().
#define LSM303DLHC_COMP_4P0GA 4.0f |
Definition at line 99 of file lsm303dlhc.h.
Referenced by comp_set_full_scale(), and lsm303dlhcStart().
#define LSM303DLHC_COMP_4P7GA 4.7f |
Definition at line 100 of file lsm303dlhc.h.
Referenced by comp_set_full_scale(), and lsm303dlhcStart().
#define LSM303DLHC_COMP_5P6GA 5.6f |
Definition at line 101 of file lsm303dlhc.h.
Referenced by comp_set_full_scale(), and lsm303dlhcStart().
#define LSM303DLHC_COMP_8P1GA 8.1f |
Definition at line 102 of file lsm303dlhc.h.
Referenced by comp_set_full_scale(), and lsm303dlhcStart().
#define LSM303DLHC_COMP_SENS_XY_1P3GA 0.000909f |
Definition at line 104 of file lsm303dlhc.h.
Referenced by comp_reset_sensivity(), and lsm303dlhcStart().
#define LSM303DLHC_COMP_SENS_XY_1P9GA 0.001169f |
Definition at line 105 of file lsm303dlhc.h.
Referenced by comp_reset_sensivity(), and lsm303dlhcStart().
#define LSM303DLHC_COMP_SENS_XY_2P5GA 0.0014925f |
Definition at line 106 of file lsm303dlhc.h.
Referenced by comp_reset_sensivity(), and lsm303dlhcStart().
#define LSM303DLHC_COMP_SENS_XY_4P0GA 0.0022222f |
Definition at line 107 of file lsm303dlhc.h.
Referenced by comp_reset_sensivity(), and lsm303dlhcStart().
#define LSM303DLHC_COMP_SENS_XY_4P7GA 0.0025000f |
Definition at line 108 of file lsm303dlhc.h.
Referenced by comp_reset_sensivity(), and lsm303dlhcStart().
#define LSM303DLHC_COMP_SENS_XY_5P6GA 0.0030303f |
Definition at line 109 of file lsm303dlhc.h.
Referenced by comp_reset_sensivity(), and lsm303dlhcStart().
#define LSM303DLHC_COMP_SENS_XY_8P1GA 0.0043478f |
Definition at line 110 of file lsm303dlhc.h.
Referenced by comp_reset_sensivity(), and lsm303dlhcStart().
#define LSM303DLHC_COMP_SENS_Z_1P3GA 0.0010204f |
Definition at line 112 of file lsm303dlhc.h.
Referenced by comp_reset_sensivity(), and lsm303dlhcStart().
#define LSM303DLHC_COMP_SENS_Z_1P9GA 0.0013071f |
Definition at line 113 of file lsm303dlhc.h.
Referenced by comp_reset_sensivity(), and lsm303dlhcStart().
#define LSM303DLHC_COMP_SENS_Z_2P5GA 0.0016666f |
Definition at line 114 of file lsm303dlhc.h.
Referenced by comp_reset_sensivity(), and lsm303dlhcStart().
#define LSM303DLHC_COMP_SENS_Z_4P0GA 0.0025000f |
Definition at line 115 of file lsm303dlhc.h.
Referenced by comp_reset_sensivity(), and lsm303dlhcStart().
#define LSM303DLHC_COMP_SENS_Z_4P7GA 0.0028169f |
Definition at line 116 of file lsm303dlhc.h.
Referenced by comp_reset_sensivity(), and lsm303dlhcStart().
#define LSM303DLHC_COMP_SENS_Z_5P6GA 0.0033898f |
Definition at line 117 of file lsm303dlhc.h.
Referenced by comp_reset_sensivity(), and lsm303dlhcStart().
#define LSM303DLHC_COMP_SENS_Z_8P1GA 0.0048780f |
Definition at line 118 of file lsm303dlhc.h.
Referenced by comp_reset_sensivity(), and lsm303dlhcStart().
#define LSM303DLHC_COMP_BIAS 0.0f |
Definition at line 120 of file lsm303dlhc.h.
Referenced by comp_reset_bias(), and lsm303dlhcStart().
#define LSM303DLHC_DI_MASK 0xFF |
Definition at line 127 of file lsm303dlhc.h.
#define LSM303DLHC_DI | ( | n | ) |
Definition at line 128 of file lsm303dlhc.h.
#define LSM303DLHC_AD_MASK 0x7F |
Definition at line 129 of file lsm303dlhc.h.
#define LSM303DLHC_AD | ( | n | ) |
Definition at line 130 of file lsm303dlhc.h.
#define LSM303DLHC_MS (1 << 7) |
Definition at line 131 of file lsm303dlhc.h.
Referenced by lsm303dlhcI2CReadRegister(), and lsm303dlhcI2CWriteRegister().
#define LSM303DLHC_AD_ACC_CTRL_REG1 0x20 |
Definition at line 138 of file lsm303dlhc.h.
Referenced by lsm303dlhcStart(), and lsm303dlhcStop().
#define LSM303DLHC_AD_ACC_CTRL_REG2 0x21 |
Definition at line 139 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_CTRL_REG3 0x22 |
Definition at line 140 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_CTRL_REG4 0x23 |
Definition at line 141 of file lsm303dlhc.h.
Referenced by acc_set_full_scale().
#define LSM303DLHC_AD_ACC_CTRL_REG5 0x24 |
Definition at line 142 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_CTRL_REG6 0x25 |
Definition at line 143 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_REFERENCE 0x26 |
Definition at line 144 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_STATUS_REG 0x27 |
Definition at line 145 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_OUT_X_L 0x28 |
Definition at line 146 of file lsm303dlhc.h.
Referenced by acc_read_raw().
#define LSM303DLHC_AD_ACC_OUT_X_H 0x29 |
Definition at line 147 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_OUT_Y_L 0x2A |
Definition at line 148 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_OUT_Y_H 0x2B |
Definition at line 149 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_OUT_Z_L 0x2C |
Definition at line 150 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_OUT_Z_H 0x2D |
Definition at line 151 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_FIFO_CTRL_REG 0x2E |
Definition at line 152 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_FIFO_SRC_REG 0x2F |
Definition at line 153 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_INT1_CFG 0x30 |
Definition at line 154 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_INT1_SRC 0x31 |
Definition at line 155 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_INT1_THS 0x32 |
Definition at line 156 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_INT1_DURATION 0x33 |
Definition at line 157 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_INT2_CFG 0x34 |
Definition at line 158 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_INT2_SRC 0x35 |
Definition at line 159 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_INT2_THS 0x36 |
Definition at line 160 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_INT2_DURATION 0x37 |
Definition at line 161 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_CLICK_CFG 0x38 |
Definition at line 162 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_CLICK_SRC 0x39 |
Definition at line 163 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_CLICK_THS 0x3A |
Definition at line 164 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_TIME_LIMIT 0x3B |
Definition at line 165 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_TIME_LATENCY 0x3C |
Definition at line 166 of file lsm303dlhc.h.
#define LSM303DLHC_AD_ACC_TIME_WINDOW 0x3D |
Definition at line 167 of file lsm303dlhc.h.
#define LSM303DLHC_AD_COMP_CRA_REG 0x00 |
Definition at line 168 of file lsm303dlhc.h.
Referenced by lsm303dlhcStart().
#define LSM303DLHC_AD_COMP_CRB_REG 0x01 |
Definition at line 169 of file lsm303dlhc.h.
Referenced by comp_set_full_scale().
#define LSM303DLHC_AD_COMP_MR_REG 0x02 |
Definition at line 170 of file lsm303dlhc.h.
Referenced by lsm303dlhcStop().
#define LSM303DLHC_AD_COMP_OUT_X_H 0x03 |
Definition at line 171 of file lsm303dlhc.h.
#define LSM303DLHC_AD_COMP_OUT_X_L 0x04 |
Definition at line 172 of file lsm303dlhc.h.
Referenced by comp_read_raw().
#define LSM303DLHC_AD_COMP_OUT_Z_H 0x05 |
Definition at line 173 of file lsm303dlhc.h.
#define LSM303DLHC_AD_COMP_OUT_Z_L 0x06 |
Definition at line 174 of file lsm303dlhc.h.
#define LSM303DLHC_AD_COMP_OUT_Y_H 0x07 |
Definition at line 175 of file lsm303dlhc.h.
#define LSM303DLHC_AD_COMP_OUT_Y_L 0x08 |
Definition at line 176 of file lsm303dlhc.h.
#define LSM303DLHC_AD_COMP_SR_REG 0x09 |
Definition at line 177 of file lsm303dlhc.h.
#define LSM303DLHC_AD_COMP_IRA_REG 0x0A |
Definition at line 178 of file lsm303dlhc.h.
#define LSM303DLHC_AD_COMP_IRB_REG 0x0B |
Definition at line 179 of file lsm303dlhc.h.
#define LSM303DLHC_AD_COMP_IRC_REG 0x0C |
Definition at line 180 of file lsm303dlhc.h.
#define LSM303DLHC_AD_COMP_TEMP_OUT_H 0x31 |
Definition at line 181 of file lsm303dlhc.h.
#define LSM303DLHC_AD_COMP_TEMP_OUT_L 0x32 |
Definition at line 182 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG1_A_MASK 0xFF |
Definition at line 189 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG1_A_XEN (1 << 0) |
Definition at line 190 of file lsm303dlhc.h.
Referenced by lsm303dlhcStart().
#define LSM303DLHC_CTRL_REG1_A_YEN (1 << 1) |
Definition at line 191 of file lsm303dlhc.h.
Referenced by lsm303dlhcStart().
#define LSM303DLHC_CTRL_REG1_A_ZEN (1 << 2) |
Definition at line 192 of file lsm303dlhc.h.
Referenced by lsm303dlhcStart().
#define LSM303DLHC_CTRL_REG1_A_LPEN (1 << 3) |
Definition at line 193 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG1_A_ODR0 (1 << 4) |
Definition at line 194 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG1_A_ODR1 (1 << 5) |
Definition at line 195 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG1_A_ODR2 (1 << 6) |
Definition at line 196 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG1_A_ODR3 (1 << 7) |
Definition at line 197 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG2_A_MASK 0xFF |
Definition at line 204 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG2_A_HPIS1 (1 << 0) |
Definition at line 205 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG2_A_HPIS2 (1 << 1) |
Definition at line 206 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG2_A_HPCLICK (1 << 2) |
Definition at line 207 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG2_A_FDS (1 << 3) |
Definition at line 208 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG2_A_HPCF1 (1 << 4) |
Definition at line 209 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG2_A_HPCF2 (1 << 5) |
Definition at line 210 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG2_A_HPM0 (1 << 6) |
Definition at line 211 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG2_A_HPM1 (1 << 7) |
Definition at line 212 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG3_A_MASK 0xFD |
Definition at line 219 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG3_A_I1_OVERRUN (1 << 1) |
Definition at line 220 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG3_A_I1_WTM (1 << 2) |
Definition at line 221 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG3_A_I1_DRDY2 (1 << 3) |
Definition at line 222 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG3_A_I1_DRDY1 (1 << 4) |
Definition at line 223 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG3_A_I1_AOI2 (1 << 5) |
Definition at line 224 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG3_A_I1_AOI1 (1 << 6) |
Definition at line 225 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG3_A_I1_CLICK (1 << 7) |
Definition at line 226 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG4_A_MASK 0xF9 |
Definition at line 233 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG4_A_SIM (1 << 0) |
Definition at line 234 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG4_A_HR (1 << 3) |
Definition at line 235 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG4_A_FS_MASK 0x30 |
Definition at line 236 of file lsm303dlhc.h.
Referenced by acc_set_full_scale().
#define LSM303DLHC_CTRL_REG4_A_FS0 (1 << 4) |
Definition at line 237 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG4_A_FS1 (1 << 5) |
Definition at line 238 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG4_A_BLE (1 << 6) |
Definition at line 239 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG4_A_BDU (1 << 7) |
Definition at line 240 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG5_A_MASK 0xCF |
Definition at line 247 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG5_A_D4D_INT2 (1 << 0) |
Definition at line 248 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG5_A_LIR_INT2 (1 << 1) |
Definition at line 249 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG5_A_D4D_INT1 (1 << 2) |
Definition at line 250 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG5_A_LIR_INT1 (1 << 3) |
Definition at line 251 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG5_A_FIFO_EN (1 << 6) |
Definition at line 252 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG5_A_BOOT (1 << 7) |
Definition at line 253 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG6_A_MASK 0xFA |
Definition at line 260 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG6_A_H_LACTIVE (1 << 1) |
Definition at line 261 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG6_A_P2_ACT (1 << 3) |
Definition at line 262 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG6_A_BOOT_I1 (1 << 4) |
Definition at line 263 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG6_A_I2_INT2 (1 << 5) |
Definition at line 264 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG6_A_I2_INT1 (1 << 6) |
Definition at line 265 of file lsm303dlhc.h.
#define LSM303DLHC_CTRL_REG6_A_I2_CLICKEN (1 << 7) |
Definition at line 266 of file lsm303dlhc.h.
#define LSM303DLHC_CRA_REG_M_MASK 0x9C |
Definition at line 273 of file lsm303dlhc.h.
#define LSM303DLHC_CRA_REG_M_DO0 (1 << 2) |
Definition at line 274 of file lsm303dlhc.h.
#define LSM303DLHC_CRA_REG_M_DO1 (1 << 3) |
Definition at line 275 of file lsm303dlhc.h.
#define LSM303DLHC_CRA_REG_M_DO2 (1 << 4) |
Definition at line 276 of file lsm303dlhc.h.
#define LSM303DLHC_CRA_REG_M_TEMP_EN (1 << 7) |
Definition at line 277 of file lsm303dlhc.h.
#define LSM303DLHC_CRB_REG_M_MASK 0xE0 |
Definition at line 284 of file lsm303dlhc.h.
#define LSM303DLHC_CRB_REG_M_GN_MASK 0xE0 |
Definition at line 285 of file lsm303dlhc.h.
Referenced by comp_set_full_scale().
#define LSM303DLHC_CRB_REG_M_GN0 (1 << 5) |
Definition at line 286 of file lsm303dlhc.h.
#define LSM303DLHC_CRB_REG_M_GN1 (1 << 6) |
Definition at line 287 of file lsm303dlhc.h.
#define LSM303DLHC_CRB_REG_M_GN2 (1 << 7) |
Definition at line 288 of file lsm303dlhc.h.
#define LSM303DLHC_MR_REG_M_MASK 0x03 |
Definition at line 295 of file lsm303dlhc.h.
#define LSM303DLHC_MR_REG_M_MD0 (1 << 0) |
Definition at line 296 of file lsm303dlhc.h.
#define LSM303DLHC_MR_REG_M_MD1 (1 << 1) |
Definition at line 297 of file lsm303dlhc.h.
#define LSM303DLHC_USE_SPI FALSE |
LSM303DLHC SPI interface switch.
If set to TRUE
the support for SPI is included.
FALSE
. Definition at line 314 of file lsm303dlhc.h.
#define LSM303DLHC_SHARED_SPI FALSE |
LSM303DLHC shared SPI switch.
If set to TRUE
the device acquires SPI bus ownership on each transaction.
FALSE
. Requires SPI_USE_MUTUAL_EXCLUSION. Definition at line 324 of file lsm303dlhc.h.
#define LSM303DLHC_USE_I2C TRUE |
LSM303DLHC I2C interface switch.
If set to TRUE
the support for I2C is included.
TRUE
. Definition at line 333 of file lsm303dlhc.h.
#define LSM303DLHC_SHARED_I2C FALSE |
LSM303DLHC shared I2C switch.
If set to TRUE
the device acquires I2C bus ownership on each transaction.
FALSE
. Requires I2C_USE_MUTUAL_EXCLUSION. Definition at line 343 of file lsm303dlhc.h.
#define LSM303DLHC_USE_ADVANCED FALSE |
LSM303DLHC advanced configurations switch.
If set to TRUE
more configurations are available.
FALSE
. Definition at line 352 of file lsm303dlhc.h.
#define _lsm303dlhc_methods_alone |
LSM303DLHC
specific methods.
Definition at line 600 of file lsm303dlhc.h.
#define _lsm303dlhc_methods |
LSM303DLHC
specific methods with inherited ones.
Definition at line 611 of file lsm303dlhc.h.
#define _lsm303dlhc_data |
LSM303DLHCDriver
specific data.
Definition at line 627 of file lsm303dlhc.h.
#define lsm303dlhcAccelerometerGetAxesNumber | ( | devp | ) |
Return the number of axes of the BaseAccelerometer.
[in] | devp | pointer to LSM303DLHCDriver . |
Definition at line 677 of file lsm303dlhc.h.
#define lsm303dlhcAccelerometerReadRaw | ( | devp, | |
axes ) |
Retrieves raw data from the BaseAccelerometer.
[in] | devp | pointer to LSM303DLHCDriver . |
[out] | axes | a buffer which would be filled with raw data. |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if a timeout occurred before operation end. |
Definition at line 698 of file lsm303dlhc.h.
#define lsm303dlhcAccelerometerReadCooked | ( | devp, | |
axes ) |
Retrieves cooked data from the BaseAccelerometer.
[in] | devp | pointer to LSM303DLHCDriver . |
[out] | axes | a buffer which would be filled with cooked data. |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if a timeout occurred before operation end. |
Definition at line 720 of file lsm303dlhc.h.
#define lsm303dlhcAccelerometerSetBias | ( | devp, | |
bp ) |
Set bias values for the BaseAccelerometer.
[in] | devp | pointer to LSM303DLHCDriver . |
[in] | bp | a buffer which contains biases. |
MSG_OK | if the function succeeded. |
Definition at line 737 of file lsm303dlhc.h.
#define lsm303dlhcAccelerometerResetBias | ( | devp | ) |
Reset bias values for the BaseAccelerometer.
[in] | devp | pointer to LSM303DLHCDriver . |
MSG_OK | if the function succeeded. |
Definition at line 752 of file lsm303dlhc.h.
#define lsm303dlhcAccelerometerSetSensitivity | ( | devp, | |
sp ) |
Set sensitivity values for the BaseAccelerometer.
[in] | devp | pointer to LSM303DLHCDriver . |
[in] | sp | a buffer which contains sensitivities. |
MSG_OK | if the function succeeded. |
Definition at line 769 of file lsm303dlhc.h.
#define lsm303dlhcAccelerometerResetSensitivity | ( | devp | ) |
Reset sensitivity values for the BaseAccelerometer.
[in] | devp | pointer to LSM303DLHCDriver . |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
Definition at line 784 of file lsm303dlhc.h.
#define lsm303dlhcAccelerometerSetFullScale | ( | devp, | |
fs ) |
Changes the LSM303DLHCDriver accelerometer fullscale value.
[in] | devp | pointer to LSM303DLHCDriver . |
[in] | fs | new fullscale value. |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
Definition at line 802 of file lsm303dlhc.h.
#define lsm303dlhcCompassGetAxesNumber | ( | devp | ) |
Return the number of axes of the BaseCompass.
[in] | devp | pointer to LSM303DLHCDriver . |
Definition at line 814 of file lsm303dlhc.h.
#define lsm303dlhcCompassReadRaw | ( | devp, | |
axes ) |
Retrieves raw data from the BaseCompass.
[in] | devp | pointer to BaseCompass interface. |
[out] | axes | a buffer which would be filled with raw data. |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if a timeout occurred before operation end. |
Definition at line 835 of file lsm303dlhc.h.
#define lsm303dlhcCompassReadCooked | ( | devp, | |
axes ) |
Retrieves cooked data from the BaseCompass.
[in] | devp | pointer to BaseCompass interface. |
[out] | axes | a buffer which would be filled with cooked data. |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if a timeout occurred before operation end. |
Definition at line 857 of file lsm303dlhc.h.
#define lsm303dlhcCompassSetBias | ( | devp, | |
bp ) |
Set bias values for the BaseCompass.
[in] | devp | pointer to BaseCompass interface. |
[in] | bp | a buffer which contains biases. |
MSG_OK | if the function succeeded. |
Definition at line 874 of file lsm303dlhc.h.
#define lsm303dlhcCompassResetBias | ( | devp | ) |
Reset bias values for the BaseCompass.
[in] | devp | pointer to LSM303DLHCDriver . |
MSG_OK | if the function succeeded. |
Definition at line 889 of file lsm303dlhc.h.
#define lsm303dlhcCompassSetSensitivity | ( | devp, | |
sp ) |
Set sensitivity values for the BaseCompass.
[in] | devp | pointer to LSM303DLHCDriver . |
[in] | sp | a buffer which contains sensitivities. |
MSG_OK | if the function succeeded. |
Definition at line 906 of file lsm303dlhc.h.
#define lsm303dlhcCompassResetSensitivity | ( | devp | ) |
Reset sensitivity values for the BaseCompass.
[in] | devp | pointer to LSM303DLHCDriver . |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
Definition at line 921 of file lsm303dlhc.h.
#define lsm303dlhcCompassSetFullScale | ( | devp, | |
fs ) |
Changes the LSM303DLHCDriver compass fullscale value.
[in] | devp | pointer to LSM303DLHCDriver . |
[in] | fs | new fullscale value. |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
Definition at line 939 of file lsm303dlhc.h.
typedef struct LSM303DLHCDriver LSM303DLHCDriver |
Structure representing a LSM303DLHC driver.
Definition at line 398 of file lsm303dlhc.h.
enum 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.
enum 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.
enum lsm303dlhc_acc_odr_t |
LSM303DLHC accelerometer subsystem output data rate.
Definition at line 413 of file lsm303dlhc.h.
enum lsm303dlhc_acc_ae_t |
LSM303DLHC accelerometer subsystem axes enabling.
Definition at line 429 of file lsm303dlhc.h.
enum 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.
enum 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.
enum 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.
enum 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.
enum lsm303dlhc_comp_fs_t |
LSM303DLHC compass subsystem full scale.
Definition at line 480 of file lsm303dlhc.h.
LSM303DLHC compass subsystem output data rate.
Definition at line 493 of file lsm303dlhc.h.
enum 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.
enum 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.
|
static |
Reads registers value using I2C.
[in] | i2cp | pointer to the I2C interface. |
[in] | sad | slave address without R bit. |
[in] | reg | first sub-register address. |
[in] | rxbuf | receiving buffer. |
[in] | n | size of rxbuf. |
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().
|
static |
Writes a value into a register using I2C.
[in] | i2cp | pointer to the I2C interface. |
[in] | sad | slave address without R bit. |
[in] | txbuf | buffer containing sub-address value in first position and values to write. |
[in] | n | size of txbuf less one (not considering the first element). |
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().
|
static |
Return the number of axes of the BaseAccelerometer.
[in] | ip | pointer to BaseAccelerometer interface. |
Definition at line 104 of file lsm303dlhc.c.
References LSM303DLHC_ACC_NUMBER_OF_AXES.
|
static |
Retrieves raw data from the BaseAccelerometer.
[in] | ip | pointer to BaseAccelerometer interface. |
[out] | axes | a buffer which would be filled with raw data. |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if 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().
|
static |
Retrieves cooked data from the BaseAccelerometer.
[in] | ip | pointer to BaseAccelerometer interface. |
[out] | axes | a buffer which would be filled with cooked data. |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if 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.
|
static |
Set bias values for the BaseAccelerometer.
[in] | ip | pointer to BaseAccelerometer interface. |
[in] | bp | a buffer which contains biases. |
MSG_OK | if 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.
|
static |
Reset bias values for the BaseAccelerometer.
[in] | ip | pointer to BaseAccelerometer interface. |
MSG_OK | if 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.
|
static |
Set sensitivity values for the BaseAccelerometer.
[in] | ip | pointer to BaseAccelerometer interface. |
[in] | sp | a buffer which contains sensitivities. |
MSG_OK | if 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.
|
static |
Reset sensitivity values for the BaseAccelerometer.
[in] | ip | pointer to BaseAccelerometer interface. |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
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.
|
static |
Changes the LSM303DLHCDriver accelerometer fullscale value.
[in] | devp | pointer to LSM303DLHCDriver interface. |
[in] | fs | new fullscale value. |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
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.
|
static |
Return the number of axes of the BaseCompass.
[in] | ip | pointer to BaseCompass interface |
Definition at line 440 of file lsm303dlhc.c.
References LSM303DLHC_COMP_NUMBER_OF_AXES, and osalDbgCheck.
|
static |
Retrieves raw data from the BaseCompass.
[in] | ip | pointer to BaseCompass interface. |
[out] | axes | a buffer which would be filled with raw data. |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if 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().
|
static |
Retrieves cooked data from the BaseCompass.
[in] | ip | pointer to BaseCompass interface. |
[out] | axes | a buffer which would be filled with cooked data. |
MSG_OK | if the function succeeded. |
MSG_RESET | if one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors() . |
MSG_TIMEOUT | if 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.
|
static |
Set bias values for the BaseCompass.
[in] | ip | pointer to BaseCompass interface. |
[in] | bp | a buffer which contains biases. |
MSG_OK | if 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.
|
static |
Reset bias values for the BaseCompass.
[in] | ip | pointer to BaseCompass interface. |
MSG_OK | if 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.
|
static |
Set sensitivity values for the BaseCompass.
[in] | ip | pointer to BaseCompass interface. |
[in] | sp | a buffer which contains sensitivities. |
MSG_OK | if 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.
|
static |
Reset sensitivity values for the BaseCompass.
[in] | ip | pointer to BaseCompass interface. |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
Definition at line 638 of file lsm303dlhc.c.
References FALSE, 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_READY, MSG_OK, MSG_RESET, objGetInstance, osalDbgAssert, and osalDbgCheck.
|
static |
Changes the LSM303DLHCDriver compass fullscale value.
[in] | devp | pointer to LSM303DLHCDriver interface. |
[in] | fs | new fullscale value. |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
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.
void lsm303dlhcObjectInit | ( | LSM303DLHCDriver * | devp | ) |
Initializes an instance.
[out] | devp | pointer to the LSM303DLHCDriver object |
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.
void lsm303dlhcStart | ( | LSM303DLHCDriver * | devp, |
const LSM303DLHCConfig * | config ) |
Configures and activates LSM303DLHC Complex Driver peripheral.
[in] | devp | pointer to the LSM303DLHCDriver object |
[in] | config | pointer to the LSM303DLHCConfig object |
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.
void lsm303dlhcStop | ( | LSM303DLHCDriver * | devp | ) |
Deactivates the LSM303DLHC Complex Driver peripheral.
[in] | devp | pointer to the LSM303DLHCDriver object |
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.
|
static |
Definition at line 822 of file lsm303dlhc.c.
|
static |
Definition at line 827 of file lsm303dlhc.c.
|
static |
Definition at line 833 of file lsm303dlhc.c.