Adafruit LPS2X Barometric Pressure Sensor Library
|
#include <Adafruit_LPS2X.h>
Public Member Functions | |
~Adafruit_LPS22 () | |
Destroy the Adafruit_LPS22::Adafruit_LPS22 object. | |
lps22_rate_t | getDataRate (void) |
Gets the current rate at which pressure and temperature measurements are taken. More... | |
void | setDataRate (lps22_rate_t data_rate) |
Sets the rate at which pressure and temperature measurements. More... | |
void | configureInterrupt (bool activelow, bool opendrain, bool data_ready, bool pres_high=false, bool pres_low=false, bool fifo_full=false, bool fifo_watermark=false, bool fifo_overflow=false) |
Configures the INT pin. 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_Temp * | temp_sensor = NULL |
Temp sensor data object. | |
Adafruit_LPS2X_Pressure * | pressure_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. | |
Specific subclass for LPS22 variant
lps22_rate_t Adafruit_LPS22::getDataRate | ( | void | ) |
Gets the current rate at which pressure and temperature measurements are taken.
void Adafruit_LPS22::setDataRate | ( | lps22_rate_t | new_data_rate | ) |
Sets the rate at which pressure and temperature measurements.
new_data_rate | The data rate to set. Must be a lps22_rate_t |
void Adafruit_LPS22::configureInterrupt | ( | bool | activelow, |
bool | opendrain, | ||
bool | data_ready, | ||
bool | pres_high = false , |
||
bool | pres_low = false , |
||
bool | fifo_full = false , |
||
bool | fifo_watermark = false , |
||
bool | fifo_overflow = false |
||
) |
Configures the INT pin.
activelow | Pass true to make the INT pin drop low on interrupt |
opendrain | Pass true to make the INT pin an open drain output |
data_ready | If true, interrupt fires on new data ready |
pres_high | If true, interrupt fires on high threshold pass |
pres_low | If true, interrupt fires on low threshold pass |
fifo_full | If true, interrupt fires on fifo full |
fifo_watermark | If true, interrupt fires on fifo watermark pass |
fifo_overflow | If true, interrupt fires on fifo overflow |
|
protectedvirtual |
Initializer for post i2c/spi init.
sensor_id | Optional unique ID for the sensor set |
Implements Adafruit_LPS2X.