hdwr

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 CloseBlink1Device added in v0.1.0

func CloseBlink1Device() error

CloseBlink1Device stops SDK goroutines, closes HID, then releases ownership. It preserves stable output; turning off is an explicit command in legacy CLI.

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