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.
LPS22HBSensor Class Reference
Abstract class of an LPS22HB Pressure sensor. More...
#include <LPS22HBSensor.h>
Inherits PressureSensor, and TempSensor.
Public Member Functions | |
| LPS22HBSensor (DevI2C *i2c, uint8_t address=LPS22HB_ADDRESS_HIGH, PinName int_pin=NC) | |
| Constructor. | |
| virtual int | init (void *init) |
| Initializing the component. | |
| virtual int | read_id (uint8_t *id) |
| Read ID address of LPS22HB. | |
| virtual int | get_pressure (float *pfData) |
| Read LPS22HB output register, and calculate the pressure in mbar. | |
| virtual int | get_temperature (float *pfData) |
| Read LPS22HB output register, and calculate the temperature. | |
| int | enable (void) |
| Enable LPS22HB. | |
| int | disable (void) |
| Disable LPS22HB. | |
| int | reset (void) |
| Reboot memory content of LPS22HB. | |
| int | get_odr (float *odr) |
| Read LPS22HB output data rate. | |
| int | set_odr (float odr) |
| Set ODR. | |
| int | read_reg (uint8_t reg, uint8_t *data) |
| Read the data from register. | |
| int | write_reg (uint8_t reg, uint8_t data) |
| Write the data to register. | |
| 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. | |
| virtual int | get_fahrenheit (float *pf_data) |
| Get current temperature in degrees Fahrenheit [°F]. | |
| virtual int | get_fahrenheit (float *pf_data) |
| Get current temperature in degrees Fahrenheit [°F]. | |
| virtual int | get_fahrenheit (float *pf_data) |
| Get current temperature in degrees Fahrenheit [°F]. | |
| virtual int | get_fahrenheit (float *pf_data) |
| Get current temperature in degrees Fahrenheit [°F]. | |
Detailed Description
Abstract class of an LPS22HB Pressure sensor.
Definition at line 58 of file LPS22HBSensor.h.
Constructor & Destructor Documentation
| LPS22HBSensor | ( | DevI2C * | i2c, |
| uint8_t | address = LPS22HB_ADDRESS_HIGH, |
||
| PinName | int_pin = NC |
||
| ) |
Constructor.
- Parameters:
-
i2c object of an helper class which handles the I2C peripheral address the address of the component's instance
Definition at line 51 of file LPS22HBSensor.cpp.
Member Function Documentation
| int disable | ( | void | ) |
Disable LPS22HB.
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 132 of file LPS22HBSensor.cpp.
| int enable | ( | void | ) |
Enable LPS22HB.
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 110 of file LPS22HBSensor.cpp.
| 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 LSM303AGR/ST_INTERFACES/Sensors/TempSensor.h.
| 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 LSM6DSL/ST_INTERFACES/Sensors/TempSensor.h.
| 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 HTS221/ST_INTERFACES/Sensors/TempSensor.h.
| 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 LPS22HB/ST_INTERFACES/Sensors/TempSensor.h.
| int get_odr | ( | float * | odr ) |
Read LPS22HB output data rate.
- Parameters:
-
odr the pointer to the output data rate
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 233 of file LPS22HBSensor.cpp.
| int get_pressure | ( | float * | pfData ) | [virtual] |
Read LPS22HB output register, and calculate the pressure in mbar.
- Parameters:
-
pfData the pressure value in mbar
- Return values:
-
0 in case of success, an error code otherwise
Implements PressureSensor.
Definition at line 193 of file LPS22HBSensor.cpp.
| int get_temperature | ( | float * | pfData ) | [virtual] |
Read LPS22HB output register, and calculate the temperature.
- Parameters:
-
pfData the temperature value
- Return values:
-
0 in case of success, an error code otherwise
Implements TempSensor.
Definition at line 213 of file LPS22HBSensor.cpp.
| 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 62 of file LPS22HBSensor.cpp.
| uint8_t io_read | ( | uint8_t * | pBuffer, |
| uint8_t | RegisterAddr, | ||
| uint16_t | NumByteToRead | ||
| ) |
Utility function to read data.
- Parameters:
-
pBuffer,: pointer to data to be read. RegisterAddr,: specifies internal address register to be read. NumByteToRead,: number of bytes to be read.
- Return values:
-
0 if ok, an error code otherwise.
Definition at line 81 of file LPS22HBSensor.h.
| uint8_t io_write | ( | uint8_t * | pBuffer, |
| uint8_t | RegisterAddr, | ||
| uint16_t | NumByteToWrite | ||
| ) |
Utility function to write data.
- Parameters:
-
pBuffer,: pointer to data to be written. RegisterAddr,: specifies internal address register to be written. NumByteToWrite,: number of bytes to write.
- Return values:
-
0 if ok, an error code otherwise.
Definition at line 93 of file LPS22HBSensor.h.
| int read_id | ( | uint8_t * | id ) | [virtual] |
Read ID address of LPS22HB.
- Parameters:
-
id the pointer where the ID of the device is stored
- Return values:
-
0 in case of success, an error code otherwise
Implements Component.
Definition at line 156 of file LPS22HBSensor.cpp.
| int read_reg | ( | uint8_t | reg, |
| uint8_t * | data | ||
| ) |
Read the data from register.
- Parameters:
-
reg register address data register data
- Return values:
-
0 in case of success 1 in case of failure
Definition at line 350 of file LPS22HBSensor.cpp.
| int reset | ( | void | ) |
Reboot memory content of LPS22HB.
- Parameters:
-
None
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 177 of file LPS22HBSensor.cpp.
| int set_odr | ( | float | odr ) |
Set ODR.
- Parameters:
-
odr the output data rate to be set
- Return values:
-
0 in case of success, an error code otherwise
Definition at line 275 of file LPS22HBSensor.cpp.
| int write_reg | ( | uint8_t | reg, |
| uint8_t | data | ||
| ) |
Write the data to register.
- Parameters:
-
reg register address data register data
- Return values:
-
0 in case of success 1 in case of failure
Definition at line 368 of file LPS22HBSensor.cpp.
Generated on Tue Jul 12 2022 21:38:10 by
1.7.2