Microchip® Advanced Software Framework

ili9488.c File Reference

API driver for ILI9488 TFT display component.

Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.

#include "ili9488.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include "pio.h"
#include "spi_master.h"

Macros

#define LCD_DATA_CACHE_SIZE   ILI9488_LCD_WIDTH
 

Functions

static void ili9488_check_box_coordinates (uint32_t *p_ul_x1, uint32_t *p_ul_y1, uint32_t *p_ul_x2, uint32_t *p_ul_y2)
 Check box coordinates. More...
 
void ili9488_copy_pixels_from_screen (uint16_t *pixels, uint32_t count)
 Copy pixels from the screen to a pixel buffer. More...
 
void ili9488_copy_pixels_to_screen (const uint16_t *pixels, uint32_t count)
 Copy pixels from SRAM to the screen. More...
 
void ili9488_delay (uint32_t ul_ms)
 Delay function. More...
 
void ili9488_display_off (void)
 Turn off the LCD. More...
 
void ili9488_display_on (void)
 Turn on the LCD. More...
 
static void ili9488_draw_char (uint32_t ul_x, uint32_t ul_y, uint8_t uc_c)
 Draw an ASCII character on LCD. More...
 
uint32_t ili9488_draw_circle (uint32_t ul_x, uint32_t ul_y, uint32_t ul_r)
 Draw a circle on LCD. More...
 
uint32_t ili9488_draw_filled_circle (uint32_t ul_x, uint32_t ul_y, uint32_t ul_r)
 Draw a filled circle on LCD. More...
 
void ili9488_draw_filled_rectangle (uint32_t ul_x1, uint32_t ul_y1, uint32_t ul_x2, uint32_t ul_y2)
 Draw a filled rectangle on LCD. More...
 
void ili9488_draw_line (uint32_t ul_x1, uint32_t ul_y1, uint32_t ul_x2, uint32_t ul_y2)
 Draw a line on LCD. More...
 
static void ili9488_draw_line_bresenham (uint32_t ul_x1, uint32_t ul_y1, uint32_t ul_x2, uint32_t ul_y2)
 Draw a line on LCD, which is not horizontal or vertical. More...
 
uint32_t ili9488_draw_pixel (uint32_t ul_x, uint32_t ul_y)
 Draw a pixel on LCD. More...
 
void ili9488_draw_pixmap (uint32_t ul_x, uint32_t ul_y, uint32_t ul_width, uint32_t ul_height, const ili9488_color_t *p_ul_pixmap)
 Draw a pixmap on LCD. More...
 
void ili9488_draw_prepare (uint32_t ul_x, uint32_t ul_y, uint32_t ul_width, uint32_t ul_height)
 Prepare LCD to draw. More...
 
void ili9488_draw_rectangle (uint32_t ul_x1, uint32_t ul_y1, uint32_t ul_x2, uint32_t ul_y2)
 Draw a rectangle on LCD. More...
 
void ili9488_draw_string (uint32_t ul_x, uint32_t ul_y, const uint8_t *p_str)
 Draw a string on LCD. More...
 
void ili9488_duplicate_pixel (const uint16_t color, uint32_t count)
 Set a given number of pixels to the same color. More...
 
void ili9488_fill (ili9488_color_t ul_color)
 Fill the LCD buffer with the specified color. More...
 
ili9488_color_t ili9488_get_pixel (uint32_t ul_x, uint32_t ul_y)
 Get a pixel from LCD. More...
 
uint32_t ili9488_init (struct ili9488_opt_t *p_opt)
 Initialize the ILI9488 lcd driver. More...
 
static uint32_t ili9488_read_chipid (void)
 Read chipid. More...
 
uint16_t ili9488_read_gram (void)
 Read a single color from the graphical memory. More...
 
static uint32_t ili9488_read_ram (void)
 Read data to LCD GRAM. More...
 
void ili9488_scroll (uint16_t ul_tfa, uint16_t ul_vsa, uint16_t ul_bfa)
 Scroll up/down for the number of specified lines. More...
 
void ili9488_set_bottom_right_limit (ili9488_coord_t x, ili9488_coord_t y)
 Set the display bottom right drawing limit. More...
 
void ili9488_set_cursor_position (uint16_t x, uint16_t y)
 Set cursor of LCD screen. More...
 
void ili9488_set_display_direction (enum ili9488_display_direction direction)
 ILI9488 configure landscape. More...
 
void ili9488_set_foreground_color (uint32_t ul_color)
 Set foreground color. More...
 
void ili9488_set_limits (ili9488_coord_t start_x, ili9488_coord_t start_y, ili9488_coord_t end_x, ili9488_coord_t end_y)
 Set the full display drawing limits. More...
 
void ili9488_set_orientation (uint8_t flags)
 Sets the orientation of the display data. More...
 
void ili9488_set_scroll_address (uint16_t ul_vsp)
 Enable the scrolling feature. More...
 
void ili9488_set_top_left_limit (ili9488_coord_t x, ili9488_coord_t y)
 Set the display top left drawing limit. More...
 
void ili9488_set_window (uint16_t x, uint16_t y, uint16_t width, uint16_t height)
 ILI9488 configure window. More...
 
void ili9488_write_brightness (uint16_t us_value)
 Set display brightness. More...
 
void ili9488_write_gram (uint16_t color)
 Write the graphical memory with a single color pixel. More...
 
static void ili9488_write_ram (ili9488_color_t ul_color)
 Write data to LCD GRAM. More...
 
static void ili9488_write_ram_buffer (const ili9488_color_t *p_ul_buf, uint32_t ul_size)
 Write multiple data in buffer to LCD controller. More...
 
static void ili9488_write_ram_prepare (void)
 Prepare to write GRAM data. More...
 
static void ili9488_write_register (uint8_t uc_reg, const ili9488_color_t *us_data, uint32_t size)
 Write data to LCD Register. More...
 

Variables

static ili9488_color_t g_ul_pixel_cache [LCD_DATA_CACHE_SIZE *LCD_DATA_COLOR_UNIT]
 
struct ili9488_font gfont = {10, 14}
 
static ili9488_coord_t limit_end_x
 
static ili9488_coord_t limit_end_y
 
static ili9488_coord_t limit_start_x
 
static ili9488_coord_t limit_start_y
 
const uint8_t p_uc_charset10x14 []
 Character set table for font 10x14 Coding format: Char height is 14 bits, which is coded using 2 bytes per column (2 unused bits). More...