Microchip® Advanced Software Framework

widget_scr_settings.c File Reference

Settings widget for the SAM toolkit demo application.

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_settings
 Widget application context. More...
 

Enumerations

enum  settings_command_id {
  ICON_DUMMY_ID = 0,
  ICON_SETTINGS_TIME_ID,
  ICON_SETTINGS_DATE_ID,
  ICON_SETTINGS_BACKLIGHT_ID,
  ICON_SETTINGS_TSD_ID,
  ICON_SETTINGS_RET_ID,
  ICON_SETTINGS_MAX_ID
}
 Command event IDs for the settings widgets. More...
 

Functions

static void app_widget_launch_settings (void)
 Setup settings widget. More...
 
void app_widget_settings_on (uint8_t on)
 Enable/disable settings widget. More...
 
static bool widget_settings_frame_command_handler (struct wtk_basic_frame *frame, win_command_t command_data)
 Frame handler for the application. More...
 

Variables

static char demo_func_name [] = "Demo Settings"
 Function name of the settings widget. More...
 
static struct
widget_context_settings
widget_ctx_settings
 Statically allocated context pointer. More...
 
static struct gfx_bitmap win_root_logo_icon
 Logo bitmap. More...
 
static struct gfx_bitmap win_settings_backlight_icon
 Backlight settings bitmap. More...
 
static struct gfx_bitmap win_settings_date_icon
 Date settings bitmap. More...
 
static struct gfx_bitmap win_settings_ret_icon
 Return bitmap. More...
 
static struct gfx_bitmap win_settings_time_icon
 Time settings bitmap. More...
 
static struct gfx_bitmap win_settings_tsd_icon
 Touch calibration settings bitmap. More...
 

Command event IDs for the settings widgets.

Enumerator
ICON_DUMMY_ID 

Dummy icon.

ICON_SETTINGS_TIME_ID 

Command event ID for time settings icon button.

ICON_SETTINGS_DATE_ID 

Command event ID for date settings icon button.

ICON_SETTINGS_BACKLIGHT_ID 

Command event ID for backlight settings icon button.

ICON_SETTINGS_TSD_ID 

Command event ID for touch calibration settings button.

ICON_SETTINGS_RET_ID 

Command event ID for return icon button.

ICON_SETTINGS_MAX_ID 

Max settings icon number.

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

Frame handler for the application.

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

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

References app_widget_main_on(), app_widget_settings_backlight_on(), app_widget_settings_date_on(), app_widget_settings_on(), app_widget_settings_time_on(), DEMO_LCD_CALIBRATE_MODE, demo_set_special_mode_status(), ICON_SETTINGS_BACKLIGHT_ID, ICON_SETTINGS_DATE_ID, ICON_SETTINGS_RET_ID, ICON_SETTINGS_TIME_ID, ICON_SETTINGS_TSD_ID, and UNUSED.

Referenced by app_widget_launch_settings().

char demo_func_name[] = "Demo Settings"
static

Function name of the settings widget.

Referenced by app_widget_launch_settings().

struct widget_context_settings* widget_ctx_settings
static

Statically allocated context pointer.

struct gfx_bitmap win_root_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_settings_backlight_icon
static
Initial value:
= {
.width = 64, .height=64,
.type = GFX_BITMAP_EXT,
}
Definition: gfx_generic.h:68
#define DEMO_BMP_BTN_BACKLIGHT_SETUP
Definition: bitmaps.h:78

Backlight settings bitmap.

struct gfx_bitmap win_settings_date_icon
static
Initial value:
= {
.width = 56, .height=56,
.type = GFX_BITMAP_EXT,
.data.custom = DEMO_BMP_BTN_DATE_SETUP
}
Definition: gfx_generic.h:68
#define DEMO_BMP_BTN_DATE_SETUP
Definition: bitmaps.h:77

Date settings bitmap.

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

Return bitmap.

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

Time settings bitmap.

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

Touch calibration settings bitmap.