![]() |
Ultibo API
C/C++ API for Ultibo Core
|
#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. | |
| #define ILI9486_FRAMEBUFFER_DESCRIPTION "ILITEK ILI9486 TFT LCD" |
Description of ILI9486 device.
ILI9486 specific constants
| #define ILI9486_SPI_RATE 32000000 |
Default SPI clock rate.
ILI9486 SPI constants
| #define ILI9486_CMD_NOP 0x00 |
8.2.1. NOP: No Operation
ILI9486 Command constants
| #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.
ILI9486 Memory access control constants (See ILI9486 datasheet 8.2.28. Memory Access Control)
| #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.
| typedef struct _ILI9486_FRAMEBUFFER ILI9486_FRAMEBUFFER |
ILI9486 specific types
| 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
| SPI | The SPI device that this ILI9486 is connected to |
| ChipSelect | The SPI chip select to use when communicating with this device |
| Name | The text description of this device which will show in the device list (Optional) |
| Rotation | The rotation value for the framebuffer device (eg FRAMEBUFFER_ROTATION_180) |
| Width | The width of the framebuffer in pixels |
| Height | The height of the framebuffer in pixels |
| RST | GPIO pin information for the Reset pin (Optional) |
| DC | GPIO pin information for the Data/Command pin |
| BL | GPIO pin information for the Backlight pin (Optional) |
| uint32_t STDCALL ili9486_framebuffer_destroy | ( | FRAMEBUFFER_DEVICE * | framebuffer | ) |
Release, deregister and destroy an ILI9486 Framebuffer device created by this driver.
| Framebuffer | The Framebuffer device to destroy |