Documentation
¶
Overview ¶
Package ens160 provides a driver for the ScioSense ENS160 digital gas sensor.
Datasheet: https://www.sciosense.com/wp-content/uploads/2023/12/ENS160-Datasheet.pdf
Index ¶
- Constants
- type Device
- func (d *Device) AQI() uint8
- func (d *Device) Configure() error
- func (d *Device) Connected() bool
- func (d *Device) ECO2() uint16
- func (d *Device) SetEnvDataMilli(tempMilliC, rhMilliPct int32) error
- func (d *Device) TVOC() uint16
- func (d *Device) Update(which drivers.Measurement) error
- func (d *Device) Validity() uint8
- func (d *Device) ValidityString() string
Constants ¶
const ( ModeDeepSleep = 0x00 ModeIdle = 0x01 ModeStandard = 0x02 ModeReset = 0xF0 )
Operating modes
const ( ValidityNormalOperation = 0x00 ValidityWarmUpPhase = 0x01 // need ~3 minutes until valid data ValidityInitialStartUpPhase = 0x02 // need ~1 hour until valid data ValidityInvalidOutput = 0x03 )
Validity flags
const ( LowPartID = 0x60 HighPartID = 0x01 )
Part IDs
const DefaultAddress = 0x53
DefaultAddress is the default I2C address for the ENS160 when the ADDR pin is connected to high (3.3V). When connected to low (GND), the address is 0x52.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device wraps an I2C connection to an ENS160 device.
func (*Device) SetEnvDataMilli ¶
SetEnvDataMilli sets the ambient temperature and humidity for compensation.
tempMilliC is the temperature in milli-degrees Celsius. rhMilliPct is the relative humidity in milli-percent.
func (*Device) Update ¶
func (d *Device) Update(which drivers.Measurement) error
Update refreshes the concentration measurements.
func (*Device) ValidityString ¶
ValidityString returns a human-readable string describing the current validity status.