ChibiOS 21.11.4

Detailed Description

Collaboration diagram for LPS25H:

LPS25H data structures and types.

enum  lps25h_sad_t { LPS25H_SAD_GND = 0x5C , LPS25H_SAD_VCC = 0x5D }
 LPS25H slave address. More...
enum  lps25h_odr_t {
  LPS25H_ODR_ONE_SHOT = 0x00 , LPS25H_ODR_1HZ = 0x10 , LPS25H_ODR_7HZ = 0x20 , LPS25H_ODR_12P5HZ = 0x30 ,
  LPS25H_ODR_25HZ = 0x40
}
 LPS25H output data rate and bandwidth. More...
enum  lps25h_avgp_t { LPS25H_AVGP_8 = 0x00 , LPS25H_AVGP_32 = 0x01 , LPS25H_AVGP_128 = 0x02 , LPS25H_AVGP_512 = 0x03 }
 LPS25H pressure resolution. More...
enum  lps25h_avgt_t { LPS25H_AVGT_8 = 0x00 , LPS25H_AVGT_32 = 0x04 , LPS25H_AVGT_128 = 0x08 , LPS25H_AVGT_512 = 0x0C }
 LPS25H temperature resolution. More...
enum  lps25h_bdu_t { LPS25H_BDU_CONTINUOUS = 0x00 , LPS25H_BDU_BLOCKED = 0x40 }
 LPS25H block data update. More...
enum  lps25h_state_t { LPS25H_UNINIT = 0 , LPS25H_STOP = 1 , LPS25H_READY = 2 }
 Driver state machine possible states. More...
typedef struct LPS25HDriver LPS25HDriver
 Structure representing a LPS25H driver.
#define _lps25h_methods_alone
 LPS25H specific methods.
#define _lps25h_methods
 LPS25H specific methods with inherited ones.
#define _lps25h_data
 LPS25HDriver specific data.

Version identification

#define EX_LPS25H_VERSION   "1.1.3"
 LPS25H driver version string.
#define EX_LPS25H_MAJOR   1
 LPS25H driver version major number.
#define EX_LPS25H_MINOR   1
 LPS25H driver version minor number.
#define EX_LPS25H_PATCH   3
 LPS25H driver version patch number.
#define LPS25H_BARO_NUMBER_OF_AXES   1U
 LPS25H barometer subsystem characteristics.
#define LPS25H_BARO_SENS   0.00024414f
#define LPS25H_BARO_BIAS   0.0f
#define LPS25H_THERMO_NUMBER_OF_AXES   1U
 LPS25H thermometer subsystem characteristics.
#define LPS25H_THERMO_SENS   0.00208333f
#define LPS25H_THERMO_BIAS   -42.5f

LPS25H communication interfaces related bit masks

#define LPS25H_DI_MASK   0xFF
#define LPS25H_DI(n)
#define LPS25H_AD_MASK   0x3F
#define LPS25H_AD(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.
#define LPS25H_SHARED_SPI   FALSE
 LPS25H shared SPI switch.
#define LPS25H_USE_I2C   TRUE
 LPS25H I2C interface switch.
#define LPS25H_SHARED_I2C   FALSE
 LPS25H shared I2C switch.
#define LPS25H_USE_ADVANCED   FALSE
 LPS25H advanced configurations switch.

Data Structures

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

Macros

#define lps25hBarometerGetAxesNumber(devp)
 Return the number of axes of the BaseBarometer.
#define lps25hBarometerReadRaw(devp, axes)
 Retrieves raw data from the BaseBarometer.
#define lps25hBarometerReadCooked(devp, axes)
 Retrieves cooked data from the BaseBarometer.
#define lps25hBarometerSetBias(devp, bp)
 Set bias values for the BaseBarometer.
#define lps25hBarometerResetBias(devp)
 Reset bias values for the BaseBarometer.
#define lps25hBarometerSetSensitivity(devp, sp)
 Set sensitivity values for the BaseBarometer.
#define lps25hBarometerResetSensitivity(devp)
 Reset sensitivity values for the BaseBarometer.
#define lps25hThermometerGetAxesNumber(devp)
 Return the number of axes of the BaseThermometer.
#define lps25hThermometerReadRaw(devp, axes)
 Retrieves raw data from the BaseThermometer.
