driver

package
v0.0.0-...-7d4f8a7 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2016 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotSupported = errors.New("Command is not supported")
)

Errors

Functions

This section is empty.

Types

type Display

type Display interface {
	//System
	Close() error
	SetEncoding(encoding.Encoding)

	//
	Init() error
	Test() error
	Clear() error

	Send([]byte) error
	Receive(b []byte) (n int, err error)

	//Mode
	ModeRewrite() error
	ModeVScroll() error
	ModeHScroll() error

	Brightness(byte) error

	//Rows
	ClearRow() error

	//Cursor
	CursorVisible(bool) error
	CursorMoveUp() error
	CursorMoveDown() error
	CursorMoveRight() error
	CursorMoveLeft() error

	CursorMoveLeftTop() error
	CursorMoveBeginInRow() error
	CursorMoveEndInRow() error
	CursorMoveBottom() error
	CursorMove(row, col byte) error

	//Text
	PrintRow(row byte, text string) error

	//Flags
	FlagEnable(enabled bool, num byte) error
	FlagsDisable() error
}

type Driver

type Driver interface {
	GetDisplay(proto Protocol, config map[string]interface{}) (Display, error)
}

type Protocol

type Protocol interface {
	InitCmd() []byte
	ClearCmd() []byte
	TestCmd() []byte

	//Mode
	ModeRewriteCmd() []byte
	ModeVScrollCmd() []byte
	ModeHScrollCmd() []byte
	BrightnessCmd(byte) []byte

	//Rows
	ClearRowCmd() []byte

	//Cursor
	CursorVisibleCmd(bool) []byte

	CursorMoveUpCmd() []byte
	CursorMoveDownCmd() []byte
	CursorMoveRightCmd() []byte
	CursorMoveLeftCmd() []byte

	CursorMoveLeftTopCmd() []byte
	CursorMoveBeginInRowCmd() []byte
	CursorMoveEndInRowCmd() []byte
	CursorMoveBottomCmd() []byte
	CursorMoveCmd(row, col byte) []byte

	//Text
	PrintRowCmd(row byte, text string) []byte

	//Flags
	FlagEnableCmd(enabled bool, num byte) []byte
	FlagsDisableCmd() []byte
}

Protocol specific to a particular communication protocol

Jump to

Keyboard shortcuts

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