Crate lps22hb[][src]

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

Various functions related to configuration

Various functions related to FIFO

Interface trait

Various functions related to interrupts

Register mapping and bitmasks

Functions related to sensor measurements: reading value or status, setting offset and reference

Structs

Holds the driver instance with the selected interface

Enums

FIFO mode selection. (Refer to Table 20)

Interrupt active setting for the INT_DRDY pin: active high (default) or active low

INT_DRDY pin configuration. (Refer to Table 19)

Interrupt pad setting for INT_DRDY pin: push-pull (default) or open-drain.

Output data rate and power mode selection (ODR). (Refer to Table 17)

SPI interface mode