LPCOpen Platform  v1.03
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
LPC18xx/43xx emWin graphics dual core example using emWin library

Detailed Description

Example description
This example demonstartes the graphics example using emWin library. The example has 2 modules. The emWin graphics module implements the grpahics GUI for the application. This module also integrates touch screen driver. The graphics application can be run on M4/M0 core of LPC43xx.
The SysTick module provides the system ticks functionality in stand-alone configuration.

Special connection requirements
There are no special connection requirements for this example.

Build procedures:
LPC18xx/43xx example quickstart for Keil uVision4
LPC18xx/43xx example quickstart for IAR EWARM
LPC18xx/43xx example quickstart for Code Red Xpresso

Supported boards and board setup:
Hitex 1850 evaluation boards
Hitex 4350 evaluation boards
Keil 1857 evaluation boards
Keil 4357 evaluation boards
NGX 1830 Xplorer boards
NGX 4330 Xplorer boards

Submitting LPCOpen issues:
Community support for LPCOpen

Example description
The System tick module implements the system tick functionality for LPC43XX cores in stand-alone configuration. The system tick functions are used in emWin graphics module. For Cortex-M4 core, it will use the SysTick timer module.
For Cortex-M0 core, it uses the RITimer module.

Special connection requirements
There are no special connection requirements for this example.

Build procedures:
LPC18xx/43xx example quickstart for Keil uVision4
LPC18xx/43xx example quickstart for IAR EWARM
LPC18xx/43xx example quickstart for Code Red Xpresso

Supported boards and board setup:
Hitex 1850 evaluation boards
Hitex 4350 evaluation boards
Keil 1857 evaluation boards
Keil 4357 evaluation boards
NGX 1830 Xplorer boards
NGX 4330 Xplorer boards

Submitting LPCOpen issues:
Community support for LPCOpen

Macros

#define ID_FRAMEWIN_0   (GUI_ID_USER + 0x0A)
 
#define ID_TEXT_0   (GUI_ID_USER + 0x0B)
 
#define ID_BUTTON_0   (GUI_ID_USER + 0x0C)
 
#define ID_BUTTON_1   (GUI_ID_USER + 0x0D)
 
#define ID_BUTTON_2   (GUI_ID_USER + 0x0E)
 
#define ID_TEXT_1   (GUI_ID_USER + 0x10)
 
#define ID_TEXT_2   (GUI_ID_USER + 0x11)
 
#define ID_TEXT_3   (GUI_ID_USER + 0x12)
 
#define ID_TEXT_4   (GUI_ID_USER + 0x13)
 
#define ID_TEXT_5   (GUI_ID_USER + 0x14)
 
#define ID_EDIT_0   (GUI_ID_USER + 0x15)
 
#define ID_EDIT_1   (GUI_ID_USER + 0x16)
 
#define TSC_CHECK_DELAY   (20)
 
#define GUI_BUF_ADDR   0x28050000
 GUI buffers required for emwin library.
 
#define GUI_NUMBYTES   ((1024 * 1024) * 2)
 
#define GUI_BLOCKSIZE   (0x128)
 
#define GUI_BUF   LOCATE_AT(GUI_BUF_ADDR)
 
#define FRAME_BUF   LOCATE_AT(FRAMEBUFFER_ADDR)
 
#define TSC_CHECK_DELAY   (20)
 

Functions

static void lcd_update_remoteip (uint32_t new_remote_ip)
 
static void lcd_update_values (WM_HWIN hWin_up)
 
static void lcd_update_hostip (uint32_t host_ip)
 
void SysTick_Enable (uint32_t period)
 System Tick enable function.
 
void EVENT_lwip_http_access (uint32_t addr)
 
void EMWIN_Init (void)
 emWin dual core example initialisation function
 
void emwin_tasks (void)
 emWin dual core example task
 
void SysTick_Disable (void)
 System Tick disable function.
 
void SysTick_Handler (void)
 System Tick module IRQ handler function.
 
void msDelay (uint32_t ms)
 Delay function.
 
uint32_t sys_now (void)
 LWIP standalone mode time support.
 

Variables

volatile uint32_t host_ip_addr
 
volatile uint32_t remote_ip_addr
 
static volatile int start = 0
 
static volatile short counter = 0
 
static WM_HWIN hWin
 
