hdwr

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package hdwr provides functions that needs access to the hardware.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListDeviceDetails

func ListDeviceDetails(fwVer, showAll bool) ([]*schema.DeviceDetail, error)

ListDeviceDetails returns a list of all blink(1) devices with details.

func OpenBlink1Device

func OpenBlink1Device(hint string) (err error)

OpenBlink1Device opens a corresponding blink(1) device by hint.

func PlayOnChipPattern

func PlayOnChipPattern(start, end, times int, wait bool) error

PlayOnChipPattern starts playing a blink(1) pattern on the opened device.

func PlayState

func PlayState(st b1.LightState) error

PlayState plays a blink(1) state on the opened device.

func PlayStateAndWait

func PlayStateAndWait(st b1.LightState) error

PlayStateAndWait plays a blink(1) state on the opened device and wait for completion.

func PlayStateSequence

func PlayStateSequence(seq b1.StateSequence) error

PlayStateSequence plays a blink(1) state sequence on the opened device.

func ReadLEDColor

func ReadLEDColor(n int) (color.Color, error)

ReadLEDColor reads the color of the opened device.

func ReadOnChipSequence

func ReadOnChipSequence() (b1.StateSequence, error)

ReadOnChipSequence reads a blink(1) state sequence from the opened device.

func ReadPlayingState

func ReadPlayingState() (b1.PatternState, error)

ReadPlayingState reads the playing state of the opened device.

func SaveOnChipPattern

func SaveOnChipPattern() error

SaveOnChipPattern saves a blink(1) pattern on the opened device.

func SetColor

func SetColor(cl color.Color) error

SetColor sets the color of the opened device.

func SetLog

func SetLog(l *zap.SugaredLogger)

SetLog sets the logger from outside the package.

func StopPlaying

func StopPlaying() error

StopPlaying stops playing any blink(1) state on the opened device.

func TickleOnChipPattern

func TickleOnChipPattern(start, end int, waitTimeout time.Duration) error

TickleOnChipPattern starts playing a blink(1) pattern on the opened device.

func WriteOnChipPattern

func WriteOnChipPattern(start, end int, seq b1.StateSequence) error

WriteOnChipPattern writes a blink(1) pattern on the opened device.

Types

This section is empty.

Jump to

Keyboard shortcuts

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