Documentation
¶
Index ¶
- func IsRemote(device string) bool
- func ReadImageFile(filePath string, width, height int) ([]byte, error)
- type LocalDisplay
- func (l *LocalDisplay) Clear() error
- func (l *LocalDisplay) Close() error
- func (l *LocalDisplay) DisplayImage(pngData []byte) error
- func (l *LocalDisplay) DisplayImageFromFile(filePath string) error
- func (l *LocalDisplay) DisplayText(text string) error
- func (l *LocalDisplay) EPD() *epd.EPD
- func (l *LocalDisplay) HardwareInit()
- func (l *LocalDisplay) Sleep() error
- type RemoteDisplay
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LocalDisplay ¶
type LocalDisplay struct {
// contains filtered or unexported fields
}
LocalDisplay implements Service for direct hardware access via SPI/GPIO.
func NewLocalDisplay ¶
func NewLocalDisplay(device string) (*LocalDisplay, error)
NewLocalDisplay creates a new local display service for the given device.
func (*LocalDisplay) Close ¶
func (l *LocalDisplay) Close() error
Close releases resources. For local display, this is a no-op.
func (*LocalDisplay) DisplayImage ¶
func (l *LocalDisplay) DisplayImage(pngData []byte) error
DisplayImage accepts raw PNG data and displays it on the EPD.
func (*LocalDisplay) DisplayImageFromFile ¶
func (l *LocalDisplay) DisplayImageFromFile(filePath string) error
DisplayImageFromFile reads an image from a file path or URL and displays it.
func (*LocalDisplay) DisplayText ¶
func (l *LocalDisplay) DisplayText(text string) error
DisplayText renders text and displays it on the EPD.
func (*LocalDisplay) EPD ¶
func (l *LocalDisplay) EPD() *epd.EPD
EPD returns the underlying EPD device for direct access (e.g. HardwareInit).
func (*LocalDisplay) HardwareInit ¶
func (l *LocalDisplay) HardwareInit()
HardwareInit initializes (wakes) the display hardware.
func (*LocalDisplay) Sleep ¶
func (l *LocalDisplay) Sleep() error
Sleep puts the EPD into sleep mode.
type RemoteDisplay ¶
type RemoteDisplay struct {
// contains filtered or unexported fields
}
RemoteDisplay implements Service by forwarding calls to a remote daemon via gRPC.
func NewRemoteDisplay ¶
func NewRemoteDisplay(address string) (*RemoteDisplay, error)
NewRemoteDisplay creates a new remote display service connected to the given address.
func (*RemoteDisplay) Clear ¶
func (r *RemoteDisplay) Clear() error
Clear sends a clear command to the remote daemon.
func (*RemoteDisplay) Close ¶
func (r *RemoteDisplay) Close() error
Close closes the gRPC connection.
func (*RemoteDisplay) DisplayImage ¶
func (r *RemoteDisplay) DisplayImage(pngData []byte) error
DisplayImage sends raw PNG data to the remote daemon for display.
func (*RemoteDisplay) DisplayText ¶
func (r *RemoteDisplay) DisplayText(text string) error
DisplayText sends text to the remote daemon for rendering and display.
func (*RemoteDisplay) Sleep ¶
func (r *RemoteDisplay) Sleep() error
Sleep sends a sleep command to the remote daemon.
type Service ¶
type Service interface {
// DisplayImage accepts raw PNG data and displays it on the EPD.
DisplayImage(pngData []byte) error
// DisplayText renders text and displays it on the EPD.
DisplayText(text string) error
// Clear clears the EPD to white.
Clear() error
// Sleep puts the EPD into sleep mode.
Sleep() error
// Close releases any resources held by the display service.
Close() error
}
Service abstracts over local hardware and remote gRPC display operations.