Microchip® Advanced Software Framework

thirdparty/lwip/netconn_http_stats_example/task_gfx.c File Reference

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
 BMP (Windows) Header Format. More...
 

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
 IP mode: 0 unselected, 1 static, 2 dhcp. More...
 
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
#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.

Parameters
stack_depth_wordsTask stack size in 32 bits word.
task_priorityTask priority.

Initialize display.

Create the task as described above.

References gfx_init(), gfx_task(), NULL, and xTaskCreate.

static void event_handler ( rtouch_event_t const *  event)
static

Callback called when the pen is pressed on the touchscreen.

Parameters
xhorizontal position (in pixel if ts calibrated).
yvertical 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 void gfx_draw_bmpfile ( const uint8_t *  bmpImage)
static

Draw a bitmap image.

Expected file format is 320x240, 24 bits, RGB888.

Parameters
bmpImagePointer 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(), offset, and bmpfile_header::width.

Referenced by gfx_task().

static void gfx_init ( void  )
static

Initialize the LCD.

Referenced by create_gfx_task().

uint32_t app_hold = 1

Used to block the application on instruction screen.

Used to block the application on instruction screen.

int8_t g_c_ipconfig[25]

Referenced by gfx_task(), and status_callback().

uint32_t g_ip_mode = 0

IP mode: 0 unselected, 1 static, 2 dhcp.

Referenced by ethernet_configure_interface(), event_handler(), gfx_task(), qtouch_task(), and status_callback().

const portTickType gfx_refresh_rate = 1000UL / portTICK_RATE_MS
static

Referenced by gfx_task().

const portTickType instructions_delay = 50UL / portTICK_RATE_MS

Small delay to hold tasks, during instruction screen.

const portTickType presentation_delay = 2000UL / portTICK_RATE_MS
static

Referenced by gfx_task().

const portTickType touch_delay = 10UL / portTICK_RATE_MS
static

Referenced by gfx_task().