Ultibo API
C/C++ API for Ultibo Core
Loading...
Searching...
No Matches
ili9486.h File Reference
#include "ultibo/gpio.h"
#include "ultibo/spi.h"
#include "ultibo/framebuffer.h"
#include "ultibo/tftframebuffer.h"

Go to the source code of this file.

Data Structures

struct  _ILI9486_FRAMEBUFFER

Macros

#define ILI9486_FRAMEBUFFER_DESCRIPTION   "ILITEK ILI9486 TFT LCD"
 Description of ILI9486 device.
#define ILI9486_SPI_RATE   32000000
 Default SPI clock rate.
#define ILI9486_CMD_NOP   0x00
 8.2.1. NOP: No Operation
#define ILI9486_CMD_SWRESET   0x01
 8.2.2. SWRESET: Software Reset
#define ILI9486_CMD_SLPOUT   0x11
 8.2.13. SLPOUT: Sleep Out (This command turns off sleep mode)
#define ILI9486_CMD_DISPOFF   0x28
 8.2.18. DISPOFF: Display OFF (This command is used to enter into DISPLAY OFF mode. In this mode, the output from Frame Memory is disabled and blank page inserted)
#define ILI9486_CMD_DISPON   0x29
 8.2.19. DISPON: Display ON (This command is used to recover from DISPLAY OFF mode. Output from the Frame Memory is enabled)
#define ILI9486_CMD_CASET   0x2A
 8.2.20. CASET: Column Address Set (This command is used to define area of frame memory where MCU can access)
#define ILI9486_CMD_PASET   0x2B
 8.2.21. PASET: Page Address Set (This command is used to define area of frame memory where MCU can access)
#define ILI9486_CMD_RAMWR   0x2C
 8.2.22. Memory Write (This command is used to transfer data from MCU to frame memory)
#define ILI9486_CMD_MADCTL   0x36
 8.2.28. MADCTL: Memory Access Control (This command defines read/write scanning direction of frame memory)
#define ILI9486_CMD_COLMOD   0x3A
 8.2.32. COLMOD: Pixel Format Set (This command sets the pixel format for the RGB image data used by the interface)
#define ILI9486_CMD_IFMODE   0xB0
 8.2.50. IFMODE : Interface Mode Control
#define ILI9486_CMD_FRMCTR1   0xB1
 8.2.51. FRMCTR1: Frame Rate Control (In Normal Mode/Full Colors)
#define ILI9486_CMD_DISCTRL   0xB6
 8.2.56. DISCTRL: Display Function Control
#define ILI9486_CMD_PWCTRL1   0xC0
 8.2.58. PWCTRL1: Power Control 1
#define ILI9486_CMD_PWCTRL2   0xC1
 8.2.59. PWCTRL2: Power Control 2
#define ILI9486_CMD_PWCTRL3   0xC2
 8.2.60. PWCTRL3: Power Control 3 (For Normal Mode)
#define ILI9486_CMD_VMCTRL1   0xC5
 8.2.63. VMCTRL1: VCOM Control 1
#define ILI9486_CMD_PGAMCTRL   0xE0
 8.2.77. PGAMCTRL: Positive Gamma Correction (Set the gray scale voltage to adjust the gamma characteristics of the TFT panel)
#define ILI9486_CMD_NGAMCTRL   0xE1
 8.2.78. NGAMCTRL: Negative Gamma Correction (Set the gray scale voltage to adjust the gamma characteristics of the TFT panel)
#define ILI9486_CMD_DGAMCTRL   0xE2
 8.2.79. DGAMCTRL: Digital Gamma Control 1 (Gamma Macro-adjustment registers for red gamma curve)
#define ILI9486_CMD_MADCTL_MY   0x80
 Row Address Order.
#define ILI9486_CMD_MADCTL_MX   0x40
 Column Address Order.
#define ILI9486_CMD_MADCTL_MV   0x20
 Row / Column Exchange.
#define ILI9486_CMD_MADCTL_ML   0x10
 Vertical Refresh Order.
#define ILI9486_CMD_MADCTL_RGB   0x00
 Colour selector switch control(0=RGB colour filter panel, 1=BGR colour filter panel).
#define ILI9486_CMD_MADCTL_BGR   0x08
#define ILI9486_CMD_MADCTL_MH   0x04
 Horizontal Refresh Order.

Typedefs

typedef struct _ILI9486_FRAMEBUFFER ILI9486_FRAMEBUFFER

Functions

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 framebuffer API.
uint32_t STDCALL ili9486_framebuffer_destroy (FRAMEBUFFER_DEVICE *framebuffer)
 Release, deregister and destroy an ILI9486 Framebuffer device created by this driver.

Macro Definition Documentation

◆ ILI9486_FRAMEBUFFER_DESCRIPTION

#define ILI9486_FRAMEBUFFER_DESCRIPTION   "ILITEK ILI9486 TFT LCD"

Description of ILI9486 device.

ILI9486 specific constants

◆ ILI9486_SPI_RATE

#define ILI9486_SPI_RATE   32000000

Default SPI clock rate.

ILI9486 SPI constants

◆ ILI9486_CMD_NOP

#define ILI9486_CMD_NOP   0x00

8.2.1. NOP: No Operation

ILI9486 Command constants

◆ ILI9486_CMD_SWRESET

#define ILI9486_CMD_SWRESET   0x01

8.2.2. SWRESET: Software Reset

◆ ILI9486_CMD_SLPOUT

#define ILI9486_CMD_SLPOUT   0x11

8.2.13. SLPOUT: Sleep Out (This command turns off sleep mode)

◆ ILI9486_CMD_DISPOFF

#define ILI9486_CMD_DISPOFF   0x28

