ina260

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: MIT Imports: 1 Imported by: 0

README

goina260

Port of github.com/jveitchmichaelis/ina260 to golang

Documentation

Index

Constants

View Source
const (
	PCAAutoincrementOFF           = 0x00
	PCAAutoincrementALL           = 0x80
	PCAAutoincrementIndividual    = 0xA0
	PCAAutoincrementControl       = 0xC0
	PCAAutoincrementControlGlobal = 0xE0

	REGConfig         = 0x00
	REGCurrent        = 0x01
	REGBusVoltage     = 0x02
	REGPower          = 0x03
	REGMaskEnable     = 0x06
	REGAlert          = 0x07
	REGManufacturerID = 0xFE
	REGDieID          = 0xFF

	RST     = 15
	AVG2    = 11
	AVG1    = 10
	AVG0    = 9
	VBUSCT2 = 8
	VBUSCT1 = 7
	VBUSCT0 = 6
	ISHCT2  = 5
	ISHCT1  = 4
	ISHCT0  = 3
	MODE3   = 2
	MODE2   = 1
	MODE1   = 0

	OCL  = 15
	UCL  = 14
	BOL  = 13
	BUL  = 12
	POL  = 11
	CNVR = 10
	AFF  = 4
	CVRF = 3
	OVF  = 2
	APOL = 1
	LEN  = 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type S

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

func New

func New(addr uint8, bus int) (sensor S, err error)

func (S) Close

func (s S) Close() error

func (S) DieID

func (s S) DieID() (id uint16, revision uint8, err error)

func (S) ManufacturerID

func (s S) ManufacturerID() (uint16, error)

func (S) ReadData

func (s S) ReadData(readVoltage, readCurrent, readPower bool) (voltage, current, power float64, err error)

Jump to

Keyboard shortcuts

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