ChibiOS  19.1.4
Collaboration diagram for LPS25H:

Detailed Description

Macros

#define lps25hBarometerGetAxesNumber(devp)   barometerGetAxesNumber(&((devp)->baro_if))
 Return the number of axes of the BaseBarometer. More...
 
#define lps25hBarometerReadRaw(devp, axes)   barometerReadRaw(&((devp)->baro_if), axes)
 Retrieves raw data from the BaseBarometer. More...
 
#define lps25hBarometerReadCooked(devp, axes)   barometerReadCooked(&((devp)->baro_if), axes)
 Retrieves cooked data from the BaseBarometer. More...
 
#define lps25hBarometerSetBias(devp, bp)   barometerSetBias(&((devp)->baro_if), bp)
 Set bias values for the BaseBarometer. More...
 
#define lps25hBarometerResetBias(devp)   barometerResetBias(&((devp)->baro_if))
 Reset bias values for the BaseBarometer. More...
 
#define lps25hBarometerSetSensitivity(devp, sp)   barometerSetSensitivity(&((devp)->baro_if), sp)
 Set sensitivity values for the BaseBarometer. More...
 
#define lps25hBarometerResetSensitivity(devp)   barometerResetSensitivity(&((devp)->baro_if))
 Reset sensitivity values for the BaseBarometer. More...
 
#define lps25hThermometerGetAxesNumber(devp)   thermometerGetAxesNumber(&((devp)->thermo_if))
 Return the number of axes of the BaseThermometer. More...
 
#define lps25hThermometerReadRaw(devp, axes)   thermometerReadRaw(&((devp)->thermo_if), axes)
 Retrieves raw data from the BaseThermometer. More...
 
#define lps25hThermometerReadCooked(devp, axes)   thermometerReadCooked(&((devp)->thermo_if), axes)
 Retrieves cooked data from the BaseThermometer. More...
 
#define lps25hThermometerSetBias(devp, bp)   thermometerSetBias(&((devp)->thermo_if), bp)
 Set bias values for the BaseThermometer. More...
 
#define lps25hThermometerResetBias(devp)   thermometerResetBias(&((devp)->thermo_if))
 Reset bias values for the BaseThermometer. More...
 
#define lps25hThermometerSetSensitivity(devp, sp)   thermometerSetSensitivity(&((devp)->thermo_if), sp)
 Set sensitivity values for the BaseThermometer. More...
 
#define lps25hThermometerResetSensitivity(devp)   thermometerResetSensitivity(&((devp)->thermo_if))
 Reset sensitivity values for the BaseThermometer. More...
 

Version identification

#define EX_LPS25H_VERSION   "1.1.2"
 LPS25H driver version string. More...
 
#define EX_LPS25H_MAJOR   1
 LPS25H driver version major number. More...
 
#define EX_LPS25H_MINOR   1
 LPS25H driver version minor number. More...
 
#define EX_LPS25H_PATCH   2
 LPS25H driver version patch number. More...
 
#define LPS25H_BARO_NUMBER_OF_AXES   1U
 LPS25H barometer subsystem characteristics. More...
 
#define LPS25H_THERMO_NUMBER_OF_AXES   1U
 LPS25H thermometer subsystem characteristics. More...
 

LPS25H communication interfaces related bit masks

#define LPS25H_DI_MASK   0xFF
 
#define LPS25H_DI(n)   (1 << n)
 
#define LPS25H_AD_MASK   0x3F
 
#define LPS25H_AD(n)   (1 << n)
 
#define LPS25H_MS   (1 << 6)
 
#define LPS25H_RW   (1 << 7)
 
#define LPS25H_SUB_MS   (1 << 7)
 

LPS25H register addresses

#define LPS25H_AD_REF_P_XL   0x08
 
#define LPS25H_AD_REF_P_L   0x09
 
#define LPS25H_AD_REF_P_H   0x0A
 
#define LPS25H_AD_WHO_AM_I   0x0F
 
#define LPS25H_AD_RES_CONF   0x10
 
#define LPS25H_AD_CTRL_REG1   0x20
 
#define LPS25H_AD_CTRL_REG2   0x21
 
#define LPS25H_AD_CTRL_REG3   0x22
 
#define LPS25H_AD_CTRL_REG4   0x23
 
#define LPS25H_AD_INT_CFG   0x24
 
#define LPS25H_AD_INT_SRC   0x25
 
#define LPS25H_AD_STATUS_REG   0x27
 
#define LPS25H_AD_PRESS_OUT_XL   0x28
 
#define LPS25H_AD_PRESS_OUT_L   0x29
 
#define LPS25H_AD_PRESS_OUT_H   0x2A
 
#define LPS25H_AD_TEMP_OUT_L   0x2B
 
#define LPS25H_AD_TEMP_OUT_H   0x2C
 
#define LPS25H_AD_FIFO_CTRL   0x2E
 
#define LPS25H_AD_FIFO_SRC   0x2F
 
#define LPS25H_AD_THS_P_L   0x30
 
#define LPS25H_AD_THS_P_H   0x31
 
#define LPS25H_AD_RPDS_L   0x39
 
#define LPS25H_AD_RPDS_H   0x3A
 

LPS25H_CTRL_REG1 register bits definitions

#define LPS25H_CTRL_REG1_MASK   0xFF
 
#define LPS25H_CTRL_REG1_SIM   (1 << 0)
 
#define LPS25H_CTRL_REG1_RESET_AZ   (1 << 1)
 
#define LPS25H_CTRL_REG1_BDU   (1 << 2)
 
#define LPS25H_CTRL_REG1_DIFF_EN   (1 << 3)
 
#define LPS25H_CTRL_REG1_ODR0   (1 << 4)
 
#define LPS25H_CTRL_REG1_ODR1   (1 << 5)
 
#define LPS25H_CTRL_REG1_ODR2   (1 << 6)
 
#define LPS25H_CTRL_REG1_PD   (1 << 7)
 

LPS25H_CTRL_REG2 register bits definitions

#define LPS25H_CTRL_REG2_MASK   0xF3
 
#define LPS25H_CTRL_REG2_ONE_SHOT   (1 << 0)
 
#define LPS25H_CTRL_REG2_AUTO_ZERO   (1 << 1)
 
#define LPS25H_CTRL_REG2_SWRESET   (1 << 2)
 
#define LPS25H_CTRL_REG2_FIFO_MEAN_DEC   (1 << 4)
 
#define LPS25H_CTRL_REG2_WTM_EN   (1 << 5)
 
#define LPS25H_CTRL_REG2_FIFO_EN   (1 << 6)
 
#define LPS25H_CTRL_REG2_BOOT   (1 << 7)
 

LPS25H_CTRL_REG3 register bits definitions

#define LPS25H_CTRL_REG3_MASK   0xC3
 
#define LPS25H_CTRL_REG3_INT_S1   (1 << 0)
 
#define LPS25H_CTRL_REG3_INT_S2   (1 << 1)
 
#define LPS25H_CTRL_REG3_PP_OD   (1 << 6)
 
#define LPS25H_CTRL_REG3_INT_H_L   (1 << 7)
 

LPS25H_CTRL_REG4 register bits definitions

#define LPS25H_CTRL_REG4_MASK   0x0F
 
#define LPS25H_CTRL_REG4_P1_DRDY   (1 << 0)
 
#define LPS25H_CTRL_REG4_P1_OVERRUN   (1 << 1)
 
#define LPS25H_CTRL_REG4_P1_WTM   (1 << 2)
 
#define LPS25H_CTRL_REG4_P1_EMPTY   (1 << 3)
 

LPS25H_INT1_CFG register bits definitions

#define LPS25H_INT1_CFG_MASK   0x07
 
#define LPS25H_INT1_CFG_PH_E   (1 << 0)
 
#define LPS25H_INT1_CFG_PL_E   (1 << 1)
 
#define LPS25H_INT1_CFG_LIR   (1 << 2)
 

LPS25H_INT1_SRC register bits definitions

#define LPS25H_INT1_SRC_MASK   0x07
 
#define LPS25H_INT1_SRC_PH   (1 << 0)
 
#define LPS25H_INT1_SRC_PL   (1 << 1)
 
#define LPS25H_INT1_SRC_IA   (1 << 2)
 

Configuration options

#define LPS25H_USE_SPI   FALSE
 LPS25H SPI interface switch. More...
 
#define LPS25H_SHARED_SPI   FALSE
 LPS25H shared SPI switch. More...
 
#define LPS25H_USE_I2C   TRUE
 LPS25H I2C interface switch. More...
 
#define LPS25H_SHARED_I2C   FALSE
 LPS25H shared I2C switch. More...
 
#define LPS25H_USE_ADVANCED   FALSE
 LPS25H advanced configurations switch. More...
 

LPS25H data structures and types.

Todo:
Add support for LPS25H over SPI.
typedef struct LPS25HDriver LPS25HDriver
 Structure representing a LPS25H driver. More...
 
#define _lps25h_methods_alone
 LPS25H specific methods. More...
 
#define _lps25h_methods
 LPS25H specific methods with inherited ones. More...
 
#define _lps25h_data
 LPS25HDriver specific data. More...
 

Data Structures

struct  LPS25HConfig
 LPS25H configuration structure. More...
 
struct  LPS25HVMT
 LPS25H virtual methods table. More...
 
struct  LPS25HDriver
 LPS25H 2-axis barometer/thermometer class. More...
 

Functions

static msg_t lps25hI2CReadRegister (I2CDriver *i2cp, lps25h_sad_t sad, uint8_t reg, uint8_t *rxbuf, size_t n)
 Reads registers value using I2C. More...
 
static msg_t lps25hI2CWriteRegister (I2CDriver *i2cp, lps25h_sad_t sad, uint8_t *txbuf, size_t n)
 Writes a value into a register using I2C. More...
 
static size_t baro_get_axes_number (void *ip)
 Return the number of axes of the BaseBarometer. More...
 
static msg_t baro_read_raw (void *ip, int32_t axes[])
 Retrieves raw data from the BaseBarometer. More...
 
static msg_t baro_read_cooked (void *ip, float axes[])
 Retrieves cooked data from the BaseBarometer. More...
 
static msg_t baro_set_bias (void *ip, float *bp)
 Set bias values for the BaseBarometer. More...
 
static msg_t baro_reset_bias (void *ip)
 Reset bias values for the BaseBarometer. More...
 
static msg_t baro_set_sensitivity (void *ip, float *sp)
 Set sensitivity values for the BaseBarometer. More...
 
static msg_t baro_reset_sensitivity (void *ip)
 Reset sensitivity values for the BaseBarometer. More...
 
static size_t thermo_get_axes_number (void *ip)
 Return the number of axes of the BaseThermometer. More...
 
static msg_t thermo_read_raw (void *ip, int32_t axes[])
 Retrieves raw data from the BaseThermometer. More...
 
static msg_t thermo_read_cooked (void *ip, float *axis)
 Retrieves cooked data from the BaseThermometer. More...
 
static msg_t thermo_set_bias (void *ip, float *bp)
 Set bias values for the BaseThermometer. More...
 
static msg_t thermo_reset_bias (void *ip)
 Reset bias values for the BaseThermometer. More...
 
static msg_t thermo_set_sensitivity (void *ip, float *sp)
 Set sensitivity values for the BaseThermometer. More...
 
static msg_t thermo_reset_sensitivity (void *ip)
 Reset sensitivity values for the BaseThermometer. More...
 
void lps25hObjectInit (LPS25HDriver *devp)
 Initializes an instance. More...
 
void lps25hStart (LPS25HDriver *devp, const LPS25HConfig *config)
 Configures and activates LPS25H Complex Driver peripheral. More...
 
void lps25hStop (LPS25HDriver *devp)
 Deactivates the LPS25H Complex Driver peripheral. More...
 

Macro Definition Documentation

#define EX_LPS25H_VERSION   "1.1.2"

LPS25H driver version string.

Definition at line 46 of file lps25h.h.

#define EX_LPS25H_MAJOR   1

LPS25H driver version major number.

Definition at line 51 of file lps25h.h.

#define EX_LPS25H_MINOR   1

LPS25H driver version minor number.

Definition at line 56 of file lps25h.h.

#define EX_LPS25H_PATCH   2

LPS25H driver version patch number.

Definition at line 61 of file lps25h.h.

#define LPS25H_BARO_NUMBER_OF_AXES   1U

LPS25H barometer subsystem characteristics.

Note
Sensitivity is expressed as hPa/LSB whereas hPa stand for hectopascal.
Bias is expressed as hPa.

Definition at line 72 of file lps25h.h.

Referenced by baro_get_axes_number(), and lps25hObjectInit().

#define LPS25H_THERMO_NUMBER_OF_AXES   1U

LPS25H thermometer subsystem characteristics.

Note
Sensitivity is expressed as °C/LSB.
Bias is expressed as °C.

Definition at line 85 of file lps25h.h.

Referenced by lps25hObjectInit(), and thermo_get_axes_number().

#define LPS25H_USE_SPI   FALSE

LPS25H SPI interface switch.

If set to TRUE the support for SPI is included.

Note
The default is FALSE.

Definition at line 219 of file lps25h.h.

#define LPS25H_SHARED_SPI   FALSE

LPS25H shared SPI switch.

If set to TRUE the device acquires SPI bus ownership on each transaction.

Note
The default is FALSE. Requires SPI_USE_MUTUAL_EXCLUSION.

Definition at line 229 of file lps25h.h.

#define LPS25H_USE_I2C   TRUE

LPS25H I2C interface switch.

If set to TRUE the support for I2C is included.

Note
The default is TRUE.

Definition at line 238 of file lps25h.h.

#define LPS25H_SHARED_I2C   FALSE

LPS25H shared I2C switch.

If set to TRUE the device acquires I2C bus ownership on each transaction.

Note
The default is FALSE. Requires I2C_USE_MUTUAL_EXCLUSION.

Definition at line 248 of file lps25h.h.

#define LPS25H_USE_ADVANCED   FALSE

LPS25H advanced configurations switch.

If set to TRUE more configurations are available.

Note
The default is FALSE.

Definition at line 257 of file lps25h.h.

#define _lps25h_methods_alone

LPS25H specific methods.

Note
No methods so far, just a common ancestor interface.

Definition at line 430 of file lps25h.h.

#define _lps25h_methods
Value:
#define _lps25h_methods_alone
LPS25H specific methods.
Definition: lps25h.h:430

LPS25H specific methods with inherited ones.

Definition at line 435 of file lps25h.h.

#define _lps25h_data
Value:
/* Driver state.*/ \
/* Current configuration data.*/ \
const LPS25HConfig *config; \
/* Barometer subsystem axes number.*/ \
size_t baroaxes; \
/* Barometer subsystem current sensitivity.*/ \
float barosensitivity; \
/* Barometer subsystem current bias .*/ \
float barobias; \
/* Thermometer subsystem axes number.*/ \
size_t thermoaxes; \
/* Thermometer subsystem current sensitivity.*/ \
float thermosensitivity; \
/* Thermometer subsystem current bias.*/ \
float thermobias;
LPS25H configuration structure.
Definition: lps25h.h:364
lps25h_state_t
Driver state machine possible states.
Definition: lps25h.h:355

LPS25HDriver specific data.

Definition at line 451 of file lps25h.h.

#define lps25hBarometerGetAxesNumber (   devp)    barometerGetAxesNumber(&((devp)->baro_if))

Return the number of axes of the BaseBarometer.

Parameters
[in]devppointer to LPS25HDriver.
Returns
the number of axes.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 496 of file lps25h.h.

#define lps25hBarometerReadRaw (   devp,
  axes 
)    barometerReadRaw(&((devp)->baro_if), axes)

Retrieves raw data from the BaseBarometer.

Note
This data is retrieved from MEMS register without any algebraical manipulation.
The axes array must be at least the same size of the BaseBarometer axes number.
Parameters
[in]devppointer to LPS25HDriver.
[out]axesa buffer which would be filled with raw data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 517 of file lps25h.h.

#define lps25hBarometerReadCooked (   devp,
  axes 
)    barometerReadCooked(&((devp)->baro_if), axes)

Retrieves cooked data from the BaseBarometer.

Note
This data is manipulated according to the formula cooked = (raw * sensitivity) - bias.
Final data is expressed as hPa.
The axes array must be at least the same size of the BaseBarometer axes number.
Parameters
[in]devppointer to LPS25HDriver.
[out]axesa buffer which would be filled with cooked data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 539 of file lps25h.h.