8.2.18. DISPOFF: Display OFF (This command is used to enter into DISPLAY OFF mode. In this mode, the output from Frame Memory is disabled and blank page inserted)

◆ ILI9486_CMD_DISPON

#define ILI9486_CMD_DISPON   0x29

8.2.19. DISPON: Display ON (This command is used to recover from DISPLAY OFF mode. Output from the Frame Memory is enabled)

◆ ILI9486_CMD_CASET

#define ILI9486_CMD_CASET   0x2A

8.2.20. CASET: Column Address Set (This command is used to define area of frame memory where MCU can access)

◆ ILI9486_CMD_PASET

#define ILI9486_CMD_PASET   0x2B

8.2.21. PASET: Page Address Set (This command is used to define area of frame memory where MCU can access)

◆ ILI9486_CMD_RAMWR

#define ILI9486_CMD_RAMWR   0x2C

8.2.22. Memory Write (This command is used to transfer data from MCU to frame memory)

◆ ILI9486_CMD_MADCTL

#define ILI9486_CMD_MADCTL   0x36

8.2.28. MADCTL: Memory Access Control (This command defines read/write scanning direction of frame memory)

◆ ILI9486_CMD_COLMOD

#define ILI9486_CMD_COLMOD   0x3A

8.2.32. COLMOD: Pixel Format Set (This command sets the pixel format for the RGB image data used by the interface)

◆ ILI9486_CMD_IFMODE

#define ILI9486_CMD_IFMODE   0xB0

8.2.50. IFMODE : Interface Mode Control

◆ ILI9486_CMD_FRMCTR1

#define ILI9486_CMD_FRMCTR1   0xB1

8.2.51. FRMCTR1: Frame Rate Control (In Normal Mode/Full Colors)

◆ ILI9486_CMD_DISCTRL

#define ILI9486_CMD_DISCTRL   0xB6

8.2.56. DISCTRL: Display Function Control

◆ ILI9486_CMD_PWCTRL1

#define ILI9486_CMD_PWCTRL1   0xC0

8.2.58. PWCTRL1: Power Control 1

◆ ILI9486_CMD_PWCTRL2

#define ILI9486_CMD_PWCTRL2   0xC1

8.2.59. PWCTRL2: Power Control 2

◆ ILI9486_CMD_PWCTRL3

#define ILI9486_CMD_PWCTRL3   0xC2

8.2.60. PWCTRL3: Power Control 3 (For Normal Mode)

◆ ILI9486_CMD_VMCTRL1

#define ILI9486_CMD_VMCTRL1   0xC5

8.2.63. VMCTRL1: VCOM Control 1

◆ ILI9486_CMD_PGAMCTRL

#define ILI9486_CMD_PGAMCTRL   0xE0

8.2.77. PGAMCTRL: Positive Gamma Correction (Set the gray scale voltage to adjust the gamma characteristics of the TFT panel)

◆ ILI9486_CMD_NGAMCTRL

#define ILI9486_CMD_NGAMCTRL   0xE1

8.2.78. NGAMCTRL: Negative Gamma Correction (Set the gray scale voltage to adjust the gamma characteristics of the TFT panel)

◆ ILI9486_CMD_DGAMCTRL

#define ILI9486_CMD_DGAMCTRL   0xE2

8.2.79. DGAMCTRL: Digital Gamma Control 1 (Gamma Macro-adjustment registers for red gamma curve)

◆ ILI9486_CMD_MADCTL_MY

#define ILI9486_CMD_MADCTL_MY   0x80

Row Address Order.

ILI9486 Memory access control constants (See ILI9486 datasheet 8.2.28. Memory Access Control)

◆ ILI9486_CMD_MADCTL_MX

#define ILI9486_CMD_MADCTL_MX   0x40

Column Address Order.

◆ ILI9486_CMD_MADCTL_MV

#define ILI9486_CMD_MADCTL_MV   0x20

Row / Column Exchange.

◆ ILI9486_CMD_MADCTL_ML

#define ILI9486_CMD_MADCTL_ML   0x10

Vertical Refresh Order.

◆ ILI9486_CMD_MADCTL_RGB

#define ILI9486_CMD_MADCTL_RGB   0x00

Colour selector switch control(0=RGB colour filter panel, 1=BGR colour filter panel).

◆ ILI9486_CMD_MADCTL_BGR

#define ILI9486_CMD_MADCTL_BGR   0x08

◆ ILI9486_CMD_MADCTL_MH

#define ILI9486_CMD_MADCTL_MH   0x04

Horizontal Refresh Order.

Typedef Documentation

◆ ILI9486_FRAMEBUFFER

ILI9486 specific types

Function Documentation

◆ ili9486_framebuffer_create()

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 framebuffer API.

ILI9486 Functions

Parameters
SPIThe SPI device that this ILI9486 is connected to
ChipSelectThe SPI chip select to use when communicating with this device
NameThe text description of this device which will show in the device list (Optional)
RotationThe rotation value for the framebuffer device (eg FRAMEBUFFER_ROTATION_180)
WidthThe width of the framebuffer in pixels
HeightThe height of the framebuffer in pixels
RSTGPIO pin information for the Reset pin (Optional)
DCGPIO pin information for the Data/Command pin
BLGPIO pin information for the Backlight pin (Optional)
Returns
Pointer to the new Framebuffer device or nil if the framebuffer device could not be created

◆ ili9486_framebuffer_destroy()

uint32_t STDCALL ili9486_framebuffer_destroy ( FRAMEBUFFER_DEVICE * framebuffer)

Release, deregister and destroy an ILI9486 Framebuffer device created by this driver.

Parameters
FramebufferThe Framebuffer device to destroy
Returns
ERROR_SUCCESS if completed or another error code on failure