cci

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2017 License: Apache-2.0 Imports: 12 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

http://www.flir.com/uploadedFiles/OEM/Products/LWIR-Cameras/Lepton/FLIR-Lepton-Software-Interface-Description-Document.pdf

Found via http://www.flir.com/cores/display/?id=51878

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() (devices.Celsius, error)

GetTemp returns the temperature inside the camera.

func (*Dev) GetTempHousing

func (d *Dev) GetTempHousing() (devices.Celsius, 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 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) 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) 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     devices.Celsius         // Default: 3°C
	ImminentDelay           uint16                  // Default: 52
	VideoFreezeDuringFFC    bool                    // Default: true
	FFCDesired              bool                    // Default: false
	ExplicitCommandToOpen   bool                    // Default: false
}

FFCMode

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 (
	// No FFC was requested.
	FFCNever FFCState = 0
	// FFC is in progress. It lasts 23 frames (at 27fps) so it lasts less than a second.
	FFCInProgress FFCState = 1
	// 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