Expand description
A platform agnostic driver to interface with LPS25HB 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() - set data rate, see
set_datarate()
NOTE: This is an early version of the crate. Only I2C interface is supported at the moment.
§Datasheet: LPS25HB
§Usage examples (see also examples folder)
Please find additional examples using hardware in this repository: examples
§Read pressure and temperature
use lps25hb::interface::{I2cInterface, i2c::I2cAddress};
use lps25hb::*;
let mut lps25 = LPS25HB.new(i2c_interface);
lps25hb.sensor_on(true).unwrap();
lps25.one_shot().unwrap();
let pressure = lps25.read_pressure().unwrap();
let temperature = lps25.read_temperature().unwrap();Modules§
- config
- Various functions related to configuration
- fifo
- Various functions related to FIFO
- interface
- Interface trait
- interrupt
- Various functions related to interrupts
- register
- Register mapping
- sensor
- TO DO:
Structs§
- LPS25HB
- Holds the driver instance with the selected interface
Enums§
- FIFO_
MEAN - FIFO Mean mode running average sample size. (Refer to Table 23)
- FIFO_
MODE - FIFO mode selection. (Refer to Table 22)
- INT_
ACTIVE - Interrupt active setting for the INT_DRDY pin: active high (default) or active low
- INT_
DRDY - INT_DRDY pin configuration. (Refer to Table 21)
- INT_PIN
- Interrupt pad setting for INT_DRDY pin: push-pull (default) or open-drain.
- ODR
- Output data rate and power mode selection (ODR). (Refer to Table 20)
- PRESS_
RES - Pressure resolution configuration, number of internal average(Refer to Table 19)
- SPI_
Mode - SPI interface mode
- TEMP_
RES - Temperature resolution configuration, number of internal average(Refer to Table 18)