ili9341

package
v0.0.0-...-3d984ba Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2018 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NOP     = 0x00
	SWRESET = 0x01
	SPLIN   = 0x10
	SLPOUT  = 0x11
	DISPOFF = 0x28
	DISPON  = 0x29
	RAMWR   = 0x2C
	MADCTL  = 0x36
	PIXSET  = 0x3A
	CASET   = 0x2A
	PASET   = 0x2B
)

These commands can be used to directly interract with display controller using DCI.

Variables

This section is empty.

Functions

This section is empty.

Types

type Area

type Area struct {
	// contains filtered or unexported fields
}

func (*Area) Bounds

func (a *Area) Bounds() image.Rectangle

func (*Area) DrawCircle

func (a *Area) DrawCircle(p0 image.Point, r int)

DrawCircle draws empty circle. 16-bit command.

func (*Area) DrawLine

func (a *Area) DrawLine(p0, p1 image.Point)

DrawLine draws a line from p0 to p1 (including both points). 16-bit command.

func (*Area) DrawLine_

func (a *Area) DrawLine_(p0, p1 image.Point)

DrawLine_ draws a line from p0 to p1 (including both points). 16-bit command. DrawLine_ uses less memory for code than DrawLine but is generally slower (can be faster for very short lines: 1-3 pixels). Use DrawLine_ if you are very short of Flash space and do not care about speed or to draw very short lines.

func (*Area) DrawPoint

func (a *Area) DrawPoint(p image.Point)

DrawPoint draws a point (one pixel). 16-bit command.

func (*Area) FillCircle

func (a *Area) FillCircle(p0 image.Point, r int)

FillCircle draws filled circle. 16-bit command.

func (*Area) FillRect

func (a *Area) FillRect(r image.Rectangle)

FillRect draws a filled rectangle. 16-bit command.

func (*Area) P0

func (a *Area) P0() image.Point

func (*Area) SetColor

func (a *Area) SetColor(c color.Color)

SetColor sets the color used by drawing methods.

func (*Area) SetColorRGB

func (a *Area) SetColorRGB(r, g, b byte)

SetColor sets the color used by drawing methods.

func (*Area) TextWriter

func (a *Area) TextWriter(f *Font) TextWriter

type DCI

type DCI interface {
	Setup() // Setup configures and enables SPI.

	Cmd(b byte)       // Cmd invokes a command (8-bit word size).
	WriteByte(b byte) // WriteByte pass one byte of data (8-bit word size).

	SetWordSize(size int) // SetWordSize changes the data word to size bits.

	Cmd2(w uint16)        // Cmd2 invokes two commands (16-bit word size).
	WriteWord(w uint16)   // Word passes one word of data (16-bit word size).
	Write(data []uint16)  // Write passes many words of data (16-bit word size).
	Fill(w uint16, n int) // Fill passes a word n times (16-bit word size).

	Err(clear bool) error // Err returns and clears internal error variable.
}

DCI stands for Display Controller Interface / Data and Control Interface.

type Display

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

func MakeDisplay

func MakeDisplay(dci DCI, width, height int) Display

MakeDisplay returns initialised Display value.

func NewDisplay

func NewDisplay(dci DCI, width, height int) *Display

NewDisplay works like MakeDisplay but returns a pointer to the heap allocated variable.

func (*Display) Area

func (d *Display) Area(r image.Rectangle) Area

func (*Display) Bounds

func (d *Display) Bounds() image.Rectangle

Bounds returns the bounds of the display

func (*Display) DCI

func (d *Display) DCI() DCI

DCI allows to direct access to the internal DCI.

func (*Display) DispOn

func (d *Display) DispOn()

DispOn invokes Display ON command (8-bit).

func (*Display) Err

func (d *Display) Err(clear bool) error

Err returns and clears internal error variable.

func (*Display) MADCtl

func (d *Display) MADCtl(mad MAD)

MADCtl invokes Memory Access Control command (8-bit).

func (*Display) NewArea

func (d *Display) NewArea(r image.Rectangle) *Area

func (*Display) PixSet

func (d *Display) PixSet(pf PixFmt)

PixSet invokes Pixel Format Set command (8-bit).

func (*Display) Reset

func (d *Display) Reset()

Reset invokes Software Reset command (8-bit).

func (*Display) SetWordSize

func (d *Display) SetWordSize(size int)

SetWordSize changes the data word size.

func (*Display) SlpIn

func (d *Display) SlpIn()

SlpIn invokes Enter Sleep Mode command (8-bit).

func (*Display) SlpOut

func (d *Display) SlpOut()

SlpOut invokes Sleep Out command (8-bit). SlpOut usually requires 120 ms delay before next command.

type Font

type Font struct {
}

type MAD

type MAD byte

MAD is a bitmask that describes memory access direction.

const (
	MH  MAD = 1 << 2 // Horizontal refresh order.
	BGR MAD = 1 << 3 // RGB-BGR order.
	ML  MAD = 1 << 4 // Vertical refresh order.
	MV  MAD = 1 << 5 // Row/column exchange.
	MX  MAD = 1 << 6 // Column address order.
	MY  MAD = 1 << 7 // Row address order.
)

type PixFmt

type PixFmt byte

PixFmt describes pixel format.

const (
	PF16 PixFmt = 0x55 // 16-bit 565 pixel format.
	PF18 PixFmt = 0x66 // 18-bit 666 pixel format.
)

type TextWriter

type TextWriter struct {
	// contains filtered or unexported fields
}

TextWriter allows to write a text on the display.

func (*TextWriter) Pos

func (w *TextWriter) Pos() image.Point

func (*TextWriter) SetColor

func (w *TextWriter) SetColor(c color.Color)

func (*TextWriter) SetColorRGB

func (w *TextWriter) SetColorRGB(r, g, b byte)

func (*TextWriter) SetPos

func (w *TextWriter) SetPos(p image.Point)

func (*TextWriter) Write

func (w *TextWriter) Write(s []byte) (int, error)

func (*TextWriter) WriteString

func (w *TextWriter) WriteString(s string) (int, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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