Documentation ¶
Index ¶
- Constants
- type Area
- func (a *Area) Bounds() image.Rectangle
- func (a *Area) DrawCircle(p0 image.Point, r int)
- func (a *Area) DrawLine(p0, p1 image.Point)
- func (a *Area) DrawLine_(p0, p1 image.Point)
- func (a *Area) DrawPoint(p image.Point)
- func (a *Area) FillCircle(p0 image.Point, r int)
- func (a *Area) FillRect(r image.Rectangle)
- func (a *Area) P0() image.Point
- func (a *Area) SetColor(c color.Color)
- func (a *Area) SetColorRGB(r, g, b byte)
- func (a *Area) TextWriter(f *Font) TextWriter
- type DCI
- type Display
- func (d *Display) Area(r image.Rectangle) Area
- func (d *Display) Bounds() image.Rectangle
- func (d *Display) DCI() DCI
- func (d *Display) DispOn()
- func (d *Display) Err(clear bool) error
- func (d *Display) MADCtl(mad MAD)
- func (d *Display) NewArea(r image.Rectangle) *Area
- func (d *Display) PixSet(pf PixFmt)
- func (d *Display) Reset()
- func (d *Display) SetWordSize(size int)
- func (d *Display) SlpIn()
- func (d *Display) SlpOut()
- type Font
- type MAD
- type PixFmt
- type TextWriter
Constants ¶
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) DrawCircle ¶
DrawCircle draws empty circle. 16-bit command.
func (*Area) DrawLine ¶
DrawLine draws a line from p0 to p1 (including both points). 16-bit command.
func (*Area) DrawLine_ ¶
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) FillCircle ¶
FillCircle draws filled circle. 16-bit command.
func (*Area) SetColorRGB ¶
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 ¶
MakeDisplay returns initialised Display value.
func NewDisplay ¶
NewDisplay works like MakeDisplay but returns a pointer to the heap allocated variable.
func (*Display) SetWordSize ¶
SetWordSize changes the data word size.
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) WriteString ¶
func (w *TextWriter) WriteString(s string) (int, error)