Unit PiTFT35

From Ultibo.org
Revision as of 01:19, 14 October 2016 by Ultibo (Talk | contribs)

Jump to: navigation, search

Return to Unit Reference


Description


The Adafruit PiTFT 3.5" LCD is a 480 x 320 pixel TFT with resistive touchscreen using a Himax HX8357 driver and a STMicroelectronics STMPE811 resistive touchscreen controller.

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

Details:

HX8357D

Width: 320

Height: 480

SPI Mode: 0

SPI Frequency: 42000000

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)

GPIO_PIN_18 (PWM)

STMPE

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)

Constants


To be documented

Type definitions


To be documented

Public variables


To be documented

Function declarations



Initialization functions

procedure PiTFT35Init;
Description: Initialize the PiTFT35 unit and parameters
Note Called only during system startup


function PiTFT35Start(Rotation:LongWord; const Device:String; DisplaySelect,TouchSelect:Word):THandle;
Description: Start the PiTFT35 driver and register the Touch, Backlight (GPIO) and Framebuffer devices associated with the display
Rotation The rotation of the display (eg FRAMEBUFFER_ROTATION_180)
Device The SPI device that the HX8357D and STMPE610 devices are connected to
DisplaySelect The SPI chip select of the HX8357D LCD controller
TouchSelect The SPI chip select of the STMPE610 touch controller
Return The handle of the PiTFT35 on success or INVALID_HANDLE_VALUE on failure
Note This function will be called during startup if the parameter PITFT35_AUTOSTART is True

Can be called multiple times to support more than one PiTFT LCD display


function PiTFT35Stop(Handle:THandle):Boolean;
Description: Stop the PiTFT35 driver and deregister the Touch, Backlight (GPIO) and Framebuffer devices associated with the display
Handle The handle of the PiTFT35 or INVALID_HANDLE_VALUE for the default display
Return True if completed or False on failure


Return to Unit Reference