Atmel Software Framework

uc3-dsplib-demo/gui.h File Reference
#include "et024006dhu.h"
#include "dsp_sprintf.h"

Macros

#define GUI_BOXES
 
#define GUI_COMMENT_BG_COLOR   GUI_NO_COLOR
 
#define GUI_COMMENT_FG_COLOR   GUI_TEXT_COLOR
 
#define GUI_COMMENT_HEIGHT   56
 
#define GUI_COMMENT_ID   5
 
#define GUI_COMMENT_WIDTH   190
 
#define GUI_COMMENT_X   126
 
#define GUI_COMMENT_Y   153
 
#define GUI_FILTER_BG_COLOR   GUI_NO_COLOR
 
#define GUI_FILTER_FG_COLOR   GUI_TEXT_COLOR
 
#define GUI_FILTER_HEIGHT   32
 
#define GUI_FILTER_ID   4
 
#define GUI_FILTER_WIDTH   171
 
#define GUI_FILTER_X   130
 
#define GUI_FILTER_Y   32
 
#define GUI_FONT   FONT8x8
 
#define GUI_FONT_HEIGHT   8
 
#define GUI_FONT_WIDTH   8
 
#define GUI_INPUT_BG_COLOR   GUI_MAIN_BG_COLOR
 
#define GUI_INPUT_FG_COLOR   GUI_MAIN_FG_COLOR
 
#define GUI_INPUT_HEIGHT   56
 
#define GUI_INPUT_ID   2
 
#define GUI_INPUT_WIDTH   92
 
#define GUI_INPUT_X   84
 
#define GUI_INPUT_Y   82
 
#define GUI_MAIN_BG_COLOR   0xF79E
 
#define GUI_MAIN_FG_COLOR   BLACK
 
#define GUI_NO_COLOR   ((uint16_t) -1)
 
#define GUI_NO_SEL   -1
 
#define GUI_OUTPUT_BG_COLOR   GUI_MAIN_BG_COLOR
 
#define GUI_OUTPUT_FG_COLOR   GUI_MAIN_FG_COLOR
 
#define GUI_OUTPUT_HEIGHT   56
 
#define GUI_OUTPUT_ID   3
 
#define GUI_OUTPUT_WIDTH   92
 
#define GUI_OUTPUT_X   210
 
#define GUI_OUTPUT_Y   82
 
#define GUI_SELECTION_COLOR   0xAA3F
 
#define GUI_SOURCE1_BG_COLOR   GUI_MAIN_BG_COLOR
 
#define GUI_SOURCE1_FG_COLOR   GUI_MAIN_FG_COLOR
 
#define GUI_SOURCE1_HEIGHT   56
 
#define GUI_SOURCE1_ID   0
 
#define GUI_SOURCE1_WIDTH   92
 
#define GUI_SOURCE1_X   13
 
#define GUI_SOURCE1_Y   10
 
#define GUI_SOURCE2_BG_COLOR   GUI_MAIN_BG_COLOR
 
#define GUI_SOURCE2_FG_COLOR   GUI_MAIN_FG_COLOR
 
#define GUI_SOURCE2_HEIGHT   56
 
#define GUI_SOURCE2_ID   1
 
#define GUI_SOURCE2_WIDTH   92
 
#define GUI_SOURCE2_X   13
 
#define GUI_SOURCE2_Y   153
 
#define GUI_TEXT_BUFFER_SIZE   256
 This does not take care of the buffer overflow, so make sure this value is big enough. More...
 
#define GUI_TEXT_COLOR   0xAEAE
 
#define gui_text_printf(box_id, format,...)
 Print a text in the text area. More...
 
#define GUI_ZOOM_BOX_HEIGHT   218
 
#define GUI_ZOOM_BOX_WIDTH   320
 
#define GUI_ZOOM_BOX_X   0
 
#define GUI_ZOOM_BOX_Y   0
 

Functions

void gui_change_update_fs (uint32_t time_ms)
 This function change the frequency rate of the update of the display. More...
 
void gui_clear_view (void)
 
uint32_t gui_get_update_fs (void)
 
void gui_init (int cpu_hz, int hsb_hz, int pba_hz, int pbb_hz)
 
void gui_set_selection (int box_id)
 Select a new box (can select only one box a time) More...
 
void gui_task (void)
 
void gui_text_print (int box_id, const char *text)
 Print text in a text box. More...
 

