49#if (LPS25H_USE_I2C) || defined(__DOXYGEN__)
64 uint8_t reg, uint8_t* rxbuf,
size_t n) {
88 uint8_t* txbuf,
size_t n) {
136 "baro_read_raw(), invalid state");
139 "baro_read_raw(), channel not ready");
144 devp->config->i2ccfg);
155 *axes = buff[0] + (buff[1] << 8) + (buff[2] << 16);
188 "baro_read_cooked(), invalid state");
192 *axes = (raw * devp->barosensitivity) - devp->barobias;
222 "baro_set_bias(), invalid state");
224 devp->barobias = *bp;
248 "baro_reset_bias(), invalid state");
276 "baro_set_sensitivity(), invalid state");
278 devp->barosensitivity = *sp;
301 "baro_reset_sensitivity(), invalid state");
348 "thermo_read_raw(), invalid state");
351 "thermo_read_raw(), channel not ready");
356 devp->config->i2ccfg);
367 tmp = buff[0] + (buff[1] << 8);
368 *axes = (int32_t)tmp;
401 "thermo_read_cooked(), invalid state");
405 *axis = (raw * devp->thermosensitivity) - devp->thermobias;
432 "thermo_set_bias(), invalid state");
434 devp->thermobias = *bp;
459 "thermo_reset_bias(), invalid state");
488 "thermo_set_sensitivity(), invalid state");
490 devp->thermosensitivity = *sp;
514 "thermo_reset_sensitivity(), invalid state");
577 "lps25hStart(), invalid state");
579 devp->config = config;
585#if LPS25H_USE_ADVANCED || defined(__DOXYGEN__)
586 cr[1] |= devp->config->bdu;
606#if LPS25H_USE_ADVANCED || defined(__DOXYGEN__)
607 cr[1] = devp->config->baroresolution | devp->config->thermoresolution;
624 if(devp->config->barosensitivity == NULL) {
629 devp->barosensitivity = *(devp->config->barosensitivity);
632 if(devp->config->barobias == NULL) {
637 devp->barobias = *(devp->config->barobias);
640 if(devp->config->thermosensitivity == NULL) {
645 devp->thermosensitivity = *(devp->config->thermosensitivity);
648 if(devp->config->thermobias == NULL) {
653 devp->thermobias = *(devp->config->thermobias);
675 "lps25hStop(), invalid state");
681 (devp)->config->i2ccfg);
static const struct ADXL317VMT vmt_device
static msg_t baro_read_raw(void *ip, int32_t axes[])
Read baromether raw data.
static msg_t baro_reset_bias(void *ip)
Reset the barometer bias.
static msg_t thermo_set_bias(void *ip, float *bp)
Set the thermometer bias.
static msg_t thermo_read_raw(void *ip, int32_t axes[])
Read thermometer raw data.
static size_t baro_get_axes_number(void *ip)
Get the barometer number of axes.
static msg_t baro_set_bias(void *ip, float *bp)
Set the barometer bias.
static size_t thermo_get_axes_number(void *ip)
Get the thermometer number of axes.
static msg_t thermo_read_cooked(void *ip, float axes[])
Read thermometer cooked data.
static msg_t baro_read_cooked(void *ip, float axes[])
Read barometer cooked data.
static msg_t thermo_reset_bias(void *ip)
Reset the thermometer bias.
#define objGetInstance(type, ip)
Returns the instance pointer starting from an interface pointer.
static msg_t thermo_reset_sensitivity(void *ip)
Reset sensitivity values for the BaseThermometer.
static msg_t thermo_set_sensitivity(void *ip, float *sp)
Set sensitivity values for the BaseThermometer.
static const struct BaseThermometerVMT vmt_thermometer
msg_t i2cStart(I2CDriver *i2cp, const I2CConfig *config)
Configures and activates the I2C peripheral.
msg_t i2cMasterTransmitTimeout(I2CDriver *i2cp, i2caddr_t addr, const uint8_t *txbuf, size_t txbytes, uint8_t *rxbuf, size_t rxbytes, sysinterval_t timeout)
Sends data via the I2C bus.
void i2cReleaseBus(I2CDriver *i2cp)
Releases exclusive access to the I2C bus.
void i2cStop(I2CDriver *i2cp)
Deactivates the I2C peripheral.
void i2cAcquireBus(I2CDriver *i2cp)
Gains exclusive access to the I2C bus.
struct hal_i2c_driver I2CDriver
Type of a structure representing an I2C driver.
static const struct BaseBarometerVMT vmt_barometer
static msg_t baro_reset_sensitivity(void *ip)
Reset sensitivity values for the BaseBarometer.
static msg_t baro_set_sensitivity(void *ip, float *sp)
Set sensitivity values for the BaseBarometer.
static msg_t thermo_reset_sensitivity(void *ip)
Reset sensitivity values for the BaseThermometer.
static msg_t lps25hI2CWriteRegister(I2CDriver *i2cp, lps25h_sad_t sad, uint8_t *txbuf, size_t n)
Writes a value into a register using I2C.
static msg_t thermo_set_sensitivity(void *ip, float *sp)
Set sensitivity values for the BaseThermometer.
static msg_t baro_read_raw(void *ip, int32_t axes[])
Retrieves raw data from the BaseBarometer.
static msg_t baro_reset_bias(void *ip)
Reset bias values for the BaseBarometer.
#define LPS25H_AD_CTRL_REG1
#define LPS25H_BARO_NUMBER_OF_AXES
LPS25H barometer subsystem characteristics.
static msg_t thermo_set_bias(void *ip, float *bp)
Set bias values for the BaseThermometer.
#define LPS25H_AD_RES_CONF
static msg_t thermo_read_raw(void *ip, int32_t axes[])
Retrieves raw data from the BaseThermometer.
static msg_t baro_reset_sensitivity(void *ip)
Reset sensitivity values for the BaseBarometer.
#define LPS25H_THERMO_NUMBER_OF_AXES
LPS25H thermometer subsystem characteristics.
void lps25hObjectInit(LPS25HDriver *devp)
Initializes an instance.
void lps25hStart(LPS25HDriver *devp, const LPS25HConfig *config)
Configures and activates LPS25H Complex Driver peripheral.
#define LPS25H_THERMO_BIAS
lps25h_sad_t
LPS25H slave address.
static size_t baro_get_axes_number(void *ip)
Return the number of axes of the BaseBarometer.
static msg_t baro_set_bias(void *ip, float *bp)
Set bias values for the BaseBarometer.
#define LPS25H_AD_PRESS_OUT_XL
static size_t thermo_get_axes_number(void *ip)
Return the number of axes of the BaseThermometer.
static msg_t baro_set_sensitivity(void *ip, float *sp)
Set sensitivity values for the BaseBarometer.
void lps25hStop(LPS25HDriver *devp)
Deactivates the LPS25H Complex Driver peripheral.
static msg_t thermo_read_cooked(void *ip, float *axis)
Retrieves cooked data from the BaseThermometer.
#define LPS25H_THERMO_SENS
#define LPS25H_AD_TEMP_OUT_L
static msg_t baro_read_cooked(void *ip, float axes[])
Retrieves cooked data from the BaseBarometer.
static msg_t thermo_reset_bias(void *ip)
Reset bias values for the BaseThermometer.
#define LPS25H_CTRL_REG1_PD
static msg_t lps25hI2CReadRegister(I2CDriver *i2cp, lps25h_sad_t sad, uint8_t reg, uint8_t *rxbuf, size_t n)
Reads registers value using I2C.
#define osalDbgAssert(c, remark)
Condition assertion.
#define osalDbgCheck(c)
Function parameters check.
#define osalThreadSleepMilliseconds(msecs)
Delays the invoking thread for the specified number of milliseconds.
#define MSG_OK
Normal wakeup message.
#define TIME_INFINITE
Infinite interval specification for all functions with a timeout specification.
LPS25H MEMS interface module header.
const struct BaseBarometerVMT * vmt
Virtual Methods Table.
BaseBarometer virtual methods table.
const struct BaseThermometerVMT * vmt
Virtual Methods Table.
BaseThermometer virtual methods table.
LPS25H configuration structure.
I2CDriver * i2cp
I2C driver associated to this LPS25H.
LPS25H 2-axis barometer/thermometer class.
BaseBarometer baro_if
Base barometer interface.
const struct LPS25HVMT * vmt
Virtual Methods Table.
BaseThermometer thermo_if
Base thermometer interface.
LPS25H virtual methods table.
const I2CConfig * config
Current configuration data.