ads1115

package
v0.0.0-...-6389ad2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComparatorLatching

type ComparatorLatching byte
const (
	ComparatorLatchingFalse ComparatorLatching = 0
	ComparatorLatchingTrue  ComparatorLatching = 1
)

func (ComparatorLatching) String

func (c ComparatorLatching) String() string

type ComparatorMode

type ComparatorMode byte
const (
	ComparatorModeTraditional ComparatorMode = 0
	ComparatorModeWindow      ComparatorMode = 1
)

func (ComparatorMode) String

func (c ComparatorMode) String() string

type ComparatorPolarity

type ComparatorPolarity byte
const (
	ComparatorPolarityActiveLow  ComparatorPolarity = 0
	ComparatorPolarityActiveHigh ComparatorPolarity = 1
)

func (ComparatorPolarity) String

func (c ComparatorPolarity) String() string

type ComparatorQueue

type ComparatorQueue byte
const (
	ComparatorQueue1Sample ComparatorQueue = 0
	ComparatorQueue2Sample ComparatorQueue = 1
	ComparatorQueue3Sample ComparatorQueue = 2
	ComparatorDisable      ComparatorQueue = 3
)

type DataRate

type DataRate byte
const (
	Rate8SPS   DataRate = 0
	Rate16SPS  DataRate = 1
	Rate32SPS  DataRate = 2
	Rate64SPS  DataRate = 3
	Rate128SPS DataRate = 4
	Rate250SPS DataRate = 5
	Rate475SPS DataRate = 6
	Rate860SPS DataRate = 7
)

func (DataRate) String

func (d DataRate) String() string

type Dev

type Dev struct {
	Device *i2c.Dev
}

Dev - i2c.Dev associated with mcp9600

func (*Dev) GetComparatorLatch

func (d *Dev) GetComparatorLatch() (ComparatorLatching, error)

GetComparatorLatch -

func (*Dev) GetComparatorMode

func (d *Dev) GetComparatorMode() (ComparatorMode, error)

GetComparatorMode -

func (*Dev) GetComparatorPolarity

func (d *Dev) GetComparatorPolarity() (ComparatorPolarity, error)

GetComparatorPolarity -

func (*Dev) GetComparatorQueue

func (d *Dev) GetComparatorQueue() (ComparatorQueue, error)

GetComparatorQueue -

func (*Dev) GetDataRate

func (d *Dev) GetDataRate() (DataRate, error)

GetDataRate -

func (*Dev) GetHighThreshold

func (d *Dev) GetHighThreshold() (int16, error)

GetHighThreshold -

func (*Dev) GetLowThreshold

func (d *Dev) GetLowThreshold() (int16, error)

GetLowThreshold -

func (*Dev) GetMode

func (d *Dev) GetMode() (OperatingMode, error)

GetMode - Get operating mode

func (*Dev) GetMux

func (d *Dev) GetMux() (InputMuxSetting, error)

GetMux - Get conversion multiplexer configuration

func (*Dev) GetNormalizedConversion

func (d *Dev) GetNormalizedConversion() (float64, error)

GetNormalizedConversion - return ranges between 1 and -1 of full-scale value

func (*Dev) GetNormalizedSingle

func (d *Dev) GetNormalizedSingle() (float64, error)

GetNormalizedSingle - In single mode, trigger, wait for, then return a conversion

func (*Dev) GetRange

func (d *Dev) GetRange() (FullScaleRange, error)

GetRange - Set programmable gain amplifier config

func (*Dev) GetScaledConversion

func (d *Dev) GetScaledConversion(r FullScaleRange) (float64, error)

GetScaledConversion - return current scaled value given fullscalerange

func (*Dev) GetScaledSingle

func (d *Dev) GetScaledSingle(r FullScaleRange) (float64, error)

GetScaledSingle - Same as GetNormalizedSingle, but scaled given fullscalerange

func (*Dev) SetComparatorLatch

func (d *Dev) SetComparatorLatch(v ComparatorLatching) error

SetComparatorLatch -

func (*Dev) SetComparatorMode

func (d *Dev) SetComparatorMode(v ComparatorMode) error

SetComparatorMode -

func (*Dev) SetComparatorPolarity

func (d *Dev) SetComparatorPolarity(v ComparatorPolarity) error

SetComparatorPolarity -

func (*Dev) SetComparatorQueue

func (d *Dev) SetComparatorQueue(v ComparatorQueue) error

SetComparatorQueue -

func (*Dev) SetDataRate

func (d *Dev) SetDataRate(v DataRate) error

SetDataRate -

func (*Dev) SetHighThreshold

func (d *Dev) SetHighThreshold(v int16) error

SetHighThreshold -

func (*Dev) SetLowThreshold

func (d *Dev) SetLowThreshold(v int16) error

SetLowThreshold -

func (*Dev) SetMode

func (d *Dev) SetMode(v OperatingMode) error

SetMode - Set operating mode

func (*Dev) SetMux

func (d *Dev) SetMux(v InputMuxSetting) error

SetMux - Set conversion multiplexer configuration

func (*Dev) SetRange

func (d *Dev) SetRange(v FullScaleRange) error

SetRange - Set programmable gain amplifier config

type FullScaleRange

type FullScaleRange byte
const (
	Range6p144 FullScaleRange = 0
	Range4p096 FullScaleRange = 1
	Range2p048 FullScaleRange = 2
	Range1p024 FullScaleRange = 3
	Range0p512 FullScaleRange = 4
	Range0p256 FullScaleRange = 5
)

func (FullScaleRange) String

func (f FullScaleRange) String() string

func (FullScaleRange) ToFloat

func (f FullScaleRange) ToFloat() float64

type InputMuxSetting

type InputMuxSetting byte
const (
	Mux0v1 InputMuxSetting = 0
	Mux0v3 InputMuxSetting = 1
	Mux1v3 InputMuxSetting = 2
	Mux2v3 InputMuxSetting = 3
	Mux0vG InputMuxSetting = 4
	Mux1vG InputMuxSetting = 5
	Mux2vG InputMuxSetting = 6
	Mux3vG InputMuxSetting = 7
)

func (InputMuxSetting) String

func (i InputMuxSetting) String() string

type OperatingMode

type OperatingMode byte
const (
	ModeContinuous OperatingMode = 0
	ModeSingle     OperatingMode = 1
)

func (OperatingMode) String

func (o OperatingMode) String() string

type Register

type Register byte
const (
	RegisterConversion Register = 0
	RegisterConfig     Register = 1
	RegisterLoThresh   Register = 2
	RegisterHiThresh   Register = 3
)

Jump to

Keyboard shortcuts

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