Ultibo API
C/C++ API for Ultibo Core
Loading...
Searching...
No Matches
ili9486.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_ILI9486_H
27#define _ULTIBO_ILI9486_H
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#include "ultibo/gpio.h"
34#include "ultibo/spi.h"
35#include "ultibo/framebuffer.h"
37
39#define ILI9486_FRAMEBUFFER_DESCRIPTION "ILITEK ILI9486 TFT LCD"
40
42#define ILI9486_SPI_RATE 32000000
43
45#define ILI9486_CMD_NOP 0x00
46#define ILI9486_CMD_SWRESET 0x01
47
48#define ILI9486_CMD_SLPOUT 0x11
49
50#define ILI9486_CMD_DISPOFF 0x28
51#define ILI9486_CMD_DISPON 0x29
52
53#define ILI9486_CMD_CASET 0x2A
54#define ILI9486_CMD_PASET 0x2B
55#define ILI9486_CMD_RAMWR 0x2C
56
57#define ILI9486_CMD_MADCTL 0x36
58
59#define ILI9486_CMD_COLMOD 0x3A
60
61#define ILI9486_CMD_IFMODE 0xB0
62
63#define ILI9486_CMD_FRMCTR1 0xB1
64
65#define ILI9486_CMD_DISCTRL 0xB6
66
67#define ILI9486_CMD_PWCTRL1 0xC0
68#define ILI9486_CMD_PWCTRL2 0xC1
69#define ILI9486_CMD_PWCTRL3 0xC2
70
71#define ILI9486_CMD_VMCTRL1 0xC5
72
73#define ILI9486_CMD_PGAMCTRL 0xE0
74#define ILI9486_CMD_NGAMCTRL 0xE1
75#define ILI9486_CMD_DGAMCTRL 0xE2
76
78#define ILI9486_CMD_MADCTL_MY 0x80
79#define ILI9486_CMD_MADCTL_MX 0x40
80#define ILI9486_CMD_MADCTL_MV 0x20
81#define ILI9486_CMD_MADCTL_ML 0x10
82#define ILI9486_CMD_MADCTL_RGB 0x00
83#define ILI9486_CMD_MADCTL_BGR 0x08
84#define ILI9486_CMD_MADCTL_MH 0x04
85
89{
90 // TFT Properties
92 // ILI9486 Properties
93};
94
96
110FRAMEBUFFER_DEVICE * STDCALL ili9486_framebuffer_create(SPI_DEVICE *spi, uint16_t chipselect, char *name, uint32_t rotation, uint32_t width, uint32_t height, GPIO_INFO *rst, GPIO_INFO *dc, GPIO_INFO *bl);
111
118
119#ifdef __cplusplus
120}
121#endif
122
123#endif // _ULTIBO_ILI9486_H
struct _FRAMEBUFFER_DEVICE FRAMEBUFFER_DEVICE
Definition framebuffer.h:112
#define STDCALL
Definition globaltypes.h:45
struct _GPIO_INFO GPIO_INFO
Definition gpio.h:176
FRAMEBUFFER_DEVICE *STDCALL ili9486_framebuffer_create(SPI_DEVICE *spi, uint16_t chipselect, char *name, uint32_t rotation, uint32_t width, uint32_t height, GPIO_INFO *rst, GPIO_INFO *dc, GPIO_INFO *bl)
Create, register and allocate a new ILI9486 Framebuffer device which can be accessed using the frameb...
struct _ILI9486_FRAMEBUFFER ILI9486_FRAMEBUFFER
Definition ili9486.h:87
uint32_t STDCALL ili9486_framebuffer_destroy(FRAMEBUFFER_DEVICE *framebuffer)
Release, deregister and destroy an ILI9486 Framebuffer device created by this driver.
struct _SPI_DEVICE SPI_DEVICE
Definition spi.h:108
Definition ili9486.h:89
TFT_FRAMEBUFFER tft
Definition ili9486.h:91
struct _TFT_FRAMEBUFFER TFT_FRAMEBUFFER
Definition tftframebuffer.h:43