Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
LPS22HH Class Reference
Abstract class of a LPS22HH pressure sensor. More...
#include <LPS22HH.h>
Public Member Functions | |
| LPS22HH (PinName sda, PinName scl) | |
| Constructor. | |
| LPS22HHStatusTypeDef | begin () |
| Constructor. | |
| LPS22HHStatusTypeDef | end () |
| Disable the sensor and relative resources. | |
| LPS22HHStatusTypeDef | ReadID (uint8_t *Id) |
| Get WHO_AM_I value. | |
| LPS22HHStatusTypeDef | Enable () |
| Enable the LPS22HH pressure sensor. | |
| LPS22HHStatusTypeDef | Disable () |
| Disable the LPS22HH pressure sensor. | |
| LPS22HHStatusTypeDef | GetOutputDataRate (float *Odr) |
| Get output data rate. | |
| LPS22HHStatusTypeDef | SetOutputDataRate (float Odr) |
| Set the LPS22HH pressure sensor output data rate. | |
| float | GetPressure () |
| Get the LPS22HH pressure value. | |
| LPS22HHStatusTypeDef | Get_PRESS_DRDY_Status (uint8_t *Status) |
| Get the LPS22HH pressure data ready bit value. | |
| LPS22HHStatusTypeDef | GetTemperature (float *Value) |
| Get the LPS22HH temperature value. | |
| LPS22HHStatusTypeDef | Get_TEMP_DRDY_Status (uint8_t *Status) |
| Get the LPS22HH temperature data ready bit value. | |
| LPS22HHStatusTypeDef | Read_Reg (uint8_t reg, uint8_t *Data) |
| Get the LPS22HH register value. | |
| LPS22HHStatusTypeDef | Write_Reg (uint8_t reg, uint8_t Data) |
| Set the LPS22HH register value. | |
| LPS22HHStatusTypeDef | Get_FIFO_Data (float *Press, float *Temp) |
| Get the LPS22HH FIFO data level. | |
| LPS22HHStatusTypeDef | Get_FIFO_FTh_Status (uint8_t *Status) |
| Get the LPS22HH FIFO threshold. | |
| LPS22HHStatusTypeDef | Get_FIFO_Full_Status (uint8_t *Status) |
| Get the LPS22HH FIFO full status. | |
| LPS22HHStatusTypeDef | Get_FIFO_Ovr_Status (uint8_t *Status) |
| Get the LPS22HH FIFO OVR status. | |
| LPS22HHStatusTypeDef | Get_FIFO_Level (uint8_t *Status) |
| Get the LPS22HH FIFO data level. | |
| LPS22HHStatusTypeDef | Reset_FIFO_Interrupt (uint8_t interrupt) |
| Reset the FIFO interrupt. | |
| LPS22HHStatusTypeDef | Set_FIFO_Interrupt (uint8_t interrupt) |
| Set the FIFO interrupt. | |
| LPS22HHStatusTypeDef | Set_FIFO_Mode (uint8_t Mode) |
| Set the FIFO mode. | |
| LPS22HHStatusTypeDef | Set_FIFO_Watermark_Level (uint8_t Watermark) |
| Set the LPS22HH FIFO data level. | |
| LPS22HHStatusTypeDef | Stop_FIFO_On_Watermark (uint8_t Stop) |
| Set the LPS22HH stop on watermark function. | |
| LPS22HHStatusTypeDef | Set_One_Shot () |
| Set the LPS22HH One Shot Mode. | |
| LPS22HHStatusTypeDef | Get_One_Shot_Status (uint8_t *Status) |
| Get the LPS22HH One Shot Status. | |
| uint8_t | IO_Read (uint8_t *pBuffer, uint8_t RegisterAddr, uint16_t NumByteToRead) |
| Utility function to read data. | |
| uint8_t | IO_Write (uint8_t *pBuffer, uint8_t RegisterAddr, uint16_t NumByteToWrite) |
| Utility function to write data. | |
Detailed Description
Abstract class of a LPS22HH pressure sensor.
Definition at line 356 of file LPS22HH.h.
Constructor & Destructor Documentation
| LPS22HH | ( | PinName | sda, |
| PinName | scl | ||
| ) |
Constructor.
- Parameters:
-
i2c object of an helper class which handles the I2C peripheral address the address of the component's instance
Definition at line 42 of file LPS22HH.cpp.
Member Function Documentation
| LPS22HHStatusTypeDef begin | ( | ) |
Constructor.
- Parameters:
-
spi object of an helper class which handles the SPI peripheral cs_pin the chip select pin spi_speed the SPI speed
LPS22HH::LPS22HH(SPIClass *spi, int cs_pin, uint32_t spi_speed) : dev_spi(spi), cs_pin(cs_pin), spi_speed(spi_speed) { reg_ctx.write_reg = LPS22HH_io_write; reg_ctx.read_reg = LPS22HH_io_read; reg_ctx.handle = (void *)this; dev_i2c = NULL; address = 0; enabled = 0; } Configure the sensor in order to be used
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 71 of file LPS22HH.cpp.
| LPS22HHStatusTypeDef Disable | ( | ) |
Disable the LPS22HH pressure sensor.
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 168 of file LPS22HH.cpp.
| LPS22HHStatusTypeDef Enable | ( | ) |
Enable the LPS22HH pressure sensor.
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 145 of file LPS22HH.cpp.
| LPS22HHStatusTypeDef end | ( | ) |
Disable the sensor and relative resources.
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 108 of file LPS22HH.cpp.
| LPS22HHStatusTypeDef Get_FIFO_Data | ( | float * | Press, |
| float * | Temp | ||
| ) |
Get the LPS22HH FIFO data level.
- Parameters:
-
Status the status of data ready bit
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 551 of file LPS22HH.cpp.
| LPS22HHStatusTypeDef Get_FIFO_FTh_Status | ( | uint8_t * | Status ) |
Get the LPS22HH FIFO threshold.
- Parameters:
-
Status the status of data ready bit
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 580 of file LPS22HH.cpp.
| LPS22HHStatusTypeDef Get_FIFO_Full_Status | ( | uint8_t * | Status ) |
Get the LPS22HH FIFO full status.
- Parameters:
-
Status the status of data ready bit
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 595 of file LPS22HH.cpp.
| LPS22HHStatusTypeDef Get_FIFO_Level | ( | uint8_t * | Status ) |
Get the LPS22HH FIFO data level.
- Parameters:
-
Status the status of data ready bit
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 625 of file LPS22HH.cpp.
| LPS22HHStatusTypeDef Get_FIFO_Ovr_Status | ( | uint8_t * | Status ) |
Get the LPS22HH FIFO OVR status.
- Parameters:
-
Status the status of data ready bit
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 610 of file LPS22HH.cpp.
| LPS22HHStatusTypeDef Get_One_Shot_Status | ( | uint8_t * | Status ) |
Get the LPS22HH One Shot Status.
- Parameters:
-
Status pointer to the one shot status (1 means measurements available, 0 means measurements not available yet)
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 782 of file LPS22HH.cpp.
| LPS22HHStatusTypeDef Get_PRESS_DRDY_Status | ( | uint8_t * | Status ) |
Get the LPS22HH pressure data ready bit value.
- Parameters:
-
Status the status of data ready bit
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 468 of file LPS22HH.cpp.
| LPS22HHStatusTypeDef Get_TEMP_DRDY_Status | ( | uint8_t * | Status ) |
Get the LPS22HH temperature data ready bit value.
- Parameters:
-
Status the status of data ready bit
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 503 of file LPS22HH.cpp.
| LPS22HHStatusTypeDef GetOutputDataRate | ( | float * | Odr ) |
Get output data rate.
- Parameters:
-
Odr the output data rate value
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 262 of file LPS22HH.cpp.
| float GetPressure | ( | ) |
Get the LPS22HH pressure value.
- Parameters:
-
Value pointer where the pressure value is written
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 447 of file LPS22HH.cpp.
| LPS22HHStatusTypeDef GetTemperature | ( | float * | Value ) |
Get the LPS22HH temperature value.
- Parameters:
-
Value pointer where the temperature value is written
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 483 of file LPS22HH.cpp.
| uint8_t IO_Read | ( | uint8_t * | pBuffer, |
| uint8_t | RegisterAddr, | ||
| uint16_t | NumByteToRead | ||
| ) |
| uint8_t IO_Write | ( | uint8_t * | pBuffer, |
| uint8_t | RegisterAddr, | ||
| uint16_t | NumByteToWrite | ||
| ) |
| LPS22HHStatusTypeDef Read_Reg | ( | uint8_t | Reg, |
| uint8_t * | Data | ||
| ) |
Get the LPS22HH register value.
- Parameters:
-
Reg address to be written Data value to be written
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 519 of file LPS22HH.cpp.
| LPS22HHStatusTypeDef ReadID | ( | uint8_t * | Id ) |
Get WHO_AM_I value.
- Parameters:
-
Id the WHO_AM_I value
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 125 of file LPS22HH.cpp.
| LPS22HHStatusTypeDef Reset_FIFO_Interrupt | ( | uint8_t | interrupt ) |
Reset the FIFO interrupt.
- Parameters:
-
interrupt The FIFO interrupt to be reset; values: 0 = FTH; 1 = FULL; 2 = OVR
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 640 of file LPS22HH.cpp.
| LPS22HHStatusTypeDef Set_FIFO_Interrupt | ( | uint8_t | interrupt ) |
Set the FIFO interrupt.
- Parameters:
-
interrupt The FIFO interrupt to be reset; values: 0 = FTH; 1 = FULL; 2 = OVR
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 674 of file LPS22HH.cpp.
| LPS22HHStatusTypeDef Set_FIFO_Mode | ( | uint8_t | Mode ) |
Set the FIFO mode.
- Parameters:
-
Mode the FIFO mode to be set
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 708 of file LPS22HH.cpp.
| LPS22HHStatusTypeDef Set_FIFO_Watermark_Level | ( | uint8_t | Watermark ) |
Set the LPS22HH FIFO data level.
- Parameters:
-
Status the status of data ready bit
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 737 of file LPS22HH.cpp.
| LPS22HHStatusTypeDef Set_One_Shot | ( | ) |
Set the LPS22HH One Shot Mode.
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 766 of file LPS22HH.cpp.
| LPS22HHStatusTypeDef SetOutputDataRate | ( | float | Odr ) |
Set the LPS22HH pressure sensor output data rate.
- Parameters:
-
Odr the output data rate value to be set
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 379 of file LPS22HH.cpp.
| LPS22HHStatusTypeDef Stop_FIFO_On_Watermark | ( | uint8_t | Stop ) |
Set the LPS22HH stop on watermark function.
- Parameters:
-
Stop the state of stop on watermark function
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 752 of file LPS22HH.cpp.
| LPS22HHStatusTypeDef Write_Reg | ( | uint8_t | Reg, |
| uint8_t | Data | ||
| ) |
Set the LPS22HH register value.
- Parameters:
-
pObj the device pObj Reg address to be written Data value to be written
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 536 of file LPS22HH.cpp.
Generated on Sun Jul 31 2022 16:54:09 by
1.7.2