Unit PiTFT28

From Ultibo.org
Jump to: navigation, search

Return to Unit Reference


Description


Adafruit PiTFT 2.8" LCD Driver unit

The Adafruit PiTFT 2.8" and PiTFT 3.2" LCD is a 320 x 240 pixel TFT with resistive touchscreen using an ILITEK ILI9340 driver and a STMicroelectronics STMPE610 resistive touchscreen controller. There is also a version available that includes a capacitive touchscreen using the Focaltech FT6236 controller.

This unit ties together the various components needed to make one of these boards work with Ultibo by finding the correct SPI or I2C device, creating the STMPE610 or FT6236 Touch device, creating the ILI9340 Framebuffer device and registering all of it with the correct parameters for the Adafruit board.

Details:

ILI9340

Width: 240

Height: 320

SPI Mode: 0

SPI Frequency: 32000000

SPI Chip Select: SPI_CS_0

DC GPIO: GPIO_PIN_25 (Pull: GPIO_PULL_NONE)

RST GPIO: GPIO_PIN_UNKNOWN

Backlight GPIO: GPIO_PIN_2 (STMPE GPIO)

STMPE (Resistive touch)

Chip: STMPE_CHIP_610

SPI Mode: 0

SPI Frequency: 500000

SPI Chip Select: SPI_CS_1

IRQ GPIO: GPIO_PIN_24 (Trigger: GPIO_TRIGGER_FALLING)(Pull: GPIO_PULL_UP)

FT6236 (Capacitive touch)

I2C Address: 0x38

IRQ GPIO: GPIO_PIN_24 (Trigger: GPIO_TRIGGER_FALLING)(Pull: GPIO_PULL_UP)

Switches

SW1 GPIO: GPIO_PIN_22

SW2 GPIO: GPIO_PIN_27

SW3 GPIO: GPIO_PIN_17

SW4 GPIO: GPIO_PIN_23

Constants



[Expand]
PiTFT28 specific constants PITFT28_*


[Expand]
PiTFT28 GPIO PITFT28_LCD_*


Type definitions



PiTFT28 specific types

[Expand]

PPiTFT28LCD = ^TPiTFT28LCD;

TPiTFT28LCD = record


Public variables



PiTFT28 specific variables

PITFT28_SPI_DEVICE:String = 'SPI0';
PITFT28_LCD_CHIPSELECT:Word = SPI_CS_0;
PITFT28_TOUCH_CHIPSELECT:Word = SPI_CS_1;
PITFT28_I2C_DEVICE:String = 'I2C0';
PITFT28_TOUCH_ADDRESS:Word = $38;


Function declarations



Initialization functions

[Expand]
procedure PiTFT28Init;
Description: Initialize the PiTFT28 unit and parameters


[Expand]
function PiTFT28Start(Rotation:LongWord; const Device:String; DisplaySelect,TouchSelect:Word):THandle; inline;
Description: Start the PiTFT28 driver and register the Touch, Backlight (GPIO) and Framebuffer devices associated with the display


[Expand]
function PiTFT28ResistiveStart(Rotation:LongWord; const Device:String; DisplaySelect,TouchSelect:Word):THandle;
Description: Start the PiTFT28 driver and register the resistive Touch, Backlight (GPIO) and Framebuffer devices associated with the display


[Expand]
function PiTFT28CapacitiveStart(Rotation:LongWord; const SPIDevice,I2CDevice:String; DisplaySelect,TouchAddress:Word):THandle;
Description: Start the PiTFT28 driver and register the capacitive Touch and Framebuffer devices associated with the display


[Expand]
function PiTFT28Stop(Handle:THandle):Boolean;
Description: Stop the PiTFT28 driver and deregister the Touch, Backlight (GPIO) and Framebuffer devices associated with the display


Return to Unit Reference