Microchip® Advanced Software Framework

widget_scr_settings_time.c File Reference

Time settings widget for SAM toolkit demo application.

Copyright (c) 2012-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_time
 Time settings widget context. More...
 

Macros

#define TOTAL_NUM_TIME_LABEL   6
 Total number of time settings widget labels. More...
 

Enumerations

enum  time_command_id {
  ICON_DUMMY_ID = 0,
  ICON_SETTINGS_TIME_HOUR_UP_ID,
  ICON_SETTINGS_TIME_MIN_UP_ID,
  ICON_SETTINGS_TIME_SEC_UP_ID,
  ICON_SETTINGS_TIME_HOUR_DOWN_ID,
  ICON_SETTINGS_TIME_MIN_DOWN_ID,
  ICON_SETTINGS_TIME_SEC_DOWN_ID,
  ICON_SETTINGS_TIME_RET_ID,
  ICON_SETTINGS_TIME_MAX_ID,
  LABEL_YEAR_ID = 0,
  LABEL_MONTH_ID,
  LABEL_DATE_ID
}
 Command event IDs for time settings widget. More...
 
enum  time_settings_label_type {
  LABEL_HOUR_ID = 0,
  LABEL_MIN_ID,
  LABEL_SEC_ID
}
 Label widget IDs. More...
 

Functions

static void app_widget_launch_settings_time (void)
 Setup time settings widget. More...
 
void app_widget_settings_time_on (uint8_t on)
 Enable/disable time settings widget. More...
 
static bool widget_settings_time_setup_command_handler (struct wtk_basic_frame *frame, win_command_t command_data)
 Frame handler for the application. More...
 

Variables

static char demo_func_name [] = "Set Time"
 Function name string. More...
 
static char str_hour [3]
 String array for hour. More...
 
static char str_min [3]
 String array for minutes. More...
 
static char str_sec [3]
 String array for second. More...
 
static struct
widget_context_settings_time
widget_ctx_settings_time
 Statically allocated context pointer. More...
 
static struct gfx_bitmap win_root_logo_icon
 Root logo bitmap. More...
 
static struct gfx_bitmap win_settings_time_hour_down_icon
 Hour down icon bitmap. More...
 
static struct gfx_bitmap win_settings_time_hour_up_icon
 Hour up icon bitmap. More...
 
static struct gfx_bitmap win_settings_time_min_down_icon
 Mintues down icon bitmap. More...
 
static struct gfx_bitmap win_settings_time_min_up_icon
 Minutes up icon bitmap. More...
 
static struct gfx_bitmap win_settings_time_ret_icon
 Return to up layer screen icon bitmap. More...
 
static struct gfx_bitmap win_settings_time_sec_down_icon
 Second down icon bitmap. More...
 
static struct gfx_bitmap win_settings_time_sec_up_icon
 Second up icon bitmap. More...
 

#define TOTAL_NUM_TIME_LABEL   6

Total number of time settings widget labels.

Command event IDs for time settings widget.

Enumerator
ICON_DUMMY_ID 

Dummy icon.

ICON_SETTINGS_TIME_HOUR_UP_ID 

Command event ID for hour up icon button.

ICON_SETTINGS_TIME_MIN_UP_ID 

Command event ID for minutes up icon button.

ICON_SETTINGS_TIME_SEC_UP_ID 

Command event ID for second up icon button.

ICON_SETTINGS_TIME_HOUR_DOWN_ID 

Command event ID for hour down icon button.

ICON_SETTINGS_TIME_MIN_DOWN_ID 

Command event ID for minutes down icon button.

ICON_SETTINGS_TIME_SEC_DOWN_ID 

Command event ID for second down icon button.

ICON_SETTINGS_TIME_RET_ID 

Command event ID for second icon button.

ICON_SETTINGS_TIME_MAX_ID 

Max time settings icon number.

LABEL_YEAR_ID 

Year label ID.

LABEL_MONTH_ID 

Month label ID.

LABEL_DATE_ID 

Date label ID.

Label widget IDs.

Enumerator
LABEL_HOUR_ID 

Hour label ID.

LABEL_MIN_ID 

Minute label ID.

LABEL_SEC_ID 

Second label ID.

static void app_widget_launch_settings_time ( void  )
static
void app_widget_settings_time_on ( uint8_t  on)

Enable/disable time settings widget.

Parameters
onTurn on/off time settings widget.

References app_widget_launch_settings_time(), widget_context_settings_time::frame, win_destroy(), and wtk_basic_frame_as_child().

Referenced by widget_settings_frame_command_handler(), and widget_settings_time_setup_command_handler().

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

char demo_func_name[] = "Set Time"
static

Function name string.

Referenced by app_widget_launch_settings_time().

char str_hour[3]
static
char str_min[3]
static
char str_sec[3]
static
struct widget_context_settings_time* widget_ctx_settings_time
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

Root logo bitmap.

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

Hour down icon bitmap.

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

Hour up icon bitmap.

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

Mintues down icon bitmap.

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

Minutes up icon bitmap.

struct gfx_bitmap win_settings_time_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 to up layer screen icon bitmap.

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

Second down icon bitmap.

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

Second up icon bitmap.