Documentation

Overview

Package characterdisplay provides an ease-of-use layer on top of a character display controller.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller interface {
	DisplayOff() error            // turns the display off
	DisplayOn() error             // turns the display on
	CursorOff() error             // sets the cursor visibility to off
	CursorOn() error              // sets the cursor visibility to on
	BlinkOff() error              // sets the cursor blink off
	BlinkOn() error               // sets the cursor blink on
	ShiftLeft() error             // moves the cursor and text one column to the left
	ShiftRight() error            // moves the cursor and text one column to the right
	BacklightOff() error          // turns the display backlight off
	BacklightOn() error           // turns the display backlight on
	Home() error                  // moves the cursor to the home position
	Clear() error                 // clears the display and moves the cursor to the home position
	WriteChar(byte) error         // writes a character to the display
	SetCursor(col, row int) error // sets the cursor position
	Close() error                 // closes the controller resources
}

Controller is an interface that describes the basic functionality of a character display controller.

type Display

type Display struct {
	Controller
	// contains filtered or unexported fields
}

Display represents an abstract character display and provides a ease-of-use layer on top of a character display controller.

func New

func New(controller Controller, cols, rows int) *Display

New creates a new Display

func (*Display) Clear

func (disp *Display) Clear() error

Clear clears the display, preserving the mode settings and setting the correct home.

func (*Display) Home

func (disp *Display) Home() error

Home moves the cursor and all characters to the home position.

func (*Display) Message

func (disp *Display) Message(message string) error

Message prints the given string on the display, including interpreting newline characters and wrapping at the end of lines.

func (*Display) Newline

func (disp *Display) Newline() error

Newline moves the input cursor to the beginning of the next line.

func (*Display) SetCursor

func (disp *Display) SetCursor(col, row int) error

SetCursor sets the input cursor to the given position.