volatile int tsc_init_done = 0
 Touch screen initialisation done flag.
 
GUI_BUF U32 GUI_Memory [GUI_NUMBYTES/sizeof(U32)]
 
U32 GUI_Memory_Size = GUI_NUMBYTES
 
U32 GUI_Block_Size = GUI_BLOCKSIZE
 
FRAME_BUF uint16_t Frame_Buf [C_GLCD_H_SIZE *C_GLCD_V_SIZE]
 
static uint32_t saved_period
 
static int16_t old_tmp_x = -1
 
static int16_t old_tmp_y = -1
 
volatile uint32_t systick_timems
 System Tick count value.
 
volatile int tsc_init_done
 Touch screen initialisation done flag.
 
uint32_t SystemCoreClock
 Current system clock rate, mainly used for sysTick.
 

Macro Definition Documentation

#define FRAME_BUF   LOCATE_AT(FRAMEBUFFER_ADDR)

Macro to locate the Frame buffer

Definition at line 165 of file dualcore_emwin.c.

#define GUI_BLOCKSIZE   (0x128)

GUI block size

Definition at line 158 of file dualcore_emwin.c.

#define GUI_BUF   LOCATE_AT(GUI_BUF_ADDR)

Macro to locate the GUI buffer

Definition at line 159 of file dualcore_emwin.c.

#define GUI_BUF_ADDR   0x28050000

GUI buffers required for emwin library.

Start address of GUI buffer in SDRAM

Definition at line 156 of file dualcore_emwin.c.

#define GUI_NUMBYTES   ((1024 * 1024) * 2)

Size of GUI buffer in No. of bytes

Definition at line 157 of file dualcore_emwin.c.

#define ID_BUTTON_0   (GUI_ID_USER + 0x0C)

Definition at line 116 of file dualcore_emwin.c.

#define ID_BUTTON_1   (GUI_ID_USER + 0x0D)

Definition at line 117 of file dualcore_emwin.c.

#define ID_BUTTON_2   (GUI_ID_USER + 0x0E)

Definition at line 118 of file dualcore_emwin.c.

#define ID_EDIT_0   (GUI_ID_USER + 0x15)

Definition at line 124 of file dualcore_emwin.c.

#define ID_EDIT_1   (GUI_ID_USER + 0x16)

Definition at line 125 of file dualcore_emwin.c.

#define ID_FRAMEWIN_0   (GUI_ID_USER + 0x0A)

Widget IDs used in Frame window

Definition at line 114 of file dualcore_emwin.c.

#define ID_TEXT_0   (GUI_ID_USER + 0x0B)

Definition at line 115 of file dualcore_emwin.c.

#define ID_TEXT_1   (GUI_ID_USER + 0x10)

Definition at line 119 of file dualcore_emwin.c.

#define ID_TEXT_2   (GUI_ID_USER + 0x11)

Definition at line 120 of file dualcore_emwin.c.

#define ID_TEXT_3   (GUI_ID_USER + 0x12)

Definition at line 121 of file dualcore_emwin.c.

#define ID_TEXT_4   (GUI_ID_USER + 0x13)

Definition at line 122 of file dualcore_emwin.c.

#define ID_TEXT_5   (GUI_ID_USER + 0x14)

Definition at line 123 of file dualcore_emwin.c.

#define TSC_CHECK_DELAY   (20)

Definition at line 80 of file lpc43xx_systick.c.

#define TSC_CHECK_DELAY   (20)

TSC status check delay

Definition at line 130 of file dualcore_emwin.c.

Function Documentation

void EMWIN_Init ( void  )

emWin dual core example initialisation function

The function initialises the LCD controller & Touch screen controller. It will register the IPC callbacks to receive graphics information from other processor core. In stand-alone configuration, it will also create the emWin Widget framewindow of the graphics application. This function is called by main() only when EXAMPLE_EMWIN is defined.

Returns
None

Definition at line 453 of file dualcore_emwin.c.

void emwin_tasks ( void  )

emWin dual core example task

In stand-alone configuration, it will update the fields on LCD screen. In FreeRTOS/uCOS-III configurations, this will create the LCD & Touch Screen application tasks. Called by dual core main() only when EXAMPLE_EMWIN is defined.

Returns
None

Definition at line 541 of file dualcore_emwin.c.

void EVENT_lwip_http_access ( uint32_t  addr)

