Documentation ¶
Overview ¶
Package ssd1331 implements a driver for the SSD1331 TFT color displays.
Datasheet: https://www.crystalfontz.com/controllers/SolomonSystech/SSD1331/381/
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) 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) IsBGR(bgr bool)
- func (d *Device) SetContrast(contrastA, contrastB, contrastC uint8)
- func (d *Device) SetPixel(x int16, y int16, c color.RGBA)
- func (d *Device) Size() (w, h int16)
- func (d *Device) Tx(data []byte, isCommand bool)
- type Model
- type Rotation
Constants ¶
View Source
const ( DRAWLINE = 0x21 DRAWRECT = 0x22 FILL = 0x26 SETCOLUMN = 0x15 SETROW = 0x75 CONTRASTA = 0x81 CONTRASTB = 0x82 CONTRASTC = 0x83 MASTERCURRENT = 0x87 SETREMAP = 0xA0 STARTLINE = 0xA1 DISPLAYOFFSET = 0xA2 NORMALDISPLAY = 0xA4 DISPLAYALLON = 0xA5 DISPLAYALLOFF = 0xA6 INVERTDISPLAY = 0xA7 SETMULTIPLEX = 0xA8 SETMASTER = 0xAD DISPLAYOFF = 0xAE DISPLAYON = 0xAF POWERMODE = 0xB0 PRECHARGE = 0xB1 CLOCKDIV = 0xB3 PRECHARGEA = 0x8A PRECHARGEB = 0x8B PRECHARGEC = 0x8C PRECHARGELEVEL = 0xBB VCOMH = 0xBE )
Registers
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device wraps an SPI connection.
func (*Device) Display ¶
Display does nothing, there's no buffer as it might be too big for some boards
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) FillRectangle ¶
FillRectangle fills a rectangle at a given coordinates with a color
func (*Device) FillRectangleWithBuffer ¶
FillRectangle fills a rectangle at a given coordinates with a buffer
func (*Device) FillScreen ¶
FillScreen fills the screen with a given color
func (*Device) SetContrast ¶
SetContrast sets the three contrast values (A, B & C)
Click to show internal directories.
Click to hide internal directories.