|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
33 #define ADXL345_DATA_FORMAT ((adxl->config.int_invert<<5)|(adxl->config.full_res<<3)|(adxl->config.justify_msb<<2)|(adxl->config.range))
112 #define Int16FromBuf(_buf,_idx) ((int16_t)((_buf[_idx+1]<<8) | _buf[_idx]))
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
void adxl345_i2c_event(struct Adxl345_I2c *adxl)
uint16_t len_r
Number of bytes to read/receive.
bool drdy_int_enable
Enable Data Ready Interrupt.
@ I2CTransTx
transmit only transaction
#define ADXL345_REG_INT_ENABLE
enum Adxl345Rates rate
Data Output Rate.
@ I2CTransFailed
transaction failed
struct Adxl345Config config
static void adxl345_i2c_tx_reg(struct Adxl345_I2c *adxl, uint8_t reg, uint8_t val)
#define ADXL345_DATA_FORMAT
void adxl345_i2c_init(struct Adxl345_I2c *adxl, struct i2c_periph *i2c_p, uint8_t addr)
uint8_t len_w
Number of bytes to write/transmit.
#define Int16FromBuf(_buf, _idx)
@ I2CTransSuccess
transaction successfully finished by I2C driver
struct i2c_periph * i2c_p
#define ADXL345_REG_DATA_FORMAT
void adxl345_i2c_start_configure(struct Adxl345_I2c *adxl)
Start configuration if not already done.
#define ADXL345_REG_BW_RATE
bool initialized
config done flag
enum I2CTransactionStatus status
Transaction status.
@ I2CTransTxRx
transmit and receive transaction
uint8_t slave_addr
Slave address.
#define ADXL345_REG_POWER_CTL
union Adxl345_I2c::@304 data
volatile bool data_available
data ready flag
#define ADXL345_REG_DATA_X0
@ I2CTransDone
transaction set to done by user level
static bool i2c_submit(struct i2c_periph *p, struct i2c_transaction *t)
Submit a I2C transaction.
static void adxl345_i2c_send_config(struct Adxl345_I2c *adxl)
struct i2c_transaction i2c_trans
enum Adxl345ConfStatus init_status
init status
static void adxl345_set_default_config(struct Adxl345Config *c)
enum I2CTransactionType type
Transaction type.
void adxl345_i2c_read(struct Adxl345_I2c *adxl)