hd44780

package module
v0.0.0-...-f3398c7 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: GPL-3.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (

	// LCD 4x20 Mode Setting defaults
	Lines int = 4

	Width int = 20 // Maximum characters per line

)

Variables

View Source
var (
	BKPin int = 0
	RSPin int = 0 // GOIO 7   --> Raspberry Physical Pin 26  RS Bit/pin
	EPin  int = 0 // GPIO 8   --> Raspberry Physical Pin 24  Enable bit/pin
	D4Pin int = 0 // GPIO 25  --> Raspberry Physical Pin 22  Data4 bit/pin
	D5Pin int = 0 // GPIO 24  --> Raspberry Physical Pin 18  Data5 bit/pin
	D6Pin int = 0 // GPIO 23  --> Raspberry Physical Pin 16  Data6 bit/pin
	D7Pin int = 0 // GPIO 18  --> Raspberry Physical Pin 12  Data7 bit/pin
)

Functions

func LcdDisplay

func LcdDisplay(lcdtext_show [4]string, PRSPin int, PEPin int, PD4Pin int, PD5Pin int, PD6Pin int, PD7Pin int, LCDInterfaceType string, LCDI2CAddress byte)

Types

type GPIO4bit

type GPIO4bit struct {
	sync.Mutex

	RSPin int // GOIO 7   --> Raspberry Physical Pin 26
	EPin  int // GPIO 8    --> Raspberry Physical Pin 24
	D4Pin int // GPIO 25  --> Raspberry Physical Pin 22
	D5Pin int // GPIO 24  --> Raspberry Physical Pin 18
	D6Pin int // GPIO 23  --> Raspberry Physical Pin 16
	D7Pin int // GPIO 18  --> Raspberry Physical Pin 12

	// max lines
	Lines int
	// Memory address for each line
	LinesAddr []byte
	// LCD width (number of character in line)
	Width int
	// contains filtered or unexported fields
}

func NewGPIO4bit

func NewGPIO4bit() (h *GPIO4bit)

NewGPIO4bit create new GPIO4bit structure with some defaults

func (*GPIO4bit) Active

func (h *GPIO4bit) Active() bool

Active return true when interface is working ok

func (*GPIO4bit) Clear

func (h *GPIO4bit) Clear()

Clear display

func (*GPIO4bit) Close

func (h *GPIO4bit) Close()

Close interface, clear display.

func (*GPIO4bit) Display

func (h *GPIO4bit) Display(line int, text string)

Display only one line

func (*GPIO4bit) DisplayLines

func (h *GPIO4bit) DisplayLines(msg string)

DisplayLines sends one or more lines separated by \n to lcd

func (*GPIO4bit) Open

func (h *GPIO4bit) Open() (err error)

Open / initialize LCD interface

func (*GPIO4bit) Reset

func (h *GPIO4bit) Reset()

Reset interface

func (*GPIO4bit) SetChar

func (h *GPIO4bit) SetChar(pos byte, def []byte)

func (*GPIO4bit) ToggleBacklight

func (h *GPIO4bit) ToggleBacklight()

type HD44780

type HD44780 interface {
	Open() (err error)
	Reset()
	Close()
	Clear()
	Display(line int, text string)
	DisplayLines(msg string)
	Active() bool
	SetChar(pos byte, def []byte)
	ToggleBacklight()
}

type I2C4bit

type I2C4bit struct {

	// max lines
	Lines int
	// LCD width (number of character in line)
	Width int
	// contains filtered or unexported fields
}

I2C4bit allow communicate wit HD44780 via I2C in 4bit mode

func NewI2C4bit

func NewI2C4bit(addr byte) (h *I2C4bit)

NewI2C4bit create new I2C4bit structure with some defaults

func (*I2C4bit) Active

func (h *I2C4bit) Active() bool

Active return true when interface is working ok

func (*I2C4bit) Clear

func (h *I2C4bit) Clear()

Clear screen

func (*I2C4bit) Close

func (h *I2C4bit) Close()

Close interface, clear display.

func (*I2C4bit) Display

func (h *I2C4bit) Display(line int, text string)

Display only one line

func (*I2C4bit) DisplayLines

func (h *I2C4bit) DisplayLines(msg string)

DisplayLines sends one or more lines separated by \n to lcd

func (*I2C4bit) Open

func (h *I2C4bit) Open() (err error)

Open / initialize LCD interface

func (*I2C4bit) Reset

func (h *I2C4bit) Reset()

Reset interface

func (*I2C4bit) SetChar

func (h *I2C4bit) SetChar(pos byte, def []byte)

func (*I2C4bit) ToggleBacklight

func (h *I2C4bit) ToggleBacklight()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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