#define lps25hBarometerSetBias (   devp,
  bp 
)    barometerSetBias(&((devp)->baro_if), bp)

Set bias values for the BaseBarometer.

Note
Bias must be expressed as hPa.
The bias buffer must be at least the same size of the BaseBarometer axes number.
Parameters
[in]devppointer to LPS25HDriver.
[in]bpa buffer which contains biases.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 556 of file lps25h.h.

#define lps25hBarometerResetBias (   devp)    barometerResetBias(&((devp)->baro_if))

Reset bias values for the BaseBarometer.

Note
Default biases value are obtained from device datasheet when available otherwise they are considered zero.
Parameters
[in]devppointer to LPS25HDriver.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 571 of file lps25h.h.

#define lps25hBarometerSetSensitivity (   devp,
  sp 
)    barometerSetSensitivity(&((devp)->baro_if), sp)

Set sensitivity values for the BaseBarometer.

Note
Sensitivity must be expressed as hPa/LSB.
The sensitivity buffer must be at least the same size of the BaseBarometer axes number.
Parameters
[in]devppointer to LPS25HDriver.
[in]spa buffer which contains sensitivities.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 588 of file lps25h.h.

#define lps25hBarometerResetSensitivity (   devp)    barometerResetSensitivity(&((devp)->baro_if))

Reset sensitivity values for the BaseBarometer.

Note
Default sensitivities value are obtained from device datasheet.
Parameters
[in]devppointer to LPS25HDriver.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 602 of file lps25h.h.

#define lps25hThermometerGetAxesNumber (   devp)    thermometerGetAxesNumber(&((devp)->thermo_if))

Return the number of axes of the BaseThermometer.

Parameters
[in]devppointer to LPS25HDriver.
Returns
the number of axes.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 614 of file lps25h.h.

#define lps25hThermometerReadRaw (   devp,
  axes 
)    thermometerReadRaw(&((devp)->thermo_if), axes)

Retrieves raw data from the BaseThermometer.

Note
This data is retrieved from MEMS register without any algebraical manipulation.
The axes array must be at least the same size of the BaseThermometer axes number.
Parameters
[in]devppointer to LPS25HDriver.
[out]axesa buffer which would be filled with raw data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 635 of file lps25h.h.

#define lps25hThermometerReadCooked (   devp,
  axes 
)    thermometerReadCooked(&((devp)->thermo_if), axes)

Retrieves cooked data from the BaseThermometer.

Note
This data is manipulated according to the formula cooked = (raw * sensitivity) - bias.
Final data is expressed as °C.
The axes array must be at least the same size of the BaseThermometer axes number.
Parameters
[in]devppointer to LPS25HDriver.
[out]axesa buffer which would be filled with cooked data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 657 of file lps25h.h.

#define lps25hThermometerSetBias (   devp,
  bp 
)    thermometerSetBias(&((devp)->thermo_if), bp)

Set bias values for the BaseThermometer.

Note
Bias must be expressed as °C.
The bias buffer must be at least the same size of the BaseThermometer axes number.
Parameters
[in]devppointer to LPS25HDriver.
[in]bpa buffer which contains biases.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 674 of file lps25h.h.

#define lps25hThermometerResetBias (   devp)    thermometerResetBias(&((devp)->thermo_if))

Reset bias values for the BaseThermometer.

Note
Default biases value are obtained from device datasheet when available otherwise they are considered zero.
Parameters
[in]devppointer to LPS25HDriver.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 689 of file lps25h.h.

#define lps25hThermometerSetSensitivity (   devp,
  sp 
)    thermometerSetSensitivity(&((devp)->thermo_if), sp)

Set sensitivity values for the BaseThermometer.

Note
Sensitivity must be expressed as °C/LSB.
The sensitivity buffer must be at least the same size of the BaseThermometer axes number.
Parameters
[in]devppointer to LPS25HDriver.
[in]spa buffer which contains sensitivities.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 706 of file lps25h.h.

#define lps25hThermometerResetSensitivity (   devp)    thermometerResetSensitivity(&((devp)->thermo_if))

Reset sensitivity values for the BaseThermometer.

Note
Default sensitivities value are obtained from device datasheet.
Parameters
[in]devppointer to LPS25HDriver.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 720 of file lps25h.h.

