periph: Index | Files

package cci

import ""

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.



Package Files

cci.go doc.go strings_gen.go

type CameraStatus Uses

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 Uses

func (i CameraStatus) String() string

type Dev Uses

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 Uses

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

New returns a driver for the FLIR Lepton CCI protocol.

func (*Dev) GetFFCModeControl Uses

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

GetFFCModeControl returns the internal state with regards to calibration.

func (*Dev) GetSerial Uses

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

GetSerial returns the FLIR Lepton serial number.

func (*Dev) GetShutterPos Uses

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

GetShutterPos returns the position of the shutter if present.

func (*Dev) GetStatus Uses

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

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

func (*Dev) GetTemp Uses

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

GetTemp returns the temperature inside the camera.

func (*Dev) GetTempHousing Uses

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

GetTempHousing returns the temperature of the camera housing.

func (*Dev) GetUptime Uses

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

GetUptime returns the uptime. Rolls over after 1193 hours.

func (*Dev) Halt Uses

func (d *Dev) Halt() error

Halt implements conn.Resource.

Halt stops the camera.

func (*Dev) Init Uses

func (d *Dev) Init() error

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

func (*Dev) Precision Uses

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

Precision implements physic.SenseEnv.

func (*Dev) RunFFC Uses

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 Uses

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

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

func (*Dev) SenseContinuous Uses

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

SenseContinuous implements physic.SenseEnv.

func (*Dev) String Uses

func (d *Dev) String() string

String implements conn.Resource.

func (*Dev) WaitIdle Uses

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

WaitIdle waits for camera to be ready.

It loops forever and returns the StatusBit.

type FFCMode Uses

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 Uses

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 Uses

func (i FFCShutterMode) String() string

type FFCState Uses

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 Uses

func (i FFCState) String() string

type ShutterPos Uses

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 Uses

func (i ShutterPos) String() string

type ShutterTempLockoutState Uses

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 Uses

func (i ShutterTempLockoutState) String() string

type Status Uses

type Status struct {
    CameraStatus CameraStatus
    CommandCount uint16

Status returns the camera status as returned by the camera.

type StatusBit Uses

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 Uses

func (s StatusBit) String() string

Package cci imports 13 packages (graph) and is imported by 4 packages. Updated 2018-08-08. Refresh now. Tools for package owners.