Adafruit LPS2X Barometric Pressure Sensor Library
Public Member Functions | Protected Member Functions | List of all members
Adafruit_LPS25 Class Reference

#include <Adafruit_LPS2X.h>

Inheritance diagram for Adafruit_LPS25:
Adafruit_LPS2X

Public Member Functions

 ~Adafruit_LPS25 ()
 Destroy the Adafruit_LPS25::Adafruit_LPS25 object.
 
lps25_rate_t getDataRate (void)
 Gets the current rate at which pressure and temperature measurements are taken. More...
 
void setDataRate (lps25_rate_t data_rate)
 Sets the rate at which pressure and temperature measurements. More...
 
void powerDown (bool power_down)
 Puts the sensor into power down mode, shutting the sensor down. More...
 
void configureInterrupt (bool activelow, bool opendrain, bool pres_high=false, bool pres_low=false)
 Configures the INT pin, by default it will output DRDY signal. More...
 
- Public Member Functions inherited from Adafruit_LPS2X
 Adafruit_LPS2X ()
 Construct a new Adafruit_LPS2X::Adafruit_LPS2X object.
 
bool begin_I2C (uint8_t i2c_addr=LPS2X_I2CADDR_DEFAULT, TwoWire *wire=&Wire, int32_t sensor_id=0)
 Sets up the hardware and initializes I2C. More...
 
bool begin_SPI (uint8_t cs_pin, SPIClass *theSPI=&SPI, int32_t sensor_id=0)
 Sets up the hardware and initializes hardware SPI. More...
 
bool begin_SPI (int8_t cs_pin, int8_t sck_pin, int8_t miso_pin, int8_t mosi_pin, int32_t sensor_id=0)
 Sets up the hardware and initializes software SPI. More...
 
void setPresThreshold (uint16_t hPa_delta)
 Set the pressure threshold register for interrupt levels. More...
 
bool getEvent (sensors_event_t *pressure, sensors_event_t *temp)
 Gets the pressure sensor and temperature values as sensor events. More...
 
void reset (void)
 Performs a software reset initializing registers to their power on state.
 
Adafruit_Sensor * getTemperatureSensor (void)
 Gets an Adafruit Unified Sensor object for the temp sensor component. More...
 
Adafruit_Sensor * getPressureSensor (void)
 Gets an Adafruit Unified Sensor object for the presure sensor component. More...
 

Protected Member Functions

bool _init (int32_t sensor_id)
 Initializer for post i2c/spi init. More...
 
- Protected Member Functions inherited from Adafruit_LPS2X
void _read (void)
 Updates the measurement data for all sensors simultaneously.
 

Additional Inherited Members

- Protected Attributes inherited from Adafruit_LPS2X
float _temp
 Last reading's temperature (C)
 
float _pressure
 Last reading's pressure (hPa)
 
uint16_t _sensorid_pressure
 ID number for pressure.
 
uint16_t _sensorid_temp
 ID number for temperature.
 
float temp_scaling = 1
 Different chips have different scalings.
 
float temp_offset = 1
 Different chips have different offsets.
 
uint8_t inc_spi_flag
 If this chip has a bitflag for incrementing SPI registers. More...
 
bool isOneShot = false
 true if data rate is one-shot
 
Adafruit_I2CDevice * i2c_dev = NULL
 Pointer to I2C bus interface.
 
Adafruit_SPIDevice * spi_dev = NULL
 Pointer to SPI bus interface.
 
Adafruit_LPS2X_Temptemp_sensor = NULL
 Temp sensor data object.
 
Adafruit_LPS2X_Pressurepressure_sensor
 Pressure sensor data object. More...
 
Adafruit_BusIO_Register * ctrl1_reg = NULL
 The first control register.
 
Adafruit_BusIO_Register * ctrl2_reg = NULL
 The second control register.
 
Adafruit_BusIO_Register * ctrl3_reg = NULL
 The third control register.
 
Adafruit_BusIO_Register * threshp_reg = NULL
 Pressure threshold.
 

Detailed Description

Specific subclass for LPS25 variant

Member Function Documentation

◆ getDataRate()

lps25_rate_t Adafruit_LPS25::getDataRate ( void  )

Gets the current rate at which pressure and temperature measurements are taken.

Returns
lps25_rate_t The current data rate

◆ setDataRate()

void Adafruit_LPS25::setDataRate ( lps25_rate_t  new_data_rate)

Sets the rate at which pressure and temperature measurements.

Parameters
new_data_rateThe data rate to set. Must be a lps25_rate_t

◆ powerDown()

void Adafruit_LPS25::powerDown ( bool  power_down)

Puts the sensor into power down mode, shutting the sensor down.

Parameters
power_down

◆ configureInterrupt()

void Adafruit_LPS25::configureInterrupt ( bool  activelow,
bool  opendrain,
bool  pres_high = false,
bool  pres_low = false 
)

Configures the INT pin, by default it will output DRDY signal.

Parameters
activelowPass true to make the INT pin drop low on interrupt
opendrainPass true to make the INT pin an open drain output
pres_highIf true, interrupt fires on high threshold pass
pres_lowIf true, interrupt fires on low threshold pass

◆ _init()

bool Adafruit_LPS25::_init ( int32_t  sensor_id)
protectedvirtual

Initializer for post i2c/spi init.

Parameters
sensor_idOptional unique ID for the sensor set
Returns
True if chip identified and initialized

Implements Adafruit_LPS2X.


The documentation for this class was generated from the following files: