36 return (calib->
b5 + 8) >> 4;
47 int32_t x1 = (calib->
b2 * (b6 * b6 >> 12)) >> 11;
51 x1 = calib->
ac3 * b6 >> 13;
52 x2 = (calib->
b1 * (b6 * b6 >> 12)) >> 16;
53 x3 = ((x1 + x2) + 2) >> 2;
56 int32_t p = b7 < 0x80000000 ? (b7 * 2) / b4 : (b7 / b4) * 2;
57 x1 = (p >> 8) * (p >> 8);
58 x1 = (x1 * 3038) >> 16;
59 x2 = (-7357 *
p) >> 16;
60 return p + ((x1 + x2 + 3791) >> 4);
int32_t up
uncompensated pressure
#define BMP085_OSS
Over sample setting (0-3)
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
transaction successfully finished by I2C driver
static bool bmp085_eoc_true(void)
Dummy function to always return TRUE on EndOfConversion check.
Bmp085EOC eoc
function to check End Of Conversion
#define BMP085_START_TEMP
struct i2c_transaction i2c_trans
enum Bmp085Status status
state machine status
Bosch BMP085 driver interface.
static int32_t bmp085_compensated_pressure(struct Bmp085Calib *calib, int32_t raw)
Apply temp calibration and sensor calibration to raw measurement to get Pa (from BMP085 datasheet) ...
int32_t temperature
temperature in 0.1 deg Celcius
transaction set to done by user level
void bmp085_read_eeprom_calib(struct Bmp085 *bmp)
static int32_t bmp085_compensated_temperature(struct Bmp085Calib *calib, int32_t raw)
bool i2c_transceive(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len_w, uint16_t len_r)
Submit a write/read transaction.
void bmp085_init(struct Bmp085 *bmp, struct i2c_periph *i2c_p, uint8_t addr)
enum I2CTransactionStatus status
Transaction status.
struct i2c_periph * i2c_p
bool i2c_transmit(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len)
Submit a write only transaction.
Bosch BMP085 register definitions.
uint8_t slave_addr
Slave address.
I2C peripheral structure.
int32_t pressure
pressure in Pascal
volatile bool data_available
data ready flag
bool initialized
config done flag
#define BMP085_EEPROM_AC1
int32_t ut
uncompensated temperature
void bmp085_periodic(struct Bmp085 *bmp)
Start new measurement if idle or read temp/pressure.
void bmp085_event(struct Bmp085 *bmp)