Microchip® Advanced Software Framework

widget_scr_settings_backlight.c File Reference

Backlight settings widget for 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_backlight
 Backlight settings widget context. More...
 

Enumerations

enum  bkl_command_id {
  ICON_DUMMY_ID = 0,
  ICON_SETTINGS_BACKLIGHT_UP_ID,
  ICON_SETTINGS_BACKLIGHT_DOWN_ID,
  ICON_SETTINGS_BACKLIGHT_RET_ID,
  ICON_SETTINGS_BACKLIGHT_MAX_ID
}
 Command event IDs for backlight settings widget. More...
 

Functions

static void app_widget_launch_settings_backlight (void)
 Setup backlight settings widget. More...
 
void app_widget_settings_backlight_on (uint8_t on)
 Enable/disable date settings widget. More...
 
static bool widget_settings_backlight_setup_command_handler (struct wtk_basic_frame *frame, win_command_t command_data)
 Frame handler for the backlight settings widget. More...
 

Variables

static char demo_func_name [] = "Set Backlight"
 Backlight settings function string. More...
 
static struct
widget_context_settings_backlight
widget_ctx_settings_backlight
 Statically allocated context pointer. More...
 
static struct gfx_bitmap win_root_logo_icon
 Logo frame bitmap. More...
 
static struct gfx_bitmap win_settings_backlight_down_icon
 Backlight down icon bitmap. More...
 
static struct gfx_bitmap win_settings_backlight_ret_icon
 Function return bitmap. More...
 
static struct gfx_bitmap win_settings_backlight_up_icon
 Backlight up icon bitmap. More...
 

Command event IDs for backlight settings widget.

Enumerator
ICON_DUMMY_ID 

Dummy icon.

ICON_SETTINGS_BACKLIGHT_UP_ID 

Command event ID for baklight up icon button.

ICON_SETTINGS_BACKLIGHT_DOWN_ID 

Command event ID for backlight down icon button.

ICON_SETTINGS_BACKLIGHT_RET_ID 

Command event ID for return icon button.

ICON_SETTINGS_BACKLIGHT_MAX_ID 

Max backling settings icon number.

void app_widget_settings_backlight_on ( uint8_t  on)
static bool widget_settings_backlight_setup_command_handler ( struct wtk_basic_frame frame,
win_command_t  command_data 
)
static

Frame handler for the backlight settings widget.

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

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

References AAT31XX_MAX_BACKLIGHT_LEVEL, AAT31XX_MIN_BACKLIGHT_LEVEL, aat31xx_set_backlight(), app_widget_settings_backlight_on(), app_widget_settings_on(), demo_param_t::backlight, demo_parameters_commit_changes(), g_demo_parameters, ICON_SETTINGS_BACKLIGHT_DOWN_ID, ICON_SETTINGS_BACKLIGHT_RET_ID, ICON_SETTINGS_BACKLIGHT_UP_ID, and UNUSED.

Referenced by app_widget_launch_settings_backlight().

char demo_func_name[] = "Set Backlight"
static

Backlight settings function string.

Referenced by app_widget_launch_settings_backlight().

struct widget_context_settings_backlight* widget_ctx_settings_backlight
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 frame bitmap.

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

Backlight down icon bitmap.

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

Function return bitmap.

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

Backlight up icon bitmap.