#define lps25hThermometerReadCooked(devp, axes)
 Retrieves cooked data from the BaseThermometer.
#define lps25hThermometerSetBias(devp, bp)
 Set bias values for the BaseThermometer.
#define lps25hThermometerResetBias(devp)
 Reset bias values for the BaseThermometer.
#define lps25hThermometerSetSensitivity(devp, sp)
 Set sensitivity values for the BaseThermometer.
#define lps25hThermometerResetSensitivity(devp)
 Reset sensitivity values for the BaseThermometer.

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.
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 size_t baro_get_axes_number (void *ip)
 Return the number of axes of the BaseBarometer.
static msg_t baro_read_raw (void *ip, int32_t axes[])
 Retrieves raw data from the BaseBarometer.
static msg_t baro_read_cooked (void *ip, float axes[])
 Retrieves cooked data from the BaseBarometer.
static msg_t baro_set_bias (void *ip, float *bp)
 Set bias values for the BaseBarometer.
static msg_t baro_reset_bias (void *ip)
 Reset bias values for the BaseBarometer.
static msg_t baro_set_sensitivity (void *ip, float *sp)
 Set sensitivity values for the BaseBarometer.
static msg_t baro_reset_sensitivity (void *ip)
 Reset sensitivity values for the BaseBarometer.
static size_t thermo_get_axes_number (void *ip)
 Return the number of axes of the BaseThermometer.
static msg_t thermo_read_raw (void *ip, int32_t axes[])
 Retrieves raw data from the BaseThermometer.
static msg_t thermo_read_cooked (void *ip, float *axis)
 Retrieves cooked data from the BaseThermometer.
static msg_t thermo_set_bias (void *ip, float *bp)
 Set bias values for the BaseThermometer.
static msg_t thermo_reset_bias (void *ip)
 Reset bias values for the BaseThermometer.
static msg_t thermo_set_sensitivity (void *ip, float *sp)
 Set sensitivity values for the BaseThermometer.
static msg_t thermo_reset_sensitivity (void *ip)
 Reset sensitivity values for the BaseThermometer.
void lps25hObjectInit (LPS25HDriver *devp)
 Initializes an instance.
void lps25hStart (LPS25HDriver *devp, const LPS25HConfig *config)
 Configures and activates LPS25H Complex Driver peripheral.
void lps25hStop (LPS25HDriver *devp)
 Deactivates the LPS25H Complex Driver peripheral.

Variables

static const struct LPS25HVMT vmt_device
static const struct BaseBarometerVMT vmt_barometer
static const struct BaseThermometerVMT vmt_thermometer

Macro Definition Documentation

◆ EX_LPS25H_VERSION

#define EX_LPS25H_VERSION   "1.1.3"

LPS25H driver version string.

Definition at line 46 of file lps25h.h.

◆ EX_LPS25H_MAJOR

#define EX_LPS25H_MAJOR   1

LPS25H driver version major number.

Definition at line 51 of file lps25h.h.

◆ EX_LPS25H_MINOR

#define EX_LPS25H_MINOR   1

LPS25H driver version minor number.

Definition at line 56 of file lps25h.h.

◆ EX_LPS25H_PATCH

#define EX_LPS25H_PATCH   3

LPS25H driver version patch number.

Definition at line 61 of file lps25h.h.

◆ LPS25H_BARO_NUMBER_OF_AXES

#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().

◆ LPS25H_BARO_SENS

#define LPS25H_BARO_SENS   0.00024414f

Definition at line 74 of file lps25h.h.

Referenced by baro_reset_bias(), baro_reset_sensitivity(), and lps25hStart().

◆ LPS25H_BARO_BIAS

#define LPS25H_BARO_BIAS   0.0f

Definition at line 75 of file lps25h.h.

Referenced by lps25hStart().

◆ LPS25H_THERMO_NUMBER_OF_AXES

#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().

◆ LPS25H_THERMO_SENS

#define LPS25H_THERMO_SENS   0.00208333f

Definition at line 87 of file lps25h.h.

Referenced by lps25hStart(), and thermo_reset_sensitivity().

◆ LPS25H_THERMO_BIAS

#define LPS25H_THERMO_BIAS   -42.5f

Definition at line 88 of file lps25h.h.

