![]() |
Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for ST LSM303D 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 | lsm303d_spi_init (struct Lsm303d_Spi *lsm, struct spi_periph *spi_p, uint8_t slave_idx, enum Lsm303dTarget target) |
static void | lsm303d_spi_tx_reg (struct Lsm303d_Spi *lsm, uint8_t reg, uint8_t val) |
static void | lsm303d_spi_send_config (struct Lsm303d_Spi *lsm) |
Configuration function called once before normal use. | |
void | lsm303d_spi_start_configure (struct Lsm303d_Spi *lsm) |
void | lsm303d_spi_read (struct Lsm303d_Spi *lsm) |
void | lsm303d_spi_event (struct Lsm303d_Spi *lsm) |
Driver for ST LSM303D 3D accelerometer and magnetometer.
Definition in file lsm303d_spi.c.
Definition at line 172 of file lsm303d_spi.c.
void lsm303d_spi_event | ( | struct Lsm303d_Spi * | lsm | ) |
Definition at line 176 of file lsm303d_spi.c.
References foo, Int16FromBuf, LSM303D_CONF_UNINIT, lsm303d_spi_send_config(), LSM303D_TARGET_ACC, LSM303D_ZYXADA, LSM303D_ZYXMDA, SPITransDone, SPITransFailed, SPITransSuccess, and TRUE.
Referenced by imu_px4_event().
void lsm303d_spi_init | ( | struct Lsm303d_Spi * | lsm, |
struct spi_periph * | spi_p, | ||
uint8_t | slave_idx, | ||
enum Lsm303dTarget | target | ||
) |
Definition at line 32 of file lsm303d_spi.c.
References FALSE, foo, LSM303D_CONF_UNINIT, lsm303d_set_default_config(), SPICphaEdge2, SPICpolIdleHigh, SPIDiv64, SPIDss8bit, SPIMSBFirst, SPISelectUnselect, SPITransDone, and target.
Referenced by imu_px4_init().
void lsm303d_spi_read | ( | struct Lsm303d_Spi * | lsm | ) |
Definition at line 151 of file lsm303d_spi.c.
References foo, LSM303D_REG_STATUS_A, LSM303D_REG_STATUS_M, LSM303D_TARGET_ACC, spi_submit(), and SPITransDone.
Referenced by lsm303d_spi_periodic().
|
static |
Configuration function called once before normal use.
Definition at line 80 of file lsm303d_spi.c.
References foo, LSM303D_AFS_MASK, LSM303D_AHPM_MASK, LSM303D_AODR_MASK, LSM303D_AXEN, LSM303D_AYEN, LSM303D_AZEN, LSM303D_CONF_CTRL_REG1, LSM303D_CONF_CTRL_REG2, LSM303D_CONF_CTRL_REG3, LSM303D_CONF_CTRL_REG4, LSM303D_CONF_CTRL_REG5, LSM303D_CONF_CTRL_REG6, LSM303D_CONF_CTRL_REG7, LSM303D_CONF_DONE, LSM303D_CONF_WHO_AM_I, LSM303D_INT1_DRDY_A, LSM303D_INT2_DRDY_M, LSM303D_M_ODR_MASK, LSM303D_MFS_MASK, LSM303D_REG_CTRL1, LSM303D_REG_CTRL2, LSM303D_REG_CTRL3, LSM303D_REG_CTRL4, LSM303D_REG_CTRL5, LSM303D_REG_CTRL6, LSM303D_REG_CTRL7, LSM303D_REG_WHO_AM_I, LSM303D_REG_WHO_I_AM, lsm303d_spi_tx_reg(), spi_submit(), SPITransDone, and TRUE.
Referenced by lsm303d_spi_event(), and lsm303d_spi_start_configure().
void lsm303d_spi_start_configure | ( | struct Lsm303d_Spi * | lsm | ) |
Definition at line 140 of file lsm303d_spi.c.
References foo, LSM303D_CONF_UNINIT, lsm303d_spi_send_config(), SPITransDone, and SPITransSuccess.
Referenced by lsm303d_spi_periodic().
|
static |
Definition at line 70 of file lsm303d_spi.c.
References foo, spi_submit(), and val.
Referenced by lsm303d_spi_send_config().