Crate lps22hb[−][src]
A platform agnostic driver to interface with LPS22HB pressure sensor module.
This driver allows you to:
- read atmospheric pressure in hPa, see
read_pressure()
- read temperature in degrees Celsius, see
read_temperature()
- enable single-shot data acquisition, see ’enable_one_shot()`
NOTE: This is a very early version of the crate. Only I2C interface is supported at the moment. Only single shot mode is supported.
Datasheet: LPS22HB
Usage examples (see also examples folder)
Please find additional examples using hardware in this repository: examples
Read pressure and temperature
use lps22hb::interface::{I2cInterface, i2c::I2cAddress}; use lps22hb::{sensor, LPS22HBInit}; let mut lps22 = LPS22HBInit { ..Default::default() }.with_interface(i2c_interface); lps22.begin_sensor().unwrap(); lps22.enable_one_shot().unwrap(); let pressure = lps22.read_pressure().unwrap(); let temperature = lps22.read_temperature().unwrap();
Modules
interface | Interface trait |
register | Register mapping |
sensor | Pressure sensor settings, types |
Structs
LPS22HB | LPS22HB sensor |
LPS22HBInit | LPS22HB init struct. Use this struct to configure sensors and init LPS22HB with an interface of your choice. |