isl29125

package
v0.0.0-...-21a23f8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2015 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package isl29125 allows interfacing with the ISL29125 RGB light sensor Datasheet: http://www.intersil.com/content/dam/Intersil/documents/isl2/isl29125.pdf

Index

Constants

View Source
const (
	ModePowerDown = 0x00
	ModeGreenOnly = 0x01
	ModeRedOnly   = 0x02
	ModeBlueOnly  = 0x03
	ModeStandBy   = 0x04
	ModeRGB       = 0x05
	ModeRG        = 0x06
	ModeGB        = 0x07
)
View Source
const (
	LuxRange375 = 0x00
	LuxRange10k = 0x08
)
View Source
const (
	IRAdjustLow  = 0x00
	IRAdjustMed  = 0x20
	IRAdjustHigh = 0x3f
)
View Source
const (
	Resolution16Bit = 0x00
	Resolution12Bit = 0x10
)
View Source
const (
	SyncStartOnWrite = 0x00
	SyncStartOnInt   = 0x20
)
View Source
const (
	RegisterDeviceID  = 0x00
	RegisterConfig1   = 0x01
	RegisterConfig2   = 0x02
	RegisterConfig3   = 0x03
	RegisterFlags     = 0x08
	RegisterGreenLow  = 0x09
	RegisterGreenHigh = 0x0a
	RegisterRedLow    = 0x0b
	RegisterRedHigh   = 0x0c
	RegisterBlueLow   = 0x0d
	RegisterBlueHigh  = 0x0e
)
View Source
const (
	FlagReady               = 0x00
	FlagInterrupt           = 0x01
	FlagConversion          = 0x02
	FlagPowerDownOrBrownOut = 0x04
	FlagGreenConverting     = 0x10
	FlagRedConverting       = 0x20
	FlagBlueConverting      = 0x30
)
View Source
const (
	SensorAddr = 0x44
	DeviceID   = 0x7d
)
View Source
const (
	CmdGetStatus = 0x08
	CmdReset     = 0x46
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ISL29125

type ISL29125 struct {
	Bus  embd.I2CBus
	Poll int
	// contains filtered or unexported fields
}

ISL29125 represents an RGB light sensor.

func New

func New(config uint8, bus embd.I2CBus) *ISL29125

New returns an ISL29125 for a given config.

func (*ISL29125) Close

func (i *ISL29125) Close()

Close down sensor.

func (*ISL29125) Reading

func (i *ISL29125) Reading() (*Reading, error)

Reading returns a single sensor reading.

func (*ISL29125) Run

func (i *ISL29125) Run()

Run starts continuous sensor data acquisition loop.

type Reading

type Reading struct {
	Red        uint16
	Green      uint16
	Blue       uint16
	Lux        uint16
	LuxRange   int
	Resolution int
}

Reading represents a single reading from an RGB light sensor.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL