ili9341

package
v0.0.0-...-b952502 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2020 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	NumPixels = numHorzPixels * numVertPixels
)

Variables

View Source
var (
	Black       = RGB{R: 0x00, G: 0x00, B: 0x00}
	Navy        = RGB{R: 0x00, G: 0x00, B: 0x0F}
	DarkGreen   = RGB{R: 0x00, G: 0x1F, B: 0x00}
	DarkCyan    = RGB{R: 0x00, G: 0x1F, B: 0x0F}
	Maroon      = RGB{R: 0x0F, G: 0x00, B: 0x00}
	Purple      = RGB{R: 0x0F, G: 0x00, B: 0x0F}
	Olive       = RGB{R: 0x0F, G: 0x1F, B: 0x00}
	LightGrey   = RGB{R: 0x18, G: 0x30, B: 0x18}
	DarkGrey    = RGB{R: 0x0F, G: 0x1F, B: 0x0F}
	Blue        = RGB{R: 0x00, G: 0x00, B: 0x1F}
	Green       = RGB{R: 0x00, G: 0x3F, B: 0x00}
	Cyan        = RGB{R: 0x00, G: 0x3F, B: 0x1F}
	Red         = RGB{R: 0x1F, G: 0x00, B: 0x00}
	Magenta     = RGB{R: 0x1F, G: 0x00, B: 0x1F}
	Yellow      = RGB{R: 0x1F, G: 0x3F, B: 0x00}
	White       = RGB{R: 0x1F, G: 0x3F, B: 0x1F}
	Orange      = RGB{R: 0x1F, G: 0x29, B: 0x00}
	GreenYellow = RGB{R: 0x15, G: 0x3F, B: 0x05}
	Pink        = RGB{R: 0x1F, G: 0x00, B: 0x1F}
)

Functions

func Wheel

func Wheel() func() RGB

Types

type Config

type Config struct {
	PinCS  ft232h.Pin
	PinDC  ft232h.CPin
	PinRST ft232h.CPin
	Rotate Rotation
}

type Frame

type Frame struct {
	Origin Point
	Size   Size
}

func MakeFrame

func MakeFrame(x int, y int, w int, h int) Frame

func MakeFrameRect

func MakeFrameRect(x0 int, y0 int, x1 int, y1 int) Frame

type ILI9341

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

func New

func New(ft *ft232h.FT232H, config *Config) (*ILI9341, error)

func (*ILI9341) Clip

func (lcd *ILI9341) Clip(p Point) Point

func (*ILI9341) DrawBitmap16BPP

func (lcd *ILI9341) DrawBitmap16BPP(frame Frame, bmp []uint16) error

func (*ILI9341) DrawBitmap1BPP

func (lcd *ILI9341) DrawBitmap1BPP(fg RGB, bg RGB, frame Frame, bmp []uint8) error

func (*ILI9341) DrawBitmapRect16BPP

func (lcd *ILI9341) DrawBitmapRect16BPP(x int, y int, w int, h int, bmp []uint16) error

func (*ILI9341) DrawBitmapRect1BPP

func (lcd *ILI9341) DrawBitmapRect1BPP(fg RGB, bg RGB, x int, y int, w int, h int, bmp []uint8) error

func (*ILI9341) DrawPixel

func (lcd *ILI9341) DrawPixel(color RGB, x int, y int) error

func (*ILI9341) FillFrame

func (lcd *ILI9341) FillFrame(color RGB, frame Frame) error

func (*ILI9341) FillFrameRect

func (lcd *ILI9341) FillFrameRect(color RGB, x int, y int, w int, h int) error

func (*ILI9341) FillScreen

func (lcd *ILI9341) FillScreen(color RGB) error

func (*ILI9341) Init

func (lcd *ILI9341) Init() error

func (*ILI9341) Normalize

func (lcd *ILI9341) Normalize(f Frame) Frame

func (*ILI9341) Reset

func (lcd *ILI9341) Reset() error

func (*ILI9341) SendCommand

func (lcd *ILI9341) SendCommand(cmd uint8) error

func (*ILI9341) SendCommandData

func (lcd *ILI9341) SendCommandData(cmd uint8, data []uint8) error

func (*ILI9341) SendData

func (lcd *ILI9341) SendData(data []uint8) error

func (*ILI9341) SetFrame

func (lcd *ILI9341) SetFrame(frame Frame) error

func (*ILI9341) SetFrameRect

func (lcd *ILI9341) SetFrameRect(x0 int, y0 int, x1 int, y1 int) error

func (*ILI9341) Size

func (lcd *ILI9341) Size() Size

func (*ILI9341) WriteData

func (lcd *ILI9341) WriteData(data []uint8, start bool, stop bool) error

type Point

type Point struct {
	X int
	Y int
}

func MakePoint

func MakePoint(x int, y int) Point

type RGB

type RGB struct {
	R int16
	G int16
	B int16
}

func (RGB) Buffer

func (c RGB) Buffer(n uint) []uint8

func (*RGB) LSB

func (c *RGB) LSB() uint8

func (*RGB) MSB

func (c *RGB) MSB() uint8

func (*RGB) Pack

func (c *RGB) Pack() RGB16

type RGB16

type RGB16 uint16 // RGB 5-6-5 format

func (RGB16) Buffer

func (c RGB16) Buffer(n uint) []uint8

func (RGB16) LSB

func (c RGB16) LSB() uint8

func (RGB16) MSB

func (c RGB16) MSB() uint8

func (RGB16) Unpack

func (c RGB16) Unpack() RGB

type Rotation

type Rotation byte
const (
	// rotation indicates position of board pins when looking at the screen
	RotDown    Rotation = 0
	RotLeft    Rotation = 1
	RotUp      Rotation = 2
	RotRight   Rotation = 3
	RotDefault Rotation = RotDown
)

func (Rotation) MADCTL

func (r Rotation) MADCTL() byte

func (Rotation) Size

func (r Rotation) Size() Size

type Size

type Size struct {
	Width  int
	Height int
}

func MakeSize

func MakeSize(w int, h int) Size

Jump to

Keyboard shortcuts

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