Microchip® Advanced Software Framework

example1.c File Reference

Graphic library example application.

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

#include <board.h>
#include <sysclk.h>
#include "asf.h"
#include "smiley.h"
#include "atmel_logo.h"

Macros

#define GAP   (STEP + SPACING)
 
#define LANDSCAPE_MODE
 
#define SPACING   10
 
#define STEP   20
 

Functions

int main (void)
 main example code More...
 

Variables

const gfx_color_t color_table []
 
const char example_string [] = "Atmel Graphical Library GFX Service Test"
 

#define GAP   (STEP + SPACING)

Referenced by main().

#define LANDSCAPE_MODE
#define SPACING   10

Referenced by main().

#define STEP   20

Referenced by main().

int main ( void  )

main example code

The main function will draw all the graphic primitives from the graphic library on a line from left to right (incrementing x) and repeat this from bottom to top with varying colors (incrementing y). Below the figures it draws the Atmel logo centered on the screen.

References atmel_logo, board_init(), gfx_bitmap::color, color_table, example_string, GAP, gfx_color(), GFX_COLOR_RED, GFX_COLOR_TRANSPARENT, GFX_COLOR_WHITE, gfx_draw_bitmap(), gfx_draw_circle, gfx_draw_filled_circle, gfx_draw_filled_rect, gfx_draw_horizontal_line, gfx_draw_line, gfx_draw_pixel(), gfx_draw_rect, gfx_draw_string_aligned(), gfx_draw_vertical_line, GFX_FLIP_Y, gfx_get_height(), gfx_get_width(), gfx_init, gfx_set_orientation(), GFX_SWITCH_XY, GFX_WHOLE, gfx_bitmap::height, smiley, SPACING, STEP, sysclk_init(), sysfont, TEXT_ALIGN_LEFT, TEXT_POS_CENTER_X, and gfx_bitmap::width.

const gfx_color_t color_table[]
Initial value:
#define GFX_COLOR_GREEN
Definition: gfx.h:160
#define GFX_COLOR_YELLOW
Definition: gfx.h:166
#define GFX_COLOR_MAGENTA
Definition: gfx.h:164
#define GFX_COLOR_CYAN
Definition: gfx.h:168
#define GFX_COLOR_RED
Definition: gfx.h:158
#define GFX_COLOR_BLUE
Definition: gfx.h:162

Referenced by main().

const char example_string[] = "Atmel Graphical Library GFX Service Test"

Referenced by main().