Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for ADXL345 accelerometer using I2C. More...
Go to the source code of this file.
Macros | |
#define | ADXL345_DATA_FORMAT ((adxl->config.int_invert<<5)|(adxl->config.full_res<<3)|(adxl->config.justify_msb<<2)|(adxl->config.range)) |
#define | Int16FromBuf(_buf, _idx) ((int16_t)((_buf[_idx+1]<<8) | _buf[_idx])) |
Functions | |
void | adxl345_i2c_init (struct Adxl345_I2c *adxl, struct i2c_periph *i2c_p, uint8_t addr) |
static void | adxl345_i2c_tx_reg (struct Adxl345_I2c *adxl, uint8_t reg, uint8_t val) |
static void | adxl345_i2c_send_config (struct Adxl345_I2c *adxl) |
void | adxl345_i2c_start_configure (struct Adxl345_I2c *adxl) |
Start configuration if not already done. More... | |
void | adxl345_i2c_read (struct Adxl345_I2c *adxl) |
void | adxl345_i2c_event (struct Adxl345_I2c *adxl) |
#define ADXL345_DATA_FORMAT ((adxl->config.int_invert<<5)|(adxl->config.full_res<<3)|(adxl->config.justify_msb<<2)|(adxl->config.range)) |
Definition at line 33 of file adxl345_i2c.c.
#define Int16FromBuf | ( | _buf, | |
_idx | |||
) | ((int16_t)((_buf[_idx+1]<<8) | _buf[_idx])) |
Definition at line 112 of file adxl345_i2c.c.
void adxl345_i2c_event | ( | struct Adxl345_I2c * | adxl | ) |
Definition at line 114 of file adxl345_i2c.c.
References adxl345_i2c_send_config(), ADXL_CONF_UNINIT, i2c_transaction::buf, Adxl345_I2c::data, Adxl345_I2c::data_available, Adxl345_I2c::i2c_trans, I2CTransDone, I2CTransFailed, I2CTransSuccess, Adxl345_I2c::init_status, Adxl345_I2c::initialized, Int16FromBuf, and i2c_transaction::status.
Referenced by imu_aspirin_i2c_event().
void adxl345_i2c_init | ( | struct Adxl345_I2c * | adxl, |
struct i2c_periph * | i2c_p, | ||
uint8_t | addr | ||
) |
Definition at line 36 of file adxl345_i2c.c.
References adxl345_set_default_config(), ADXL_CONF_UNINIT, Adxl345_I2c::config, Adxl345_I2c::i2c_p, Adxl345_I2c::i2c_trans, I2CTransDone, Adxl345_I2c::init_status, Adxl345_I2c::initialized, i2c_transaction::slave_addr, and i2c_transaction::status.
Referenced by imu_aspirin_i2c_init().
void adxl345_i2c_read | ( | struct Adxl345_I2c * | adxl | ) |
Definition at line 101 of file adxl345_i2c.c.
References ADXL345_REG_DATA_X0, i2c_transaction::buf, Adxl345_I2c::i2c_p, i2c_submit(), Adxl345_I2c::i2c_trans, I2CTransDone, I2CTransTxRx, Adxl345_I2c::initialized, i2c_transaction::len_r, i2c_transaction::len_w, i2c_transaction::status, and i2c_transaction::type.
Referenced by adxl345_i2c_periodic().
|
static |
Definition at line 60 of file adxl345_i2c.c.
References ADXL345_DATA_FORMAT, adxl345_i2c_tx_reg(), ADXL345_REG_BW_RATE, ADXL345_REG_DATA_FORMAT, ADXL345_REG_INT_ENABLE, ADXL345_REG_POWER_CTL, ADXL_CONF_DONE, ADXL_CONF_ENABLE, ADXL_CONF_FORMAT, ADXL_CONF_INT, ADXL_CONF_RATE, Adxl345_I2c::config, Adxl345Config::drdy_int_enable, Adxl345_I2c::i2c_trans, I2CTransDone, Adxl345_I2c::init_status, Adxl345_I2c::initialized, Adxl345Config::rate, and i2c_transaction::status.
Referenced by adxl345_i2c_event(), and adxl345_i2c_start_configure().
void adxl345_i2c_start_configure | ( | struct Adxl345_I2c * | adxl | ) |
Start configuration if not already done.
Definition at line 90 of file adxl345_i2c.c.
References adxl345_i2c_send_config(), ADXL_CONF_UNINIT, Adxl345_I2c::i2c_trans, I2CTransDone, I2CTransSuccess, Adxl345_I2c::init_status, and i2c_transaction::status.
Referenced by adxl345_i2c_periodic().
|
static |
Definition at line 49 of file adxl345_i2c.c.
References i2c_transaction::buf, Adxl345_I2c::i2c_p, i2c_submit(), Adxl345_I2c::i2c_trans, I2CTransTx, i2c_transaction::len_r, i2c_transaction::len_w, i2c_transaction::type, and val.
Referenced by adxl345_i2c_send_config().