Basically i glued Peter Drescher and Simon Ford libs in a GraphicsDisplay class, then derived TFT or LCD class (which inherits Protocols class), then the most derived ones (Inits), which are per-display and are the only part needed to be adapted to diff hw.

Fork of UniGraphic by GraphicsDisplay

Embed: (wiki syntax)

« Back to documentation index

Protocols Class Reference

Protocols Class Reference

Abstract interface class for spi and parallel protocols. More...

#include <Protocols.h>

Inherited by BUS16, BUS8, PAR16, PAR8, SPI16, and SPI8.

Public Member Functions

virtual void wr_cmd8 (unsigned char cmd)=0
 Send 8bit command to display controller.
virtual void wr_data8 (unsigned char data)=0
 Send 8bit data to display controller.
virtual void wr_cmd16 (unsigned short cmd)=0
 Send 2x8bit command to display controller.
virtual void wr_data16 (unsigned short data)=0
 Send 2x8bit data to display controller.
virtual void wr_gram (unsigned short data)=0
 Send 16bit pixeldata to display controller.
virtual void wr_gram (unsigned short data, unsigned int count)=0
 Send same 16bit pixeldata to display controller multiple times.
virtual void wr_grambuf (unsigned short *data, unsigned int lenght)=0
 Send array of pixeldata shorts to display controller.
virtual unsigned short rd_gram (bool convert)=0
 Read 16bit pixeldata from display controller (with dummy cycle)
virtual unsigned int rd_reg_data32 (unsigned char reg)=0
 Read 4x8bit register data (with dummy cycle)
virtual unsigned int rd_extcreg_data32 (unsigned char reg, unsigned char SPIreadenablecmd)=0
 Read 3x8bit ExtendedCommands register data.
virtual void dummyread ()=0
 ILI932x specific, does a dummy read cycle, number of bits is protocol dependent for PAR protocols: a signle RD bit toggle for SPI8: 8clocks for SPI16: 16 clocks.
virtual void reg_select (unsigned char reg, bool forread=false)=0
 ILI932x specific, select register for a successive write or read.
virtual void reg_write (unsigned char reg, unsigned short data)=0
 ILI932x specific, write register with data.
virtual unsigned short reg_read (unsigned char reg)=0
 ILI932x specific, read register.
virtual void hw_reset ()=0
 HW reset sequence (without display init commands)
virtual void BusEnable (bool enable)=0
 Set ChipSelect high or low.

Detailed Description

Abstract interface class for spi and parallel protocols.

Definition at line 32 of file Protocols.h.


Member Function Documentation

virtual void BusEnable ( bool  enable ) [pure virtual]

Set ChipSelect high or low.

Parameters:
enable0/1

Implemented in BUS16, BUS8, PAR16, PAR8, SPI16, and SPI8.

virtual void dummyread (  ) [pure virtual]

ILI932x specific, does a dummy read cycle, number of bits is protocol dependent for PAR protocols: a signle RD bit toggle for SPI8: 8clocks for SPI16: 16 clocks.

Implemented in BUS16, BUS8, PAR16, PAR8, SPI16, and SPI8.

virtual void hw_reset (  ) [pure virtual]

HW reset sequence (without display init commands)

Implemented in BUS16, BUS8, PAR16, PAR8, SPI16, and SPI8.

virtual unsigned int rd_extcreg_data32 ( unsigned char  reg,
unsigned char  SPIreadenablecmd 
) [pure virtual]

Read 3x8bit ExtendedCommands register data.

Parameters:
regthe register to read
SPIreadenablecmdvendor/device specific cmd to read EXTC registers
Returns:
data as uint
Note:
EXTC regs (0xB0 to 0xFF) are read/write registers but needs special cmd to be read in SPI mode

Implemented in BUS16, BUS8, PAR16, PAR8, SPI16, and SPI8.

virtual unsigned short rd_gram ( bool  convert ) [pure virtual]

Read 16bit pixeldata from display controller (with dummy cycle)

Parameters:
converttrue/false. Convert 18bit to 16bit, some controllers returns 18bit
Returns:
16bit color

Implemented in BUS16, BUS8, PAR16, PAR8, SPI16, and SPI8.

virtual unsigned int rd_reg_data32 ( unsigned char  reg ) [pure virtual]

Read 4x8bit register data (with dummy cycle)

Parameters:
regthe register to read
Returns:
data as uint

Implemented in BUS16, BUS8, PAR16, PAR8, SPI16, and SPI8.

virtual unsigned short reg_read ( unsigned char  reg ) [pure virtual]

ILI932x specific, read register.

Parameters:
regregister to be read
Returns:
16bit register value

Implemented in BUS16, BUS8, PAR16, PAR8, SPI16, and SPI8.

virtual void reg_select ( unsigned char  reg,
bool  forread = false 
) [pure virtual]

ILI932x specific, select register for a successive write or read.

Parameters:
regregister to be selected
forreadfalse = a write next (default), true = a read next
Note:
forread only used by SPI protocols

Implemented in BUS16, BUS8, PAR16, PAR8, SPI16, and SPI8.

virtual void reg_write ( unsigned char  reg,
unsigned short  data 
) [pure virtual]

ILI932x specific, write register with data.

Parameters:
regregister to write
data16bit data

Implemented in BUS16, BUS8, PAR16, PAR8, SPI16, and SPI8.

virtual void wr_cmd16 ( unsigned short  cmd ) [pure virtual]

Send 2x8bit command to display controller.

Parameters:
cmd,:halfword to send

Implemented in BUS16, BUS8, PAR16, PAR8, SPI16, and SPI8.

virtual void wr_cmd8 ( unsigned char  cmd ) [pure virtual]

Send 8bit command to display controller.

Parameters:
cmd,:byte to send

Implemented in BUS16, BUS8, PAR16, PAR8, SPI16, and SPI8.

virtual void wr_data16 ( unsigned short  data ) [pure virtual]

Send 2x8bit data to display controller.

Parameters:
data,:halfword to send

Implemented in BUS16, BUS8, PAR16, PAR8, SPI16, and SPI8.

virtual void wr_data8 ( unsigned char  data ) [pure virtual]

Send 8bit data to display controller.

Parameters:
data,:byte to send

Implemented in BUS16, BUS8, PAR16, PAR8, SPI16, and SPI8.

virtual void wr_gram ( unsigned short  data ) [pure virtual]

Send 16bit pixeldata to display controller.

Parameters:
data,:halfword to send

Implemented in BUS16, BUS8, PAR16, PAR8, SPI16, and SPI8.

virtual void wr_gram ( unsigned short  data,
unsigned int  count 
) [pure virtual]

Send same 16bit pixeldata to display controller multiple times.

Parameters:
data,:halfword to send
count,:how many

Implemented in BUS16, BUS8, PAR16, PAR8, SPI16, and SPI8.

virtual void wr_grambuf ( unsigned short *  data,
unsigned int  lenght 
) [pure virtual]

Send array of pixeldata shorts to display controller.

Parameters:
data,:unsigned short pixeldata array
lenght,:lenght (in shorts)

Implemented in BUS16, BUS8, PAR16, PAR8, SPI16, and SPI8.