Typedef Documentation

typedef struct LPS25HDriver LPS25HDriver

Structure representing a LPS25H driver.

Definition at line 303 of file lps25h.h.

Enumeration Type Documentation

LPS25H slave address.

Enumerator
LPS25H_SAD_GND 

Slave Address when SA0 is to GND

LPS25H_SAD_VCC 

Slave Address when SA0 is to VCC

Definition at line 308 of file lps25h.h.

LPS25H output data rate and bandwidth.

Enumerator
LPS25H_ODR_ONE_SHOT 

One shot.

LPS25H_ODR_1HZ 

Output data rate 1 Hz.

LPS25H_ODR_7HZ 

Output data rate 7 Hz.

LPS25H_ODR_12P5HZ 

Output data rate 12.5 Hz.

LPS25H_ODR_25HZ 

Output data rate 25 Hz.

Definition at line 316 of file lps25h.h.

LPS25H pressure resolution.

Enumerator
LPS25H_AVGP_8 

Number of internal average is 8.

LPS25H_AVGP_32 

Number of internal average is 32.

LPS25H_AVGP_128 

Number of internal average is 128.

LPS25H_AVGP_512 

Number of internal average is 512.

Definition at line 327 of file lps25h.h.

LPS25H temperature resolution.

Enumerator
LPS25H_AVGT_8 

Number of internal average is 8.

LPS25H_AVGT_32 

Number of internal average is 32.

LPS25H_AVGT_128 

Number of internal average is 128.

LPS25H_AVGT_512 

Number of internal average is 512.

Definition at line 337 of file lps25h.h.

LPS25H block data update.

Enumerator
LPS25H_BDU_CONTINUOUS 

Block data continuously updated.

LPS25H_BDU_BLOCKED 

Block data updated after reading.

Definition at line 347 of file lps25h.h.

Driver state machine possible states.

Enumerator
LPS25H_UNINIT 

Not initialized.

LPS25H_STOP 

Stopped.

LPS25H_READY 

Ready.

Definition at line 355 of file lps25h.h.

Function Documentation

static msg_t lps25hI2CReadRegister ( I2CDriver i2cp,
lps25h_sad_t  sad,
uint8_t  reg,
uint8_t *  rxbuf,
size_t  n 
)
static

Reads registers value using I2C.

Precondition
The I2C interface must be initialized and the driver started.
Parameters
[in]i2cppointer to the I2C interface
[in]sadslave address without R bit
[in]regfirst sub-register address
[out]rxbufpointer to an output buffer
[in]nnumber of consecutive register to read
Returns
the operation status.
Function Class:Not an API, this function is for internal use only.

Definition at line 63 of file lps25h.c.

References i2cMasterTransmitTimeout(), and TIME_INFINITE.

Referenced by baro_read_raw(), and thermo_read_raw().

Here is the call graph for this function:

static msg_t lps25hI2CWriteRegister ( I2CDriver i2cp,
lps25h_sad_t  sad,
uint8_t *  txbuf,
size_t  n 
)
static

Writes a value into a register using I2C.

Precondition
The I2C interface must be initialized and the driver started.
Parameters
[in]i2cppointer to the I2C interface
[in]sadslave address without R bit
[in]txbufbuffer containing sub-address value in first position and values to write
[in]nsize of txbuf less one (not considering the first element)
Returns
the operation status.
Function Class:Not an API, this function is for internal use only.

Definition at line 87 of file lps25h.c.

References i2cMasterTransmitTimeout(), and TIME_INFINITE.

Referenced by lps25hStart(), and lps25hStop().

Here is the call graph for this function:

static size_t baro_get_axes_number ( void *  ip)
static

Return the number of axes of the BaseBarometer.

Parameters
[in]ippointer to BaseBarometer interface.
Returns
the number of axes.

Definition at line 103 of file lps25h.c.

References LPS25H_BARO_NUMBER_OF_AXES.

Referenced by thermo_reset_sensitivity().

static msg_t baro_read_raw ( void *  ip,
int32_t  axes[] 
)
static

Retrieves raw data from the BaseBarometer.

Note
This data is retrieved from MEMS register without any algebraical manipulation.
The axes array must be at least the same size of the BaseBarometer axes number.
Parameters
[in]ippointer to BaseBarometer interface.
[out]axesa buffer which would be filled with raw data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.

