Ultibo API
C/C++ API for Ultibo Core
Loading...
Searching...
No Matches
pitft28.h
Go to the documentation of this file.
1/*
2 * This file is part of the Ultibo project, https://ultibo.org/
3 *
4 * The MIT License (MIT)
5 *
6 * Copyright (c) 2026 Garry Wood <garry@softoz.com.au>
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 * THE SOFTWARE.
25 */
26#ifndef _ULTIBO_PITFT28_H
27#define _ULTIBO_PITFT28_H
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#include "ultibo/gpio.h"
34#include "ultibo/i2c.h"
35#include "ultibo/spi.h"
36#include "ultibo/framebuffer.h"
37#include "ultibo/touch.h"
38
40#define PITFT28_FRAMEBUFFER_DESCRIPTION "Adafruit PiTFT 2.8\" LCD"
41
42#define PITFT28_SIGNATURE 0xAF000028
43
44#define PITFT28_SCREEN_WIDTH 240
45#define PITFT28_SCREEN_HEIGHT 320
46
48#define PITFT28_LCD_DC GPIO_PIN_25
49#define PITFT28_TOUCH_IRQ GPIO_PIN_24
50
51#define PITFT28_LCD_BL GPIO_PIN_2
52
54typedef struct _PITFT28LCD PITFT28LCD;
66
68
80HANDLE STDCALL pitft28_start(uint32_t rotation, char *device, uint16_t displayselect, uint16_t touchselect);
81
92HANDLE STDCALL pitft28_resistive_start(uint32_t rotation, char *device, uint16_t displayselect, uint16_t touchselect);
93
105HANDLE STDCALL pitft28_capacitive_start(uint32_t rotation, char *spidevice, char *i2cdevice, uint16_t displayselect, uint16_t touchaddress);
106
113
114#ifdef __cplusplus
115}
116#endif
117
118#endif // _ULTIBO_PITFT28_H
struct _FRAMEBUFFER_DEVICE FRAMEBUFFER_DEVICE
Definition framebuffer.h:112
size_t HANDLE
Definition globaltypes.h:51
#define STDCALL
Definition globaltypes.h:45
_Bool BOOL
Built in Boolean type (1 byte) (Redeclared here for flexibility).
Definition globaltypes.h:55
struct _GPIO_DEVICE GPIO_DEVICE
Forward declared for GPIOPin.
Definition gpio.h:85
struct _I2C_DEVICE I2C_DEVICE
Definition i2c.h:81
struct _PITFT28LCD PITFT28LCD
Definition pitft28.h:54
HANDLE STDCALL pitft28_resistive_start(uint32_t rotation, char *device, uint16_t displayselect, uint16_t touchselect)
Start the PiTFT28 driver and register the resistive Touch, Backlight (GPIO) and Framebuffer devices a...
HANDLE STDCALL pitft28_capacitive_start(uint32_t rotation, char *spidevice, char *i2cdevice, uint16_t displayselect, uint16_t touchaddress)
Start the PiTFT28 driver and register the capacitive Touch and Framebuffer devices associated with th...
HANDLE STDCALL pitft28_start(uint32_t rotation, char *device, uint16_t displayselect, uint16_t touchselect)
Start the PiTFT28 driver and register the Touch, Backlight (GPIO) and Framebuffer devices associated ...
BOOL STDCALL pitft28_stop(HANDLE handle)
Stop the PiTFT28 driver and deregister the Touch, Backlight (GPIO) and Framebuffer devices associated...
struct _SPI_DEVICE SPI_DEVICE
Definition spi.h:108
Definition pitft28.h:56
GPIO_DEVICE * gpio
GPIO device for this display.
Definition pitft28.h:61
I2C_DEVICE * i2c
I2C device for this display.
Definition pitft28.h:60
FRAMEBUFFER_DEVICE * framebuffer
Framebuffer (ILI9340) device for this display.
Definition pitft28.h:64
GPIO_DEVICE * backlight
Backlight GPIO (STMPE) device for this display.
Definition pitft28.h:63
uint32_t signature
Signature for entry validation.
Definition pitft28.h:57
uint32_t rotation
Framebuffer rotation (eg FRAMEBUFFER_ROTATION_180).
Definition pitft28.h:58
TOUCH_DEVICE * touch
Touch (STMPE or FT6236) device for this display.
Definition pitft28.h:62
SPI_DEVICE * spi
SPI device for this display.
Definition pitft28.h:59
struct _TOUCH_DEVICE TOUCH_DEVICE
Definition touch.h:151