Atmel Xplained Evaluation Board ATXMEGAA3BU-XPLD ATXMEGAA3BU-XPLD 데이터 시트

제품 코드
ATXMEGAA3BU-XPLD
다운로드
페이지 15
 
AVR1934
 
 
7
8413A-AVR-09/11 
2.6.2 Text drawing with font support 
Font support is made available through the gfx_mono_text.c and gfx_mono_text.h 
files, which in turn relies on system font objects from sysfont.c and sysfont.h, allowing 
printing of text from glyph data stored in program memory using progmem.c and 
progmem.h. 
2.6.3 Usage in demo application 
The demo application uses the menu system service, which in turn uses gfx_mono, 
combining primitive drawing and text output to create a simple navigation menu 
system. See the menu system chapter for more information. Each individual 
application uses the library for different purposes, such as text, primitives and 
bitmaps. 
2.7 Menu system 
The module 
common.services.gfx_mono.menu
 provides a simple menu system for 
monochrome graphical displays. 
Typical flow of an application using the menu system: 
1. Define 
menu 
structure. 
2. Call 
gfx_mono_menu_init()
3.  Get user input. 
4.  Update menu with user input using function 
gfx_mono_menu_process_key()
5. Interpret 
gfx_mono_menu_process_key()
 return value. 
6.  Go to 3. 
2.7.1 Menu 
struct
 
The menu is declared using the 'menu' struct defined in 
gfx_mono_menu.h
. It consists 
of the following members: 
•   
title:
 the title of the menu, shown on the top line of the display 
•   
strings:
 an array of strings, each string defines one line in the menu 
•   
num_elements:
 number of elements (strings) in the menu 
 
In addition you have two members for internal use, which should be initialized to 0: 
•   
current_selection:
 the line currently selected 
•   
current_page:
 the active page 
2.7.2 Initialize menu system 
To initialize the menu system, call the 
gfx_mono_menu_init()
 function. Use a 
reference to the menu 
struct
 as parameter. This function will clear the display and 
draw the menu. 
2.7.3 Update menu 
Before the menu can be updated, input from the user is needed. Methods for getting 
input are not part of the menu module, and must be implemented separately. 
 
As soon as input is available, the menu system is informed using the 
gfx_mono_menu_process_key()
 function. Use a reference to your menu struct and 
the user input key code as parameters.