ssd1351

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package ssd1351 provides driver to SSD1351 based displays.

Index

Constants

View Source
const (
	CASET   = epson.CASET  // Set Column Address
	PASET   = epson.PASET  // Set Row Address
	RAMWR   = epson.RAMWR  // Write RAM Command
	RAMRD   = epson.RAMRD  // Read RAM Command
	RMCD    = 0xA0         // Set Re-map & Color Depth
	VSCSAD  = 0xA1         // Set Display Start Line
	DOFFSET = 0xA2         // Set Display Offset
	DISBLK  = 0xA4         // Set Entire Display Black
	DISWHT  = 0xA5         // Set Entire Display White
	DISNOR  = epson.DISNOR // Set Normal Display
	DISINV  = epson.DISINV // Set Inverse Display
	FUNCSEL = 0xAB         // Set Function selection
	SLPIN   = epson.DISOFF // Set Sleep mode ON
	SLPOUT  = epson.DISON  // Set Sleep mode OFF
	PHALEN  = 0xB1         // Set Phase Length (pase 1 and 2)
	DENH    = 0xB2         // Display Enhancement
	CLKDIV  = 0xB3         // Set Front Clock Divider / Oscillator Freq
	VSL     = 0xB4         // Set Segment Low Voltage
	GPIO    = 0xB5         // Set GPIO
	PHA3LEN = 0xB6         // Set Second Pre-charge period (phase 3)
	GRAYLUT = 0xB8         // Look Up Table for Gray Scale Pulse width
	LINLUT  = 0xB9         // Use Built-in Linear LUT
	VPREC   = 0xBB         // Set Pre-charge voltage
	VCOMH   = 0xBE         // Set VCOMH Voltage
	CCABC   = 0xC1         // Set Contrast Current for Color A,B,C
	MCCC    = 0xC7         // Master Contrast Current Control
	MUXR    = 0xCA         // Set Multiplex Ratio
	CMDLCK  = 0xFD         // Set Command Lock
)

SSD1351 commands

View Source
const (
	VAI       = 1 << 0 // Vertical (instead of horizontal) address increment
	C127_SEG0 = 1 << 1 // Column address 127 (instead of 0) is mapped to SEG0
	CBA       = 1 << 2 // CBA (intead of ABC) color sequence
	COMn_COM0 = 1 << 4 // COM[n-1] to COM0 scan (instead of COM0 to COM[n-1])
	COMSplit  = 1 << 5 // Enable COM Split Odd Even
	CF2       = 1 << 6 // color format 2
	RGB18     = 1 << 7 // 18-bit 666 pixel format (instead of 16-bit 565)
)

RMCD arguments

View Source
const (
	MaxSPIWriteClock = 4_500_000
	MaxSPIReadClock  = 6_700_000
)

The maximum SPI clock is 4.5 MHz. In practice the controller seems to work fine with 20 MHz SPI clock and it was the maximum allowed clock in the revision 1.3 of the datasheet. The performance of a particular SPI bus depends on many factors which can probably be tuned for even higher speeds. The absolute upper limits are those given for the parallel interface.

View Source
const (
	MaxParallelWriteClock = 3_300_000
	MaxParallelReadClock  = 3_100_000
)

The maximum speed of the 18/16/8-bit paraler interface is 3.3 MHz for writing and 3.1 Mhz for reading. This corresponds to the maximum bandwidth of 60 Mb/s and 56 Mb/s respectively (18-bit interface).

Variables

View Source
var GFX = []byte{
	100, ms,
	CMDLCK, 1, 0x12,
	CMDLCK, 1, 0xB1,
	SLPIN, 0,
	CLKDIV, 1, 0xF1,
	MUXR, 1, 127,
	DOFFSET, 1, 0,
	GPIO, 1, 0,
	FUNCSEL, 1, 0x01,
	PHALEN, 1, 0x32,
	VCOMH, 1, 0x05,
	DISNOR, 0,
	CCABC, 3, 0xC8, 0x80, 0xC8,
	MCCC, 1, 0x0F,
	VSL, 3, 0xA0, 0xB5, 0x55,
	PHA3LEN, 1, 0x01,
	SLPOUT, 0,
	RMCD, 1, COMSplit | COMn_COM0 | CBA,
}

GFX contains initialization commands taken from Adafruit GFX library.

View Source
var UG2828GDEDF11 = []byte{}/* 130 elements not displayed */

UG2828GDEDF11 contains the initialization commands taken from the documentation of UG-2828GDEDF11 1.5" 128x128 RGB OLED. This display is used by Waveshare and probably by Adafruit 1.5" RGB OLED modules.

Functions

func New

func New(dci tftdrv.DCI) *tftdrv.Driver

Types

This section is empty.

Jump to

Keyboard shortcuts

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