cci

package
v3.6.10 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package cci declares the Camera Command Interface to interact with a FLIR Lepton over I²C.

This protocol controls and queries the camera but is not used to read the images.

Datasheet

https://www.flir.com/globalassets/imported-assets/document/flir-lepton-software-interface-description-document.pdf

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CameraStatus

type CameraStatus uint32

CameraStatus returns the status of the FLIR Lepton's camera.

const (
	SystemReady              CameraStatus = 0
	SystemInitializing       CameraStatus = 1
	SystemInLowPowerMode     CameraStatus = 2
	SystemGoingIntoStandby   CameraStatus = 3
	SystemFlatFieldInProcess CameraStatus = 4
)

Valid values for CameraStatus.

func (CameraStatus) String

func (i CameraStatus) String() string

type Dev

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

Dev is the Lepton specific Command and Control Interface (CCI).

Dev can safely accessed concurrently via multiple goroutines.

This interface is accessed via I²C and provides access to view and modify the internal state.

Maximum I²C speed is 1Mhz.

func New

func New(i i2c.Bus) (*Dev, error)

New returns a driver for the FLIR Lepton CCI protocol.

func (*Dev) GetFFCModeControl

func (d *Dev) GetFFCModeControl() (*FFCMode, error)

GetFFCModeControl returns the internal state with regards to calibration.

func (*Dev) GetSerial

func (d *Dev) GetSerial() (uint64, error)

GetSerial returns the FLIR Lepton serial number.

func (*Dev) GetShutterPos

func (d *Dev) GetShutterPos() (ShutterPos, error)

GetShutterPos returns the position of the shutter if present.

func (*Dev) GetStatus

func (d *Dev) GetStatus() (*Status, error)

GetStatus return the status of the camera as known by the camera itself.

func (*Dev) GetTemp

func (d *Dev) GetTemp() (physic.Temperature, error)

GetTemp returns the temperature inside the camera.

func (*Dev) GetTempHousing

func (d *Dev) GetTempHousing() (physic.Temperature, error)

GetTempHousing returns the temperature of the camera housing.

func (*Dev) GetUptime

func (d *Dev) GetUptime() (time.Duration, error)

GetUptime returns the uptime. Rolls over after 1193 hours.

func (*Dev) Halt

func (d *Dev) Halt() error

Halt implements conn.Resource.

Halt stops the camera.

func (*Dev) Init

func (d *Dev) Init() error

Init initializes the FLIR Lepton in raw 14 bits mode, enables telemetry as header.

func (*Dev) Precision

func (d *Dev) Precision(e *physic.Env)

Precision implements physic.SenseEnv.

func (*Dev) RunFFC

func (d *Dev) RunFFC() error

RunFFC forces a Flat-Field Correction to be done by the camera for recalibration. It takes 23 frames and the camera runs at 27fps so it lasts less than a second.

func (*Dev) Sense

func (d *Dev) Sense(e *physic.Env) error

Sense implements physic.SenseEnv. It returns the housing temperature.

func (*Dev) SenseContinuous

func (d *Dev) SenseContinuous(time.Duration) (<-chan physic.Env, error)

SenseContinuous implements physic.SenseEnv.

func (*Dev) String

func (d *Dev) String() string

String implements conn.Resource.

func (*Dev) WaitIdle

func (d *Dev) WaitIdle() (StatusBit, error)

WaitIdle waits for camera to be ready.

It loops forever and returns the StatusBit.

type FFCMode

type FFCMode struct {
	FFCShutterMode          FFCShutterMode          // Default: FFCShutterModeExternal
	ShutterTempLockoutState ShutterTempLockoutState // Default: ShutterTempLockoutStateInactive
	ElapsedTimeSinceLastFFC time.Duration           // Uptime
	DesiredFFCPeriod        time.Duration           // Default: 300s
	DesiredFFCTempDelta     physic.Temperature      // Default: 3K
	ImminentDelay           uint16                  // Default: 52
	VideoFreezeDuringFFC    bool                    // Default: true
	FFCDesired              bool                    // Default: false
	ExplicitCommandToOpen   bool                    // Default: false
}

FFCMode describes the various self-calibration settings and state.

type FFCShutterMode

type FFCShutterMode uint32

FFCShutterMode is used in FFCMode.

const (
	FFCShutterModeManual   FFCShutterMode = 0
	FFCShutterModeAuto     FFCShutterMode = 1
	FFCShutterModeExternal FFCShutterMode = 2
)

Valid values for FFCShutterMode.

func (FFCShutterMode) String

func (i FFCShutterMode) String() string

type FFCState

type FFCState uint8

FFCState describes the Flat-Field Correction state.

const (
	// FFCNever means no FFC was requested.
	FFCNever FFCState = 0
	// FFCInProgress means a FFC is in progress. It lasts 23 frames (at 27fps) so it lasts less than a second.
	FFCInProgress FFCState = 1
	// FFCComplete means FFC was completed successfully.
	FFCComplete FFCState = 2
)

func (FFCState) String

func (i FFCState) String() string

type ShutterPos

type ShutterPos uint32

ShutterPos returns the shutter position, which is used to calibrate the camera.

const (
	ShutterPosUnknown ShutterPos = 0xFFFFFFFF // -1
	ShutterPosIdle    ShutterPos = 0
	ShutterPosOpen    ShutterPos = 1
	ShutterPosClosed  ShutterPos = 2
	ShutterPosBrakeOn ShutterPos = 3
)

Valid values for ShutterPos.

func (ShutterPos) String

func (i ShutterPos) String() string

type ShutterTempLockoutState

type ShutterTempLockoutState uint32

ShutterTempLockoutState is used in FFCMode.

const (
	ShutterTempLockoutStateInactive ShutterTempLockoutState = 0
	ShutterTempLockoutStateHigh     ShutterTempLockoutState = 1
	ShutterTempLockoutStateLow      ShutterTempLockoutState = 2
)

Valid values for ShutterTempLockoutState.

func (ShutterTempLockoutState) String

func (i ShutterTempLockoutState) String() string

type Status

type Status struct {
	CameraStatus CameraStatus
	CommandCount uint16
}

Status returns the camera status as returned by the camera.

type StatusBit

type StatusBit uint16

StatusBit is the status as returned by the FLIR Lepton.

const (
	StatusBusy       StatusBit = 0x1
	StatusBootNormal StatusBit = 0x2
	StatusBooted     StatusBit = 0x4
	StatusErrorMask  StatusBit = 0xFF00
)

Status bitmask.

func (StatusBit) String

func (s StatusBit) String() string

Jump to

Keyboard shortcuts

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