Ultibo API
C/C++ API for Ultibo Core
Loading...
Searching...
No Matches
tftframebuffer.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_TFTFRAMEBUFFER_H
27#define _ULTIBO_TFTFRAMEBUFFER_H
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#include "ultibo/globaltypes.h"
34#include "ultibo/globalconst.h"
35#include "ultibo/framebuffer.h"
36#include "ultibo/gpio.h"
37#include "ultibo/spi.h"
38
40#define TFT_FRAMEBUFFER_FRAME_RATE_DEFAULT 20
41
44
48
50typedef uint32_t STDCALL (*tft_framebuffer_set_write_address_proc)(TFT_FRAMEBUFFER *framebuffer, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2);
51
52typedef uint32_t STDCALL (*tft_framebuffer_write_memory_proc)(TFT_FRAMEBUFFER *framebuffer, size_t address, uint32_t size);
53
82
84
90
96
102uint32_t STDCALL tft_framebuffer_mark(FRAMEBUFFER_DEVICE *framebuffer, uint32_t x, uint32_t y, uint32_t width, uint32_t height, uint32_t flags);
103
108uint32_t STDCALL tft_framebuffer_commit(FRAMEBUFFER_DEVICE *framebuffer, size_t address, uint32_t size, uint32_t flags);
109
115
117
118#ifdef __cplusplus
119}
120#endif
121
122#endif // _ULTIBO_TFTFRAMEBUFFER_H
struct _FRAMEBUFFER_DEVICE FRAMEBUFFER_DEVICE
Definition framebuffer.h:112
struct _FRAMEBUFFER_PROPERTIES FRAMEBUFFER_PROPERTIES
Definition framebuffer.h:85
int32_t LONGBOOL
Compatibility with FPC LongBool type (4 bytes).
Definition globaltypes.h:56
#define STDCALL
Definition globaltypes.h:45
HANDLE TIMER_HANDLE
Definition globaltypes.h:119
HANDLE MUTEX_HANDLE
Definition globaltypes.h:105
struct _GPIO_INFO GPIO_INFO
Definition gpio.h:176
struct _SPI_DEVICE SPI_DEVICE
Definition spi.h:108
Definition tftframebuffer.h:56
MUTEX_HANDLE lock
Lock for dirty region redraw.
Definition tftframebuffer.h:77
GPIO_INFO bl
The GPIO information for the backlight line.
Definition tftframebuffer.h:64
uint32_t width
Framebuffer Width in Pixels.
Definition tftframebuffer.h:71
tft_framebuffer_deinitialize_proc deinitialize
A device specific Deinitialize method (Optional).
Definition tftframebuffer.h:66
GPIO_INFO dc
The GPIO information for the data/command line.
Definition tftframebuffer.h:63
uint32_t height
Framebuffer Height in Pixels.
Definition tftframebuffer.h:72
uint16_t chipselect
The SPI chip select of the device.
Definition tftframebuffer.h:61
uint32_t framerate
Frame rate for display refresh (in Frames Per Second).
Definition tftframebuffer.h:79
tft_framebuffer_write_memory_proc writememory
A device specific WriteMemory method (Mandatory).
Definition tftframebuffer.h:69
LONGBOOL ready
If True timer should be enabled during Mark operation.
Definition tftframebuffer.h:76
tft_framebuffer_initialize_proc initialize
A device specific Initialize method (Optional).
Definition tftframebuffer.h:65
tft_framebuffer_set_write_address_proc setwriteaddress
A device specific SetWriteAddress method (Mandatory).
Definition tftframebuffer.h:68
FRAMEBUFFER_DEVICE framebuffer
Definition tftframebuffer.h:58
uint32_t transfersize
Maximum transfer size for the SPI device (or -1 if No Maximum).
Definition tftframebuffer.h:80
GPIO_INFO rst
The GPIO information for the reset line.
Definition tftframebuffer.h:62
uint32_t rotation
Framebuffer Rotation (eg FRAMEBUFFER_ROTATION_180).
Definition tftframebuffer.h:73
uint32_t dirtyy2
Last line of dirty region (or 0 if none dirty).
Definition tftframebuffer.h:75
SPI_DEVICE * spi
The SPI device this Framebuffer is connected to.
Definition tftframebuffer.h:60
tft_framebuffer_get_defaults_proc getdefaults
A device specific GetDefaults method (Mandatory).
Definition tftframebuffer.h:67
TIMER_HANDLE timer
Handle for dirty region redraw timer.
Definition tftframebuffer.h:78
uint32_t dirtyy1
First line of dirty region (or Height - 1 if none dirty).
Definition tftframebuffer.h:74
uint32_t STDCALL tft_framebuffer_allocate(FRAMEBUFFER_DEVICE *framebuffer, FRAMEBUFFER_PROPERTIES *properties)
Implementation of FramebufferDeviceAllocate API for TFT Framebuffer.
uint32_t STDCALL(* tft_framebuffer_get_defaults_proc)(TFT_FRAMEBUFFER *framebuffer, FRAMEBUFFER_PROPERTIES *properties, FRAMEBUFFER_PROPERTIES *defaults)
Definition tftframebuffer.h:49
struct _TFT_FRAMEBUFFER TFT_FRAMEBUFFER
Definition tftframebuffer.h:43
uint32_t STDCALL(* tft_framebuffer_set_write_address_proc)(TFT_FRAMEBUFFER *framebuffer, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2)
Definition tftframebuffer.h:50
uint32_t STDCALL(* tft_framebuffer_deinitialize_proc)(TFT_FRAMEBUFFER *framebuffer)
Definition tftframebuffer.h:47
uint32_t STDCALL tft_framebuffer_mark(FRAMEBUFFER_DEVICE *framebuffer, uint32_t x, uint32_t y, uint32_t width, uint32_t height, uint32_t flags)
Implementation of FramebufferDeviceMark API for TFT Framebuffer.
void STDCALL tft_framebuffer_update_display(TFT_FRAMEBUFFER *framebuffer)
Timer function for display dirty region redraw.
uint32_t STDCALL tft_framebuffer_release(FRAMEBUFFER_DEVICE *framebuffer)
Implementation of FramebufferDeviceRelease API for TFT Framebuffer.
uint32_t STDCALL tft_framebuffer_commit(FRAMEBUFFER_DEVICE *framebuffer, size_t address, uint32_t size, uint32_t flags)
Implementation of FramebufferDeviceCommit API for TFT Framebuffer.
uint32_t STDCALL(* tft_framebuffer_write_memory_proc)(TFT_FRAMEBUFFER *framebuffer, size_t address, uint32_t size)
Definition tftframebuffer.h:52
uint32_t STDCALL(* tft_framebuffer_initialize_proc)(TFT_FRAMEBUFFER *framebuffer, FRAMEBUFFER_PROPERTIES *defaults)
Definition tftframebuffer.h:46