Crate lps22hb

Crate lps22hb 

Source
Expand description

A platform agnostic driver to interface with LPS22HB pressure sensor module.

This driver allows you to:

NOTE: Only I2C interface is supported at the moment. //!

§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::*;

let mut lps22 = LPS22HB.new(i2c_interface);
//!
lps22.one_shot().unwrap();

let pressure = lps22.read_pressure().unwrap();
let temperature = lps22.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 and bitmasks
sensor
Functions related to sensor measurements: reading value or status, setting offset and reference

Structs§

LPS22HB
Holds the driver instance with the selected interface

Enums§

FIFO_MODE
FIFO mode selection. (Refer to Table 20)
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 19)
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 17)
SPI_Mode
SPI interface mode