Ultibo API
C/C++ API for Ultibo Core
Loading...
Searching...
No Matches
pitft35.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_PITFT35_H
27#define _ULTIBO_PITFT35_H
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#include "ultibo/gpio.h"
34#include "ultibo/spi.h"
35#include "ultibo/pwm.h"
36#include "ultibo/framebuffer.h"
37#include "ultibo/touch.h"
38
40#define PITFT35_FRAMEBUFFER_DESCRIPTION "Adafruit PiTFT 3.5\" LCD"
41
42#define PITFT35_SIGNATURE 0xAF000035
43
44#define PITFT35_SCREEN_WIDTH 320
45#define PITFT35_SCREEN_HEIGHT 480
46
48#define PITFT35_LCD_DC GPIO_PIN_25
49#define PITFT35_TOUCH_IRQ GPIO_PIN_24
50
51#define PITFT35_LCD_BL GPIO_PIN_2
52#define PITFT35_LCD_BL_PWM GPIO_PIN_18
53
55typedef struct _PITFT35LCD PITFT35LCD;
66
68
79HANDLE STDCALL pitft35_start(uint32_t rotation, char *device, uint16_t displayselect, uint16_t touchselect);
80
87
88#ifdef __cplusplus
89}
90#endif
91
92#endif // _ULTIBO_PITFT35_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 _PITFT35LCD PITFT35LCD
Definition pitft35.h:55
BOOL STDCALL pitft35_stop(HANDLE handle)
Stop the PiTFT35 driver and deregister the Touch, Backlight (GPIO) and Framebuffer devices associated...
HANDLE STDCALL pitft35_start(uint32_t rotation, char *device, uint16_t displayselect, uint16_t touchselect)
Start the PiTFT35 driver and register the Touch, Backlight (GPIO) and Framebuffer devices associated ...
struct _SPI_DEVICE SPI_DEVICE
Definition spi.h:108
Definition pitft35.h:57
GPIO_DEVICE * gpio
GPIO device for this display.
Definition pitft35.h:61
FRAMEBUFFER_DEVICE * framebuffer
Framebuffer (HX8357D) device for this display.
Definition pitft35.h:64
GPIO_DEVICE * backlight
Backlight GPIO (STMPE) device for this display.
Definition pitft35.h:63
uint32_t signature
Signature for entry validation.
Definition pitft35.h:58
uint32_t rotation
Framebuffer rotation (eg FRAMEBUFFER_ROTATION_180).
Definition pitft35.h:59
TOUCH_DEVICE * touch
Touch (STMPE) device for this display.
Definition pitft35.h:62
SPI_DEVICE * spi
SPI device for this display.
Definition pitft35.h:60
struct _TOUCH_DEVICE TOUCH_DEVICE
Definition touch.h:151