embd: github.com/kidoman/embd/interface/display/characterdisplay Index | Files

package characterdisplay

import "github.com/kidoman/embd/interface/display/characterdisplay"

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

Index

Package Files

characterdisplay.go

type Controller Uses

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 Uses

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 Uses

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

New creates a new Display

func (*Display) Clear Uses

func (disp *Display) Clear() error

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

func (*Display) Home Uses

func (disp *Display) Home() error

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

func (*Display) Message Uses

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 Uses

func (disp *Display) Newline() error

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

func (*Display) SetCursor Uses

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

SetCursor sets the input cursor to the given position.

Package characterdisplay is imported by 1 packages. Updated 2016-07-16. Refresh now. Tools for package owners.