ChibiOS/EX 1.3.0
|
LSM303AGR compass subsystem data structures and types. | |
enum | lsm303agr_comp_odr_t { LSM303AGR_COMP_ODR_10HZ = 0x00 , LSM303AGR_COMP_ODR_20HZ = 0x04 , LSM303AGR_COMP_ODR_50HZ = 0x08 , LSM303AGR_COMP_ODR_100HZ = 0x0C } |
LSM303AGR compass subsystem output data rate. More... | |
enum | lsm303agr_comp_mode_t { LSM303AGR_COMP_MODE_NORM = 0x00 , LSM303AGR_COMP_MODE_SINGLE = 0x01 , LSM303AGR_COMP_MODE_IDLE = 0x02 } |
LSM303AGR compass subsystem working mode. More... | |
enum | lsm303agr_comp_lpow_t { LSM303AGR_COMP_LPOW_DIS = 0x00 , LSM303AGR_COMP_LPOW_EN = 0x10 } |
LSM303AGR compass subsystem working mode. More... |
LSM303AGR main system data structures and types. | |
enum | lsm303agr_state_t { LSM303AGR_UNINIT = 0 , LSM303AGR_STOP = 1 , LSM303AGR_READY = 2 } |
Driver state machine possible states. More... | |
#define | _lsm303agr_methods_alone |
LSM303AGR specific methods. | |
#define | _lsm303agr_methods |
LSM303AGR specific methods with inherited ones. | |
#define | _lsm303agr_data |
LSM303AGRDriver specific data. |
Version identification | |
#define | EX_LSM303AGR_VERSION "1.0.2" |
LSM303AGR driver version string. | |
#define | EX_LSM303AGR_MAJOR 1 |
LSM303AGR driver version major number. | |
#define | EX_LSM303AGR_MINOR 0 |
LSM303AGR driver version minor number. | |
#define | EX_LSM303AGR_PATCH 2 |
LSM303AGR driver version patch number. | |
#define | LSM303AGR_ACC_NUMBER_OF_AXES 3U |
LSM303AGR accelerometer subsystem characteristics. | |
#define | LSM303AGR_ACC_2G 2.0f |
#define | LSM303AGR_ACC_4G 4.0f |
#define | LSM303AGR_ACC_8G 8.0f |
#define | LSM303AGR_ACC_16G 16.0f |
#define | LSM303AGR_ACC_SENS_2G 0.060f |
#define | LSM303AGR_ACC_SENS_4G 0.120f |
#define | LSM303AGR_ACC_SENS_8G 0.240f |
#define | LSM303AGR_ACC_SENS_16G 0.750f |
#define | LSM303AGR_ACC_BIAS 0.0f |
#define | LSM303AGR_COMP_NUMBER_OF_AXES 3U |
LSM303AGR compass subsystem characteristics. | |
#define | LSM303AGR_COMP_50GA 50.0f |
#define | LSM303AGR_COMP_SENS_50GA 0.00015f |
#define | LSM303AGR_COMP_BIAS 0.0f |
LSM303AGR communication interfaces related bit masks | |
#define | LSM303AGR_DI_MASK 0xFF |
#define | LSM303AGR_DI(n) |
#define | LSM303AGR_AD_MASK 0x7F |
#define | LSM303AGR_AD(n) |
#define | LSM303AGR_MS (1 << 7) |
LSM303AGR_TEMP_CFG_REG_A register bits definitions | |
#define | LSM303AGR_TEMP_CFG_REG_A_TEMP_EN0 (1 << 0) |
#define | LSM303AGR_TEMP_CFG_REG_A_TEMP_EN1 (1 << 0) |
LSM303AGR_CTRL_REG1_A register bits definitions | |
#define | LSM303AGR_CTRL_REG1_A_XEN (1 << 0) |
#define | LSM303AGR_CTRL_REG1_A_YEN (1 << 1) |
#define | LSM303AGR_CTRL_REG1_A_ZEN (1 << 2) |
#define | LSM303AGR_CTRL_REG1_A_LPEN (1 << 3) |
#define | LSM303AGR_CTRL_REG1_A_ODR0 (1 << 4) |
#define | LSM303AGR_CTRL_REG1_A_ODR1 (1 << 5) |
#define | LSM303AGR_CTRL_REG1_A_ODR2 (1 << 6) |
#define | LSM303AGR_CTRL_REG1_A_ODR3 (1 << 7) |
LSM303AGR_CTRL_REG2_A register bits definitions | |
#define | LSM303AGR_CTRL_REG2_A_HPIS1 (1 << 0) |
#define | LSM303AGR_CTRL_REG2_A_HPIS2 (1 << 1) |
#define | LSM303AGR_CTRL_REG2_A_HPCLICK (1 << 2) |
#define | LSM303AGR_CTRL_REG2_A_FDS (1 << 3) |
#define | LSM303AGR_CTRL_REG2_A_HPCF1 (1 << 4) |
#define | LSM303AGR_CTRL_REG2_A_HPCF2 (1 << 5) |
#define | LSM303AGR_CTRL_REG2_A_HPM0 (1 << 6) |
#define | LSM303AGR_CTRL_REG2_A_HPM1 (1 << 7) |
LSM303AGR_CTRL_REG3_A register bits definitions | |
#define | LSM303AGR_CTRL_REG3_A_I1_OVERRUN (1 << 1) |
#define | LSM303AGR_CTRL_REG3_A_I1_WTM (1 << 2) |
#define | LSM303AGR_CTRL_REG3_A_I1_DRDY2 (1 << 3) |
#define | LSM303AGR_CTRL_REG3_A_I1_DRDY1 (1 << 4) |
#define | LSM303AGR_CTRL_REG3_A_I1_AOI2 (1 << 5) |
#define | LSM303AGR_CTRL_REG3_A_I1_AOI1 (1 << 6) |
#define | LSM303AGR_CTRL_REG3_A_I1_CLICK (1 << 7) |
LSM303AGR_CTRL_REG4_A register bits definitions | |
#define | LSM303AGR_CTRL_REG4_A_SPI_ENABLE (1 << 0) |
#define | LSM303AGR_CTRL_REG4_A_ST0 (1 << 1) |
#define | LSM303AGR_CTRL_REG4_A_ST1 (1 << 2) |
#define | LSM303AGR_CTRL_REG4_A_HR (1 << 3) |
#define | LSM303AGR_CTRL_REG4_A_FS_MASK 0x30 |
#define | LSM303AGR_CTRL_REG4_A_FS0 (1 << 4) |
#define | LSM303AGR_CTRL_REG4_A_FS1 (1 << 5) |
#define | LSM303AGR_CTRL_REG4_A_BLE (1 << 6) |
#define | LSM303AGR_CTRL_REG4_A_BDU (1 << 7) |
LSM303AGR_CTRL_REG5_A register bits definitions | |
#define | LSM303AGR_CTRL_REG5_A_D4D_INT2 (1 << 0) |
#define | LSM303AGR_CTRL_REG5_A_LIR_INT2 (1 << 1) |
#define | LSM303AGR_CTRL_REG5_A_D4D_INT1 (1 << 2) |
#define | LSM303AGR_CTRL_REG5_A_LIR_INT1 (1 << 3) |
#define | LSM303AGR_CTRL_REG5_A_FIFO_EN (1 << 6) |
#define | LSM303AGR_CTRL_REG5_A_BOOT (1 << 7) |
LSM303AGR_CTRL_REG6_A register bits definitions | |
#define | LSM303AGR_CTRL_REG6_A_H_LACTIVE (1 << 1) |
#define | LSM303AGR_CTRL_REG6_A_P2_ACT (1 << 3) |
#define | LSM303AGR_CTRL_REG6_A_BOOT_I2 (1 << 4) |
#define | LSM303AGR_CTRL_REG6_A_I2_INT2 (1 << 5) |
#define | LSM303AGR_CTRL_REG6_A_I2_INT1 (1 << 6) |
#define | LSM303AGR_CTRL_REG6_A_I2_CLICKEN (1 << 7) |
LSM303AGR_CFG_REG_A register bits definitions | |
#define | LSM303AGR_CFG_REG_A_M_MD0 (1 << 0) |
#define | LSM303AGR_CFG_REG_A_M_MD1 (1 << 1) |
#define | LSM303AGR_CFG_REG_A_M_ODR0 (1 << 2) |
#define | LSM303AGR_CFG_REG_A_M_ODR1 (1 << 3) |
#define | LSM303AGR_CFG_REG_A_M_LP (1 << 4) |
#define | LSM303AGR_CFG_REG_A_M_SOFT_RST (1 << 5) |
#define | LSM303AGR_CFG_REG_A_M_REBOOT (1 << 6) |
#define | LSM303AGR_CFG_REG_A_M_COMP_TEMP_EN (1 << 7) |
LSM303AGR_CFG_REG_B register bits definitions | |
#define | LSM303AGR_CFG_REG_B_M_LPF (1 << 0) |
#define | LSM303AGR_CFG_REG_B_M_OFF_CANC (1 << 1) |
#define | LSM303AGR_CFG_REG_B_M_SET_FREQ (1 << 2) |
#define | LSM303AGR_CFG_REG_B_M_INT_ON (1 << 3) |
#define | LSM303AGR_CFG_REG_B_M_OFF_CANC_OS (1 << 4) |
LSM303AGR_CFG_REG_C register bits definitions | |
#define | LSM303AGR_CFG_REG_C_M_INT_MAG (1 << 0) |
#define | LSM303AGR_CFG_REG_C_M_SELF_TEST (1 << 1) |
#define | LSM303AGR_CFG_REG_C_M_BLE (1 << 3) |
#define | LSM303AGR_CFG_REG_C_M_BDU (1 << 4) |
#define | LSM303AGR_CFG_REG_C_M_I2C_DIS (1 << 5) |
#define | LSM303AGR_CFG_REG_C_M_INT_MAG_PIN (1 << 6) |
Configuration options | |
#define | LSM303AGR_USE_SPI FALSE |
LSM303AGR SPI interface switch. | |
#define | LSM303AGR_SHARED_SPI FALSE |
LSM303AGR shared SPI switch. | |
#define | LSM303AGR_USE_I2C TRUE |
LSM303AGR I2C interface switch. | |
#define | LSM303AGR_SHARED_I2C FALSE |
LSM303AGR shared I2C switch. | |
#define | LSM303AGR_USE_ADVANCED FALSE |
LSM303AGR advanced configurations switch. |
Data Structures | |
struct | LSM303AGRConfig |
LSM303AGR configuration structure. More... | |
struct | LSM303AGRVMT |
LSM303AGR virtual methods table. More... | |
struct | LSM303AGRDriver |
LSM303AGR 6-axis accelerometer/compass class. More... |
Macros | |
#define | lsm303agrAccelerometerGetAxesNumber(devp) |
Return the number of axes of the BaseAccelerometer. | |
#define | lsm303agrAccelerometerReadRaw(devp, axes) |
Retrieves raw data from the BaseAccelerometer. | |
#define | lsm303agrAccelerometerReadCooked(devp, axes) |
Retrieves cooked data from the BaseAccelerometer. | |
#define | lsm303agrAccelerometerSetBias(devp, bp) |
Set bias values for the BaseAccelerometer. | |
#define | lsm303agrAccelerometerResetBias(devp) |
Reset bias values for the BaseAccelerometer. | |
#define | lsm303agrAccelerometerSetSensitivity(devp, sp) |
Set sensitivity values for the BaseAccelerometer. | |
#define | lsm303agrAccelerometerResetSensitivity(devp) |
Reset sensitivity values for the BaseAccelerometer. | |
#define | lsm303agrAccelerometerSetFullScale(devp, fs) |
Changes the LSM303AGRDriver accelerometer fullscale value. | |
#define | lsm303agrCompassGetAxesNumber(devp) |
Return the number of axes of the BaseCompass. | |
#define | lsm303agrCompassReadRaw(devp, axes) |
Retrieves raw data from the BaseCompass. | |
#define | lsm303agrCompassReadCooked(devp, axes) |
Retrieves cooked data from the BaseCompass. | |
#define | lsm303agrCompassSetBias(devp, bp) |
Set bias values for the BaseCompass. | |
#define | lsm303agrCompassResetBias(devp) |
Reset bias values for the BaseCompass. | |
#define | lsm303agrCompassSetSensitivity(devp, sp) |
Set sensitivity values for the BaseCompass. | |
#define | lsm303agrCompassResetSensitivity(devp) |
Reset sensitivity values for the BaseCompass. |
Enumerations | |
enum | lsm303agr_sad_t { LSM303AGR_SAD_ACC = 0x19 , LSM303AGR_SAD_COMP = 0x1E } |
Accelerometer and Compass Slave Address. More... |
Functions | |
static msg_t | lsm303agrI2CReadRegister (I2CDriver *i2cp, lsm303agr_sad_t sad, uint8_t reg, uint8_t *rxbuf, size_t n) |
Reads registers value using I2C. | |
static msg_t | lsm303agrI2CWriteRegister (I2CDriver *i2cp, lsm303agr_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 (LSM303AGRDriver *devp, lsm303agr_acc_fs_t fs) |
Changes the LSM303AGRDriver 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. | |
void | lsm303agrObjectInit (LSM303AGRDriver *devp) |
Initializes an instance. | |
void | lsm303agrStart (LSM303AGRDriver *devp, const LSM303AGRConfig *config) |
Configures and activates LSM303AGR Complex Driver peripheral. | |
void | lsm303agrStop (LSM303AGRDriver *devp) |
Deactivates the LSM303AGR Complex Driver peripheral. |
Variables | |
static const struct LSM303AGRVMT | vmt_device |
static const struct BaseAccelerometerVMT | vmt_accelerometer |
static const struct BaseCompassVMT | vmt_compass |
#define EX_LSM303AGR_VERSION "1.0.2" |
LSM303AGR driver version string.
Definition at line 46 of file lsm303agr.h.
#define EX_LSM303AGR_MAJOR 1 |
LSM303AGR driver version major number.
Definition at line 51 of file lsm303agr.h.
#define EX_LSM303AGR_MINOR 0 |
LSM303AGR driver version minor number.
Definition at line 56 of file lsm303agr.h.
#define EX_LSM303AGR_PATCH 2 |
LSM303AGR driver version patch number.
Definition at line 61 of file lsm303agr.h.
#define LSM303AGR_ACC_NUMBER_OF_AXES 3U |
LSM303AGR accelerometer subsystem characteristics.
Definition at line 72 of file lsm303agr.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(), lsm303agrObjectInit(), and lsm303agrStart().
#define LSM303AGR_ACC_2G 2.0f |
Definition at line 74 of file lsm303agr.h.
Referenced by acc_set_full_scale(), and lsm303agrStart().
#define LSM303AGR_ACC_4G 4.0f |
Definition at line 75 of file lsm303agr.h.
Referenced by acc_set_full_scale(), and lsm303agrStart().
#define LSM303AGR_ACC_8G 8.0f |
Definition at line 76 of file lsm303agr.h.
Referenced by acc_set_full_scale(), and lsm303agrStart().
#define LSM303AGR_ACC_16G 16.0f |
Definition at line 77 of file lsm303agr.h.
Referenced by acc_set_full_scale(), and lsm303agrStart().
#define LSM303AGR_ACC_SENS_2G 0.060f |
Definition at line 79 of file lsm303agr.h.
Referenced by acc_reset_sensivity(), and lsm303agrStart().
#define LSM303AGR_ACC_SENS_4G 0.120f |
Definition at line 80 of file lsm303agr.h.
Referenced by acc_reset_sensivity(), and lsm303agrStart().
#define LSM303AGR_ACC_SENS_8G 0.240f |
Definition at line 81 of file lsm303agr.h.
Referenced by acc_reset_sensivity(), and lsm303agrStart().
#define LSM303AGR_ACC_SENS_16G 0.750f |
Definition at line 82 of file lsm303agr.h.
Referenced by acc_reset_sensivity(), and lsm303agrStart().
#define LSM303AGR_ACC_BIAS 0.0f |
Definition at line 84 of file lsm303agr.h.
Referenced by acc_reset_bias(), and lsm303agrStart().
#define LSM303AGR_COMP_NUMBER_OF_AXES 3U |
LSM303AGR compass subsystem characteristics.
Definition at line 94 of file lsm303agr.h.
Referenced by comp_get_axes_number(), comp_read_cooked(), comp_read_raw(), comp_reset_bias(), comp_reset_sensivity(), comp_set_bias(), comp_set_sensivity(), lsm303agrObjectInit(), and lsm303agrStart().
#define LSM303AGR_COMP_50GA 50.0f |
Definition at line 96 of file lsm303agr.h.
Referenced by lsm303agrStart().
#define LSM303AGR_COMP_SENS_50GA 0.00015f |
Definition at line 98 of file lsm303agr.h.
Referenced by comp_reset_sensivity(), and lsm303agrStart().
#define LSM303AGR_COMP_BIAS 0.0f |
Definition at line 100 of file lsm303agr.h.
Referenced by comp_reset_bias().
#define LSM303AGR_DI_MASK 0xFF |
Definition at line 107 of file lsm303agr.h.
#define LSM303AGR_DI | ( | n | ) |
Definition at line 108 of file lsm303agr.h.
#define LSM303AGR_AD_MASK 0x7F |
Definition at line 109 of file lsm303agr.h.
#define LSM303AGR_AD | ( | n | ) |
Definition at line 110 of file lsm303agr.h.
#define LSM303AGR_MS (1 << 7) |
Definition at line 111 of file lsm303agr.h.
Referenced by lsm303agrI2CReadRegister(), and lsm303agrI2CWriteRegister().
#define LSM303AGR_AD_STATUS_REG_AUX_A 0x07 |
Definition at line 118 of file lsm303agr.h.
#define LSM303AGR_AD_OUT_TEMP_L_A 0x0C |
Definition at line 119 of file lsm303agr.h.
#define LSM303AGR_AD_OUT_TEMP_H_A 0x0D |
Definition at line 120 of file lsm303agr.h.
#define LSM303AGR_AD_INT_COUNTER_REG_A 0x0E |
Definition at line 121 of file lsm303agr.h.
#define LSM303AGR_AD_WHO_AM_I_A 0x0F |
Definition at line 122 of file lsm303agr.h.
#define LSM303AGR_AD_TEMP_CFG_REG_A 0x1F |
Definition at line 123 of file lsm303agr.h.
#define LSM303AGR_AD_CTRL_REG1_A 0x20 |
Definition at line 124 of file lsm303agr.h.
Referenced by lsm303agrStart(), and lsm303agrStop().
#define LSM303AGR_AD_CTRL_REG2_A 0x21 |
Definition at line 125 of file lsm303agr.h.
#define LSM303AGR_AD_CTRL_REG3_A 0x22 |
Definition at line 126 of file lsm303agr.h.
#define LSM303AGR_AD_CTRL_REG4_A 0x23 |
Definition at line 127 of file lsm303agr.h.
Referenced by acc_set_full_scale().
#define LSM303AGR_AD_CTRL_REG5_A 0x24 |
Definition at line 128 of file lsm303agr.h.
#define LSM303AGR_AD_CTRL_REG6_A 0x25 |
Definition at line 129 of file lsm303agr.h.
#define LSM303AGR_AD_REFERENCE_A 0x26 |
Definition at line 130 of file lsm303agr.h.
#define LSM303AGR_AD_STATUS_REG_A 0x27 |
Definition at line 131 of file lsm303agr.h.
#define LSM303AGR_AD_OUT_X_L_A 0x28 |
Definition at line 132 of file lsm303agr.h.
Referenced by acc_read_raw().
#define LSM303AGR_AD_OUT_X_H_A 0x29 |
Definition at line 133 of file lsm303agr.h.
#define LSM303AGR_AD_OUT_Y_L_A 0x2A |
Definition at line 134 of file lsm303agr.h.
#define LSM303AGR_AD_OUT_Y_H_A 0x2B |
Definition at line 135 of file lsm303agr.h.
#define LSM303AGR_AD_OUT_Z_L_A 0x2C |
Definition at line 136 of file lsm303agr.h.
#define LSM303AGR_AD_OUT_Z_H_A 0x2D |
Definition at line 137 of file lsm303agr.h.
#define LSM303AGR_AD_FIFO_CTRL_REG_A 0x2E |
Definition at line 138 of file lsm303agr.h.
#define LSM303AGR_AD_FIFO_SRC_REG_A 0x2F |
Definition at line 139 of file lsm303agr.h.
#define LSM303AGR_AD_INT1_CFG_A 0x30 |
Definition at line 140 of file lsm303agr.h.
#define LSM303AGR_AD_INT1_SRC_A 0x31 |
Definition at line 141 of file lsm303agr.h.
#define LSM303AGR_AD_INT1_THS_A 0x32 |
Definition at line 142 of file lsm303agr.h.
#define LSM303AGR_AD_INT1_DURATION_A 0x33 |
Definition at line 143 of file lsm303agr.h.
#define LSM303AGR_AD_INT2_CFG_A 0x34 |
Definition at line 144 of file lsm303agr.h.
#define LSM303AGR_AD_INT2_SRC_A 0x35 |
Definition at line 145 of file lsm303agr.h.
#define LSM303AGR_AD_INT2_THS_A 0x36 |
Definition at line 146 of file lsm303agr.h.
#define LSM303AGR_AD_INT2_DURATION_A 0x37 |
Definition at line 147 of file lsm303agr.h.
#define LSM303AGR_AD_CLICK_CFG_A 0x38 |
Definition at line 148 of file lsm303agr.h.
#define LSM303AGR_AD_CLICK_SRC_A 0x39 |
Definition at line 149 of file lsm303agr.h.
#define LSM303AGR_AD_CLICK_THS_A 0x3A |
Definition at line 150 of file lsm303agr.h.
#define LSM303AGR_AD_TIME_LIMIT_A 0x3B |
Definition at line 151 of file lsm303agr.h.
#define LSM303AGR_AD_TIME_LATENCY_A 0x3C |
Definition at line 152 of file lsm303agr.h.
#define LSM303AGR_AD_TIME_WINDOW_A 0x3D |
Definition at line 153 of file lsm303agr.h.
#define LSM303AGR_AD_ACT_THS_A 0x3E |
Definition at line 154 of file lsm303agr.h.
#define LSM303AGR_AD_ACT_DUR_A 0x3F |
Definition at line 155 of file lsm303agr.h.
#define LSM303AGR_AD_OFFSET_X_REG_L_M 0x45 |
Definition at line 156 of file lsm303agr.h.
#define LSM303AGR_AD_OFFSET_X_REG_H_M 0x46 |
Definition at line 157 of file lsm303agr.h.
#define LSM303AGR_AD_OFFSET_Y_REG_L_M 0x47 |
Definition at line 158 of file lsm303agr.h.
#define LSM303AGR_AD_OFFSET_Y_REG_H_M 0x48 |
Definition at line 159 of file lsm303agr.h.
#define LSM303AGR_AD_OFFSET_Z_REG_L_M 0x49 |
Definition at line 160 of file lsm303agr.h.
#define LSM303AGR_AD_OFFSET_Z_REG_H_M 0x4A |
Definition at line 161 of file lsm303agr.h.
#define LSM303AGR_AD_WHO_AM_I_M 0x4F |
Definition at line 162 of file lsm303agr.h.
#define LSM303AGR_AD_CFG_REG_A_M 0x60 |
Definition at line 163 of file lsm303agr.h.
Referenced by lsm303agrStart(), and lsm303agrStop().
#define LSM303AGR_AD_CFG_REG_B_M 0x61 |
Definition at line 164 of file lsm303agr.h.
#define LSM303AGR_AD_CFG_REG_C_M 0x62 |
Definition at line 165 of file lsm303agr.h.
#define LSM303AGR_AD_INT_CRTL_REG_M 0x63 |
Definition at line 166 of file lsm303agr.h.
#define LSM303AGR_AD_INT_SOURCE_REG_M 0x64 |
Definition at line 167 of file lsm303agr.h.
#define LSM303AGR_AD_INT_THS_L_REG_M 0x65 |
Definition at line 168 of file lsm303agr.h.
#define LSM303AGR_AD_INT_THS_H_REG_M 0x66 |
Definition at line 169 of file lsm303agr.h.
#define LSM303AGR_AD_STATUS_REG_M 0x67 |
Definition at line 170 of file lsm303agr.h.
#define LSM303AGR_AD_OUTX_L_REG_M 0x68 |
Definition at line 171 of file lsm303agr.h.
Referenced by comp_read_raw().
#define LSM303AGR_AD_OUTX_H_REG_M 0x69 |
Definition at line 172 of file lsm303agr.h.
#define LSM303AGR_AD_OUTY_L_REG_M 0x6A |
Definition at line 173 of file lsm303agr.h.
#define LSM303AGR_AD_OUTY_H_REG_M 0x6B |
Definition at line 174 of file lsm303agr.h.
#define LSM303AGR_AD_OUTZ_L_REG_M 0x6C |
Definition at line 175 of file lsm303agr.h.
#define LSM303AGR_AD_OUTZ_H_REG_M 0x6D |
Definition at line 176 of file lsm303agr.h.
#define LSM303AGR_TEMP_CFG_REG_A_TEMP_EN0 (1 << 0) |
Definition at line 183 of file lsm303agr.h.
#define LSM303AGR_TEMP_CFG_REG_A_TEMP_EN1 (1 << 0) |
Definition at line 184 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG1_A_XEN (1 << 0) |
Definition at line 191 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG1_A_YEN (1 << 1) |
Definition at line 192 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG1_A_ZEN (1 << 2) |
Definition at line 193 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG1_A_LPEN (1 << 3) |
Definition at line 194 of file lsm303agr.h.
Referenced by lsm303agrStart().
#define LSM303AGR_CTRL_REG1_A_ODR0 (1 << 4) |
Definition at line 195 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG1_A_ODR1 (1 << 5) |
Definition at line 196 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG1_A_ODR2 (1 << 6) |
Definition at line 197 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG1_A_ODR3 (1 << 7) |
Definition at line 198 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG2_A_HPIS1 (1 << 0) |
Definition at line 205 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG2_A_HPIS2 (1 << 1) |
Definition at line 206 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG2_A_HPCLICK (1 << 2) |
Definition at line 207 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG2_A_FDS (1 << 3) |
Definition at line 208 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG2_A_HPCF1 (1 << 4) |
Definition at line 209 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG2_A_HPCF2 (1 << 5) |
Definition at line 210 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG2_A_HPM0 (1 << 6) |
Definition at line 211 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG2_A_HPM1 (1 << 7) |
Definition at line 212 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG3_A_I1_OVERRUN (1 << 1) |
Definition at line 219 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG3_A_I1_WTM (1 << 2) |
Definition at line 220 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG3_A_I1_DRDY2 (1 << 3) |
Definition at line 221 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG3_A_I1_DRDY1 (1 << 4) |
Definition at line 222 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG3_A_I1_AOI2 (1 << 5) |
Definition at line 223 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG3_A_I1_AOI1 (1 << 6) |
Definition at line 224 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG3_A_I1_CLICK (1 << 7) |
Definition at line 225 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG4_A_SPI_ENABLE (1 << 0) |
Definition at line 232 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG4_A_ST0 (1 << 1) |
Definition at line 233 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG4_A_ST1 (1 << 2) |
Definition at line 234 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG4_A_HR (1 << 3) |
Definition at line 235 of file lsm303agr.h.
Referenced by lsm303agrStart().
#define LSM303AGR_CTRL_REG4_A_FS_MASK 0x30 |
Definition at line 236 of file lsm303agr.h.
Referenced by acc_set_full_scale().
#define LSM303AGR_CTRL_REG4_A_FS0 (1 << 4) |
Definition at line 237 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG4_A_FS1 (1 << 5) |
Definition at line 238 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG4_A_BLE (1 << 6) |
Definition at line 239 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG4_A_BDU (1 << 7) |
Definition at line 240 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG5_A_D4D_INT2 (1 << 0) |
Definition at line 247 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG5_A_LIR_INT2 (1 << 1) |
Definition at line 248 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG5_A_D4D_INT1 (1 << 2) |
Definition at line 249 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG5_A_LIR_INT1 (1 << 3) |
Definition at line 250 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG5_A_FIFO_EN (1 << 6) |
Definition at line 251 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG5_A_BOOT (1 << 7) |
Definition at line 252 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG6_A_H_LACTIVE (1 << 1) |
Definition at line 259 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG6_A_P2_ACT (1 << 3) |
Definition at line 260 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG6_A_BOOT_I2 (1 << 4) |
Definition at line 261 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG6_A_I2_INT2 (1 << 5) |
Definition at line 262 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG6_A_I2_INT1 (1 << 6) |
Definition at line 263 of file lsm303agr.h.
#define LSM303AGR_CTRL_REG6_A_I2_CLICKEN (1 << 7) |
Definition at line 264 of file lsm303agr.h.
#define LSM303AGR_CFG_REG_A_M_MD0 (1 << 0) |
Definition at line 271 of file lsm303agr.h.
#define LSM303AGR_CFG_REG_A_M_MD1 (1 << 1) |
Definition at line 272 of file lsm303agr.h.
#define LSM303AGR_CFG_REG_A_M_ODR0 (1 << 2) |
Definition at line 273 of file lsm303agr.h.
#define LSM303AGR_CFG_REG_A_M_ODR1 (1 << 3) |
Definition at line 274 of file lsm303agr.h.
#define LSM303AGR_CFG_REG_A_M_LP (1 << 4) |
Definition at line 275 of file lsm303agr.h.
#define LSM303AGR_CFG_REG_A_M_SOFT_RST (1 << 5) |
Definition at line 276 of file lsm303agr.h.
#define LSM303AGR_CFG_REG_A_M_REBOOT (1 << 6) |
Definition at line 277 of file lsm303agr.h.
#define LSM303AGR_CFG_REG_A_M_COMP_TEMP_EN (1 << 7) |
Definition at line 278 of file lsm303agr.h.
#define LSM303AGR_CFG_REG_B_M_LPF (1 << 0) |
Definition at line 285 of file lsm303agr.h.
#define LSM303AGR_CFG_REG_B_M_OFF_CANC (1 << 1) |
Definition at line 286 of file lsm303agr.h.
#define LSM303AGR_CFG_REG_B_M_SET_FREQ (1 << 2) |
Definition at line 287 of file lsm303agr.h.
#define LSM303AGR_CFG_REG_B_M_INT_ON (1 << 3) |
Definition at line 288 of file lsm303agr.h.
#define LSM303AGR_CFG_REG_B_M_OFF_CANC_OS (1 << 4) |
Definition at line 289 of file lsm303agr.h.
#define LSM303AGR_CFG_REG_C_M_INT_MAG (1 << 0) |
Definition at line 296 of file lsm303agr.h.
#define LSM303AGR_CFG_REG_C_M_SELF_TEST (1 << 1) |
Definition at line 297 of file lsm303agr.h.
#define LSM303AGR_CFG_REG_C_M_BLE (1 << 3) |
Definition at line 298 of file lsm303agr.h.
#define LSM303AGR_CFG_REG_C_M_BDU (1 << 4) |
Definition at line 299 of file lsm303agr.h.
#define LSM303AGR_CFG_REG_C_M_I2C_DIS (1 << 5) |
Definition at line 300 of file lsm303agr.h.
#define LSM303AGR_CFG_REG_C_M_INT_MAG_PIN (1 << 6) |
Definition at line 301 of file lsm303agr.h.
#define LSM303AGR_USE_SPI FALSE |
LSM303AGR SPI interface switch.
If set to TRUE
the support for SPI is included.
FALSE
. Definition at line 318 of file lsm303agr.h.
#define LSM303AGR_SHARED_SPI FALSE |
LSM303AGR 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 328 of file lsm303agr.h.
#define LSM303AGR_USE_I2C TRUE |
LSM303AGR I2C interface switch.
If set to TRUE
the support for I2C is included.
TRUE
. Definition at line 337 of file lsm303agr.h.
#define LSM303AGR_SHARED_I2C FALSE |
LSM303AGR 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 347 of file lsm303agr.h.
#define LSM303AGR_USE_ADVANCED FALSE |
LSM303AGR advanced configurations switch.
If set to TRUE
more configurations are available.
FALSE
. Definition at line 356 of file lsm303agr.h.
#define _lsm303agr_methods_alone |
LSM303AGR
specific methods.
Definition at line 584 of file lsm303agr.h.
#define _lsm303agr_methods |
LSM303AGR
specific methods with inherited ones.
Definition at line 592 of file lsm303agr.h.
#define _lsm303agr_data |
LSM303AGRDriver
specific data.
Definition at line 608 of file lsm303agr.h.
#define lsm303agrAccelerometerGetAxesNumber | ( | devp | ) |
Return the number of axes of the BaseAccelerometer.
[in] | devp | pointer to LSM303AGRDriver . |
Definition at line 658 of file lsm303agr.h.
#define lsm303agrAccelerometerReadRaw | ( | devp, | |
axes ) |
Retrieves raw data from the BaseAccelerometer.
[in] | devp | pointer to LSM303AGRDriver . |
[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 679 of file lsm303agr.h.
#define lsm303agrAccelerometerReadCooked | ( | devp, | |
axes ) |
Retrieves cooked data from the BaseAccelerometer.
[in] | devp | pointer to LSM303AGRDriver . |
[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 701 of file lsm303agr.h.
#define lsm303agrAccelerometerSetBias | ( | devp, | |
bp ) |
Set bias values for the BaseAccelerometer.
[in] | devp | pointer to LSM303AGRDriver . |
[in] | bp | a buffer which contains biases. |
MSG_OK | if the function succeeded. |
Definition at line 718 of file lsm303agr.h.
#define lsm303agrAccelerometerResetBias | ( | devp | ) |
Reset bias values for the BaseAccelerometer.
[in] | devp | pointer to LSM303AGRDriver . |
MSG_OK | if the function succeeded. |
Definition at line 733 of file lsm303agr.h.
#define lsm303agrAccelerometerSetSensitivity | ( | devp, | |
sp ) |
Set sensitivity values for the BaseAccelerometer.
[in] | devp | pointer to LSM303AGRDriver . |
[in] | sp | a buffer which contains sensitivities. |
MSG_OK | if the function succeeded. |
Definition at line 750 of file lsm303agr.h.
#define lsm303agrAccelerometerResetSensitivity | ( | devp | ) |
Reset sensitivity values for the BaseAccelerometer.
[in] | devp | pointer to LSM303AGRDriver . |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
Definition at line 765 of file lsm303agr.h.
#define lsm303agrAccelerometerSetFullScale | ( | devp, | |
fs ) |
Changes the LSM303AGRDriver accelerometer fullscale value.
[in] | devp | pointer to LSM303AGRDriver . |
[in] | fs | new fullscale value. |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
Definition at line 783 of file lsm303agr.h.
#define lsm303agrCompassGetAxesNumber | ( | devp | ) |
Return the number of axes of the BaseCompass.
[in] | devp | pointer to LSM303AGRDriver . |
Definition at line 795 of file lsm303agr.h.
#define lsm303agrCompassReadRaw | ( | 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 816 of file lsm303agr.h.
#define lsm303agrCompassReadCooked | ( | 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 838 of file lsm303agr.h.
#define lsm303agrCompassSetBias | ( | 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 855 of file lsm303agr.h.
#define lsm303agrCompassResetBias | ( | devp | ) |
Reset bias values for the BaseCompass.
[in] | devp | pointer to LSM303AGRDriver . |
MSG_OK | if the function succeeded. |
Definition at line 870 of file lsm303agr.h.
#define lsm303agrCompassSetSensitivity | ( | devp, | |
sp ) |
Set sensitivity values for the BaseCompass.
[in] | devp | pointer to LSM303AGRDriver . |
[in] | sp | a buffer which contains sensitivities. |
MSG_OK | if the function succeeded. |
Definition at line 887 of file lsm303agr.h.
#define lsm303agrCompassResetSensitivity | ( | devp | ) |
Reset sensitivity values for the BaseCompass.
[in] | devp | pointer to LSM303AGRDriver . |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
Definition at line 902 of file lsm303agr.h.
typedef struct LSM303AGRDriver LSM303AGRDriver |
Structure representing a LSM303AGR driver.
Definition at line 402 of file lsm303agr.h.
enum lsm303agr_sad_t |
Accelerometer and Compass Slave Address.
Enumerator | |
---|---|
LSM303AGR_SAD_ACC | SAD for accelerometer. |
LSM303AGR_SAD_COMP | SAD for compass. |
Definition at line 48 of file lsm303agr.c.
enum lsm303agr_acc_fs_t |
LSM303AGR accelerometer subsystem full scale.
Enumerator | |
---|---|
LSM303AGR_ACC_FS_2G | Full scale �2g. |
LSM303AGR_ACC_FS_4G | Full scale �4g. |
LSM303AGR_ACC_FS_8G | Full scale �8g. |
LSM303AGR_ACC_FS_16G | Full scale �16g. |
Definition at line 407 of file lsm303agr.h.
enum lsm303agr_acc_odr_t |
LSM303AGR accelerometer subsystem output data rate.
Definition at line 417 of file lsm303agr.h.
enum lsm303agr_acc_ae_t |
LSM303AGR accelerometer subsystem axes enabling.
Definition at line 433 of file lsm303agr.h.
enum lsm303agr_acc_mode_t |
LSM303AGR accelerometer subsystem operation mode.
Enumerator | |
---|---|
LSM303AGR_ACC_MODE_NORM | Normal mode. |
LSM303AGR_ACC_MODE_LPOW | Low power mode. |
LSM303AGR_ACC_MODE_HRES | High resolution mode. |
Definition at line 447 of file lsm303agr.h.
enum lsm303agr_acc_bdu_t |
LSM303AGR accelerometer subsystem block data update.
Enumerator | |
---|---|
LSM303AGR_ACC_BDU_CONT | Continuous update |
LSM303AGR_ACC_BDU_BLOCK | Update blocked |
Definition at line 456 of file lsm303agr.h.
enum lsm303agr_acc_end_t |
LSM303AGR accelerometer endianness.
Enumerator | |
---|---|
LSM303AGR_ACC_END_LITTLE | Little Endian |
LSM303AGR_ACC_END_BIG | Big Endian |
Definition at line 464 of file lsm303agr.h.
enum lsm303agr_comp_odr_t |
LSM303AGR compass subsystem output data rate.
Enumerator | |
---|---|
LSM303AGR_COMP_ODR_10HZ | ODR 10 Hz |
LSM303AGR_COMP_ODR_20HZ | ODR 20 Hz |
LSM303AGR_COMP_ODR_50HZ | ODR 50 Hz |
LSM303AGR_COMP_ODR_100HZ | ODR 100 Hz |
Definition at line 477 of file lsm303agr.h.
LSM303AGR compass subsystem working mode.
Enumerator | |
---|---|
LSM303AGR_COMP_MODE_NORM | Continuous-Conversion Mode |
LSM303AGR_COMP_MODE_SINGLE | Single-Conversion Mode |
LSM303AGR_COMP_MODE_IDLE | Sleep Mode |
Definition at line 487 of file lsm303agr.h.
LSM303AGR compass subsystem working mode.
Enumerator | |
---|---|
LSM303AGR_COMP_LPOW_DIS | High Resolution Mode |
LSM303AGR_COMP_LPOW_EN | Low Power Mode |
Definition at line 496 of file lsm303agr.h.
enum lsm303agr_state_t |
Driver state machine possible states.
Enumerator | |
---|---|
LSM303AGR_UNINIT | Not initialized. |
LSM303AGR_STOP | Stopped. |
LSM303AGR_READY | Ready. |
Definition at line 509 of file lsm303agr.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 lsm303agr.c.
References LSM303AGR_MS.
Referenced by acc_read_raw(), acc_set_full_scale(), and comp_read_raw().
|
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 lsm303agr.c.
References LSM303AGR_MS.
Referenced by acc_set_full_scale(), lsm303agrStart(), and lsm303agrStop().
|
static |
Return the number of axes of the BaseAccelerometer.
[in] | ip | pointer to BaseAccelerometer interface. |
Definition at line 104 of file lsm303agr.c.
References LSM303AGR_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 lsm303agr.c.
References LSM303AGR_ACC_NUMBER_OF_AXES, LSM303AGR_AD_OUT_X_L_A, LSM303AGR_READY, LSM303AGR_SAD_ACC, and lsm303agrI2CReadRegister().
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 lsm303agr.c.
References acc_read_raw(), LSM303AGR_ACC_NUMBER_OF_AXES, and LSM303AGR_READY.
|
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 lsm303agr.c.
References LSM303AGR_ACC_NUMBER_OF_AXES, and LSM303AGR_READY.
|
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 lsm303agr.c.
References LSM303AGR_ACC_BIAS, LSM303AGR_ACC_NUMBER_OF_AXES, and LSM303AGR_READY.
|
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 lsm303agr.c.
References LSM303AGR_ACC_NUMBER_OF_AXES, and LSM303AGR_READY.
|
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 lsm303agr.c.
References LSM303AGR_ACC_FS_16G, LSM303AGR_ACC_FS_2G, LSM303AGR_ACC_FS_4G, LSM303AGR_ACC_FS_8G, LSM303AGR_ACC_NUMBER_OF_AXES, LSM303AGR_ACC_SENS_16G, LSM303AGR_ACC_SENS_2G, LSM303AGR_ACC_SENS_4G, LSM303AGR_ACC_SENS_8G, and LSM303AGR_READY.
|
static |
Changes the LSM303AGRDriver accelerometer fullscale value.
[in] | devp | pointer to LSM303AGRDriver interface. |
[in] | fs | new fullscale value. |
MSG_OK | if the function succeeded. |
MSG_RESET | otherwise. |
Definition at line 355 of file lsm303agr.c.
References LSM303AGR_ACC_16G, LSM303AGR_ACC_2G, LSM303AGR_ACC_4G, LSM303AGR_ACC_8G, LSM303AGR_ACC_FS_16G, LSM303AGR_ACC_FS_2G, LSM303AGR_ACC_FS_4G, LSM303AGR_ACC_FS_8G, LSM303AGR_ACC_NUMBER_OF_AXES, LSM303AGR_AD_CTRL_REG4_A, LSM303AGR_CTRL_REG4_A_FS_MASK, LSM303AGR_READY, LSM303AGR_SAD_ACC, lsm303agrI2CReadRegister(), and lsm303agrI2CWriteRegister().
|
static |
Return the number of axes of the BaseCompass.
[in] | ip | pointer to BaseCompass interface |
Definition at line 448 of file lsm303agr.c.
References LSM303AGR_COMP_NUMBER_OF_AXES.
|
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 470 of file lsm303agr.c.
References LSM303AGR_AD_OUTX_L_REG_M, LSM303AGR_COMP_NUMBER_OF_AXES, LSM303AGR_READY, LSM303AGR_SAD_COMP, and lsm303agrI2CReadRegister().
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 524 of file lsm303agr.c.
References comp_read_raw(), LSM303AGR_COMP_NUMBER_OF_AXES, and LSM303AGR_READY.
|
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 558 of file lsm303agr.c.
References LSM303AGR_COMP_NUMBER_OF_AXES, and LSM303AGR_READY.
|
static |
Reset bias values for the BaseCompass.
[in] | ip | pointer to BaseCompass interface. |
MSG_OK | if the function succeeded. |
Definition at line 587 of file lsm303agr.c.
References LSM303AGR_COMP_BIAS, LSM303AGR_COMP_NUMBER_OF_AXES, and LSM303AGR_READY.
|
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 617 of file lsm303agr.c.
References LSM303AGR_COMP_NUMBER_OF_AXES, and LSM303AGR_READY.
|
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 646 of file lsm303agr.c.
References LSM303AGR_COMP_NUMBER_OF_AXES, LSM303AGR_COMP_SENS_50GA, and LSM303AGR_READY.
void lsm303agrObjectInit | ( | LSM303AGRDriver * | devp | ) |
Initializes an instance.
[out] | devp | pointer to the LSM303AGRDriver object |
Definition at line 693 of file lsm303agr.c.
References LSM303AGRDriver::acc_if, LSM303AGRDriver::comp_if, LSM303AGR_ACC_NUMBER_OF_AXES, LSM303AGR_COMP_NUMBER_OF_AXES, LSM303AGR_STOP, BaseAccelerometer::vmt, BaseCompass::vmt, LSM303AGRDriver::vmt, vmt_accelerometer, vmt_compass, and vmt_device.
void lsm303agrStart | ( | LSM303AGRDriver * | devp, |
const LSM303AGRConfig * | config ) |
Configures and activates LSM303AGR Complex Driver peripheral.
[in] | devp | pointer to the LSM303AGRDriver object |
[in] | config | pointer to the LSM303AGRConfig object |
Definition at line 714 of file lsm303agr.c.
References LSM303AGRConfig::i2cp, LSM303AGR_ACC_16G, LSM303AGR_ACC_2G, LSM303AGR_ACC_4G, LSM303AGR_ACC_8G, LSM303AGR_ACC_AE_XYZ, LSM303AGR_ACC_BIAS, LSM303AGR_ACC_FS_16G, LSM303AGR_ACC_FS_2G, LSM303AGR_ACC_FS_4G, LSM303AGR_ACC_FS_8G, LSM303AGR_ACC_MODE_HRES, LSM303AGR_ACC_MODE_LPOW, LSM303AGR_ACC_NUMBER_OF_AXES, LSM303AGR_ACC_SENS_16G, LSM303AGR_ACC_SENS_2G, LSM303AGR_ACC_SENS_4G, LSM303AGR_ACC_SENS_8G, LSM303AGR_AD_CFG_REG_A_M, LSM303AGR_AD_CTRL_REG1_A, LSM303AGR_COMP_50GA, LSM303AGR_COMP_NUMBER_OF_AXES, LSM303AGR_COMP_SENS_50GA, LSM303AGR_CTRL_REG1_A_LPEN, LSM303AGR_CTRL_REG4_A_HR, LSM303AGR_READY, LSM303AGR_SAD_ACC, LSM303AGR_SAD_COMP, LSM303AGR_STOP, and lsm303agrI2CWriteRegister().
void lsm303agrStop | ( | LSM303AGRDriver * | devp | ) |
Deactivates the LSM303AGR Complex Driver peripheral.
[in] | devp | pointer to the LSM303AGRDriver object |
Definition at line 876 of file lsm303agr.c.
References LSM303AGR_ACC_AE_DISABLED, LSM303AGR_ACC_ODR_PD, LSM303AGR_AD_CFG_REG_A_M, LSM303AGR_AD_CTRL_REG1_A, LSM303AGR_COMP_MODE_IDLE, LSM303AGR_READY, LSM303AGR_SAD_ACC, LSM303AGR_SAD_COMP, LSM303AGR_STOP, and lsm303agrI2CWriteRegister().
|
static |
Definition at line 665 of file lsm303agr.c.
|
static |
Definition at line 670 of file lsm303agr.c.
|
static |
Definition at line 676 of file lsm303agr.c.