Microchip® Advanced Software Framework

ili9325.c File Reference

API driver for ILI9325 TFT display component.

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

#include "ili9325.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>

Macros

#define LCD_DATA_CACHE_SIZE   ILI9325_LCD_WIDTH
 

Functions

static void ili9325_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 ili9325_copy_pixels_from_screen (ili9325_color_t *pixels, uint32_t count)
 Copy pixels from the screen to a pixel buffer. More...
 
void ili9325_copy_pixels_to_screen (const ili9325_color_t *pixels, uint32_t count)
 Copy pixels from SRAM to the screen. More...
 
void ili9325_copy_raw_pixel_24bits_to_screen (const uint8_t *raw_pixels, uint32_t count)
 Copy pixels from SRAM to the screen. More...
 
static void ili9325_delay (uint32_t ul_ms)
 Delay function. More...
 
void ili9325_disable_scroll (void)
 Disable the scrolling feature. More...
 
void ili9325_display_off (void)
 Turn off the LCD. More...
 
void ili9325_display_on (void)
 Turn on the LCD. More...
 
static void ili9325_draw_char (uint32_t ul_x, uint32_t ul_y, uint8_t uc_c)
 Draw an ASCII character on LCD. More...
 
uint32_t ili9325_draw_circle (uint32_t ul_x, uint32_t ul_y, uint32_t ul_r)
 Draw a circle on LCD. More...
 
uint32_t ili9325_draw_filled_circle (uint32_t ul_x, uint32_t ul_y, uint32_t ul_r)
 Draw a filled circle on LCD. More...
 
void ili9325_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 ili9325_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 ili9325_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 ili9325_draw_pixel (uint32_t ul_x, uint32_t ul_y)
 Draw a pixel on LCD. More...
 
void ili9325_draw_pixmap (uint32_t ul_x, uint32_t ul_y, uint32_t ul_width, uint32_t ul_height, const ili9325_color_t *p_ul_pixmap)
 Draw a pixmap on LCD. More...
 
void ili9325_draw_prepare (uint32_t ul_x, uint32_t ul_y, uint32_t ul_width, uint32_t ul_height)
 Prepare LCD to draw. More...
 
void ili9325_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 ili9325_draw_string (uint32_t ul_x, uint32_t ul_y, const uint8_t *p_str)
 Draw a string on LCD. More...
 
void ili9325_duplicate_pixel (const ili9325_color_t color, uint32_t count)
 Set a given number of pixels to the same color. More...
 
void ili9325_enable_scroll (void)
 Enable the scrolling feature. More...
 
void ili9325_fill (ili9325_color_t ul_color)
 Fill the LCD buffer with the specified color. More...
 
ili9325_color_t ili9325_get_pixel (uint32_t ul_x, uint32_t ul_y)
 Get a pixel from LCD. More...
 
uint32_t ili9325_init (struct ili9325_opt_t *p_opt)
 Initialize the ILI9325 lcd driver. More...
 
static uint16_t ili9325_lcd_get_16 (void)
 Read 16 bit data. More...
 
ili9325_color_t ili9325_read_gram (void)
 Read a single color from the graphical memory. More...
 
static uint32_t ili9325_read_ram (void)
 Read data to LCD GRAM. More...
 
static void ili9325_read_ram_prepare (void)
 Prepare to read GRAM data. More...
 
static uint16_t ili9325_read_register (uint8_t uc_reg)
 Read data from LCD Register. More...
 
void ili9325_scroll (int32_t ul_lines)
 Scroll up/down for the number of specified lines. More...
 
static void ili9325_send_draw_limits (const bool send_end_limits)
 Helper function to send the drawing limits (boundaries) to the display. More...
 
void ili9325_set_bottom_right_limit (ili9325_coord_t x, ili9325_coord_t y)
 Set the display bottom right drawing limit. More...
 
void ili9325_set_cursor_position (uint16_t us_x, uint16_t us_y)
 Set cursor of LCD screen. More...
 
void ili9325_set_display_direction (enum ili9325_display_direction e_dd, enum ili9325_shift_direction e_shd, enum ili9325_scan_direction e_scd)
 Set display direction. More...
 
void ili9325_set_foreground_color (ili9325_color_t ul_color)
 Set foreground color. More...
 
void ili9325_set_limits (ili9325_coord_t start_x, ili9325_coord_t start_y, ili9325_coord_t end_x, ili9325_coord_t end_y)
 Set the full display drawing limits. More...
 
void ili9325_set_orientation (uint8_t flags)
 Sets the orientation of the display data. More...
 
void ili9325_set_top_left_limit (ili9325_coord_t x, ili9325_coord_t y)
 Set the display top left drawing limit. More...
 
void ili9325_set_window (uint32_t ul_x, uint32_t ul_y, uint32_t ul_width, uint32_t ul_height)
 Set display window. More...
 
void ili9325_write_gram (ili9325_color_t color)
 Write the graphical memory with a single color pixel. More...
 
static void ili9325_write_ram (ili9325_color_t ul_color)
 Write data to LCD GRAM. More...
 
static void ili9325_write_ram_buffer (const ili9325_color_t *p_ul_buf, uint32_t ul_size)
 Write multiple data in buffer to LCD controller. More...
 
static void ili9325_write_ram_prepare (void)
 Prepare to write GRAM data. More...
 
static void ili9325_write_register (uint8_t uc_reg, uint16_t us_data)
 Write data to LCD Register. More...
 

Variables

static ili9325_color_t g_ul_pixel_cache [LCD_DATA_CACHE_SIZE]
 
struct ili9325_font gfont = {10, 14}
 
static volatile ili9325_coord_t limit_end_x
 
static volatile ili9325_coord_t limit_end_y
 
static volatile ili9325_coord_t limit_start_x
 
static volatile ili9325_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...