Paparazzi UAS
v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
|
ST LIS3MDL 3-axis magnetometer driver interface (I2C). More...
#include "peripherals/lis3mdl.h"
Go to the source code of this file.
Functions | |
void | lis3mdl_init (struct Lis3mdl *mag, struct i2c_periph *i2c_p, uint8_t addr, uint8_t data_rate, uint8_t scale, uint8_t mode, uint8_t perf) |
void | lis3mdl_configure (struct Lis3mdl *mag) |
void | lis3mdl_read (struct Lis3mdl *mag) |
void | lis3mdl_event (struct Lis3mdl *mag) |
ST LIS3MDL 3-axis magnetometer driver interface (I2C).
Definition in file lis3mdl.c.
#define Int16FromBuf | ( | _buf, | |
_idx | |||
) | ((int16_t)(_buf[_idx] | (_buf[_idx+1] << 8))) |
Definition at line 125 of file lis3mdl.c.
Referenced by lis3mdl_event().
#define LIS3MDL_ENABLE_AUTO_INC (0x1<<7) |
Definition at line 29 of file lis3mdl.c.
Referenced by lis3mdl_init(), and lis3mdl_read().
#define LIS3MDL_REG_CTL_1 0x20 |
Definition at line 43 of file lis3mdl.c.
Referenced by lis3mdl_init().
#define LIS3MDL_REG_STATUS 0x27 |
Definition at line 47 of file lis3mdl.c.
Referenced by lis3mdl_read().
#define LIS3MDL_STATUS_ZYXDA 0b00001000 |
Definition at line 35 of file lis3mdl.c.
Referenced by lis3mdl_event().
void lis3mdl_configure | ( | struct Lis3mdl * | mag | ) |
Definition at line 82 of file lis3mdl.c.
References Lis3mdl::i2c_p, Lis3mdl::i2c_trans, i2c_transmit(), I2CTransDone, I2CTransFailed, I2CTransSuccess, Lis3mdl::initialized, LIS3MDL_CONF_REG, LIS3MDL_CONF_UNINIT, LIS3MDL_STATUS_IDLE, i2c_transaction::slave_addr, Lis3mdl::status, and i2c_transaction::status.
Referenced by lis3mdl_periodic().
void lis3mdl_event | ( | struct Lis3mdl * | mag | ) |
Definition at line 127 of file lis3mdl.c.
References i2c_transaction::buf, Lis3mdl::data, Lis3mdl::data_available, Lis3mdl::i2c_trans, I2CTransDone, I2CTransFailed, I2CTransSuccess, Lis3mdl::initialized, Int16FromBuf, LIS3MDL_STATUS_IDLE, LIS3MDL_STATUS_MEAS, LIS3MDL_STATUS_ZYXDA, Lis3mdl::status, and i2c_transaction::status.
Referenced by mag_lis3mdl_module_event().
void lis3mdl_init | ( | struct Lis3mdl * | mag, |
struct i2c_periph * | i2c_p, | ||
uint8_t | addr, | ||
uint8_t | data_rate, | ||
uint8_t | scale, | ||
uint8_t | mode, | ||
uint8_t | perf | ||
) |
Definition at line 60 of file lis3mdl.c.
References i2c_transaction::buf, Lis3mdl::data_available, Lis3mdl::i2c_p, Lis3mdl::i2c_trans, I2CTransDone, Lis3mdl::initialized, LIS3MDL_CONF_UNINIT, LIS3MDL_ENABLE_AUTO_INC, LIS3MDL_REG_CTL_1, mode, i2c_transaction::slave_addr, Lis3mdl::status, and i2c_transaction::status.
Referenced by mag_lis3mdl_module_init().
void lis3mdl_read | ( | struct Lis3mdl * | mag | ) |
Definition at line 113 of file lis3mdl.c.
References i2c_transaction::buf, Lis3mdl::i2c_p, Lis3mdl::i2c_trans, i2c_transceive(), LIS3MDL_ENABLE_AUTO_INC, LIS3MDL_REG_STATUS, LIS3MDL_STATUS_IDLE, LIS3MDL_STATUS_MEAS, i2c_transaction::slave_addr, and Lis3mdl::status.
Referenced by lis3mdl_periodic().