#define GUI_BOXES
#define GUI_COMMENT_BG_COLOR   GUI_NO_COLOR
#define GUI_COMMENT_FG_COLOR   GUI_TEXT_COLOR
#define GUI_COMMENT_HEIGHT   56
#define GUI_COMMENT_WIDTH   190
#define GUI_COMMENT_X   126
#define GUI_COMMENT_Y   153
#define GUI_FILTER_BG_COLOR   GUI_NO_COLOR
#define GUI_FILTER_FG_COLOR   GUI_TEXT_COLOR
#define GUI_FILTER_HEIGHT   32
#define GUI_FILTER_ID   4
#define GUI_FILTER_WIDTH   171
#define GUI_FILTER_X   130
#define GUI_FILTER_Y   32
#define GUI_FONT   FONT8x8

Referenced by gui_text_print().

#define GUI_FONT_HEIGHT   8

Referenced by gui_text_print().

#define GUI_FONT_WIDTH   8
#define GUI_INPUT_BG_COLOR   GUI_MAIN_BG_COLOR
#define GUI_INPUT_FG_COLOR   GUI_MAIN_FG_COLOR
#define GUI_INPUT_HEIGHT   56
#define GUI_INPUT_ID   2

Referenced by gui_task(), and state_machine_signal().

#define GUI_INPUT_WIDTH   92
#define GUI_INPUT_X   84
#define GUI_INPUT_Y   82
#define GUI_MAIN_BG_COLOR   0xF79E
#define GUI_MAIN_FG_COLOR   BLACK
#define GUI_NO_COLOR   ((uint16_t) -1)
#define GUI_NO_SEL   -1
#define GUI_OUTPUT_BG_COLOR   GUI_MAIN_BG_COLOR
#define GUI_OUTPUT_FG_COLOR   GUI_MAIN_FG_COLOR
#define GUI_OUTPUT_HEIGHT   56
#define GUI_OUTPUT_ID   3

Referenced by gui_task(), and state_machine_signal().

#define GUI_OUTPUT_WIDTH   92
#define GUI_OUTPUT_X   210
#define GUI_OUTPUT_Y   82
#define GUI_SELECTION_COLOR   0xAA3F

Referenced by gui_set_selection().

#define GUI_SOURCE1_BG_COLOR   GUI_MAIN_BG_COLOR
#define GUI_SOURCE1_FG_COLOR   GUI_MAIN_FG_COLOR
#define GUI_SOURCE1_HEIGHT   56
#define GUI_SOURCE1_ID   0

Referenced by gui_task(), and state_machine_source().

#define GUI_SOURCE1_WIDTH   92
#define GUI_SOURCE1_X   13
#define GUI_SOURCE1_Y   10
#define GUI_SOURCE2_BG_COLOR   GUI_MAIN_BG_COLOR
#define GUI_SOURCE2_FG_COLOR   GUI_MAIN_FG_COLOR
#define GUI_SOURCE2_HEIGHT   56
#define GUI_SOURCE2_ID   1

Referenced by gui_task(), and state_machine_source().

#define GUI_SOURCE2_WIDTH   92
#define GUI_SOURCE2_X   13
#define GUI_SOURCE2_Y   153
#define GUI_TEXT_BUFFER_SIZE   256

This does not take care of the buffer overflow, so make sure this value is big enough.

#define GUI_TEXT_COLOR   0xAEAE
#define gui_text_printf (   box_id,
  format,
  ... 
)
Value:
{ \
extern char gui_text_buffer[]; \
dsp16_sprintf(gui_text_buffer, format, __VA_ARGS__); \
gui_text_print(box_id, (const char *) gui_text_buffer); \
}
int dsp16_sprintf(char *out, const char *format,...)
Definition: dsp_sprintf.c:453
char gui_text_buffer[GUI_TEXT_BUFFER_SIZE]
Definition: gui.c:91
void gui_text_print(int box_id, const char *text)
Print text in a text box.
Definition: gui.c:240

Print a text in the text area.

Referenced by state_machine_idle(), and state_machine_source().

#define GUI_ZOOM_BOX_HEIGHT   218
#define GUI_ZOOM_BOX_WIDTH   320
#define GUI_ZOOM_BOX_X   0
#define GUI_ZOOM_BOX_Y   0

void gui_change_update_fs ( uint32_t  time_ms)

This function change the frequency rate of the update of the display.

References cpu_ms_2_cy(), cpu_set_timeout(), gui_cpu_hz, gui_fs, and time_ms.

Referenced by gui_init(), and state_machine_idle().

void gui_clear_view ( void  )
uint32_t gui_get_update_fs ( void  )

References gui_fs.

Referenced by state_machine_idle().

void gui_init ( int  cpu_hz,
int  hsb_hz,
int  pba_hz,
int  pbb_hz 
)