Low power mode widget for SAM toolkit demo application.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
Data Structures | |
struct | widget_context_lpm |
Widget application context. More... | |
Enumerations | |
enum | command_id { ICON_DUMMY_ID = 0, ICON_AUDIO_RECORD_ID, ICON_AUDIO_MIC_ID, ICON_AUDIO_PLAY_PAUSE_ID, ICON_AUDIO_STOP_ID, ICON_AUDIO_VOLUME_ID, ICON_AUDIO_RET_ID, ICON_AUDIO_MAX_ID, ICON_DUMMY_ID = 0, ICON_LPM_WAIT_ID, ICON_LPM_SLEEP_ID, ICON_LPM_BACKUP_ID, ICON_LPM_RET_ID, ICON_LPM_MAX } |
Command event IDs for low power mode widget. More... | |
Functions | |
static void | app_widget_launch_lpm (void) |
Setup low power mode widget. More... | |
void | app_widget_lpm_on (uint8_t on) |
Enable/disable low power mode widget. More... | |
static bool | widget_lpm_command_handler (struct wtk_basic_frame *frame, win_command_t command_data) |
Frame handler for the low power mode widget. More... | |
Variables | |
static char | demo_func_name [] = "Low Power Mode" |
Low power mode function name string. More... | |
static char | lpm_backup [] = "Backup" |
Backup mode string. More... | |
static char | lpm_sleep [] = "Sleep" |
Sleep mode string. More... | |
static char | lpm_wait [] = "Wait" |
Wait mode string. More... | |
static struct widget_context_lpm * | widget_ctx_lpm |
Statically allocated context pointer. More... | |
static struct gfx_bitmap | win_lpm_backup_icon |
Backup mode bitmap. More... | |
static struct gfx_bitmap | win_lpm_ret_icon |
Return bitmap. More... | |
static struct gfx_bitmap | win_lpm_sleep_icon |
Sleep mode bitmap. More... | |
static struct gfx_bitmap | win_lpm_wait_icon |
Wait mode bitmap. More... | |
static struct gfx_bitmap | win_root_logo_icon |
Logo bitmap. More... | |
enum command_id |
Command event IDs for low power mode widget.
|
static |
Setup low power mode widget.
Allocates memory for the application context, and creates all widgets that make up its interface. If memory allocation or widget creation fails, the application exits immediately.
References win_attributes::area, demo_board_name, demo_func_name, GFX_BITMAP_SOLID, GFX_COLOR, ICON_LPM_BACKUP_ID, ICON_LPM_RET_ID, ICON_LPM_SLEEP_ID, ICON_LPM_WAIT_ID, lpm_backup, lpm_sleep, lpm_wait, membag_alloc(), membag_free(), win_window::parent, win_area::pos, win_area::size, widget_lpm_command_handler(), win_destroy(), win_get_attributes(), win_get_root(), win_show(), wtk_basic_frame_as_child(), wtk_basic_frame_create(), wtk_icon_button_as_child(), wtk_icon_button_create(), wtk_icon_button_size_hint(), wtk_icon_group_create(), wtk_label_as_child(), wtk_label_create(), wtk_label_size_hint(), win_point::x, and win_point::y.
Referenced by app_widget_lpm_on().
void app_widget_lpm_on | ( | uint8_t | on | ) |
Enable/disable low power mode widget.
on | Turn on/off low power mode widget. |
References app_widget_launch_lpm(), widget_context_lpm::frame, win_destroy(), and wtk_basic_frame_as_child().
Referenced by task_win(), widget_frame_command_handler(), and widget_lpm_command_handler().
|
static |
Frame handler for the low power mode widget.
Handles all command events from the widgets in the application frame.
frame | Pointer to the application frame |
command_data | Command event ID |
References app_widget_lpm_backup_on(), app_widget_lpm_on(), app_widget_lpm_sleep_on(), app_widget_lpm_wait_on(), app_widget_main_on(), ICON_LPM_BACKUP_ID, ICON_LPM_RET_ID, ICON_LPM_SLEEP_ID, ICON_LPM_WAIT_ID, and UNUSED.
Referenced by app_widget_launch_lpm().
|
static |
Low power mode function name string.
Referenced by app_widget_launch_lpm().
|
static |
Backup mode string.
Referenced by app_widget_launch_lpm().
|
static |
Sleep mode string.
Referenced by app_widget_launch_lpm().
|
static |
Wait mode string.
Referenced by app_widget_launch_lpm().
|
static |
Statically allocated context pointer.
|
static |
Backup mode bitmap.
|
static |
Return bitmap.
|
static |
Sleep mode bitmap.
|
static |
Wait mode bitmap.
|
static |
Logo bitmap.