Firmware Library for X-NUCLEO-IKS01A1 (MEMS Inertial & Environmental Sensors) Expansion Board

Dependencies:   X_NUCLEO_COMMON ST_INTERFACES

Dependents:   MultiTech_Dragonfly_2015_ATT_Gov_Solutions_Hackathon_Example HelloWorld_IKS01A1 LoRaWAN-test-10secs ServoMotorDemo ... more

Fork of X_NUCLEO_IKS01A1 by ST Expansion SW Team

Embed: (wiki syntax)

« Back to documentation index

LPS25H Class Reference

Class representing a LPS25H sensor component. More...

#include <lps25h_class.h>

Public Member Functions

 LPS25H (DevI2C &i2c)
 Constructor.
virtual ~LPS25H ()
 Destructor.
virtual int PowerOff (void)
 Enter sensor shutdown mode.
virtual int Reset (void)
 Reset sensor.

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

LPS25H ( DevI2C &  i2c )

Constructor.

Parameters:
[in]i2cdevice I2C to be used for communication

Definition at line 56 of file lps25h_class.h.

virtual ~LPS25H (  ) [virtual]

Destructor.

Definition at line 62 of file lps25h_class.h.


Member Function Documentation

PRESSURE_StatusTypeDef LPS25H_GetPressure ( float *  pfData ) [protected]

Read LPS25H output register, and calculate the pressure in mbar.

Parameters:
pfDatathe pressure value in mbar
Return values:
PRESSURE_OKin 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:
pfDatathe temperature value
Return values:
PRESSURE_OKin 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_pressthe pressure raw value
Return values:
PRESSURE_OKin 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_datathe temperature raw value
Return values:
PRESSURE_OKin 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_Initthe configuration setting for the LPS25H
Return values:
PRESSURE_OKin 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 127 of file lps25h_class.h.

void LPS25H_IO_ITConfig ( void   ) [protected]

Configures LPS25H interrupt lines for NUCLEO boards.

Definition at line 118 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]pBufferpointer to the byte-array to read data in to
[in]RegisterAddrspecifies internal address register to read from.
[in]NumByteToReadnumber of bytes to be read.
Return values:
PRESSURE_OKif ok,
PRESSURE_ERRORif an I2C error has occured

Definition at line 140 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]pBufferpointer to the byte-array data to send
[in]RegisterAddrspecifies internal address register to read from.
[in]NumByteToWritenumber of bytes to write.
Return values:
PRESSURE_OKif ok,
PRESSURE_ERRORif an I2C error has occured

Definition at line 161 of file lps25h_class.h.

PRESSURE_StatusTypeDef LPS25H_PowerOff ( void   ) [protected]

Enter the shutdown mode for LPS25H.

Return values:
PRESSURE_OKin 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_OKin 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_idthe pointer where the ID of the device is stored
Return values:
PRESSURE_OKin 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_OKin 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_StatusLPS25H_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 73 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 85 of file lps25h_class.h.