flashreset

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: 2 Imported by: 0 modules, 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 flashreset defines the portable presets and receipts used to replace the persistent Pattern rows of a blink(1). Hardware access lives in devicebackend.

Index

Constants

View Source
const (
	Off       = "off"
	Rainbow   = "rainbow"
	Starlight = "starlight"
	Fireflies = "fireflies"
	Default   = Off

	Acknowledged  = "acknowledged"
	Unconfirmed   = "unconfirmed"
	StagingFailed = "staging_failed"
)

Variables

View Source
var ErrUnsupported = errors.New("flash preset reset is unsupported for this device or session")

Functions

func Valid

func Valid(preset string) bool

Types

type Result

type Result struct {
	Serial   string `json:"serial"`
	Preset   string `json:"preset"`
	Firmware int    `json:"firmware"`
	Lines    int    `json:"lines"`
	Staged   int    `json:"staged"`
	Verified int    `json:"verified"`
	Status   string `json:"status"`
}

Result counts successful RAM staging calls and matching RAM observations. A failed staging call can have changed the next RAM row as well. Acknowledged only describes acceptance of a single save request, never cold verification.

func (Result) Validate

func (r Result) Validate(serial, preset string) error

type Row

type Row struct {
	R, G, B byte
	Ticks   uint16
}

Row always targets both LEDs. Ticks are the native 10 ms units shared by the fade and the time until the next row; a black zero-tick row would be skipped.

func Image

func Image(preset string, lines int) ([]Row, error)

Image repeats the preset over the entire usable Flash region. The caller obtains its capacity from the matched SDK profile before programming it.

Jump to

Keyboard shortcuts

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