Definition at line 125 of file lps25h.c.

References I2C_READY, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), LPS25H_READY, lps25hI2CReadRegister(), MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

Referenced by baro_read_cooked(), and thermo_reset_sensitivity().

Here is the call graph for this function:

static msg_t baro_read_cooked ( void *  ip,
float  axes[] 
)
static

Retrieves cooked data from the BaseBarometer.

Note
This data is manipulated according to the formula cooked = (raw * sensitivity) - bias.
Final data is expressed as hPa.
The axes array must be at least the same size of the BaseBarometer axes number.
Parameters
[in]ippointer to BaseBarometer interface.
[out]axesa buffer which would be filled with cooked data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.

Definition at line 177 of file lps25h.c.

References baro_read_raw(), LPS25H_READY, objGetInstance, osalDbgAssert, and osalDbgCheck.

Referenced by thermo_reset_sensitivity().

Here is the call graph for this function:

static msg_t baro_set_bias ( void *  ip,
float *  bp 
)
static

Set bias values for the BaseBarometer.

Note
Bias must be expressed as hPa.
The bias buffer must be at least the same size of the BaseBarometer axes number.
Parameters
[in]ippointer to BaseBarometer interface.
[in]bpa buffer which contains biases.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.

Definition at line 212 of file lps25h.c.

References LPS25H_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

Referenced by thermo_reset_sensitivity().

static msg_t baro_reset_bias ( void *  ip)
static

Reset bias values for the BaseBarometer.

Note
Default biases value are obtained from device datasheet when available otherwise they are considered zero.
Parameters
[in]ippointer to BaseBarometer interface.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.

Definition at line 238 of file lps25h.c.

References LPS25H_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

Referenced by thermo_reset_sensitivity().

static msg_t baro_set_sensitivity ( void *  ip,
float *  sp 
)
static

Set sensitivity values for the BaseBarometer.

Note
Sensitivity must be expressed as hPa/LSB.
The sensitivity buffer must be at least the same size of the BaseBarometer axes number.
Parameters
[in]ippointer to BaseBarometer interface.
[in]spa buffer which contains sensitivities.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.

Definition at line 266 of file lps25h.c.

References LPS25H_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

Referenced by thermo_reset_sensitivity().

static msg_t baro_reset_sensitivity ( void *  ip)
static

Reset sensitivity values for the BaseBarometer.

Note
Default sensitivities value are obtained from device datasheet.
Parameters
[in]ippointer to BaseBarometer interface.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.

Definition at line 291 of file lps25h.c.

References LPS25H_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

Referenced by thermo_reset_sensitivity().

static size_t thermo_get_axes_number ( void *  ip)
static

Return the number of axes of the BaseThermometer.

Parameters
[in]ippointer to BaseThermometer interface.
Returns
the number of axes.

Definition at line 314 of file lps25h.c.

References LPS25H_THERMO_NUMBER_OF_AXES.

Referenced by thermo_reset_sensitivity().

static msg_t thermo_read_raw ( void *  ip,
int32_t  axes[] 
)
static

Retrieves raw data from the BaseThermometer.

Note
This data is retrieved from MEMS register without any algebraical manipulation.
The axes array must be at least the same size of the BaseThermometer axes number.
Parameters
[in]ippointer to BaseThermometer interface.
[out]axesa buffer which would be filled with raw data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.

Definition at line 336 of file lps25h.c.

References I2C_READY, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), LPS25H_READY, lps25hI2CReadRegister(), MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

Referenced by thermo_read_cooked(), and thermo_reset_sensitivity().

Here is the call graph for this function:

static msg_t thermo_read_cooked ( void *  ip,
float *  axis 
)
static

Retrieves cooked data from the BaseThermometer.

Note
This data is manipulated according to the formula cooked = (raw * sensitivity) - bias.
Final data is expressed as °C.
The axes array must be at least the same size of the BaseThermometer axes number.
Parameters
[in]ippointer to BaseThermometer interface.
[out]axisa buffer which would be filled with cooked data.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.
MSG_RESETif one or more I2C errors occurred, the errors can be retrieved using i2cGetErrors().
MSG_TIMEOUTif a timeout occurred before operation end.

