Microchip® Advanced Software Framework

hx8347a.c File Reference

API driver for HX8347A TFT display component.

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

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

Macros

#define LCD_DATA_CACHE_SIZE   HX8347A_LCD_WIDTH
 

Functions

static void hx8347a_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...
 
static void hx8347a_delay (uint32_t ul_ms)
 Delay function. More...
 
void hx8347a_disable_scroll (void)
 Disables the scrolling. More...
 
void hx8347a_display_off (void)
 Turn off the LCD. More...
 
void hx8347a_display_on (void)
 Turn on the LCD. More...
 
static void hx8347a_draw_char (uint32_t ul_x, uint32_t ul_y, uint8_t uc_c)
 Draw an ASCII character on LCD. More...
 
uint32_t hx8347a_draw_circle (uint32_t ul_x, uint32_t ul_y, uint32_t ul_r)
 Draw a circle on LCD. More...
 
uint32_t hx8347a_draw_filled_circle (uint32_t ul_x, uint32_t ul_y, uint32_t ul_r)
 Draw a filled circle on LCD. More...
 
void hx8347a_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 hx8347a_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 hx8347a_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 hx8347a_draw_pixel (uint32_t ul_x, uint32_t ul_y)
 Draw a pixel on LCD. More...
 
void hx8347a_draw_pixmap (uint32_t ul_x, uint32_t ul_y, uint32_t ul_width, uint32_t ul_height, const hx8347a_color_t *p_ul_pixmap)
 Draw a pixmap on LCD. More...
 
void hx8347a_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 hx8347a_draw_string (uint32_t ul_x, uint32_t ul_y, const uint8_t *p_str)
 Draw a string on LCD. More...
 
void hx8347a_enable_scroll (void)
 Enables the scrolling feature. More...
 
void hx8347a_fill (hx8347a_color_t us_color)
 Fill the LCD buffer with the specified color. More...
 
hx8347a_color_t hx8347a_get_pixel (uint32_t ul_x, uint32_t ul_y)
 Get a pixel from LCD. More...
 
uint32_t hx8347a_init (struct hx8347a_opt_t *p_opt)
 Initialize the HX8347A lcd driver. More...
 
static hx8347a_color_t hx8347a_read_ram (void)
 Read data to LCD GRAM. More...
 
static void hx8347a_read_ram_prepare (void)
 Prepare to read GRAM data. More...
 
static uint16_t hx8347a_read_register (uint8_t uc_reg)
 Read data from LCD Register. More...
 
void hx8347a_scroll (int32_t ul_lines)
 Scroll up/down for the number of specified lines. More...
 
void hx8347a_set_cursor_position (uint16_t us_x, uint16_t us_y)
 Set cursor of LCD screen. More...
 
void hx8347a_set_display_direction (display_direction_t dd)
 Set display direction. More...
 
void hx8347a_set_foreground_color (hx8347a_color_t us_color)
 Set foreground color. More...
 
void hx8347a_set_window (uint32_t ul_x, uint32_t ul_y, uint32_t ul_width, uint32_t ul_height)
 Set display window. More...
 
static void hx8347a_write_ram (hx8347a_color_t us_color)
 Write data to LCD GRAM. More...
 
static void hx8347a_write_ram_buffer (const hx8347a_color_t *p_ul_buf, uint32_t ul_size)
 Write multiple data in buffer to LCD controller. More...
 
static void hx8347a_write_ram_prepare (void)
 Prepare to write GRAM data. More...
 
static void hx8347a_write_register (uint8_t uc_reg, uint16_t us_data)
 Write data to LCD Register. More...
 

Variables

static hx8347a_color_t g_ul_pixel_cache [LCD_DATA_CACHE_SIZE]
 
struct font gfont = {10, 14}
 
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...