ili9341

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package ili9341 provides driver to ILI9341 based displays.

Index

Constants

View Source
const (
	NOP       = philips.NOP     // No Operation
	SWRESET   = philips.SWRESET // Software Reset
	RDDIDIF   = philips.RDDIDIF // Read Display IdentificInformation
	RDDST     = philips.RDDST   // Read Display Status
	RDDPM     = 0x0A            // Read Display Power Mode
	RDDMADCTL = 0x0B            // Read Display MADCTL
	RDDCOLMOD = 0x0C            // Read Display Pixel Format
	RDDIM     = 0x0D            // Read Display Image Format
	RDDSM     = 0x0E            // Read Display Signal Mode
	RDDSDR    = 0x0F            // Read Display Self-Diagnostic Result
	SLPIN     = philips.SLPIN   // Enter Sleep Mode
	SLPOUT    = philips.SLPOUT  // Exit Sleep Mode
	PTLON     = philips.PTLON   // Partial Mode ON
	NORON     = philips.NORON   // Normal Display Mode ON
	DINVOFF   = philips.INVOFF  // Display Inversion OFF
	DINVON    = philips.INVON   // Display Inversion ON
	GAMSET    = 0x26            // Gamma Set
	DISPOFF   = philips.DISPOFF // Display OFF
	DISPON    = philips.DISPON  // Display ON
	CASET     = philips.CASET   // Column Address Set
	PASET     = philips.PASET   // Page Address Set
	RAMWR     = philips.RAMWR   // Memory Write
	RGBSET    = philips.RGBSET  // Color SET
	RAMRD     = philips.RAMRD   // Memory Read
	PLTAR     = philips.PTLAR   // Partial Area
	VSCRDEF   = philips.VSCRDEF // Vertical Scrolling Definition
	TEOFF     = philips.TEOFF   // Tearing Effect Line OFF
	TEON      = philips.TEON    // Tearing Effect Line ON
	MADCTL    = philips.MADCTL  // Memory Access Control
	VSCRSADD  = philips.SEP     // Vertical Scrolling Start Address
	IDMOFF    = philips.IDMOFF  // Idle Mode OFF
	IDMON     = philips.IDMON   // Idle Mode ON
	PIXSET    = philips.COLMOD  // Pixel Format Set
	RAMWRC    = 0x3C            // Memory Write Continue
	RAMRDC    = 0x3E            // Memory Read Continue
	TSCLSET   = 0x44            // Set Tear Scanline
	TSCLGET   = 0x45            // Get Scanline
	WRDISBV   = 0x51            // Write Display Brightness
	RDDISBV   = 0x52            // Read Display Brightness
	WRCTRLD   = 0x53            // Write CTRL Display
	RDCTRLD   = 0x54            // Read CTRL Display
	WRCABC    = 0x55            // Write Content Adaptive Brightness Ctrl
	RDCABC    = 0x56            // Read Content Adaptive Brightness Ctrl
	WRCABCMB  = 0x5E            // Write CABC Minimum Brightness
	RDCABCMB  = 0x5F            // Write CABC Minimum Brightness
	IFMODE    = 0xB0            // RGB Interface Signal Control
	FRMCTR1   = 0xB1            // Frame Control (In Normal Mode)
	FRMCTR2   = 0xB2            // Frame Control (In Idle Mode)
	FRMCTR3   = 0xB3            // Frame Control (In Partial Mode)
	INVTR     = 0xB4            // Display Inversion Control
	PRCTR     = 0xB5            // Blanking Porch Control
	DISCTRL   = 0xB6            // Display Function Control
	ETMOD     = 0xB7            // Entry Mode Set
	BLCTR1    = 0xB8            // Backlight Control 1
	BLCTR2    = 0xB9            // Backlight Control 2
	BLCTR3    = 0xBA            // Backlight Control 3
	BLCTR4    = 0xBB            // Backlight Control 4
	BLCTR5    = 0xBC            // Backlight Control 5
	BLCTR7    = 0xBE            // Backlight Control 7
	BLCTR8    = 0xBF            // Backlight Control 8
	PWCTR1    = 0xC0            // Power Control 1
	PWCTR2    = 0xC1            // Power Control 2
	VMCTR1    = 0xC5            // VCOM Control 1
	VMCTR2    = 0xC7            // VCOM Control 2
	PWCTRA    = 0xCB            // Power control A
	PWCTRB    = 0xCF            // Power control B
	NVMWR     = 0xD0            // NV Memory Write
	NVMPKEY   = 0xD1            // NV Memory Protection Key
	RDNVM     = 0xD2            // NV Memory Status Read
	RDID4     = 0xD3            // Read ID4
	RDID1     = philips.RDID1   // Read ID1
	RDID2     = philips.RDID2   // Read ID2
	RDID3     = philips.RDID3   // Read ID3
	PGAMCTRL  = 0xE0            // Positive Gamma Correction
	NGAMCTRL  = 0xE1            // Negative Gamma Correction
	DGAMCTRL1 = 0xE2            // Digital Gamma Control 1
	DGAMCTRL2 = 0xE3            // Digital Gamma Control 2
	DRVTIM    = 0xE8            // Driver timing control
	DRVTIMA   = 0xE9            // Driver timing control A
	DRVTIMB   = 0xEA            // Driver timing control B
	PONSEQ    = 0xED            // Power on sequence control
	SFD       = philips.SFD     // Set Factory Defaults (undocumented)
	IFCTL     = 0xF6            // Interface Contro
	EN3G      = 0xF2            // Enable 3G
	PUMPRT    = 0xF7            // Pump ratio control
)

