Documentation
¶
Overview ¶
Package amg88xx provides a driver for the AMG88XX Thermal Camera
Index ¶
- Constants
- Variables
- func PixelInterrupt(table *[8]uint8, pixel int) bool
- type Config
- type Device
- func (d *Device) ClearInterrupt() error
- func (d *Device) ClearStatus(flags uint8) error
- func (d *Device) Configure(cfg Config) error
- func (d *Device) DisableInterrupt() error
- func (d *Device) EnableInterrupt() error
- func (d *Device) ReadInterruptTable(table *[8]uint8) error
- func (d *Device) ReadPixels(buffer *[64]int32) error
- func (d *Device) ReadStatus() (uint8, error)
- func (d *Device) ReadThermistor() (int32, error)
- func (d *Device) SetFrameRate(framerate FrameRate) error
- func (d *Device) SetInterruptLevels(high int32, low int32) error
- func (d *Device) SetInterruptLevelsHysteresis(high int32, low int32, hysteresis int32) error
- func (d *Device) SetInterruptMode(mode InterruptMode) error
- func (d *Device) SetMovingAverageMode(mode bool) error
- func (d *Device) SetPCTL(pctl uint8) error
- func (d *Device) SetReset(rst uint8) error
- type FrameRate
- type InterruptMode
Constants ¶
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 )
const AddressHigh = 0x69
The I2C address which this device listens to.
const AddressLow = 0x68
Variables ¶
var ErrNoFrame = errors.New("amg88xx: timeout waiting for first frame")
Functions ¶
func PixelInterrupt ¶ added in v0.37.0
PixelInterrupt reports whether a pixel is flagged in an interrupt table.
Types ¶
type Device ¶
type Device struct {
Address uint16
// contains filtered or unexported fields
}
Device wraps an I2C connection to a AMG88xx device.
func New ¶
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 ¶
ClearInterrupt clears any triggered interrupts
func (*Device) ClearStatus ¶ added in v0.37.0
ClearStatus clears the given status flags.
func (*Device) DisableInterrupt ¶
DisableInterrupt disables the interrupt pin on the device
func (*Device) EnableInterrupt ¶
EnableInterrupt enables the interrupt pin on the device
func (*Device) ReadInterruptTable ¶ added in v0.37.0
ReadInterruptTable reads which pixels triggered an interrupt. Bit n of table[row] is set for the pixel at row*8+n.
func (*Device) ReadPixels ¶
ReadPixels reads the 64 values (8x8 grid) of the sensor converted to millicelsius
func (*Device) ReadStatus ¶ added in v0.37.0
ReadStatus reads the status register. Check the result with the STATUS_INTF, STATUS_OVF_IRS and STATUS_OVF_THS flags.
func (*Device) ReadThermistor ¶
ReadThermistor reads the onboard thermistor in millicelsius
func (*Device) SetFrameRate ¶
SetFrameRate configures the frame rate
func (*Device) SetInterruptLevels ¶
SetInterruptLevels sets the interrupt levels in millicelsius, with the hysteresis set to 95% of the high level.
func (*Device) SetInterruptLevelsHysteresis ¶
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 ¶
SetMovingAverageMode sets the moving average mode
type InterruptMode ¶
type InterruptMode uint8