Documentation
¶
Overview ¶
Package tsl2591 provides access to the TSL2591 sensor, over I2C/SMBus for RaspBerry.
Index ¶
Constants ¶
View Source
const ( Addr uint8 = 0x29 ReadBit uint8 = 0x01 CmdBit uint8 = 0xA0 // bits 7 and 5 for "command normal" ClearBit uint8 = 0x40 // clears any pending interrupt (write 1 to clear) WordBit uint8 = 0x20 // 1 = read/write word (rather than byte) BlockBit uint8 = 0x10 // 1 = using block read/write EnablePowerON uint8 = 0x01 EnablePowerOFF uint8 = 0x00 EnableAEN uint8 = 0x02 EnableAIEN uint8 = 0x10 ControlReset uint8 = 0x80 RegEnable uint8 = 0x00 RegControl uint8 = 0x01 RegThreshholdLLow uint8 = 0x02 RegThreshholdLHigh uint8 = 0x03 RegThreshholdHLow uint8 = 0x04 RegThreshholdHHigh uint8 = 0x05 RegInterrupt uint8 = 0x06 RegCRC uint8 = 0x08 RegID uint8 = 0x0A RegChan0Low uint8 = 0x14 RegChan0High uint8 = 0x15 RegChan1Low uint8 = 0x16 RegChan1High uint8 = 0x17 LuxDF = 408.0 LuxCoefB = 1.64 // CH0 coefficient LuxCoefC = 0.59 // CH1 coefficient A LuxCoefD = 0.86 // CH2 coefficient B )
List of register commands
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device is a TSL2591 sensor.
func Open ¶
Open opens a connection to the TSL2591 sensor device at address addr on the provided SMBus.
func (*Device) Timing ¶
func (dev *Device) Timing() IntegTimeValue
Timing returns the integration time register value.
type GainValue ¶
type GainValue uint8
GainValue describes the gain value used while extracting data from sensor data.
type IntegTimeValue ¶
type IntegTimeValue uint8
IntegTimeValue describes the integration time used while extracting data from sensor.
const ( IntegTime100ms IntegTimeValue = 0x00 IntegTime200ms IntegTimeValue = 0x01 IntegTime300ms IntegTimeValue = 0x02 IntegTime400ms IntegTimeValue = 0x03 IntegTime500ms IntegTimeValue = 0x04 IntegTime600ms IntegTimeValue = 0x05 )
Click to show internal directories.
Click to hide internal directories.