ChibiOS 21.11.4

Detailed Description

Collaboration diagram for LPS22HB:

LPS22HB data structures and types.

enum  lps22hb_sad_t { LPS22HB_SAD_GND = 0x5C , LPS22HB_SAD_VCC = 0x5D }
 LPS22HB slave address. More...
enum  lps22hb_odr_t {
  LPS22HB_ODR_PD = 0x00 , LPS22HB_ODR_1HZ = 0x10 , LPS22HB_ODR_10HZ = 0x20 , LPS22HB_ODR_25HZ = 0x30 ,
  LPS22HB_ODR_50HZ = 0x40 , LPS22HB_ODR_75HZ = 0x50
}
 LPS22HB output data rate and bandwidth. More...
enum  lps22hb_lp_t { LPS22HB_LP_DISABLED = 0x00 , LPS22HB_LP_ODR_9 = 0x08 , LPS22HB_LP_ODR_20 = 0x0C }
 LPS22HB pressure resolution. More...
enum  lps22hb_bdu_t { LPS22HB_BDU_CONTINUOUS = 0x00 , LPS22HB_BDU_BLOCKED = 0x40 }
 LPS22HB block data update. More...
enum  lps22hb_state_t { LPS22HB_UNINIT = 0 , LPS22HB_STOP = 1 , LPS22HB_READY = 2 }
 Driver state machine possible states. More...
typedef struct LPS22HBDriver LPS22HBDriver
 Structure representing a LPS22HB driver.
#define _lps22hb_methods_alone
 LPS22HB specific methods.
#define _lps22hb_methods
 LPS22HB specific methods with inherited ones.
#define _lps22hb_data
 LPS22HBDriver specific data.

Version identification

#define EX_LPS22HB_VERSION   "1.0.2"
 LPS22HB driver version string.
#define EX_LPS22HB_MAJOR   1
 LPS22HB driver version major number.
#define EX_LPS22HB_MINOR   0
 LPS22HB driver version minor number.
#define EX_LPS22HB_PATCH   2
 LPS22HB driver version patch number.
#define LPS22HB_BARO_NUMBER_OF_AXES   1U
 LPS22HB barometer subsystem characteristics.
#define LPS22HB_BARO_SENS   0.00024414f
#define LPS22HB_BARO_BIAS   0.0f
#define LPS22HB_THERMO_NUMBER_OF_AXES   1U
 LPS22HB thermometer subsystem characteristics.
#define LPS22HB_THERMO_SENS   0.01f
#define LPS22HB_THERMO_BIAS   0.0f

LPS22HB communication interfaces related bit masks

#define LPS22HB_DI_MASK   0xFF
#define LPS22HB_DI(n)
#define LPS22HB_AD_MASK   0x3F
#define LPS22HB_AD(n)
#define LPS22HB_MS   (1 << 6)
#define LPS22HB_RW   (1 << 7)
#define LPS22HB_SUB_MS   (1 << 7)

LPS22HB register addresses

#define LPS22HB_AD_INT_CFG   0x0B
#define LPS22HB_AD_THS_P_L   0x0C
#define LPS22HB_AD_THS_P_H   0x0D
#define LPS22HB_AD_WHO_AM_I   0x0F
#define LPS22HB_AD_CTRL_REG1   0x10
#define LPS22HB_AD_CTRL_REG2   0x11
#define LPS22HB_AD_CTRL_REG3   0x12
#define LPS22HB_AD_FIFO_CTRL   0x14
#define LPS22HB_AD_REF_P_XL   0x15
#define LPS22HB_AD_REF_P_L   0x16
#define LPS22HB_AD_REF_P_H   0x17
#define LPS22HB_AD_RPDS_L   0x18
#define LPS22HB_AD_RPDS_H   0x19
#define LPS22HB_AD_RES_CONF   0x1A
#define LPS22HB_AD_INT_SRC   0x25
#define LPS22HB_AD_FIFO_SRC   0x26
#define LPS22HB_AD_STATUS_REG   0x27
#define LPS22HB_AD_PRESS_OUT_XL   0x28
#define LPS22HB_AD_PRESS_OUT_L   0x29
#define LPS22HB_AD_PRESS_OUT_H   0x2A
#define LPS22HB_AD_TEMP_OUT_L   0x2B
#define LPS22HB_AD_TEMP_OUT_H   0x2C
#define LPS22HB_AD_LPFP_RES   0x33

LPS22HB_INT_CFG register bits definitions

#define LPS22HB_INT_CFG_MASK   0xFF
#define LPS22HB_INT_CFG_PHE   (1 << 0)
#define LPS22HB_INT_CFG_PLE   (1 << 1)
#define LPS22HB_INT_CFG_LIR   (1 << 2)
#define LPS22HB_INT_CFG_DIFF_EN   (1 << 3)
#define LPS22HB_INT_CFG_RESET_AZ   (1 << 4)
#define LPS22HB_INT_CFG_AUTOZERO   (1 << 5)
#define LPS22HB_INT_CFG_RESET_ARP   (1 << 6)
#define LPS22HB_INT_CFG_AUTORIFP   (1 << 7)

LPS22HB_CTRL_REG1 register bits definitions

#define LPS22HB_CTRL_REG1_MASK   0x7F
#define LPS22HB_CTRL_REG1_SIM   (1 << 0)
#define LPS22HB_CTRL_REG1_BDU   (1 << 1)
#define LPS22HB_CTRL_REG1_LPFP_CFG   (1 << 2)
#define LPS22HB_CTRL_REG1_LPFP_EN   (1 << 3)
#define LPS22HB_CTRL_REG1_ODR0   (1 << 4)
#define LPS22HB_CTRL_REG1_ODR1   (1 << 5)
#define LPS22HB_CTRL_REG1_ODR2   (1 << 6)

LPS22HB_CTRL_REG2 register bits definitions

#define LPS22HB_CTRL_REG2_MASK   0xFD
#define LPS22HB_CTRL_REG2_ONE_SHOT   (1 << 0)
#define LPS22HB_CTRL_REG2_SWRESET   (1 << 2)
#define LPS22HB_CTRL_REG2_I2C_DIS   (1 << 3)
#define LPS22HB_CTRL_REG2_IF_ADD_INC   (1 << 4)
#define LPS22HB_CTRL_REG2_STOP_ON_FTH   (1 << 5)
#define LPS22HB_CTRL_REG2_FIFO_EN   (1 << 6)
#define LPS22HB_CTRL_REG2_BOOT   (1 << 7)

LPS22HB_CTRL_REG3 register bits definitions

#define LPS22HB_CTRL_REG3_MASK   0xFF
#define LPS22HB_CTRL_REG3_INT_S1   (1 << 0)
#define LPS22HB_CTRL_REG3_INT_S2   (1 << 1)
#define LPS22HB_CTRL_REG3_DRDY   (1 << 2)
#define LPS22HB_CTRL_REG3_F_OVR   (1 << 3)
#define LPS22HB_CTRL_REG3_F_FTH   (1 << 4)
#define LPS22HB_CTRL_REG3_F_FSS5   (1 << 5)
#define LPS22HB_CTRL_REG3_PP_OD   (1 << 6)
#define LPS22HB_CTRL_REG3_INT_H_L   (1 << 7)

LPS22HB_INT_SRC register bits definitions

#define LPS22HB_INT_SRC_MASK   0x87
#define LPS22HB_INT_SRC_PH   (1 << 0)
#define LPS22HB_INT_SRC_PL   (1 << 1)
#define LPS22HB_INT_SRC_IA   (1 << 2)
#define LPS22HB_INT_SRC_BOOT_STATUS   (1 << 8)

Configuration options

#define LPS22HB_USE_SPI   FALSE
 LPS22HB SPI interface switch.
#define LPS22HB_SHARED_SPI   FALSE
 LPS22HB shared SPI switch.
#define LPS22HB_USE_I2C   TRUE
 LPS22HB I2C interface switch.
#define LPS22HB_SHARED_I2C   FALSE
 LPS22HB shared I2C switch.
#define LPS22HB_USE_ADVANCED   FALSE
 LPS22HB advanced configurations switch.

Data Structures

struct  LPS22HBConfig
 LPS22HB configuration structure. More...
struct  LPS22HBVMT
 LPS22HB virtual methods table. More...
struct  LPS22HBDriver
 LPS22HB 2-axis barometer/thermometer class. More...

Macros

#define lps22hbI2CWriteRegister(i2cp, sad, txbuf, n)
 Writes a value into a register using I2C.
#define lps22hbBarometerGetAxesNumber(devp)
 Return the number of axes of the BaseBarometer.
#define lps22hbBarometerReadRaw(devp, axes)
 Retrieves raw data from the BaseBarometer.
#define lps22hbBarometerReadCooked(devp, axes)
 Retrieves cooked data from the BaseBarometer.
#define lps22hbBarometerSetBias(devp, bp)
 Set bias values for the BaseBarometer.
#define lps22hbBarometerResetBias(devp)
 Reset bias values for the BaseBarometer.
#define lps22hbBarometerSetSensitivity(devp, sp)
 Set sensitivity values for the BaseBarometer.
#define lps22hbBarometerResetSensitivity(devp)
 Reset sensitivity values for the BaseBarometer.
#define lps22hbThermometerGetAxesNumber(devp)
 Return the number of axes of the BaseThermometer.
#define lps22hbThermometerReadRaw(devp, axes)
 Retrieves raw data from the BaseThermometer.
#define lps22hbThermometerReadCooked(devp, axes)
 Retrieves cooked data from the BaseThermometer.
#define lps22hbThermometerSetBias(devp, bp)
 Set bias values for the BaseThermometer.
#define lps22hbThermometerResetBias(devp)
 Reset bias values for the BaseThermometer.
#define lps22hbThermometerSetSensitivity(devp, sp)
 Set sensitivity values for the BaseThermometer.
#define lps22hbThermometerResetSensitivity(devp)
 Reset sensitivity values for the BaseThermometer.

Functions

static msg_t lps22hbI2CReadRegister (I2CDriver *i2cp, lps22hb_sad_t sad, uint8_t reg, uint8_t *rxbuf, size_t n)
 Reads registers value 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 lps22hbObjectInit (LPS22HBDriver *devp)
 Initializes an instance.
void lps22hbStart (LPS22HBDriver *devp, const LPS22HBConfig *config)
 Configures and activates LPS22HB Complex Driver peripheral.
void lps22hbStop (LPS22HBDriver *devp)
 Deactivates the LPS22HB Complex Driver peripheral.

Variables

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

Macro Definition Documentation

◆ lps22hbI2CWriteRegister

#define lps22hbI2CWriteRegister ( i2cp,
sad,
txbuf,
n )
Value:
i2cMasterTransmitTimeout(i2cp, sad, txbuf, n + 1, NULL, 0, \
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.
Definition hal_i2c.c:187
#define TIME_INFINITE
Infinite interval specification for all functions with a timeout specification.
Definition chtime.h:55

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 84 of file lps22hb.c.

Referenced by lps22hbStart(), and lps22hbStop().

◆ EX_LPS22HB_VERSION

#define EX_LPS22HB_VERSION   "1.0.2"

LPS22HB driver version string.

Definition at line 46 of file lps22hb.h.

◆ EX_LPS22HB_MAJOR

#define EX_LPS22HB_MAJOR   1

LPS22HB driver version major number.

Definition at line 51 of file lps22hb.h.

◆ EX_LPS22HB_MINOR

#define EX_LPS22HB_MINOR   0

LPS22HB driver version minor number.

Definition at line 56 of file lps22hb.h.

◆ EX_LPS22HB_PATCH

#define EX_LPS22HB_PATCH   2

LPS22HB driver version patch number.

Definition at line 61 of file lps22hb.h.

◆ LPS22HB_BARO_NUMBER_OF_AXES

#define LPS22HB_BARO_NUMBER_OF_AXES   1U

LPS22HB 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 lps22hb.h.

Referenced by baro_get_axes_number(), and lps22hbObjectInit().

◆ LPS22HB_BARO_SENS

#define LPS22HB_BARO_SENS   0.00024414f

Definition at line 74 of file lps22hb.h.

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

◆ LPS22HB_BARO_BIAS

#define LPS22HB_BARO_BIAS   0.0f

Definition at line 75 of file lps22hb.h.

Referenced by lps22hbStart().

◆ LPS22HB_THERMO_NUMBER_OF_AXES

#define LPS22HB_THERMO_NUMBER_OF_AXES   1U

LPS22HB thermometer subsystem characteristics.

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

Definition at line 85 of file lps22hb.h.

Referenced by lps22hbObjectInit(), and thermo_get_axes_number().

◆ LPS22HB_THERMO_SENS

#define LPS22HB_THERMO_SENS   0.01f

Definition at line 87 of file lps22hb.h.

Referenced by lps22hbStart(), and thermo_reset_sensitivity().

◆ LPS22HB_THERMO_BIAS

#define LPS22HB_THERMO_BIAS   0.0f

Definition at line 88 of file lps22hb.h.

Referenced by lps22hbStart(), and thermo_reset_bias().

◆ LPS22HB_DI_MASK

#define LPS22HB_DI_MASK   0xFF

Definition at line 95 of file lps22hb.h.

◆ LPS22HB_DI

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

Definition at line 96 of file lps22hb.h.

◆ LPS22HB_AD_MASK

#define LPS22HB_AD_MASK   0x3F

Definition at line 97 of file lps22hb.h.

◆ LPS22HB_AD

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

Definition at line 98 of file lps22hb.h.

◆ LPS22HB_MS

#define LPS22HB_MS   (1 << 6)

Definition at line 99 of file lps22hb.h.

◆ LPS22HB_RW

#define LPS22HB_RW   (1 << 7)

Definition at line 100 of file lps22hb.h.

◆ LPS22HB_SUB_MS

#define LPS22HB_SUB_MS   (1 << 7)

Definition at line 102 of file lps22hb.h.

◆ LPS22HB_AD_INT_CFG

#define LPS22HB_AD_INT_CFG   0x0B

Definition at line 109 of file lps22hb.h.

◆ LPS22HB_AD_THS_P_L

#define LPS22HB_AD_THS_P_L   0x0C

Definition at line 110 of file lps22hb.h.

◆ LPS22HB_AD_THS_P_H

#define LPS22HB_AD_THS_P_H   0x0D

Definition at line 111 of file lps22hb.h.

◆ LPS22HB_AD_WHO_AM_I

#define LPS22HB_AD_WHO_AM_I   0x0F

Definition at line 112 of file lps22hb.h.

◆ LPS22HB_AD_CTRL_REG1

#define LPS22HB_AD_CTRL_REG1   0x10

Definition at line 113 of file lps22hb.h.

Referenced by lps22hbStart(), and lps22hbStop().

◆ LPS22HB_AD_CTRL_REG2

#define LPS22HB_AD_CTRL_REG2   0x11

Definition at line 114 of file lps22hb.h.

Referenced by lps22hbStart().

◆ LPS22HB_AD_CTRL_REG3

#define LPS22HB_AD_CTRL_REG3   0x12

Definition at line 115 of file lps22hb.h.

◆ LPS22HB_AD_FIFO_CTRL

#define LPS22HB_AD_FIFO_CTRL   0x14

Definition at line 116 of file lps22hb.h.

◆ LPS22HB_AD_REF_P_XL

#define LPS22HB_AD_REF_P_XL   0x15

Definition at line 117 of file lps22hb.h.

◆ LPS22HB_AD_REF_P_L

#define LPS22HB_AD_REF_P_L   0x16

Definition at line 118 of file lps22hb.h.

◆ LPS22HB_AD_REF_P_H

#define LPS22HB_AD_REF_P_H   0x17

Definition at line 119 of file lps22hb.h.

◆ LPS22HB_AD_RPDS_L

#define LPS22HB_AD_RPDS_L   0x18

Definition at line 120 of file lps22hb.h.

◆ LPS22HB_AD_RPDS_H

#define LPS22HB_AD_RPDS_H   0x19

Definition at line 121 of file lps22hb.h.

◆ LPS22HB_AD_RES_CONF

#define LPS22HB_AD_RES_CONF   0x1A

Definition at line 122 of file lps22hb.h.

◆ LPS22HB_AD_INT_SRC

#define LPS22HB_AD_INT_SRC   0x25

Definition at line 123 of file lps22hb.h.

◆ LPS22HB_AD_FIFO_SRC

#define LPS22HB_AD_FIFO_SRC   0x26

Definition at line 124 of file lps22hb.h.

◆ LPS22HB_AD_STATUS_REG

#define LPS22HB_AD_STATUS_REG   0x27

Definition at line 125 of file lps22hb.h.

◆ LPS22HB_AD_PRESS_OUT_XL

#define LPS22HB_AD_PRESS_OUT_XL   0x28

Definition at line 126 of file lps22hb.h.

Referenced by baro_read_raw().

◆ LPS22HB_AD_PRESS_OUT_L

#define LPS22HB_AD_PRESS_OUT_L   0x29

Definition at line 127 of file lps22hb.h.

◆ LPS22HB_AD_PRESS_OUT_H

#define LPS22HB_AD_PRESS_OUT_H   0x2A

Definition at line 128 of file lps22hb.h.

◆ LPS22HB_AD_TEMP_OUT_L

#define LPS22HB_AD_TEMP_OUT_L   0x2B

Definition at line 129 of file lps22hb.h.

Referenced by thermo_read_raw().

◆ LPS22HB_AD_TEMP_OUT_H

#define LPS22HB_AD_TEMP_OUT_H   0x2C

Definition at line 130 of file lps22hb.h.

◆ LPS22HB_AD_LPFP_RES

#define LPS22HB_AD_LPFP_RES   0x33

Definition at line 131 of file lps22hb.h.

◆ LPS22HB_INT_CFG_MASK

#define LPS22HB_INT_CFG_MASK   0xFF

Definition at line 138 of file lps22hb.h.

◆ LPS22HB_INT_CFG_PHE

#define LPS22HB_INT_CFG_PHE   (1 << 0)

Definition at line 139 of file lps22hb.h.

◆ LPS22HB_INT_CFG_PLE

#define LPS22HB_INT_CFG_PLE   (1 << 1)

Definition at line 140 of file lps22hb.h.

◆ LPS22HB_INT_CFG_LIR

#define LPS22HB_INT_CFG_LIR   (1 << 2)

Definition at line 141 of file lps22hb.h.

◆ LPS22HB_INT_CFG_DIFF_EN

#define LPS22HB_INT_CFG_DIFF_EN   (1 << 3)

Definition at line 142 of file lps22hb.h.

◆ LPS22HB_INT_CFG_RESET_AZ

#define LPS22HB_INT_CFG_RESET_AZ   (1 << 4)

Definition at line 143 of file lps22hb.h.

◆ LPS22HB_INT_CFG_AUTOZERO

#define LPS22HB_INT_CFG_AUTOZERO   (1 << 5)

Definition at line 144 of file lps22hb.h.

◆ LPS22HB_INT_CFG_RESET_ARP

#define LPS22HB_INT_CFG_RESET_ARP   (1 << 6)

Definition at line 145 of file lps22hb.h.

◆ LPS22HB_INT_CFG_AUTORIFP

#define LPS22HB_INT_CFG_AUTORIFP   (1 << 7)

Definition at line 146 of file lps22hb.h.

◆ LPS22HB_CTRL_REG1_MASK

#define LPS22HB_CTRL_REG1_MASK   0x7F

Definition at line 153 of file lps22hb.h.

◆ LPS22HB_CTRL_REG1_SIM

#define LPS22HB_CTRL_REG1_SIM   (1 << 0)

Definition at line 154 of file lps22hb.h.

◆ LPS22HB_CTRL_REG1_BDU

#define LPS22HB_CTRL_REG1_BDU   (1 << 1)

Definition at line 155 of file lps22hb.h.

◆ LPS22HB_CTRL_REG1_LPFP_CFG

#define LPS22HB_CTRL_REG1_LPFP_CFG   (1 << 2)

Definition at line 156 of file lps22hb.h.

◆ LPS22HB_CTRL_REG1_LPFP_EN

#define LPS22HB_CTRL_REG1_LPFP_EN   (1 << 3)

Definition at line 157 of file lps22hb.h.

◆ LPS22HB_CTRL_REG1_ODR0

#define LPS22HB_CTRL_REG1_ODR0   (1 << 4)

Definition at line 158 of file lps22hb.h.

◆ LPS22HB_CTRL_REG1_ODR1

#define LPS22HB_CTRL_REG1_ODR1   (1 << 5)

Definition at line 159 of file lps22hb.h.

◆ LPS22HB_CTRL_REG1_ODR2

#define LPS22HB_CTRL_REG1_ODR2   (1 << 6)

Definition at line 160 of file lps22hb.h.

◆ LPS22HB_CTRL_REG2_MASK

#define LPS22HB_CTRL_REG2_MASK   0xFD

Definition at line 167 of file lps22hb.h.

◆ LPS22HB_CTRL_REG2_ONE_SHOT

#define LPS22HB_CTRL_REG2_ONE_SHOT   (1 << 0)

Definition at line 168 of file lps22hb.h.

◆ LPS22HB_CTRL_REG2_SWRESET

#define LPS22HB_CTRL_REG2_SWRESET   (1 << 2)

Definition at line 169 of file lps22hb.h.

◆ LPS22HB_CTRL_REG2_I2C_DIS

#define LPS22HB_CTRL_REG2_I2C_DIS   (1 << 3)

Definition at line 170 of file lps22hb.h.

◆ LPS22HB_CTRL_REG2_IF_ADD_INC

#define LPS22HB_CTRL_REG2_IF_ADD_INC   (1 << 4)

Definition at line 171 of file lps22hb.h.

Referenced by lps22hbStart().

◆ LPS22HB_CTRL_REG2_STOP_ON_FTH

#define LPS22HB_CTRL_REG2_STOP_ON_FTH   (1 << 5)

Definition at line 172 of file lps22hb.h.

◆ LPS22HB_CTRL_REG2_FIFO_EN

#define LPS22HB_CTRL_REG2_FIFO_EN   (1 << 6)

Definition at line 173 of file lps22hb.h.

◆ LPS22HB_CTRL_REG2_BOOT

#define LPS22HB_CTRL_REG2_BOOT   (1 << 7)

Definition at line 174 of file lps22hb.h.

◆ LPS22HB_CTRL_REG3_MASK

#define LPS22HB_CTRL_REG3_MASK   0xFF

Definition at line 181 of file lps22hb.h.

◆ LPS22HB_CTRL_REG3_INT_S1

#define LPS22HB_CTRL_REG3_INT_S1   (1 << 0)

Definition at line 182 of file lps22hb.h.

◆ LPS22HB_CTRL_REG3_INT_S2

#define LPS22HB_CTRL_REG3_INT_S2   (1 << 1)

Definition at line 183 of file lps22hb.h.

◆ LPS22HB_CTRL_REG3_DRDY

#define LPS22HB_CTRL_REG3_DRDY   (1 << 2)

Definition at line 184 of file lps22hb.h.

◆ LPS22HB_CTRL_REG3_F_OVR

#define LPS22HB_CTRL_REG3_F_OVR   (1 << 3)

Definition at line 185 of file lps22hb.h.

◆ LPS22HB_CTRL_REG3_F_FTH

#define LPS22HB_CTRL_REG3_F_FTH   (1 << 4)

Definition at line 186 of file lps22hb.h.

◆ LPS22HB_CTRL_REG3_F_FSS5

#define LPS22HB_CTRL_REG3_F_FSS5   (1 << 5)

Definition at line 187 of file lps22hb.h.

◆ LPS22HB_CTRL_REG3_PP_OD

#define LPS22HB_CTRL_REG3_PP_OD   (1 << 6)

Definition at line 188 of file lps22hb.h.

◆ LPS22HB_CTRL_REG3_INT_H_L

#define LPS22HB_CTRL_REG3_INT_H_L   (1 << 7)

Definition at line 189 of file lps22hb.h.

◆ LPS22HB_INT_SRC_MASK

#define LPS22HB_INT_SRC_MASK   0x87

Definition at line 196 of file lps22hb.h.

◆ LPS22HB_INT_SRC_PH

#define LPS22HB_INT_SRC_PH   (1 << 0)

Definition at line 197 of file lps22hb.h.

◆ LPS22HB_INT_SRC_PL

#define LPS22HB_INT_SRC_PL   (1 << 1)

Definition at line 198 of file lps22hb.h.

◆ LPS22HB_INT_SRC_IA

#define LPS22HB_INT_SRC_IA   (1 << 2)

Definition at line 199 of file lps22hb.h.

◆ LPS22HB_INT_SRC_BOOT_STATUS

#define LPS22HB_INT_SRC_BOOT_STATUS   (1 << 8)

Definition at line 200 of file lps22hb.h.

◆ LPS22HB_USE_SPI

#define LPS22HB_USE_SPI   FALSE

LPS22HB SPI interface switch.

If set to TRUE the support for SPI is included.

Note
The default is FALSE.

Definition at line 217 of file lps22hb.h.

◆ LPS22HB_SHARED_SPI

#define LPS22HB_SHARED_SPI   FALSE

LPS22HB 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 227 of file lps22hb.h.

◆ LPS22HB_USE_I2C

#define LPS22HB_USE_I2C   TRUE

LPS22HB I2C interface switch.

If set to TRUE the support for I2C is included.

Note
The default is TRUE.

Definition at line 236 of file lps22hb.h.

◆ LPS22HB_SHARED_I2C

#define LPS22HB_SHARED_I2C   FALSE

LPS22HB 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 246 of file lps22hb.h.

◆ LPS22HB_USE_ADVANCED

#define LPS22HB_USE_ADVANCED   FALSE

LPS22HB advanced configurations switch.

If set to TRUE more configurations are available.

Note
The default is FALSE.

Definition at line 255 of file lps22hb.h.

◆ _lps22hb_methods_alone

#define _lps22hb_methods_alone

LPS22HB specific methods.

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

Definition at line 414 of file lps22hb.h.

◆ _lps22hb_methods

#define _lps22hb_methods
Value:
_base_object_methods \
_lps22hb_methods_alone

LPS22HB specific methods with inherited ones.

Definition at line 419 of file lps22hb.h.

◆ _lps22hb_data

#define _lps22hb_data
Value:
/* Driver state.*/ \
lps22hb_state_t state; \
/* Current configuration data.*/ \
const LPS22HBConfig *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;
lps22hb_state_t
Driver state machine possible states.
Definition lps22hb.h:343
LPS22HB configuration structure.
Definition lps22hb.h:352

LPS22HBDriver specific data.

Definition at line 435 of file lps22hb.h.

◆ lps22hbBarometerGetAxesNumber

#define lps22hbBarometerGetAxesNumber ( devp)
Value:
barometerGetAxesNumber(&((devp)->baro_if))

Return the number of axes of the BaseBarometer.

Parameters
[in]devppointer to LPS22HBDriver.
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 480 of file lps22hb.h.

◆ lps22hbBarometerReadRaw

#define lps22hbBarometerReadRaw ( 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 LPS22HBDriver.
[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 501 of file lps22hb.h.

◆ lps22hbBarometerReadCooked

#define lps22hbBarometerReadCooked ( 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 LPS22HBDriver.
[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 523 of file lps22hb.h.

◆ lps22hbBarometerSetBias

#define lps22hbBarometerSetBias ( 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 LPS22HBDriver.
[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 540 of file lps22hb.h.

◆ lps22hbBarometerResetBias

#define lps22hbBarometerResetBias ( 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 LPS22HBDriver.
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 555 of file lps22hb.h.

◆ lps22hbBarometerSetSensitivity

#define lps22hbBarometerSetSensitivity ( 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 LPS22HBDriver.
[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 572 of file lps22hb.h.

◆ lps22hbBarometerResetSensitivity

#define lps22hbBarometerResetSensitivity ( 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 LPS22HBDriver.
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 586 of file lps22hb.h.

◆ lps22hbThermometerGetAxesNumber

#define lps22hbThermometerGetAxesNumber ( devp)
Value:
thermometerGetAxesNumber(&((devp)->thermo_if))

Return the number of axes of the BaseThermometer.

Parameters
[in]devppointer to LPS22HBDriver.
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 598 of file lps22hb.h.

◆ lps22hbThermometerReadRaw

#define lps22hbThermometerReadRaw ( 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 LPS22HBDriver.
[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 619 of file lps22hb.h.

◆ lps22hbThermometerReadCooked

#define lps22hbThermometerReadCooked ( 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 LPS22HBDriver.
[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 641 of file lps22hb.h.

◆ lps22hbThermometerSetBias

#define lps22hbThermometerSetBias ( 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 LPS22HBDriver.
[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 658 of file lps22hb.h.

◆ lps22hbThermometerResetBias

#define lps22hbThermometerResetBias ( 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 LPS22HBDriver.
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 673 of file lps22hb.h.

◆ lps22hbThermometerSetSensitivity

#define lps22hbThermometerSetSensitivity ( 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 LPS22HBDriver.
[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 690 of file lps22hb.h.

◆ lps22hbThermometerResetSensitivity

#define lps22hbThermometerResetSensitivity ( 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 LPS22HBDriver.
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 704 of file lps22hb.h.

Typedef Documentation

◆ LPS22HBDriver

typedef struct LPS22HBDriver LPS22HBDriver

Structure representing a LPS22HB driver.

Definition at line 301 of file lps22hb.h.

Enumeration Type Documentation

◆ lps22hb_sad_t

LPS22HB slave address.

Enumerator
LPS22HB_SAD_GND 

Slave Address when SA0 is to GND

LPS22HB_SAD_VCC 

Slave Address when SA0 is to VCC

Definition at line 306 of file lps22hb.h.

◆ lps22hb_odr_t

LPS22HB output data rate and bandwidth.

Enumerator
LPS22HB_ODR_PD 

Power down.

LPS22HB_ODR_1HZ 

Output data rate 1 Hz.

LPS22HB_ODR_10HZ 

Output data rate 10 Hz.

LPS22HB_ODR_25HZ 

Output data rate 25 Hz.

LPS22HB_ODR_50HZ 

Output data rate 50 Hz.

LPS22HB_ODR_75HZ 

Output data rate 75 Hz.

Definition at line 314 of file lps22hb.h.

◆ lps22hb_lp_t

LPS22HB pressure resolution.

Enumerator
LPS22HB_LP_DISABLED 

LP Filter disabled.

LPS22HB_LP_ODR_9 

LP Filter enabled. Cut-off ORD/9.

LPS22HB_LP_ODR_20 

LP Filter enabled. Cut-off ORD/20.

Definition at line 326 of file lps22hb.h.

◆ lps22hb_bdu_t

LPS22HB block data update.

Enumerator
LPS22HB_BDU_CONTINUOUS 

Block data continuously updated.

LPS22HB_BDU_BLOCKED 

Block data updated after reading.

Definition at line 335 of file lps22hb.h.

◆ lps22hb_state_t

Driver state machine possible states.

Enumerator
LPS22HB_UNINIT 

Not initialized.

LPS22HB_STOP 

Stopped.

LPS22HB_READY 

Ready.

Definition at line 343 of file lps22hb.h.

Function Documentation

◆ lps22hbI2CReadRegister()

msg_t lps22hbI2CReadRegister ( I2CDriver * i2cp,
lps22hb_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 lps22hb.c.

References i2cMasterTransmitTimeout(), and TIME_INFINITE.

Referenced by baro_read_raw(), and thermo_read_raw().

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 96 of file lps22hb.c.

References LPS22HB_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 118 of file lps22hb.c.

References I2C_READY, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), LPS22HB_AD_PRESS_OUT_XL, LPS22HB_READY, lps22hbI2CReadRegister(), 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 170 of file lps22hb.c.

References baro_read_raw(), LPS22HB_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 205 of file lps22hb.c.

References LPS22HB_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 231 of file lps22hb.c.

References LPS22HB_BARO_SENS, LPS22HB_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 259 of file lps22hb.c.

References LPS22HB_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 284 of file lps22hb.c.

References LPS22HB_BARO_SENS, LPS22HB_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 307 of file lps22hb.c.

References LPS22HB_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 329 of file lps22hb.c.

References I2C_READY, i2cAcquireBus(), i2cReleaseBus(), i2cStart(), LPS22HB_AD_TEMP_OUT_L, LPS22HB_READY, lps22hbI2CReadRegister(), 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 383 of file lps22hb.c.

References LPS22HB_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 415 of file lps22hb.c.

References LPS22HB_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 442 of file lps22hb.c.

References LPS22HB_READY, LPS22HB_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 471 of file lps22hb.c.

References LPS22HB_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 497 of file lps22hb.c.

References LPS22HB_READY, LPS22HB_THERMO_SENS, MSG_OK, objGetInstance, osalDbgAssert, and osalDbgCheck.

◆ lps22hbObjectInit()

void lps22hbObjectInit ( LPS22HBDriver * devp)

Initializes an instance.

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

Definition at line 543 of file lps22hb.c.

References LPS22HBDriver::baro_if, LPS22HB_BARO_NUMBER_OF_AXES, LPS22HB_STOP, LPS22HB_THERMO_NUMBER_OF_AXES, LPS22HBDriver::thermo_if, BaseBarometer::vmt, BaseThermometer::vmt, LPS22HBDriver::vmt, vmt_barometer, vmt_device, and vmt_thermometer.

◆ lps22hbStart()

void lps22hbStart ( LPS22HBDriver * devp,
const LPS22HBConfig * config )

Configures and activates LPS22HB Complex Driver peripheral.

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

Definition at line 565 of file lps22hb.c.

References hal_i2c_driver::config, i2cAcquireBus(), LPS22HBConfig::i2cp, i2cReleaseBus(), i2cStart(), LPS22HB_AD_CTRL_REG1, LPS22HB_AD_CTRL_REG2, LPS22HB_BARO_BIAS, LPS22HB_BARO_SENS, LPS22HB_CTRL_REG2_IF_ADD_INC, LPS22HB_READY, LPS22HB_STOP, LPS22HB_THERMO_BIAS, LPS22HB_THERMO_SENS, lps22hbI2CWriteRegister, osalDbgAssert, osalDbgCheck, and osalThreadSleepMilliseconds.

Here is the call graph for this function:

◆ lps22hbStop()

void lps22hbStop ( LPS22HBDriver * devp)

Deactivates the LPS22HB Complex Driver peripheral.

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

Definition at line 659 of file lps22hb.c.

References i2cAcquireBus(), i2cReleaseBus(), i2cStart(), i2cStop(), LPS22HB_AD_CTRL_REG1, LPS22HB_READY, LPS22HB_STOP, lps22hbI2CWriteRegister, osalDbgAssert, and osalDbgCheck.

Here is the call graph for this function:

Variable Documentation

◆ vmt_device

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

Definition at line 514 of file lps22hb.c.

◆ vmt_barometer

const struct BaseBarometerVMT vmt_barometer
static
Initial value:
= {
sizeof(struct LPS22HBVMT*),
}
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
LPS22HB virtual methods table.
Definition lps22hb.h:428

Definition at line 518 of file lps22hb.c.

Referenced by lps22hbObjectInit(), and lps25hObjectInit().

◆ vmt_thermometer

const struct BaseThermometerVMT vmt_thermometer
static
Initial value:
= {
sizeof(struct LPS22HBVMT*) + 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 525 of file lps22hb.c.