ILI9341 commands

View Source
const (
	MH  = 1 << 2 // horizontal refresh order
	BGR = 1 << 3 // BGR color filter panel
	ML  = 1 << 4 // vertical refresh order
	MV  = 1 << 5 // row/column exchange
	MX  = 1 << 6 // column address order
	MY  = 1 << 7 // row address order
)

MADCTL arguments

View Source
const (
	MCU16 = 0x05 // set 16-bit 565 pixel format for MCU interface
	MCU18 = 0x06 // set 18-bit 666 pixel format for MCU interface
	RGB16 = 0x50 // set 16-bit 565 pixel format for RGB interface
	RGB18 = 0x60 // set 18-bit 666 pixel format for RGB interface
)

PIXSET arguments

View Source
const (
	MaxSPIWriteClock = 10_000_000
	MaxSPIReadClock  = 6_700_000
)

The maximum SPI clock is 10 MHz for writing and 6.7 MHz for reading. In practice the controller seems to work fine in both directions with 24 MHz SPI clock and some sources confirm good results even at 80 MHz for writing. 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 = 15_000_000
	MaxParallelReadClock  = 2_200_000
)

The maximum speed of the 18/16/9/8-bit paraller interface is 15 MHz for writing and 2.2 MHz for reading. This corresponds to the maximum bandwidth of 272 Mb/s and 40 Mb/s respectively (18-bit interface).

Variables

View Source
var GFX = []byte{}/* 114 elements not displayed */

GFX contains initialization commands taken from Adafruit GFX library.

View Source
var MSP2807 = []byte{}/* 108 elements not displayed */

MSP2807 contains initialization commands for MSP2807 module (QD-TFT2803) taken from http://www.lcdwiki.com/2.8inch_SPI_Module_ILI9341_SKU:MSP2807

Functions

func New

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

New returns a new tftdrv.Driver that implements pix.Driver interface. The returned driver works without reading the frame memory so the alpha blending is slow and reduced to 1-bit resolution. Use NewOver if the display supports reading pixel data and the full-fledged Porter-Duff composition is required.

func NewOver

func NewOver(dci tftdrv.DCI) *tftdrv.DriverOver

NewOver returns a new tftdrv.DriverOver that implements pix.Driver interface. The returned driver fully supports the draw.Over operator but requires reading pixel data from the frame memory. If the display has write-only interface use New instead.

Types

This section is empty.

Jump to

Keyboard shortcuts

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