max30105

package module
v0.0.0-...-317c402 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2017 License: MIT Imports: 5 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

MAX30105

For use with embd

GoDoc: http://godoc.org/github.com/1lann/max30105

Documentation

Index

Constants

View Source
const (
	MAX30105Address = 0x57

	INT1Register = 0x00
	INT2Register = 0x01
	INTEnable1   = 0x02
	INTEnable2   = 0x03

	FIFOWriterPtr = 0x04
	FIFOOverflow  = 0x05
	FIFOReadPtr   = 0x06
	FIFOData      = 0x07

	FIFOConfig      = 0x08
	ModeConfig      = 0x09
	ParticleConfig  = 0x0A
	LED1PulseAmp    = 0x0C
	LED2PulseAmp    = 0x0D
	LED3PulseAmp    = 0x0E
	LEDProxAmp      = 0x10
	MultiLEDConfig1 = 0x11
	MultiLEDConfig2 = 0x12

	DieTempInt    = 0x1F
	DieTempFrac   = 0x20
	DieTempConfig = 0x21

	ProxIntThresh = 0x30

	RevisionID = 0xFE
	PartID     = 0xFF

	IntAFullMask    = 1 << 7
	IntAFullEnable  = 0x80
	IntAFullDisable = 0x00

	IntDataReadyMask    = 1 << 6
	IntDataReadyEnable  = 0x40
	IntDataReadyDisable = 0x00

	IntAlcOvfMask    = 1 << 5
	IntAlcOvfEnable  = 0x20
	IntAlcOvfDisable = 0x00

	IntProxIntMask    = 1 << 4
	IntProxIntEnable  = 0x10
	IntProxIntDisable = 0x00

	IntDieTempReadyMask    = 1 << 1
	IntDieTempReadyEnable  = 0x02
	IntDieTempReadyDisable = 0x00

	SampleAverageMask = 0xE0
	SampleAverage1    = 0x00
	SampleAverage2    = 0x20
	SampleAverage4    = 0x40
	SampleAverage8    = 0x60
	SampleAverage16   = 0x80
	SampleAverage32   = 0xA0

	RolloverMask    = 0xEF
	RolloverEnable  = 0x10
	RolloverDisable = 0x00

	AFullMask    = 0xF0
	ShutdownMask = 0x7F
	Shutdown     = 0x80
	Wakeup       = 0x00

	ResetMask = 0xBF
	Reset     = 0x40

	ModeMask      = 0xF8
	ModeRedOnly   = 0x02
	ModeRedIROnly = 0x03
	ModeMultiLED  = 0x07

	ADCRangeMask  = 0x9F
	ADCRange2048  = 0x00
	ADCRange4096  = 0x20
	ADCRange8192  = 0x40
	ADCRange16384 = 0x60

	SampleRateMask = 0xE3
	SampleRate50   = 0x00
	SampleRate100  = 0x04
	SampleRate200  = 0x08
	SampleRate400  = 0x0C
	SampleRate800  = 0x10
	SampleRate1000 = 0x14
	SampleRate1600 = 0x18
	SampleRate3200 = 0x1C

	PulseWidthMask = 0xFC
	PulseWidth69   = 0x00
	PulseWidth118  = 0x01
	PulseWidth215  = 0x02
	PulseWidth411  = 0x03

	Slot1Mask = 0xF8
	Slot2Mask = 0x8F
	Slot3Mask = 0xF8
	Slot4Mask = 0x8F

	SlotNone       = 0x00
	SlotRedLED     = 0x01
	SlotIRLED      = 0x02
	SlotGreenLED   = 0x03
	SlotNonePilot  = 0x04
	SlotRedPilot   = 0x05
	SlotIRPilot    = 0x06
	SlotGreenPilot = 0x07

	ExpectedPartID = 0x15
)

All the constants for all the registers

Variables

View Source
var (
	ErrIncorrectPart    = errors.New("max30105: incorrect part")
	ErrInvalidParameter = errors.New("max30105: invalid parameter")
	ErrReadTimeout      = errors.New("max30105: read timeout")
)

Possible errors that can occur

Functions

This section is empty.

Types

type MAX30105Driver

type MAX30105Driver struct {
	// contains filtered or unexported fields
}

MAX30105Driver represents the initialised driver for a MAX30105 chip.

func NewDriver

func NewDriver(bus embd.I2CBus) *MAX30105Driver

NewDriver returns a new MAX30105 driver with the provided options.

func (*MAX30105Driver) ClearFIFO

func (d *MAX30105Driver) ClearFIFO() error

func (*MAX30105Driver) DisableFIFORollover

func (d *MAX30105Driver) DisableFIFORollover() error

func (*MAX30105Driver) EnableFIFORollover

func (d *MAX30105Driver) EnableFIFORollover() error

func (*MAX30105Driver) EnableSlot

func (d *MAX30105Driver) EnableSlot(slotNumber byte, device byte) error

func (*MAX30105Driver) GetReadPointer

func (d *MAX30105Driver) GetReadPointer() (byte, error)

func (*MAX30105Driver) GetWritePointer

func (d *MAX30105Driver) GetWritePointer() (byte, error)

func (*MAX30105Driver) ReadSamples

func (d *MAX30105Driver) ReadSamples() ([]Sample, error)

func (*MAX30105Driver) ReadTemperature

func (d *MAX30105Driver) ReadTemperature() (float64, error)

func (*MAX30105Driver) SetADCRange

func (d *MAX30105Driver) SetADCRange(adcRange byte) error

func (*MAX30105Driver) SetFIFOAverage

func (d *MAX30105Driver) SetFIFOAverage(numSamples byte) error

func (*MAX30105Driver) SetGreenAmplitude

func (d *MAX30105Driver) SetGreenAmplitude(amplitude byte) error

func (*MAX30105Driver) SetIRAmplitude

func (d *MAX30105Driver) SetIRAmplitude(amplitude byte) error

func (*MAX30105Driver) SetLEDMode

func (d *MAX30105Driver) SetLEDMode(mode byte) error

func (*MAX30105Driver) SetProximityAmplitude

func (d *MAX30105Driver) SetProximityAmplitude(amplitude byte) error

func (*MAX30105Driver) SetProximityThreshold

func (d *MAX30105Driver) SetProximityThreshold(threshold byte) error

func (*MAX30105Driver) SetPulseWidth

func (d *MAX30105Driver) SetPulseWidth(pulseWidth byte) error

func (*MAX30105Driver) SetRedAmplitude

func (d *MAX30105Driver) SetRedAmplitude(amplitude byte) error

func (*MAX30105Driver) SetSampleRate

func (d *MAX30105Driver) SetSampleRate(sampleRate byte) error

func (*MAX30105Driver) Setup

func (d *MAX30105Driver) Setup() error

type Sample

type Sample struct {
	Red   int
	IR    int
	Green int
}

Sample represents a sample reading from the sensor.

Jump to

Keyboard shortcuts

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