Documentation ¶
Index ¶
- type Config
- type Controller
- type Expander
- type ExpanderConfig
- type Font
- type HD44780
- func (lcd *HD44780) Clear() error
- func (lcd *HD44780) Home() error
- func (lcd *HD44780) SetBacklight(v bool) error
- func (lcd *HD44780) SetCursorXY(x, y int) error
- func (lcd *HD44780) SetDisplay(displayOn, cursorOn, cursorBlink bool) error
- func (lcd *HD44780) SetEntryMode(increment, shiftDisplay bool) error
- func (lcd *HD44780) SetFunction(eightBitMode, twoLines, fiveByTen bool) error
- func (lcd *HD44780) Write(p []byte) (int, error)
- func (lcd *HD44780) WriteByte(b byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller interface { // IsEightBitMode should return true if the controller supports 8-bit communication. IsEightBitMode() bool // SetBacklight should update the state of the backlight. SetBacklight(bool) error // WriteByteIR writes to the instruction register. WriteByteIR(byte) error // ReadByteIR reads from the instruction register. ReadByteIR() (byte, error) // WriteByte writes to the data register. io.ByteWriter // ReadByte reads from the data register. io.ByteReader }
The Controller interface is the main interface for interacting with a LCD display.
type Expander ¶
type Expander struct { ExpanderConfig // contains filtered or unexported fields }
func NewExpander ¶
func NewExpander(cfg ExpanderConfig) *Expander
func (*Expander) IsEightBitMode ¶
func (*Expander) ReadByteIR ¶
func (*Expander) SetBacklight ¶
func (*Expander) WriteByteIR ¶
type ExpanderConfig ¶
type ExpanderConfig struct { RS driver.OutputPin RW driver.OutputPin E driver.OutputPin BL driver.OutputPin // Read operations will only be enabled if the DB_ pins also implement // the ioexp.InputPin interface. DB4 driver.OutputPin DB5 driver.OutputPin DB6 driver.OutputPin DB7 driver.OutputPin // optional DB0 driver.OutputPin DB1 driver.OutputPin DB2 driver.OutputPin DB3 driver.OutputPin // Flush, if set, will be called after updating pins for writing. Flush func() error // Refresh, if set, will be called before reading pins. Refresh func() error }
type HD44780 ¶
type HD44780 struct {
// contains filtered or unexported fields
}
func NewHD44780 ¶
func NewHD44780(c Controller, cfg Config) (*HD44780, error)
func (*HD44780) Clear ¶
Clear clears the entire display and sets DDRAM address 0 in the address counter.
func (*HD44780) Home ¶
Home sets DDRAM address 0 in the address counter and returns the cursor to the home position.
func (*HD44780) SetBacklight ¶
func (*HD44780) SetCursorXY ¶
SetCursorXY sets the cursor position to the specified coordinates starting from top-left.
func (*HD44780) SetDisplay ¶
func (*HD44780) SetEntryMode ¶
func (*HD44780) SetFunction ¶
SetFunction sets the number of display lines, character font, and data transmission length.
If eightBitMode is false, 4-bit communication will be used. If twoLines is false, only one line will be displayed. If fiveByTen is false, the character font will be 5x8.
Click to show internal directories.
Click to hide internal directories.