Atmel Xplained Evaluation Board ATXMEGAA3BU-XPLD ATXMEGAA3BU-XPLD Data Sheet
Product codes
ATXMEGAA3BU-XPLD
8
AVR1934
8413A-AVR-09/11
This function will then return a status code and act depending on the given keycode:
•
MENU_KEYCODE_DOWN:
Change selection to next menu item (or first if at bottom)
Returns
MENU_EVENT_IDLE
•
MENU_KEYCODE_UP:
Change selection to previous menu item (or last if at top)
Returns
MENU_EVENT_IDLE
•
MENU_KEYCODE_ENTER:
Nothing changes in menu. Returns the line selected
•
MENU_KEYCODE_BACK:
Nothing changes in menu. Returns
MENU_EVENT_EXIT
2.7.4 Custom keycodes
Keycodes are values describing different keys, enabling the system to differentiate
which key has been pressed. These definitions are located in
which key has been pressed. These definitions are located in
conf_menu.h
, and may
be changed as needed.
2.7.5 Custom indicator icon
The graphical indicator used to indicate menu selection is defined in
conf_menu.h
.
This indicator can also be changed if needed.
2.7.6 Usage in demo application
The main menu consists of the following items:
• Temperature
• Light
sensor
• Production
Date
• Date and Time
• Toggle
Backlight
2.8 Calendar service
Including
calendar.c
and
calendar.h
provides functionality for converting between
UNIX timestamps and
calendar_date
structs.
A UNIX timestamp is a 32 bit integer value representing the number of seconds that
has elapsed since January 1
has elapsed since January 1
st
1970, 00:00:00 UTC.
The
calendar_date
struct consists of seconds, minutes, hours, date, month, year
and day of week. The months and dates start at zero, so one has to increment the
variable to get the normal readable months and dates. Days of the week are
numbered from 0 to 6, where 0 is Sunday and 6 is Saturday.
variable to get the normal readable months and dates. Days of the week are
numbered from 0 to 6, where 0 is Sunday and 6 is Saturday.
The service also provides functionality for calculating the time difference between two
calendar_date
structs, as well as functionality for converting timestamps to dates in
a specified time zone and dates in a specified time zone to timestamps. The time
zones are provided as input parameters to the time zone functions as offset in hours
(positive and negative) and minutes. Calendar functionality together with the RTC
could in other applications be used to set alarm for a specific time and date.
zones are provided as input parameters to the time zone functions as offset in hours
(positive and negative) and minutes. Calendar functionality together with the RTC
could in other applications be used to set alarm for a specific time and date.
Other functionality includes incrementing seconds in the
calendar_date
struct,
without having to go through a UNIX timestamp.