amg88xx

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: BSD-3-Clause Imports: 4 Imported by: 10

Documentation

Overview

Package amg88xx provides a driver for the AMG88XX Thermal Camera

Datasheet: https://cdn-learn.adafruit.com/assets/assets/000/043/261/original/Grid-EYE_SPECIFICATIONS%28Reference%29.pdf

Index

Constants

View Source
const (
	PCTL         = 0x00
	RST          = 0x01
	FPSC         = 0x02
	INTC         = 0x03
	STAT         = 0x04
	SCLR         = 0x05
	AVE          = 0x07
	INTHL        = 0x08
	INTHH        = 0x09
	INTLL        = 0x0A
	INTLH        = 0x0B
	IHYSL        = 0x0C
	IHYSH        = 0x0D
	TTHL         = 0x0E
	TTHH         = 0x0F
	INT_OFFSET   = 0x010
	PIXEL_OFFSET = 0x80

	// power modes
	NORMAL_MODE = 0x00
	SLEEP_MODE  = 0x10
	STAND_BY_60 = 0x20
	STAND_BY_10 = 0x21

	// resets
	FLAG_RESET    = 0x30
	INITIAL_RESET = 0x3F

	// status and status clear flags
	STATUS_INTF    = 0x02
	STATUS_OVF_IRS = 0x04
	STATUS_OVF_THS = 0x08

	// frame rates
	FPS_10 FrameRate = 0x00
	FPS_1  FrameRate = 0x01

	// interrupt modes
	DIFFERENCE     InterruptMode = 0x00
	ABSOLUTE_VALUE InterruptMode = 0x01

	PIXEL_TEMP_CONVERSION = 250
	THERMISTOR_CONVERSION = 625
)
View Source
const AddressHigh = 0x69

The I2C address which this device listens to.

View Source
const AddressLow = 0x68

Variables

View Source
var ErrNoFrame = errors.New("amg88xx: timeout waiting for first frame")

Functions

func PixelInterrupt added in v0.37.0

func PixelInterrupt(table *[8]uint8, pixel int) bool

PixelInterrupt reports whether a pixel is flagged in an interrupt table.

Types

type Config

type Config struct {
}

type Device

type Device struct {
	Address uint16
	// contains filtered or unexported fields
}

Device wraps an I2C connection to a AMG88xx device.

func New

func New(bus drivers.I2C) Device

New creates a new AMG88xx connection. The I2C bus must already be configured.

This function only creates the Device object, it does not touch the device.

func (*Device) ClearInterrupt

func (d *Device) ClearInterrupt() error

ClearInterrupt clears any triggered interrupts

func (*Device) ClearStatus added in v0.37.0

func (d *Device) ClearStatus(flags uint8) error

ClearStatus clears the given status flags.

func (*Device) Configure

func (d *Device) Configure(cfg Config) error

Configure sets up the device for communication

func (*Device) DisableInterrupt

func (d *Device) DisableInterrupt() error

DisableInterrupt disables the interrupt pin on the device

func (*Device) EnableInterrupt

func (d *Device) EnableInterrupt() error

EnableInterrupt enables the interrupt pin on the device

func (*Device) ReadInterruptTable added in v0.37.0

func (d *Device) ReadInterruptTable(table *[8]uint8) error

ReadInterruptTable reads which pixels triggered an interrupt. Bit n of table[row] is set for the pixel at row*8+n.

func (*Device) ReadPixels

func (d *Device) ReadPixels(buffer *[64]int32) error

ReadPixels reads the 64 values (8x8 grid) of the sensor converted to millicelsius

func (*Device) ReadStatus added in v0.37.0

func (d *Device) ReadStatus() (uint8, error)

ReadStatus reads the status register. Check the result with the STATUS_INTF, STATUS_OVF_IRS and STATUS_OVF_THS flags.

func (*Device) ReadThermistor

func (d *Device) ReadThermistor() (int32, error)

ReadThermistor reads the onboard thermistor in millicelsius

func (*Device) SetFrameRate

func (d *Device) SetFrameRate(framerate FrameRate) error

SetFrameRate configures the frame rate

func (*Device) SetInterruptLevels

func (d *Device) SetInterruptLevels(high int32, low int32) error

SetInterruptLevels sets the interrupt levels in millicelsius, with the hysteresis set to 95% of the high level.

func (*Device) SetInterruptLevelsHysteresis

func (d *Device) SetInterruptLevelsHysteresis(high int32, low int32, hysteresis int32) error

SetInterruptLevelsHysteresis sets the interrupt levels and hysteresis in millicelsius

func (*Device) SetInterruptMode

func (d *Device) SetInterruptMode(mode InterruptMode) error

SetInterruptMode sets the interrupt mode

func (*Device) SetMovingAverageMode

func (d *Device) SetMovingAverageMode(mode bool) error

SetMovingAverageMode sets the moving average mode

func (*Device) SetPCTL

func (d *Device) SetPCTL(pctl uint8) error

SetPCTL sets the power control mode

func (*Device) SetReset

func (d *Device) SetReset(rst uint8) error

SetReset sets the reset value

type FrameRate added in v0.37.0

type FrameRate uint8

type InterruptMode

type InterruptMode uint8

Jump to

Keyboard shortcuts

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