|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
98 #define Int32FromBuf(buf, idx) (int32_t)(int8_t)buf[idx+2] << 16 | (uint16_t)buf[idx+1] << 8 | buf[idx];
103 return (
float)press / 4096;
107 return (1-pow((pressure_mbar/altimeter_setting_mbar), 0.190263)) * 4430.8;
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
uint16_t len_r
Number of bytes to read/receive.
void lps25h_i2c_read(struct Lps25h_I2c *lps)
@ I2CTransTx
transmit only transaction
#define Int32FromBuf(buf, idx)
bool initialized
config done flag
volatile bool data_available
data ready flag
@ I2CTransFailed
transaction failed
void lps25h_i2c_event(struct Lps25h_I2c *lps)
void lps25h_i2c_start_configure(struct Lps25h_I2c *lps)
uint8_t len_w
Number of bytes to write/transmit.
@ I2CTransSuccess
transaction successfully finished by I2C driver
enum Lps25hConfStatus init_status
init status
struct i2c_transaction i2c_trans
float pressureToAltMeters(float pressure_mbar, float altimeter_setting_mbar)
enum I2CTransactionStatus status
Transaction status.
@ I2CTransTxRx
transmit and receive transaction
static void lps25h_i2c_send_config(struct Lps25h_I2c *lps)
uint8_t slave_addr
Slave address.
struct Lps25hConfig config
void lps25h_i2c_init(struct Lps25h_I2c *lps, struct i2c_periph *i2c_p, uint8_t addr)
struct i2c_periph * i2c_p
#define LPS25H_REG_OUT_XL
@ I2CTransDone
transaction set to done by user level
static void lps25h_set_default_config(struct Lps25hConfig *c)
static bool i2c_submit(struct i2c_periph *p, struct i2c_transaction *t)
Submit a I2C transaction.
enum I2CTransactionType type
Transaction type.
float lps25h_readPressureMillibars(int32_t press)
static void lps25h_i2c_tx_reg(struct Lps25h_I2c *lps, uint8_t reg, uint8_t val)