Definition at line 441 of file dualcore_emwin.c.

static void lcd_update_hostip ( uint32_t  host_ip)
static

Definition at line 214 of file dualcore_emwin.c.

static void lcd_update_remoteip ( uint32_t  new_remote_ip)
static

Definition at line 172 of file dualcore_emwin.c.

static void lcd_update_values ( WM_HWIN  hWin_up)
static

Update EDIT boxes on LCD function

Definition at line 180 of file dualcore_emwin.c.

void msDelay ( uint32_t  ms)

Delay function.

Delay for the specified number of milliSeconds.

Millisecond Delay function.

Parameters
ms: Delay period in milliseconds
Returns
None Delay for the specified number of milliSeconds. This function is used by LWIP stack in stand-alone configuration

Definition at line 300 of file lpc43xx_systick.c.

uint32_t sys_now ( void  )

LWIP standalone mode time support.

Returns
Returns the current time in mS Returns the current time in mS. This is needed for the LWIP timers

Definition at line 312 of file lpc43xx_systick.c.

void SysTick_Disable ( void  )

System Tick disable function.

Returns
None The function will disbale the system ticks

Definition at line 234 of file lpc43xx_systick.c.

void SysTick_Enable ( uint32_t  period)

System Tick enable function.

LCD appplication task function for FreeRTOS & uCOS-III

Parameters
period: System Tick period
Returns
None This function will configure the system ticks as per mentioned period value. For Cortex-M4 core, it will configure & enable the SysTick timer module. For Cortex-M0 core it will configure & enable the the RITimer module.

Definition at line 223 of file lpc43xx_systick.c.

void SysTick_Handler ( void  )

System Tick module IRQ handler function.

SysTick 1mS tick handler.

Returns
None The function will handle the System Tick module interrupt events. It will update the system tick count value. If Touch screen is enabled, it will also check for the Touch screen events at periodic intervals (interval specified by TSC_CHECK_DELAY)

Definition at line 247 of file lpc43xx_systick.c.

Variable Documentation

volatile short counter = 0
static

Definition at line 101 of file dualcore_emwin.c.

FRAME_BUF uint16_t Frame_Buf[C_GLCD_H_SIZE *C_GLCD_V_SIZE]

Frame buffer

Definition at line 166 of file dualcore_emwin.c.

U32 GUI_Block_Size = GUI_BLOCKSIZE

GUI block size

Definition at line 163 of file dualcore_emwin.c.

GUI_BUF U32 GUI_Memory[GUI_NUMBYTES/sizeof(U32)]

GUI buffer

Definition at line 161 of file dualcore_emwin.c.

U32 GUI_Memory_Size = GUI_NUMBYTES

GUI buffer size

Definition at line 162 of file dualcore_emwin.c.

volatile uint32_t host_ip_addr

Global variables used by emWin application

Definition at line 98 of file dualcore_emwin.c.

WM_HWIN hWin
static

Definition at line 102 of file dualcore_emwin.c.

int16_t old_tmp_x = -1
static

Definition at line 77 of file lpc43xx_systick.c.

int16_t old_tmp_y = -1
static

Definition at line 77 of file lpc43xx_systick.c.

volatile uint32_t remote_ip_addr

Definition at line 99 of file dualcore_emwin.c.

uint32_t saved_period
static

Definition at line 76 of file lpc43xx_systick.c.

volatile int start = 0
static

Definition at line 100 of file dualcore_emwin.c.

uint32_t SystemCoreClock

Current system clock rate, mainly used for sysTick.

System Core rate (defined in LPC_BOARD library module)

< System Clock Frequency (Core Clock)

System Clock Frequency (Core Clock)

< System Clock Frequency (Core Clock)

System Clock Frequency (Core Clock)

Definition at line 47 of file board_nxp_xpresso_11c24.c.

volatile uint32_t systick_timems

System Tick count value.

Definition at line 98 of file lpc43xx_systick.c.

volatile int tsc_init_done

Touch screen initialisation done flag.

Touch screen initialisation done flag (defined in emWin module)

TSC Initiliation done flag

Definition at line 151 of file dualcore_emwin.c.

volatile int tsc_init_done = 0

Touch screen initialisation done flag.

TSC Initiliation done flag

Definition at line 151 of file dualcore_emwin.c.