struct i2c_transaction i2c_trans
I2C transaction (only one in flight at a time)
Dps310Status
States of the non-blocking driver state machine.
@ DPS310_STATUS_CONFIGURE_REGS
write PRS_CFG, TMP_CFG, MEAS_CFG (idle) and CFG_REG in one burst
@ DPS310_STATUS_READ_DATA
operational: poll the 6 result registers
@ DPS310_STATUS_GET_COEF_SRCE
read which temperature sensor the factory calibration used
@ DPS310_STATUS_WAIT_RDY
wait for SENSOR_RDY and COEF_RDY (~40ms after power-up)
@ DPS310_STATUS_CONFIGURE_MEAS
enable continuous pressure + temperature measurements
@ DPS310_STATUS_TEMP_FIX
apply the 5-write temperature errata fix (genuine DPS310 only)
@ DPS310_STATUS_GET_ID
read the product/revision ID register
@ DPS310_STATUS_UNINIT
restart point: reset driver state, then detect the sensor
@ DPS310_STATUS_GET_CALIB
read the 18 calibration coefficient bytes
uint8_t temp_fix_step
current step of the temperature errata fix sequence
float pressure
pressure in Pascal
float temperature
temperature in deg Celsius
struct i2c_periph * i2c_p
I2C peripheral used for communication.
uint32_t timer
broken-sensor retry backoff timer
int32_t raw_temperature
uncompensated temperature
enum Dps310Status status
state machine status
volatile bool data_available
data ready flag
bool is_broken
sensor not found or persistently failing, retried after a backoff period
void dps310_i2c_event(struct Dps310_I2c *dps)
Consume finished I2C transactions and advance the state machine.
bool initialized
config done flag
int32_t raw_pressure
uncompensated pressure
uint8_t init_error_cnt
number of consecutive transaction failures
uint8_t temp_coef_srce
TMP_COEF_SRCE bit read from the sensor, mirrored into TMP_CFG bit 7.
void dps310_i2c_periodic(struct Dps310_I2c *dps)
Run the driver state machine, submitting at most one I2C transaction.
void dps310_i2c_init(struct Dps310_I2c *dps, struct i2c_periph *i2c_p, uint8_t addr)
Initialize the driver instance (no bus traffic yet)
struct dps310_reg_calib_data calib
calibration data
Register definitions for Infineon DPS310 pressure sensor.
I2C transaction structure.
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.