Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for ST LSM303DLHC 3D accelerometer and magnetometer. More...
Go to the source code of this file.
Macros | |
#define | Int16FromBuf(_buf, _idx) ((int16_t)((_buf[_idx+1]<<8) | _buf[_idx])) |
Functions | |
void | lsm303dlhc_i2c_init (struct Lsm303dlhc_i2c *lsm, struct i2c_periph *i2c_p, uint8_t addr) |
Initialize Lsm303dlhc struct and set default config options. More... | |
static void | lsm303dlhc_i2c_tx_reg (struct Lsm303dlhc_I2c *lsm, uint8_t reg, uint8_t val) |
static void | lsm303dlhc_i2c_send_config (struct Lsm303dlhc_I2c *lsm) |
Configuration function called once before normal use. More... | |
void | lsm303dlhc_i2c_start_configure (struct Lsm303dlhc_I2c *lsm) |
void | lsm303dlhc_i2c_read (struct Lsm303dlhc *lsm) |
void | lsm303dlhc_i2c_event (struct Lsm303dlhc *lsm) |
Driver for ST LSM303DLHC 3D accelerometer and magnetometer.
UNTESTED
Definition in file lsm303dlhc_i2c.c.
#define Int16FromBuf | ( | _buf, | |
_idx | |||
) | ((int16_t)((_buf[_idx+1]<<8) | _buf[_idx])) |
Definition at line 164 of file lsm303dlhc_i2c.c.
void lsm303dlhc_i2c_event | ( | struct Lsm303dlhc * | lsm | ) |
Definition at line 166 of file lsm303dlhc_i2c.c.
References I2CTransDone, I2CTransFailed, I2CTransSuccess, Int16FromBuf, and LSM303DLHC_ACC_ADDR.
void lsm303dlhc_i2c_init | ( | struct Lsm303dlhc_i2c * | lsm, |
struct i2c_periph * | i2c_p, | ||
uint8_t | addr | ||
) |
Initialize Lsm303dlhc struct and set default config options.
lsm | Lsm303dlhc struct |
i2c_p | I2C peripheral to use |
addr | I2C address of Lsm303dlhc |
Definition at line 39 of file lsm303dlhc_i2c.c.
References Lsm303dlhc_i2c::config, Lsm303dlhc_i2c::i2c_p, Lsm303dlhc_i2c::i2c_trans, I2CTransDone, Lsm303dlhc_i2c::init_status, Lsm303dlhc_i2c::initialized, LSM303DLHC_ACC_ADDR, lsm303dlhc_acc_set_default_config(), lsm303dlhc_mag_set_default_config(), i2c_transaction::slave_addr, and i2c_transaction::status.
void lsm303dlhc_i2c_read | ( | struct Lsm303dlhc * | lsm | ) |
Definition at line 142 of file lsm303dlhc_i2c.c.
References i2c_submit(), I2CTransDone, I2CTransTxRx, LSM303DLHC_ACC_ADDR, LSM303DLHC_REG_OUT_X_H_M, and LSM303DLHC_REG_OUT_X_L_A.
Referenced by lsm303dlhc_i2c_send_config().
|
static |
Configuration function called once before normal use.
Definition at line 68 of file lsm303dlhc_i2c.c.
References I2CTransDone, LSM303DLHC_ACC_ADDR, LSM303DLHC_FS_MASK, lsm303dlhc_i2c_read(), lsm303dlhc_i2c_tx_reg(), LSM303DLHC_Xen, LSM303DLHC_Yen, and LSM303DLHC_Zen.
Referenced by lsm303dlhc_i2c_start_configure().
void lsm303dlhc_i2c_start_configure | ( | struct Lsm303dlhc_I2c * | lsm | ) |
Definition at line 122 of file lsm303dlhc_i2c.c.
References I2CTransDone, I2CTransSuccess, LSM303DLHC_ACC_ADDR, and lsm303dlhc_i2c_send_config().
Definition at line 57 of file lsm303dlhc_i2c.c.
References i2c_submit(), I2CTransTx, and val.
Referenced by lsm303dlhc_i2c_send_config().