Microchip® Advanced Software Framework

widget_scr_info.c File Reference

Information widget for SAM toolkit demo applicaiton.

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

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

Data Structures

struct  widget_context_info
 Infomation widget context. More...
 

Enumerations

enum  info_command_id {
  ICON_DUMMY_ID = 0,
  ICON_INFO_ID,
  ICON_INFO_DUMMY_ID
}
 Command event IDs for information widget. More...
 
enum  info_type {
  INFO_BOARD_NAME = 0,
  INFO_VER_NUM,
  INFO_MAX
}
 Information type. More...
 

Functions

void app_widget_info_on (uint8_t on)
 Enable/disable information widget. More...
 
static void app_widget_launch_info (void)
 Setup information widget. More...
 
static bool widget_info_command_handler (struct wtk_basic_frame *frame, win_command_t command_data)
 Frame handler for the information widget. More...
 

Variables

static char demo_func_name [] = "Demo Info"
 
static char demo_version_number [] = DEMO_VERSION
 
static struct widget_context_infowidget_ctx_info
 Statically allocated context pointer. More...
 
static struct gfx_bitmap win_info_logo_icon
 Frame background bitmap. More...
 
static struct gfx_bitmap win_info_ret_icon
 Frame background bitmap. More...
 

Command event IDs for information widget.

Enumerator
ICON_DUMMY_ID 

Dummy icon.

ICON_INFO_ID 

Command event ID for information icon button.

ICON_INFO_DUMMY_ID 

Dummy ID.

enum info_type

Information type.

Enumerator
INFO_BOARD_NAME 

Information type of board name.

INFO_VER_NUM 

Information type of version number.

INFO_MAX 

Max information type.

void app_widget_info_on ( uint8_t  on)

Enable/disable information widget.

Parameters
onTurn on/off information widget.

References app_widget_launch_info(), widget_context_info::frame, win_destroy(), and wtk_basic_frame_as_child().

Referenced by widget_frame_command_handler(), and widget_info_command_handler().

static bool widget_info_command_handler ( struct wtk_basic_frame frame,
win_command_t  command_data 
)
static

Frame handler for the information widget.

Handles all command events from the information widgets in the frame.

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

References app_widget_info_on(), app_widget_main_on(), ICON_INFO_ID, and UNUSED.

Referenced by app_widget_launch_info().

char demo_func_name[] = "Demo Info"
static

Referenced by app_widget_launch_info().

char demo_version_number[] = DEMO_VERSION
static

Referenced by app_widget_launch_info().

struct widget_context_info* widget_ctx_info
static

Statically allocated context pointer.

struct gfx_bitmap win_info_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

Frame background bitmap.

struct gfx_bitmap win_info_ret_icon
static
Initial value:
= {
.width = 48, .height=48,
.type = GFX_BITMAP_EXT,
.data.custom = DEMO_BMP_BTN_BACK
}
Definition: gfx_generic.h:68
#define DEMO_BMP_BTN_BACK
Definition: bitmaps.h:44

Frame background bitmap.