Referenced by lps25hStart(), and thermo_reset_bias().

◆ LPS25H_DI_MASK

#define LPS25H_DI_MASK   0xFF

Definition at line 95 of file lps25h.h.

◆ LPS25H_DI

#define LPS25H_DI ( n)
Value:
(1 << n)

Definition at line 96 of file lps25h.h.

◆ LPS25H_AD_MASK

#define LPS25H_AD_MASK   0x3F

Definition at line 97 of file lps25h.h.

◆ LPS25H_AD

#define LPS25H_AD ( n)
Value:
(1 << n)

Definition at line 98 of file lps25h.h.

◆ LPS25H_MS

#define LPS25H_MS   (1 << 6)

Definition at line 99 of file lps25h.h.

◆ LPS25H_RW

#define LPS25H_RW   (1 << 7)

Definition at line 100 of file lps25h.h.

◆ LPS25H_SUB_MS

#define LPS25H_SUB_MS   (1 << 7)

Definition at line 102 of file lps25h.h.

Referenced by lps25hI2CReadRegister(), and lps25hI2CWriteRegister().

◆ LPS25H_AD_REF_P_XL

#define LPS25H_AD_REF_P_XL   0x08

Definition at line 109 of file lps25h.h.

◆ LPS25H_AD_REF_P_L

#define LPS25H_AD_REF_P_L   0x09

Definition at line 110 of file lps25h.h.

◆ LPS25H_AD_REF_P_H

#define LPS25H_AD_REF_P_H   0x0A

Definition at line 111 of file lps25h.h.

◆ LPS25H_AD_WHO_AM_I

#define LPS25H_AD_WHO_AM_I   0x0F

Definition at line 112 of file lps25h.h.

◆ LPS25H_AD_RES_CONF

#define LPS25H_AD_RES_CONF   0x10

Definition at line 113 of file lps25h.h.

Referenced by lps25hStart().

◆ LPS25H_AD_CTRL_REG1

#define LPS25H_AD_CTRL_REG1   0x20

Definition at line 114 of file lps25h.h.

Referenced by lps25hStart(), and lps25hStop().

◆ LPS25H_AD_CTRL_REG2

#define LPS25H_AD_CTRL_REG2   0x21

Definition at line 115 of file lps25h.h.

◆ LPS25H_AD_CTRL_REG3

#define LPS25H_AD_CTRL_REG3   0x22

Definition at line 116 of file lps25h.h.

◆ LPS25H_AD_CTRL_REG4

#define LPS25H_AD_CTRL_REG4   0x23

Definition at line 117 of file lps25h.h.

◆ LPS25H_AD_INT_CFG

#define LPS25H_AD_INT_CFG   0x24

Definition at line 118 of file lps25h.h.

◆ LPS25H_AD_INT_SRC

#define LPS25H_AD_INT_SRC   0x25

Definition at line 119 of file lps25h.h.

◆ LPS25H_AD_STATUS_REG

#define LPS25H_AD_STATUS_REG   0x27

Definition at line 120 of file lps25h.h.

◆ LPS25H_AD_PRESS_OUT_XL

#define LPS25H_AD_PRESS_OUT_XL   0x28

Definition at line 121 of file lps25h.h.

Referenced by baro_read_raw().

◆ LPS25H_AD_PRESS_OUT_L

#define LPS25H_AD_PRESS_OUT_L   0x29

Definition at line 122 of file lps25h.h.

◆ LPS25H_AD_PRESS_OUT_H

#define LPS25H_AD_PRESS_OUT_H   0x2A

Definition at line 123 of file lps25h.h.

◆ LPS25H_AD_TEMP_OUT_L

#define LPS25H_AD_TEMP_OUT_L   0x2B

Definition at line 124 of file lps25h.h.

Referenced by thermo_read_raw().

◆ LPS25H_AD_TEMP_OUT_H

#define LPS25H_AD_TEMP_OUT_H   0x2C

Definition at line 125 of file lps25h.h.

◆ LPS25H_AD_FIFO_CTRL

#define LPS25H_AD_FIFO_CTRL   0x2E

Definition at line 126 of file lps25h.h.

◆ LPS25H_AD_FIFO_SRC

#define LPS25H_AD_FIFO_SRC   0x2F

Definition at line 127 of file lps25h.h.

◆ LPS25H_AD_THS_P_L

#define LPS25H_AD_THS_P_L   0x30

Definition at line 128 of file lps25h.h.

◆ LPS25H_AD_THS_P_H

#define LPS25H_AD_THS_P_H   0x31

Definition at line 129 of file lps25h.h.

◆ LPS25H_AD_RPDS_L

#define LPS25H_AD_RPDS_L   0x39

Definition at line 130 of file lps25h.h.

◆ LPS25H_AD_RPDS_H

#define LPS25H_AD_RPDS_H   0x3A

Definition at line 131 of file lps25h.h.

◆ LPS25H_CTRL_REG1_MASK

#define LPS25H_CTRL_REG1_MASK   0xFF

Definition at line 138 of file lps25h.h.

◆ LPS25H_CTRL_REG1_SIM

#define LPS25H_CTRL_REG1_SIM   (1 << 0)

Definition at line 139 of file lps25h.h.

◆ LPS25H_CTRL_REG1_RESET_AZ

#define LPS25H_CTRL_REG1_RESET_AZ   (1 << 1)

Definition at line 140 of file lps25h.h.

◆ LPS25H_CTRL_REG1_BDU

#define LPS25H_CTRL_REG1_BDU   (1 << 2)

Definition at line 141 of file lps25h.h.

◆ LPS25H_CTRL_REG1_DIFF_EN

#define LPS25H_CTRL_REG1_DIFF_EN   (1 << 3)

Definition at line 142 of file lps25h.h.

◆ LPS25H_CTRL_REG1_ODR0

#define LPS25H_CTRL_REG1_ODR0   (1 << 4)

Definition at line 143 of file lps25h.h.

◆ LPS25H_CTRL_REG1_ODR1

#define LPS25H_CTRL_REG1_ODR1   (1 << 5)

Definition at line 144 of file lps25h.h.

◆ LPS25H_CTRL_REG1_ODR2

#define LPS25H_CTRL_REG1_ODR2   (1 << 6)

Definition at line 145 of file lps25h.h.

◆ LPS25H_CTRL_REG1_PD

#define LPS25H_CTRL_REG1_PD   (1 << 7)

Definition at line 146 of file lps25h.h.

Referenced by lps25hStart().

◆ LPS25H_CTRL_REG2_MASK

#define LPS25H_CTRL_REG2_MASK   0xF3

Definition at line 153 of file lps25h.h.

◆ LPS25H_CTRL_REG2_ONE_SHOT

#define LPS25H_CTRL_REG2_ONE_SHOT   (1 << 0)

Definition at line 154 of file lps25h.h.

◆ LPS25H_CTRL_REG2_AUTO_ZERO

#define LPS25H_CTRL_REG2_AUTO_ZERO   (1 << 1)

Definition at line 155 of file lps25h.h.

◆ LPS25H_CTRL_REG2_SWRESET

#define LPS25H_CTRL_REG2_SWRESET   (1 << 2)

Definition at line 156 of file lps25h.h.

◆ LPS25H_CTRL_REG2_FIFO_MEAN_DEC

#define LPS25H_CTRL_REG2_FIFO_MEAN_DEC   (1 << 4)

Definition at line 157 of file lps25h.h.

◆ LPS25H_CTRL_REG2_WTM_EN

#define LPS25H_CTRL_REG2_WTM_EN   (1 << 5)

Definition at line 158 of file lps25h.h.

◆ LPS25H_CTRL_REG2_FIFO_EN

#define LPS25H_CTRL_REG2_FIFO_EN   (1 << 6)

Definition at line 159 of file lps25h.h.

◆ LPS25H_CTRL_REG2_BOOT

#define LPS25H_CTRL_REG2_BOOT   (1 << 7)

Definition at line 160 of file lps25h.h.

◆ LPS25H_CTRL_REG3_MASK

#define LPS25H_CTRL_REG3_MASK   0xC3

Definition at line 167 of file lps25h.h.

◆ LPS25H_CTRL_REG3_INT_S1

#define LPS25H_CTRL_REG3_INT_S1   (1 << 0)

Definition at line 168 of file lps25h.h.

◆ LPS25H_CTRL_REG3_INT_S2

#define LPS25H_CTRL_REG3_INT_S2   (1 << 1)

Definition at line 169 of file lps25h.h.

◆ LPS25H_CTRL_REG3_PP_OD

#define LPS25H_CTRL_REG3_PP_OD   (1 << 6)

Definition at line 170 of file lps25h.h.

◆ LPS25H_CTRL_REG3_INT_H_L

#define LPS25H_CTRL_REG3_INT_H_L   (1 << 7)

Definition at line 171 of file lps25h.h.

◆ LPS25H_CTRL_REG4_MASK

#define LPS25H_CTRL_REG4_MASK   0x0F

Definition at line 178 of file lps25h.h.

◆ LPS25H_CTRL_REG4_P1_DRDY

#define LPS25H_CTRL_REG4_P1_DRDY   (1 << 0)

Definition at line 179 of file lps25h.h.

◆ LPS25H_CTRL_REG4_P1_OVERRUN

#define LPS25H_CTRL_REG4_P1_OVERRUN   (1 << 1)

Definition at line 180 of file lps25h.h.

◆ LPS25H_CTRL_REG4_P1_WTM

#define LPS25H_CTRL_REG4_P1_WTM   (1 << 2)

Definition at line 181 of file lps25h.h.

◆ LPS25H_CTRL_REG4_P1_EMPTY

#define LPS25H_CTRL_REG4_P1_EMPTY   (1 << 3)

Definition at line 182 of file lps25h.h.

◆ LPS25H_INT1_CFG_MASK

#define LPS25H_INT1_CFG_MASK   0x07

Definition at line 189 of file lps25h.h.

◆ LPS25H_INT1_CFG_PH_E

#define LPS25H_INT1_CFG_PH_E   (1 << 0)

Definition at line 190 of file lps25h.h.

◆ LPS25H_INT1_CFG_PL_E

#define LPS25H_INT1_CFG_PL_E   (1 << 1)

Definition at line 191 of file lps25h.h.

◆ LPS25H_INT1_CFG_LIR

#define LPS25H_INT1_CFG_LIR   (1 << 2)

Definition at line 192 of file lps25h.h.

◆ LPS25H_INT1_SRC_MASK

#define LPS25H_INT1_SRC_MASK   0x07

Definition at line 199 of file lps25h.h.

◆ LPS25H_INT1_SRC_PH

#define LPS25H_INT1_SRC_PH   (1 << 0)

Definition at line 200 of file lps25h.h.

◆ LPS25H_INT1_SRC_PL

#define LPS25H_INT1_SRC_PL   (1 << 1)

Definition at line 201 of file lps25h.h.

◆ LPS25H_INT1_SRC_IA

#define LPS25H_INT1_SRC_IA   (1 << 2)

Definition at line 202 of file lps25h.h.

◆ LPS25H_USE_SPI

#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.

◆ LPS25H_SHARED_SPI

#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.

◆ LPS25H_USE_I2C

#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.

◆ LPS25H_SHARED_I2C

#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.

◆ LPS25H_USE_ADVANCED

#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.

◆ _lps25h_methods_alone

#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.

◆ _lps25h_methods

#define _lps25h_methods
Value:
_base_object_methods \
_lps25h_methods_alone

LPS25H specific methods with inherited ones.

Definition at line 435 of file lps25h.h.

◆ _lps25h_data

#define _lps25h_data
Value:
/* Driver state.*/ \
lps25h_state_t 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_state_t
Driver state machine possible states.
Definition lps25h.h:355
LPS25H configuration structure.
Definition lps25h.h:364

LPS25HDriver specific data.

Definition at line 451 of file lps25h.h.

◆ lps25hBarometerGetAxesNumber

#define lps25hBarometerGetAxesNumber ( devp)
Value:
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.

◆ lps25hBarometerReadRaw

#define lps25hBarometerReadRaw ( devp,
axes )
Value:
barometerReadRaw(&((devp)->baro_if), axes)
#define barometerReadRaw(ip, dp)
Barometer read raw data.

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.

◆ lps25hBarometerReadCooked

#define lps25hBarometerReadCooked ( devp,
axes )
Value:
barometerReadCooked(&((devp)->baro_if), axes)
#define barometerReadCooked(ip, dp)
Barometer read cooked data.

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.

◆ lps25hBarometerSetBias

#define lps25hBarometerSetBias ( devp,
bp )
Value:
barometerSetBias(&((devp)->baro_if), bp)
#define barometerSetBias(ip, bp)
Updates barometer bias data from received buffer.

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.

◆ lps25hBarometerResetBias

#define lps25hBarometerResetBias ( devp)
Value:
barometerResetBias(&((devp)->baro_if))
#define barometerResetBias(ip)
Reset barometer bias data restoring it to zero.

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.

◆ lps25hBarometerSetSensitivity

#define lps25hBarometerSetSensitivity ( devp,
sp )
Value:
barometerSetSensitivity(&((devp)->baro_if), sp)
#define barometerSetSensitivity(ip, sp)
Updates barometer sensitivity data from received buffer.

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.

◆ lps25hBarometerResetSensitivity

#define lps25hBarometerResetSensitivity ( devp)
Value:
barometerResetSensitivity(&((devp)->baro_if))
#define barometerResetSensitivity(ip)
Reset barometer sensitivity data restoring it to its typical value.

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.

◆ lps25hThermometerGetAxesNumber

#define lps25hThermometerGetAxesNumber ( devp)
Value:
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.

◆ lps25hThermometerReadRaw

#define lps25hThermometerReadRaw ( devp,
axes )
Value:
thermometerReadRaw(&((devp)->thermo_if), axes)
#define thermometerReadRaw(ip, dp)
Thermometer read raw data.

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.

◆ lps25hThermometerReadCooked

#define lps25hThermometerReadCooked ( devp,
axes )
Value:
thermometerReadCooked(&((devp)->thermo_if), axes)
#define thermometerReadCooked(ip, dp)
Thermometer read cooked data.

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.

◆ lps25hThermometerSetBias

#define lps25hThermometerSetBias ( devp,
bp )
Value:
thermometerSetBias(&((devp)->thermo_if), bp)
#define thermometerSetBias(ip, bp)
Updates thermometer bias data from received buffer.

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.

◆ lps25hThermometerResetBias

#define lps25hThermometerResetBias ( devp)
Value:
thermometerResetBias(&((devp)->thermo_if))
#define thermometerResetBias(ip)
Reset thermometer bias data restoring it to zero.

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.

◆ lps25hThermometerSetSensitivity

#define lps25hThermometerSetSensitivity ( devp,
sp )
Value:
thermometerSetSensitivity(&((devp)->thermo_if), sp)
#define thermometerSetSensitivity(ip, sp)
Updates thermometer sensitivity data from received buffer.

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.

◆ lps25hThermometerResetSensitivity

#define lps25hThermometerResetSensitivity ( devp)
Value:
thermometerResetSensitivity(&((devp)->thermo_if))
#define thermometerResetSensitivity(ip)
Reset thermometer sensitivity data restoring it to its typical value.

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

◆ LPS25HDriver

typedef struct LPS25HDriver LPS25HDriver

Structure representing a LPS25H driver.

Definition at line 303 of file lps25h.h.

Enumeration Type Documentation

◆ lps25h_sad_t

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_odr_t

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_avgp_t

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_avgt_t

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_bdu_t

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.

◆ lps25h_state_t

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

◆ lps25hI2CReadRegister()

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(), LPS25H_SUB_MS, and TIME_INFINITE.

Referenced by baro_read_raw(), and thermo_read_raw().

Here is the call graph for this function:

◆ lps25hI2CWriteRegister()

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(), LPS25H_SUB_MS, and TIME_INFINITE.

Referenced by lps25hStart(), and lps25hStop().

Here is the call graph for this function:

◆ baro_get_axes_number()

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.

◆ baro_read_raw()

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_AD_PRESS_OUT_XL, LPS25H_READY, lps25hI2CReadRegister(), MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

Referenced by baro_read_cooked().

Here is the call graph for this function:

◆ baro_read_cooked()

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.

Here is the call graph for this function:

◆ baro_set_bias()

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.

◆ baro_reset_bias()

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_BARO_SENS, LPS25H_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ baro_set_sensitivity()

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.

◆ baro_reset_sensitivity()

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_BARO_SENS, LPS25H_READY, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ thermo_get_axes_number()

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.

◆ thermo_read_raw()

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_AD_TEMP_OUT_L, LPS25H_READY, lps25hI2CReadRegister(), MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

Referenced by thermo_read_cooked().

Here is the call graph for this function:

◆ thermo_read_cooked()

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().

Here is the call graph for this function:

◆ thermo_set_bias()

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.

◆ thermo_reset_bias()

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, LPS25H_THERMO_BIAS, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ thermo_set_sensitivity()

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.

◆ thermo_reset_sensitivity()

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 LPS25H_READY, LPS25H_THERMO_SENS, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ lps25hObjectInit()

void lps25hObjectInit ( LPS25HDriver * devp)

Initializes an instance.

Parameters
[out]devppointer to the LPS25HDriver object
Function Class:
Object or module nitializer function.

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, BaseBarometer::vmt, BaseThermometer::vmt, LPS25HDriver::vmt, vmt_barometer, vmt_device, and vmt_thermometer.

◆ lps25hStart()

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 hal_i2c_driver::config, i2cAcquireBus(), LPS25HConfig::i2cp, i2cReleaseBus(), i2cStart(), LPS25H_AD_CTRL_REG1, LPS25H_AD_RES_CONF, LPS25H_BARO_BIAS, LPS25H_BARO_SENS, LPS25H_CTRL_REG1_PD, LPS25H_READY, LPS25H_STOP, LPS25H_THERMO_BIAS, LPS25H_THERMO_SENS, lps25hI2CWriteRegister(), osalDbgAssert, osalDbgCheck, and osalThreadSleepMilliseconds.

Here is the call graph for this function:

◆ lps25hStop()

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_AD_CTRL_REG1, LPS25H_READY, LPS25H_STOP, lps25hI2CWriteRegister(), osalDbgAssert, and osalDbgCheck.

Here is the call graph for this function:

Variable Documentation

◆ vmt_device

const struct LPS25HVMT vmt_device
static
Initial value:
= {
(size_t)0
}

Definition at line 521 of file lps25h.c.

◆ vmt_barometer

const struct BaseBarometerVMT vmt_barometer
static
Initial value:
= {
sizeof(struct LPS25HVMT*),
}
static msg_t baro_read_raw(void *ip, int32_t axes[])
Read baromether raw data.
Definition bmp085.c:399
static msg_t baro_reset_bias(void *ip)
Reset the barometer bias.
Definition bmp085.c:602
static size_t baro_get_axes_number(void *ip)
Get the barometer number of axes.
Definition bmp085.c:356
static msg_t baro_set_bias(void *ip, float *bp)
Set the barometer bias.
Definition bmp085.c:569
static msg_t baro_read_cooked(void *ip, float axes[])
Read barometer cooked data.
Definition bmp085.c:492
static msg_t baro_reset_sensitivity(void *ip)
Reset sensitivity values for the BaseBarometer.
Definition lps22hb.c:284
static msg_t baro_set_sensitivity(void *ip, float *sp)
Set sensitivity values for the BaseBarometer.
Definition lps22hb.c:259
LPS25H virtual methods table.
Definition lps25h.h:444

Definition at line 525 of file lps25h.c.

◆ vmt_thermometer

const struct BaseThermometerVMT vmt_thermometer
static
Initial value:
= {
sizeof(struct LPS25HVMT*) + sizeof(BaseBarometer),
}
static msg_t thermo_set_bias(void *ip, float *bp)
Set the thermometer bias.
Definition bmp085.c:586
static msg_t thermo_read_raw(void *ip, int32_t axes[])
Read thermometer raw data.
Definition bmp085.c:433
static size_t thermo_get_axes_number(void *ip)
Get the thermometer number of axes.
Definition bmp085.c:370
static msg_t thermo_read_cooked(void *ip, float axes[])
Read thermometer cooked data.
Definition bmp085.c:520
static msg_t thermo_reset_bias(void *ip)
Reset the thermometer bias.
Definition bmp085.c:619
static msg_t thermo_reset_sensitivity(void *ip)
Reset sensitivity values for the BaseThermometer.
Definition hts221.c:576
static msg_t thermo_set_sensitivity(void *ip, float *sp)
Set sensitivity values for the BaseThermometer.
Definition hts221.c:550
Base barometer class.

Definition at line 532 of file lps25h.c.