GFX task from the HTTP Netconn Example.
Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.
#include "task_defs.h"
#include "arm_math.h"
#include "logo_atmel.h"
#include <FreeRTOS.h>
#include <FreeRTOS_CLI.h>
#include <StackMacros.h>
#include <croutine.h>
#include <list.h>
#include <mpu_wrappers.h>
#include <portable.h>
#include <projdefs.h>
#include <queue.h>
#include <semphr.h>
#include <task.h>
#include <timers.h>
#include <pmc.h>
#include <sysclk.h>
#include "ili93xx.h"
#include "ili9325_regs.h"
#include "ili9341_regs.h"
#include "aat31xx.h"
#include "gpio.h"
#include "pio_handler.h"
#include "smc.h"
#include "ethernet.h"
#include "rtouch.h"
Data Structures | |
struct | bmpfile_header |
Macros | |
#define | ILI93XX_LCD_CS 1 |
#define | IRQ_PRIOR_PIO 13 |
IRQ priority for PIO (The lower the value, the greater the priority) More... | |
Functions | |
void | create_gfx_task (uint16_t stack_depth_words, unsigned portBASE_TYPE task_priority) |
Create the GFX task. More... | |
static void | event_handler (rtouch_event_t const *event) |
Callback called when the pen is pressed on the touchscreen. More... | |
static void | gfx_draw_bmpfile (const uint8_t *bmpImage) |
Draw a bitmap image. More... | |
static void | gfx_init (void) |
Initialize the LCD. More... | |
static void | gfx_task (void *pvParameters) |
GFX task core function. More... | |
Variables | |
uint32_t | app_hold = 1 |
Used to block the application on instruction screen. More... | |
int8_t | g_c_ipconfig [25] |
uint32_t | g_ip_mode = 0 |
static const portTickType | gfx_refresh_rate = 1000UL / portTICK_RATE_MS |
const portTickType | instructions_delay = 50UL / portTICK_RATE_MS |
Small delay to hold tasks, during instruction screen. More... | |
static const portTickType | presentation_delay = 2000UL / portTICK_RATE_MS |
static const portTickType | touch_delay = 10UL / portTICK_RATE_MS |
#define ILI93XX_LCD_CS 1 |
Referenced by gfx_init().
#define IRQ_PRIOR_PIO 13 |
IRQ priority for PIO (The lower the value, the greater the priority)
Referenced by gfx_task().
void create_gfx_task | ( | uint16_t | stack_depth_words, |
unsigned portBASE_TYPE | task_priority | ||
) |
Create the GFX task.
stack_depth_words | Task stack size in 32 bits word. |
task_priority | Task priority. |
References gfx_init(), gfx_task(), NULL, and xTaskCreate.
Referenced by main().
|
static |
Callback called when the pen is pressed on the touchscreen.
x | horizontal position (in pixel if ts calibrated). |
y | vertical position (in pixel if ts calibrated). |
References COLOR_BLACK, COLOR_GRAY, COLOR_LIGHTGREY, g_ip_mode, ili93xx_draw_filled_rectangle(), ili93xx_draw_rectangle(), ili93xx_draw_string(), ili93xx_set_foreground_color(), RTOUCH_MOVE, RTOUCH_PRESS, and RTOUCH_RELEASE.
Referenced by gfx_task().
|
static |
Draw a bitmap image.
Expected file format is 320x240, 24 bits, RGB888.
bmpImage | Pointer to the bmp file image. |
References DEVICE_TYPE_ILI9325, DEVICE_TYPE_ILI9341, bmpfile_header::height, ILI9325_GRAM_DATA_REG, ILI9341_CMD_MEMORY_WRITE, ILI9341_CMD_WRITE_MEMORY_CONTINUE, ili93xx_device_type(), ili93xx_set_cursor_position(), ili93xx_set_window(), LCD_IR(), LCD_WD(), bmpfile_header::offset, and bmpfile_header::width.
Referenced by gfx_task().
Initialize the LCD.
References ili93xx_opt_t::background_color, COLOR_WHITE, ili93xx_opt_t::foreground_color, ili93xx_init(), ILI93XX_LCD_CS, ILI93XX_LCD_HEIGHT, ILI93XX_LCD_WIDTH, pmc_enable_periph_clk(), smc_set_cycle_timing(), smc_set_mode(), smc_set_pulse_timing(), smc_set_setup_timing(), ili93xx_opt_t::ul_height, and ili93xx_opt_t::ul_width.
Referenced by create_gfx_task().
GFX task core function.
pvParameters | Junk parameter. |
References AAT31XX_MAX_BACKLIGHT_LEVEL, AAT31XX_MIN_BACKLIGHT_LEVEL, aat31xx_set_backlight(), app_hold, COLOR_BLACK, COLOR_LIGHTGREY, COLOR_WHITE, event_handler(), g_c_ipconfig, g_ip_mode, gfx_draw_bmpfile(), gfx_refresh_rate, ili93xx_display_on(), ili93xx_draw_filled_rectangle(), ili93xx_draw_rectangle(), ili93xx_draw_string(), ILI93XX_LCD_HEIGHT, ILI93XX_LCD_WIDTH, ili93xx_set_cursor_position(), ili93xx_set_foreground_color(), init_ethernet(), IRQ_PRIOR_PIO, logo_atmel_bmp, pio_handler_set_priority(), pmc_enable_periph_clk(), presentation_delay, rtouch_enable(), rtouch_init(), rtouch_process(), rtouch_set_calibration_parameter(), rtouch_set_event_handler(), touch_delay, and vTaskDelay().
Referenced by create_gfx_task().
uint32_t app_hold = 1 |
Used to block the application on instruction screen.
Referenced by gfx_task().
int8_t g_c_ipconfig[25] |
Referenced by gfx_task(), and status_callback().
uint32_t g_ip_mode = 0 |
Referenced by ethernet_configure_interface(), event_handler(), gfx_task(), and status_callback().
|
static |
Referenced by gfx_task().
const portTickType instructions_delay = 50UL / portTICK_RATE_MS |
Small delay to hold tasks, during instruction screen.
|
static |
Referenced by gfx_task().
|
static |
Referenced by gfx_task().