panel

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FrameWidth  = 800
	FrameHeight = 480
	FrameBytes  = FrameWidth * FrameHeight / 8
)

Variables

View Source
var (
	ErrFrameSize   = errors.New("panel: wrong frame size")
	ErrConfig      = errors.New("panel: invalid IO configuration")
	ErrInUse       = errors.New("panel: driver is already in use")
	ErrBusyTimeout = errors.New("panel: BUSY remained LOW until deadline")
)
View Source
var ErrStreamState = errors.New("panel: stream state or bounds")

Functions

func ErrorCode

func ErrorCode(err error) string

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter exposes the verified 7.5-inch sequence through the generic display contract.

func NewAdapter

func NewAdapter(driver *Driver) (*Adapter, error)

func (*Adapter) Capabilities

func (a *Adapter) Capabilities() display.Capabilities

func (*Adapter) Refresh

func (a *Adapter) Refresh(frame display.Frame, mode display.RefreshMode) error

func (*Adapter) Sleep

func (a *Adapter) Sleep() error

Sleep is idempotent; Driver.Refresh already powers off and enters deep sleep.

type Driver

type Driver struct {
	// contains filtered or unexported fields
}

func New

func New(io IO) (*Driver, error)

func (*Driver) Refresh

func (d *Driver) Refresh(frame []byte) error

Refresh performs the Waveshare 7.5-inch V2 full-refresh and deep-sleep sequence. Source: https://github.com/waveshareteam/Pico_ePaper_Code/blob/main/c/lib/e-Paper/EPD_7in5_V2.c

type Event

type Event struct {
	Kind       EventKind
	Phase      Phase
	Step       Step
	Command    byte
	Offset     int
	Bytes      uint32
	Busy       bool
	BusyKnown  bool
	Samples    uint32
	LowSamples uint32
}

type EventKind

type EventKind uint8
const (
	EventStep EventKind = iota + 1
	EventCommand
	EventTransferStart
	EventTransferProgress
	EventTransferDone
	EventBusyWait
	EventBusyDone
	EventComplete
)

func (EventKind) String

func (k EventKind) String() string

type IO

type IO struct {
	Write    func([]byte) error
	SetCS    func(high bool)
	SetDC    func(high bool)
	SetReset func(high bool)
	SetPower func(high bool)
	ReadBusy func() bool
	Delay    func(time.Duration)
	Observe  func(Event)
}

type OpError

type OpError struct {
	Phase     Phase
	Step      Step
	Command   byte
	Offset    int
	Busy      bool
	BusyKnown bool
	Cause     error
}

func (OpError) Error

func (e OpError) Error() string

func (OpError) Unwrap

func (e OpError) Unwrap() error

type Phase

type Phase uint8
const (
	PhaseInitialize Phase = iota + 1
	PhasePowerOn
	PhaseOldPlane
	PhaseNewPlane
	PhaseRefresh
	PhasePowerOff
)

func (Phase) String

func (p Phase) String() string

type Step

type Step uint8
const (
	StepPowerOff Step = iota + 1
	StepPowerOn
	StepReset
	StepPowerSettings
	StepBoosterSoftStart
	StepControllerPowerOn
	StepPanelSettings
	StepResolution
	StepDualSPI
	StepVCOM
	StepTCON
	StepOldPlane
	StepNewPlane
	StepDisplayRefresh
	StepVCOMOff
	StepControllerPowerOff
	StepDeepSleep
)

func (Step) String

func (s Step) String() string

type Stream

type Stream struct {
	// contains filtered or unexported fields
}

Stream is an experimental single-owner two-pass full-refresh sink. The caller verifies both passes before Commit and enforces refresh cadence. It must Abort on invalid input, disconnect or idle timeout. Only the 100-byte inversion row is retained. No partial writes/refreshes or plane-pointer resumption is assumed. Sequence source: https://github.com/waveshareteam/Pico_ePaper_Code/blob/c9bcd84db5adf5f085353649a8a5c31492bc5fb8/c/lib/e-Paper/EPD_7in5_V2.c

func NewStream

func NewStream(driver *Driver) (*Stream, error)

func (*Stream) Abort

func (s *Stream) Abort() error

func (*Stream) Begin

func (s *Stream) Begin() error

func (*Stream) Commit

func (s *Stream) Commit() error

func (*Stream) Write

func (s *Stream) Write(pass uint8, offset uint32, pixels []byte) error

Jump to

Keyboard shortcuts

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