Documentation
¶
Overview ¶
Package gc9a01 implements a driver for the gc9a01 LCD round display
Datasheet: https://www.waveshare.com/w/upload/5/5e/GC9A01A.pdf
Index ¶
- Constants
- func RGBATo565(c color.RGBA) uint16
- type Config
- type Device
- func (d *Device) Command(command uint8)
- func (d *Device) Configure(cfg Config)
- func (d *Device) Data(data uint8)
- func (d *Device) Display() error
- func (d *Device) DrawFastHLine(x0, x1, y int16, c color.RGBA)
- func (d *Device) DrawFastVLine(x, y0, y1 int16, c color.RGBA)
- func (d *Device) EnableBacklight(enable bool)
- func (d *Device) FillRectangle(x, y, width, height int16, c color.RGBA) error
- func (d *Device) FillRectangleWithBuffer(x, y, width, height int16, buffer []color.RGBA) error
- func (d *Device) FillScreen(c color.RGBA)
- func (d *Device) InvertColors(invert bool)
- func (d *Device) IsBGR(bgr bool)
- func (d *Device) Reset()
- func (d *Device) Rx(command uint8, data []byte)
- func (d *Device) SetDeviceOrientation()
- func (d *Device) SetPixel(x, y int16, c color.RGBA)
- func (d *Device) SetScroll(line int16)
- func (d *Device) SetScrollArea(topFixedArea, bottomFixedArea int16)
- func (d *Device) Size() (w, h int16)
- func (d *Device) StopScroll()
- func (d *Device) Tx(data []byte, isCommand bool)
- type FrameRate
- type Orientation
Constants ¶
const ( NOP = 0x00 SWRESET = 0x01 RDDIDIF = 0x04 RDDST = 0x09 SLPIN = 0x10 SLPOUT = 0x11 PTLON = 0x12 NORON = 0x13 INVOFF = 0x20 INVON = 0x21 DISPOFF = 0x28 DISPON = 0x29 CASET = 0x2A RASET = 0x2B RAMWR = 0x2C PTLAR = 0x30 VSCRDEF = 0x33 TEOFF = 0x34 TEON = 0x35 MADCTR = 0x36 VSCRSADD = 0x37 IDMOFF = 0x38 IDMON = 0x39 COLMOD = 0x3A RMEMCON = 0x3C STTRSCL = 0x44 GTSCL = 0x45 WRDISBV = 0x51 WRCTRLD = 0x51 MADCTL_MY = 0x80 MADCTL_MX = 0x40 MADCTL_MV = 0x20 MADCTL_ML = 0x10 MADCTL_RGB = 0x00 MADCTL_BGR = 0x08 MADCTL_MH = 0x04 RDID1 = 0xDA RDID2 = 0xDB RDID3 = 0xDC RGBICTR = 0xB0 BLPCHCTRL = 0xB5 DISFNCTL = 0xB6 TECTL = 0xBA INTCTL = 0xBA FRMCTL = 0xE8 SPICTL = 0xE9 PWCTR1 = 0xC1 PWCTR2 = 0xC2 PWCTR3 = 0xC3 PWCTR4 = 0xC4 PWCTR7 = 0xC7 INTEN1 = 0xFE INTEN2 = 0xEF GMSET1 = 0xF0 GMSET2 = 0xF1 GMSET3 = 0xF2 GMSET4 = 0xF3 HORIZONTAL Orientation = 0 VERTICAL Orientation = 1 )
Registers
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Orientation Orientation RowOffset int16 ColumnOffset int16 FrameRate FrameRate VSyncLines int16 Width int16 Height int16 }
Config is the configuration for the display
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device wraps an SPI connection.
func (*Device) DrawFastHLine ¶
DrawFastHLine draws a horizontal line faster than using SetPixel
func (*Device) DrawFastVLine ¶
DrawFastVLine draws a vertical line faster than using SetPixel
func (*Device) EnableBacklight ¶
EnableBacklight enables or disables the backlight
func (*Device) FillRectangle ¶
FillRectangle fills a rectangle at a given coordinates with a color
func (*Device) FillRectangleWithBuffer ¶
FillRectangleWithBuffer fills buffer with a rectangle at a given coordinates.
func (*Device) FillScreen ¶
FillScreen fills the screen with a given color
func (*Device) InvertColors ¶
InvertColors inverts the colors of the screen
func (*Device) SetDeviceOrientation ¶
func (d *Device) SetDeviceOrientation()
Sets Device configuration for screen orientation using the initialzation values
func (*Device) SetScrollArea ¶
SetScrollArea sets an area to scroll with fixed top and bottom parts of the display.
func (*Device) StopScroll ¶
func (d *Device) StopScroll()
StopScroll returns the display to its normal state.