Definition at line 390 of file lps25h.c.

References LPS25H_READY, objGetInstance, osalDbgAssert, osalDbgCheck, and thermo_read_raw().

Referenced by thermo_reset_sensitivity().

Here is the call graph for this function:

static msg_t thermo_set_bias ( void *  ip,
float *  bp 
)
static

Set bias values for the BaseThermometer.

Note
Bias must be expressed as °C.
The bias buffer must be at least the same size of the BaseThermometer axes number.
Parameters
[in]ippointer to BaseThermometer interface.
[in]bpa buffer which contains biases.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.

Definition at line 422 of file lps25h.c.

References LPS25H_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

Referenced by thermo_reset_sensitivity().

static msg_t thermo_reset_bias ( void *  ip)
static

Reset bias values for the BaseThermometer.

Note
Default biases value are obtained from device datasheet when available otherwise they are considered zero.
Parameters
[in]ippointer to BaseThermometer interface.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.

Definition at line 449 of file lps25h.c.

References LPS25H_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

Referenced by thermo_reset_sensitivity().

static msg_t thermo_set_sensitivity ( void *  ip,
float *  sp 
)
static

Set sensitivity values for the BaseThermometer.

Note
Sensitivity must be expressed as °C/LSB.
The sensitivity buffer must be at least the same size of the BaseThermometer axes number.
Parameters
[in]ippointer to BaseThermometer interface.
[in]spa buffer which contains sensitivities.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.

Definition at line 478 of file lps25h.c.

References LPS25H_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

Referenced by thermo_reset_sensitivity().

static msg_t thermo_reset_sensitivity ( void *  ip)
static

Reset sensitivity values for the BaseThermometer.

Note
Default sensitivities value are obtained from device datasheet.
Parameters
[in]ippointer to BaseThermometer interface.
Returns
The operation status.
Return values
MSG_OKif the function succeeded.

Definition at line 504 of file lps25h.c.

References baro_get_axes_number(), baro_read_cooked(), baro_read_raw(), baro_reset_bias(), baro_reset_sensitivity(), baro_set_bias(), baro_set_sensitivity(), LPS25H_READY, MSG_OK, objGetInstance, osalDbgAssert, osalDbgCheck, thermo_get_axes_number(), thermo_read_cooked(), thermo_read_raw(), thermo_reset_bias(), thermo_set_bias(), and thermo_set_sensitivity().

Here is the call graph for this function:

void lps25hObjectInit ( LPS25HDriver devp)

Initializes an instance.

Parameters
[out]devppointer to the LPS25HDriver object
Function Class:Initializer, this function just initializes an object and can be invoked before the kernel is initialized.

Definition at line 550 of file lps25h.c.

References LPS25HDriver::baro_if, LPS25H_BARO_NUMBER_OF_AXES, LPS25H_STOP, LPS25H_THERMO_NUMBER_OF_AXES, LPS25HDriver::thermo_if, BaseThermometer::vmt, BaseBarometer::vmt, and LPS25HDriver::vmt.

void lps25hStart ( LPS25HDriver devp,
const LPS25HConfig config 
)

Configures and activates LPS25H Complex Driver peripheral.

Parameters
[in]devppointer to the LPS25HDriver object
[in]configpointer to the LPS25HConfig object
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 572 of file lps25h.c.

References I2CDriver::config, i2cAcquireBus(), LPS25HConfig::i2cp, i2cReleaseBus(), i2cStart(), LPS25H_READY, LPS25H_STOP, lps25hI2CWriteRegister(), osalDbgAssert, osalDbgCheck, and osalThreadSleepMilliseconds.

Here is the call graph for this function:

void lps25hStop ( LPS25HDriver devp)

Deactivates the LPS25H Complex Driver peripheral.

Parameters
[in]devppointer to the LPS25HDriver object
Function Class:Normal API, this function can be invoked by regular system threads but not from within a lock zone.

Definition at line 669 of file lps25h.c.

References i2cAcquireBus(), i2cReleaseBus(), i2cStart(), i2cStop(), LPS25H_READY, LPS25H_STOP, lps25hI2CWriteRegister(), osalDbgAssert, and osalDbgCheck.

Here is the call graph for this function: