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.
LPS25H Class Reference
Class representing a LPS25H sensor component. More...
#include <lps25h_class.h>
Inherits PressureSensor, and TempSensor.
Public Member Functions | |
| LPS25H (DevI2C &i2c, uint16_t SA0=1) | |
| Constructor. | |
| virtual | ~LPS25H () |
| Destructor. | |
| virtual int | init (void *init_struct) |
| Initializing the component. | |
| virtual int | PowerOff (void) |
| Enter sensor shutdown mode. | |
| virtual int | read_id (uint8_t *p_id) |
| Getting the ID of the component. | |
| virtual int | Reset (void) |
| Reset sensor. | |
| virtual int | get_pressure (float *pfData) |
| Get current pressure [mbar]. | |
| virtual int | get_temperature (float *pfData) |
| Get current temperature in degrees Celsius [°C]. | |
| virtual int | get_fahrenheit (float *pf_data) |
| Get current temperature in degrees Fahrenheit [°F]. | |
Protected Member Functions | |
| PRESSURE_StatusTypeDef | LPS25H_Init (PRESSURE_InitTypeDef *LPS25H_Init) |
| Set LPS25H Initialization. | |
| PRESSURE_StatusTypeDef | LPS25H_ReadID (uint8_t *p_id) |
| Read ID address of LPS25H. | |
| PRESSURE_StatusTypeDef | LPS25H_RebootCmd (void) |
| Reboot memory content of LPS25H. | |
| PRESSURE_StatusTypeDef | LPS25H_GetPressure (float *pfData) |
| Read LPS25H output register, and calculate the pressure in mbar. | |
| PRESSURE_StatusTypeDef | LPS25H_GetTemperature (float *pfData) |
| Read LPS25H output register, and calculate the temperature. | |
| PRESSURE_StatusTypeDef | LPS25H_PowerOff (void) |
| Enter the shutdown mode for LPS25H. | |
| void | LPS25H_SlaveAddrRemap (uint8_t SA0_Bit_Status) |
| Set the slave address according to SA0 bit. | |
| PRESSURE_StatusTypeDef | LPS25H_PowerOn (void) |
| Exit the shutdown mode for LPS25H. | |
| PRESSURE_StatusTypeDef | LPS25H_I2C_ReadRawPressure (int32_t *raw_press) |
| Read LPS25H output register, and calculate the raw pressure. | |
| PRESSURE_StatusTypeDef | LPS25H_I2C_ReadRawTemperature (int16_t *raw_data) |
| Read LPS25H output register, and calculate the raw temperature. | |
| void | LPS25H_IO_ITConfig (void) |
| Configures LPS25H interrupt lines for NUCLEO boards. | |
| PRESSURE_StatusTypeDef | LPS25H_IO_Init (void) |
| Configures LPS25H I2C interface. | |
| PRESSURE_StatusTypeDef | LPS25H_IO_Read (uint8_t *pBuffer, uint8_t RegisterAddr, uint16_t NumByteToRead) |
| Utility function to read data from LPS25H. | |
| PRESSURE_StatusTypeDef | LPS25H_IO_Write (uint8_t *pBuffer, uint8_t RegisterAddr, uint16_t NumByteToWrite) |
| Utility function to write data to LPS25H. | |
Detailed Description
Class representing a LPS25H sensor component.
Definition at line 51 of file lps25h_class.h.
Constructor & Destructor Documentation
Constructor.
- Parameters:
-
[in] i2c device I2C to be used for communication
Definition at line 56 of file lps25h_class.h.
| virtual ~LPS25H | ( | ) | [virtual] |
Destructor.
Definition at line 63 of file lps25h_class.h.
Member Function Documentation
| virtual int get_fahrenheit | ( | float * | pf_data ) | [virtual, inherited] |
Get current temperature in degrees Fahrenheit [°F].
- Parameters:
-
[out] pf_data Pointer to where to store temperature to
- Returns:
- 0 in case of success, an error code otherwise
Definition at line 71 of file TempSensor.h.
| virtual int get_pressure | ( | float * | pf_data ) | [virtual] |
Get current pressure [mbar].
- Parameters:
-
[out] pf_data Pointer to where to store pressure to
- Returns:
- 0 in case of success, an error code otherwise
Implements PressureSensor.
Definition at line 90 of file lps25h_class.h.
| virtual int get_temperature | ( | float * | pf_data ) | [virtual] |
Get current temperature in degrees Celsius [°C].
- Parameters:
-
[out] pf_data Pointer to where to store temperature to
- Returns:
- 0 in case of success, an error code otherwise
Implements TempSensor.
Definition at line 94 of file lps25h_class.h.
| virtual int init | ( | void * | init ) | [virtual] |
Initializing the component.
- Parameters:
-
[in] init pointer to device specific initalization structure.
- Return values:
-
0 in case of success, an error code otherwise.
Implements Component.
Definition at line 66 of file lps25h_class.h.
| PRESSURE_StatusTypeDef LPS25H_GetPressure | ( | float * | pfData ) | [protected] |
Read LPS25H output register, and calculate the pressure in mbar.
- Parameters:
-
pfData the pressure value in mbar
- Return values:
-
PRESSURE_OK in case of success, an error code otherwise
Definition at line 196 of file lps25h_class.cpp.
| PRESSURE_StatusTypeDef LPS25H_GetTemperature | ( | float * | pfData ) | [protected] |
Read LPS25H output register, and calculate the temperature.
- Parameters:
-
pfData the temperature value
- Return values:
-
PRESSURE_OK in case of success, an error code otherwise
Definition at line 241 of file lps25h_class.cpp.
| PRESSURE_StatusTypeDef LPS25H_I2C_ReadRawPressure | ( | int32_t * | raw_press ) | [protected] |
Read LPS25H output register, and calculate the raw pressure.
- Parameters:
-
raw_press the pressure raw value
- Return values:
-
PRESSURE_OK in case of success, an error code otherwise
Definition at line 164 of file lps25h_class.cpp.
| PRESSURE_StatusTypeDef LPS25H_I2C_ReadRawTemperature | ( | int16_t * | raw_data ) | [protected] |
Read LPS25H output register, and calculate the raw temperature.
- Parameters:
-
raw_data the temperature raw value
- Return values:
-
PRESSURE_OK in case of success, an error code otherwise
Definition at line 215 of file lps25h_class.cpp.
| PRESSURE_StatusTypeDef LPS25H_Init | ( | PRESSURE_InitTypeDef * | LPS25H_Init ) | [protected] |
Set LPS25H Initialization.
- Parameters:
-
LPS25H_Init the configuration setting for the LPS25H
- Return values:
-
PRESSURE_OK in case of success, an error code otherwise
Definition at line 53 of file lps25h_class.cpp.
| PRESSURE_StatusTypeDef LPS25H_IO_Init | ( | void | ) | [protected] |
Configures LPS25H I2C interface.
- Returns:
- PRESSURE_OK in case of success, an error code otherwise
Definition at line 128 of file lps25h_class.h.
| void LPS25H_IO_ITConfig | ( | void | ) | [protected] |
Configures LPS25H interrupt lines for NUCLEO boards.
Definition at line 119 of file lps25h_class.h.
| PRESSURE_StatusTypeDef LPS25H_IO_Read | ( | uint8_t * | pBuffer, |
| uint8_t | RegisterAddr, | ||
| uint16_t | NumByteToRead | ||
| ) | [protected] |
Utility function to read data from LPS25H.
- Parameters:
-
[out] pBuffer pointer to the byte-array to read data in to [in] RegisterAddr specifies internal address register to read from. [in] NumByteToRead number of bytes to be read.
- Return values:
-
PRESSURE_OK if ok, PRESSURE_ERROR if an I2C error has occured
Definition at line 141 of file lps25h_class.h.
| PRESSURE_StatusTypeDef LPS25H_IO_Write | ( | uint8_t * | pBuffer, |
| uint8_t | RegisterAddr, | ||
| uint16_t | NumByteToWrite | ||
| ) | [protected] |
Utility function to write data to LPS25H.
- Parameters:
-
[in] pBuffer pointer to the byte-array data to send [in] RegisterAddr specifies internal address register to read from. [in] NumByteToWrite number of bytes to write.
- Return values:
-
PRESSURE_OK if ok, PRESSURE_ERROR if an I2C error has occured
Definition at line 162 of file lps25h_class.h.
| PRESSURE_StatusTypeDef LPS25H_PowerOff | ( | void | ) | [protected] |
Enter the shutdown mode for LPS25H.
- Return values:
-
PRESSURE_OK in case of success, an error code otherwise
Definition at line 285 of file lps25h_class.cpp.
| PRESSURE_StatusTypeDef LPS25H_PowerOn | ( | void | ) | [protected] |
Exit the shutdown mode for LPS25H.
- Return values:
-
PRESSURE_OK in case of success, an error code otherwise
Definition at line 258 of file lps25h_class.cpp.
| PRESSURE_StatusTypeDef LPS25H_ReadID | ( | uint8_t * | p_id ) | [protected] |
Read ID address of LPS25H.
- Parameters:
-
ht_id the pointer where the ID of the device is stored
- Return values:
-
PRESSURE_OK in case of success, an error code otherwise
Definition at line 122 of file lps25h_class.cpp.
| PRESSURE_StatusTypeDef LPS25H_RebootCmd | ( | void | ) | [protected] |
Reboot memory content of LPS25H.
- Return values:
-
PRESSURE_OK in case of success, an error code otherwise
Definition at line 136 of file lps25h_class.cpp.
| void LPS25H_SlaveAddrRemap | ( | uint8_t | SA0_Bit_Status ) | [protected] |
Set the slave address according to SA0 bit.
- Parameters:
-
SA0_Bit_Status LPS25H_SA0_LOW or LPS25H_SA0_HIGH
- Return values:
-
None
Definition at line 312 of file lps25h_class.cpp.
| virtual int PowerOff | ( | void | ) | [virtual] |
Enter sensor shutdown mode.
- Returns:
- 0 in case of success, an error code otherwise
Definition at line 74 of file lps25h_class.h.
| virtual int read_id | ( | uint8_t * | id ) | [virtual] |
Getting the ID of the component.
- Parameters:
-
[out] id pointer to an allocated variable to store the ID into.
- Return values:
-
0 in case of success, an error code otherwise.
Implements Component.
Definition at line 78 of file lps25h_class.h.
| virtual int Reset | ( | void | ) | [virtual] |
Reset sensor.
- Returns:
- 0 in case of success, an error code otherwise
Definition at line 86 of file lps25h_class.h.
Generated on Tue Jul 12 2022 17:30:24 by
1.7.2