Difference between revisions of "Unit PiTFT28"
Line 177: | Line 177: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Called only during system startup | | Called only during system startup | ||
|- | |- | ||
Line 189: | Line 189: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Rotation |
| The rotation of the display (eg FRAMEBUFFER_ROTATION_180) | | The rotation of the display (eg FRAMEBUFFER_ROTATION_180) | ||
|- | |- | ||
− | ! | + | ! Device |
| The SPI device that the ILI9340 and STMPE610 devices are connected to | | The SPI device that the ILI9340 and STMPE610 devices are connected to | ||
|- | |- | ||
− | ! | + | ! DisplaySelect |
| The SPI chip select of the ILI9340 LCD controller | | The SPI chip select of the ILI9340 LCD controller | ||
|- | |- | ||
− | ! | + | ! TouchSelect |
| The SPI chip select of the STMPE610 touch controller | | The SPI chip select of the STMPE610 touch controller | ||
|- | |- | ||
− | ! | + | ! Return |
| The handle of the PiTFT28 on success or INVALID_HANDLE_VALUE on failure | | The handle of the PiTFT28 on success or INVALID_HANDLE_VALUE on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| This function will be called during startup if the parameter PITFT28_AUTOSTART is True | | This function will be called during startup if the parameter PITFT28_AUTOSTART is True | ||
Can be called multiple times to support more than one PiTFT LCD display | Can be called multiple times to support more than one PiTFT LCD display | ||
Line 217: | Line 217: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Handle |
| The handle of the PiTFT28 or INVALID_HANDLE_VALUE for the default display | | The handle of the PiTFT28 or INVALID_HANDLE_VALUE for the default display | ||
|- | |- | ||
− | ! | + | ! Return |
| True if completed or False on failure | | True if completed or False on failure | ||
|- | |- |
Revision as of 04:37, 24 April 2018
Return to Unit Reference
Description
Adafruit PiTFT 2.8" LCD Driver unit
The Adafruit PiTFT 2.8" LCD is a 320 x 240 pixel TFT with resistive touchscreen using an ILITEK ILI9340 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 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
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)
Switches
SW1 GPIO: GPIO_PIN_22
SW2 GPIO: GPIO_PIN_27
SW3 GPIO: GPIO_PIN_17
SW4 GPIO: GPIO_PIN_23
Constants
PITFT28_*
PITFT28_FRAMEBUFFER_DESCRIPTION = 'Adafruit PiTFT 2.8" LCD';
|
Description of PiTFT28 device |
PITFT28_SIGNATURE = $AF000028;
|
|
PITFT28_SCREEN_WIDTH = 240;
|
|
PITFT28_SCREEN_HEIGHT = 320;
|
PITFT28_LCD_*
PITFT28_LCD_DC = GPIO_PIN_25;
|
|
PITFT28_TOUCH_IRQ = GPIO_PIN_24;
|
|
NAPITFT28_LCD_BL = GPIO_PIN_2;
|
STMPE GPIO |
Type definitions
PiTFT28 specific types
PPiTFT28LCD = ^TPiTFT28LCD;
TPiTFT28LCD = record
Signature:LongWord;
|
Signature for entry validation |
Rotation:LongWord;
|
Framebuffer rotation (eg FRAMEBUFFER_ROTATION_180) |
SPI:PSPIDevice;
|
SPI device for this display |
GPIO:PGPIODevice;
|
GPIO device for this display |
Touch:PTouchDevice;
|
Touch (STMPE) device for this display |
Backlight:PGPIODevice;
|
Backlight GPIO (STMPE) device for this display |
Framebuffer:PFramebufferDevice;
|
Framebuffer (ILI9340) device for this display |
Public variables
PiTFT28 specific variables
PITFT28_SPI_DEVICE:String = 'SPI0';
|
PITFT28_LCD_CHIPSELECT:Word = SPI_CS_0;
|
PITFT28_TOUCH_CHIPSELECT:Word = SPI_CS_1;
|
Function declarations
Initialization functions
procedure PiTFT28Init;
Note | Called only during system startup |
---|
function PiTFT28Start(Rotation:LongWord; const Device:String; DisplaySelect,TouchSelect:Word):THandle;
Rotation | The rotation of the display (eg FRAMEBUFFER_ROTATION_180) |
---|---|
Device | The SPI device that the ILI9340 and STMPE610 devices are connected to |
DisplaySelect | The SPI chip select of the ILI9340 LCD controller |
TouchSelect | The SPI chip select of the STMPE610 touch controller |
Return | The handle of the PiTFT28 on success or INVALID_HANDLE_VALUE on failure |
Note | This function will be called during startup if the parameter PITFT28_AUTOSTART is True
Can be called multiple times to support more than one PiTFT LCD display |
function PiTFT28Stop(Handle:THandle):Boolean;
Handle | The handle of the PiTFT28 or INVALID_HANDLE_VALUE for the default display |
---|---|
Return | True if completed or False on failure |
Return to Unit Reference