Documentation ¶
Overview ¶
Package lps22hb implements a driver for LPS22HB, a MEMS nano pressure sensor.
Datasheet: https://www.st.com/resource/en/datasheet/dm00140895.pdf
Index ¶
Constants ¶
View Source
const ( // I2C address LPS22HB_ADDRESS = 0x5C // control/status registers LPS22HB_WHO_AM_I_REG = 0x0F LPS22HB_CTRL1_REG = 0x10 LPS22HB_CTRL2_REG = 0x11 LPS22HB_STATUS_REG = 0x27 LPS22HB_PRESS_OUT_REG = 0x28 LPS22HB_TEMP_OUT_REG = 0x2B )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct { Address uint8 // contains filtered or unexported fields }
Device wraps an I2C connection to a HTS221 device.
func New ¶
New creates a new LPS22HB connection. The I2C bus must already be configured.
This function only creates the Device object, it does not touch the device.
func (*Device) Configure ¶
func (d *Device) Configure()
Configure sets up the LPS22HB device for communication.
func (*Device) Connected ¶
Connected returns whether LPS22HB has been found. It does a "who am I" request and checks the response.
func (*Device) ReadPressure ¶
ReadPressure returns the pressure in milli pascals (mPa).
func (*Device) ReadTemperature ¶
ReadTemperature returns the temperature in celsius milli degrees (°C/1000).
Click to show internal directories.
Click to hide internal directories.