Microchip® Advanced Software Framework

widget_scr_main.c File Reference

Main widget for SAM toolkit demo application.

Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.

#include <asf.h>
#include <string.h>
#include "demo.h"
#include "bitmaps.h"

Data Structures

struct  widget_context
 Widget application context. More...
 

Enumerations

enum  main_command_id {
  ICON_DUMMY_ID = 0,
  ICON_MAIN_AUDIO_ID,
  ICON_MAIN_VIDEO_ID,
  ICON_MAIN_PPT_ID,
  ICON_MAIN_SETTINGS_ID,
  ICON_MAIN_QTOUCH_ID,
  ICON_MAIN_LPM_ID,
  ICON_MAIN_INFO_ID,
  ICON_MAIN_MAX_NUM
}
 Command event IDs for main widget. More...
 

Functions

static void app_widget_launch_main (void)
 Setup widget demo. More...
 
void app_widget_main_on (uint8_t on)
 Enable/disable mainmode widget. More...
 
static bool widget_frame_command_handler (struct wtk_basic_frame *frame, void *command_data)
 Frame handler for the main widget. More...
 

Variables

char demo_board_name [] = DEMO_BOARD_NAME
 Demo board name. More...
 
static char demo_func_name [] = "Demo"
 
static struct widget_contextwidget_ctx_main
 Statically allocated context pointer. More...
 
static struct gfx_bitmap win_main_audio_icon
 Audio bitmap. More...
 
static struct gfx_bitmap win_main_info_icon
 Information bitmap. More...
 
static struct gfx_bitmap win_main_logo_icon
 Logo bitmap. More...
 
static struct gfx_bitmap win_main_lpm_icon
 Low power mode bitmap. More...
 
static struct gfx_bitmap win_main_qtouch_icon
 QTouch bitmap. More...
 
static struct gfx_bitmap win_main_settings_icon
 Settings bitmap. More...
 
static struct gfx_bitmap win_main_slidershow_icon
 Slider show bitmap. More...
 
static struct gfx_bitmap win_main_video_icon
 Video bitmap. More...
 

Command event IDs for main widget.

Enumerator
ICON_DUMMY_ID 

Dummy ICON.

ICON_MAIN_AUDIO_ID 

Command event ID for audio icon button.

ICON_MAIN_VIDEO_ID 

Command event ID for video icon button.

ICON_MAIN_PPT_ID 

Command event ID for ppt icon button.

ICON_MAIN_SETTINGS_ID 

Command event ID for settings icon button.

ICON_MAIN_QTOUCH_ID 

Command event ID for qtouch icon button.

ICON_MAIN_LPM_ID 

Command event ID for low power mode icon button.

ICON_MAIN_INFO_ID 

Command event ID for information icon button.

ICON_MAIN_MAX_NUM 

Max icon number for main widget.

static bool widget_frame_command_handler ( struct wtk_basic_frame frame,
void *  command_data 
)
static

Frame handler for the main widget.

Handles all command events from the widgets in the main widget.

Parameters
framePointer to the application frame.
command_dataCommand event ID.
Returns
True if exiting, to destroy the window.

References app_widget_audio_on(), app_widget_fft_on(), app_widget_info_on(), app_widget_lpm_on(), app_widget_main_on(), app_widget_qtouch_on(), app_widget_settings_on(), DEMO_FFT_MODE, DEMO_MAIN_MODE, DEMO_PPT_MODE, demo_set_special_mode_status(), ICON_MAIN_AUDIO_ID, ICON_MAIN_INFO_ID, ICON_MAIN_LPM_ID, ICON_MAIN_PPT_ID, ICON_MAIN_QTOUCH_ID, ICON_MAIN_SETTINGS_ID, ICON_MAIN_VIDEO_ID, and UNUSED.

Referenced by app_widget_launch_main().

char demo_func_name[] = "Demo"
static

Referenced by app_widget_launch_main().

struct widget_context* widget_ctx_main
static

Statically allocated context pointer.

struct gfx_bitmap win_main_audio_icon
static
Initial value:
= {
.width = 64, .height=64,
.type = GFX_BITMAP_EXT,
.data.custom = DEMO_BMP_BTN_AUDIO
}
Definition: gfx_generic.h:68
#define DEMO_BMP_BTN_AUDIO
Definition: bitmaps.h:83

Audio bitmap.

struct gfx_bitmap win_main_info_icon
static
Initial value:
= {
.width = 64, .height=64,
.type = GFX_BITMAP_EXT,
.data.custom = DEMO_BMP_BTN_INFOS
}
Definition: gfx_generic.h:68
#define DEMO_BMP_BTN_INFOS
Definition: bitmaps.h:54

Information bitmap.

struct gfx_bitmap win_main_logo_icon
static
Initial value:
= {
.width = 87, .height=40,
.type = GFX_BITMAP_EXT,
.data.custom = DEMO_BMP_LOGO_ATMEL
}
Definition: gfx_generic.h:68
#define DEMO_BMP_LOGO_ATMEL
Definition: bitmaps.h:43

Logo bitmap.

struct gfx_bitmap win_main_lpm_icon
static
Initial value:
= {
.width = 64, .height=64,
.type = GFX_BITMAP_EXT,
}
Definition: gfx_generic.h:68
#define DEMO_BMP_BTN_LOW_POWER_MODES
Definition: bitmaps.h:53

Low power mode bitmap.

struct gfx_bitmap win_main_qtouch_icon
static
Initial value:
= {
.width = 64, .height=64,
.type = GFX_BITMAP_EXT,
.data.custom = DEMO_BMP_BTN_QTOUCH
}
Definition: gfx_generic.h:68
#define DEMO_BMP_BTN_QTOUCH
Definition: bitmaps.h:52

QTouch bitmap.

struct gfx_bitmap win_main_settings_icon
static
Initial value:
= {
.width = 64, .height=64,
.type = GFX_BITMAP_EXT,
.data.custom = DEMO_BMP_BTN_SETTINGS
}
Definition: gfx_generic.h:68
#define DEMO_BMP_BTN_SETTINGS
Definition: bitmaps.h:51

Settings bitmap.

struct gfx_bitmap win_main_slidershow_icon
static
Initial value:
= {
.width = 64, .height=64,
.type = GFX_BITMAP_EXT,
.data.custom = DEMO_BMP_BTN_SLIDESHOW
}
Definition: gfx_generic.h:68
#define DEMO_BMP_BTN_SLIDESHOW
Definition: bitmaps.h:50

Slider show bitmap.

struct gfx_bitmap win_main_video_icon
static
Initial value:
= {
.width = 64, .height=64,
.type = GFX_BITMAP_EXT,
.data.custom = DEMO_BMP_BTN_GFX_DEMO
}
#define DEMO_BMP_BTN_GFX_DEMO
Definition: bitmaps.h:49
Definition: gfx_generic.h:68

Video bitmap.