Definition in file gui.h.
#include "et024006dhu.h"
Go to the source code of this file.
Defines | |
#define | GUI_BOXES |
#define | GUI_FONT FONT8x8 |
#define | GUI_FONT_HEIGHT 8 |
#define | GUI_FONT_WIDTH 8 |
#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_OUTPUT1_BG_COLOR GUI_MAIN_BG_COLOR |
#define | GUI_OUTPUT1_FG_COLOR GUI_MAIN_FG_COLOR |
#define | GUI_OUTPUT1_HEIGHT 24 |
#define | GUI_OUTPUT1_ID 1 |
#define | GUI_OUTPUT1_WIDTH 62 |
#define | GUI_OUTPUT1_X 20 |
#define | GUI_OUTPUT1_Y 112 |
#define | GUI_OUTPUT2_BG_COLOR GUI_MAIN_BG_COLOR |
#define | GUI_OUTPUT2_FG_COLOR GUI_MAIN_FG_COLOR |
#define | GUI_OUTPUT2_HEIGHT 24 |
#define | GUI_OUTPUT2_ID 2 |
#define | GUI_OUTPUT2_WIDTH 62 |
#define | GUI_OUTPUT2_X 128 |
#define | GUI_OUTPUT2_Y 22 |
#define | GUI_OUTPUT3_BG_COLOR GUI_MAIN_BG_COLOR |
#define | GUI_OUTPUT3_FG_COLOR GUI_MAIN_FG_COLOR |
#define | GUI_OUTPUT3_HEIGHT 24 |
#define | GUI_OUTPUT3_ID 3 |
#define | GUI_OUTPUT3_WIDTH 62 |
#define | GUI_OUTPUT3_X 128 |
#define | GUI_OUTPUT3_Y 190 |
#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 24 |
#define | GUI_SOURCE1_ID 0 |
#define | GUI_SOURCE1_WIDTH 62 |
#define | GUI_SOURCE1_X 238 |
#define | GUI_SOURCE1_Y 112 |
#define | GUI_TEXT_BUFFER_SIZE 256 |
This does not takje care of the buffer overflow, so make sure this value is big enough. | |
#define | GUI_TEXT_COLOR 0xAEAE |
#define | GUI_ZOOM_BOX_HEIGHT 240 |
#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. | |
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). | |
void | gui_task (void) |
#define GUI_NO_COLOR ((uint16_t) -1) |
#define GUI_NO_SEL -1 |
#define GUI_OUTPUT1_ID 1 |
Definition at line 75 of file gui.h.
Referenced by gui_task(), state_machine_global(), and state_machine_task().
#define GUI_OUTPUT2_ID 2 |
Definition at line 84 of file gui.h.
Referenced by gui_task(), state_machine_global(), and state_machine_task().
#define GUI_OUTPUT3_ID 3 |
Definition at line 93 of file gui.h.
Referenced by gui_task(), state_machine_global(), and state_machine_task().
#define GUI_SELECTION_COLOR 0xAA3F |
#define GUI_SOURCE1_ID 0 |
Definition at line 66 of file gui.h.
Referenced by gui_task(), state_machine_global(), and state_machine_task().
#define GUI_TEXT_BUFFER_SIZE 256 |
#define GUI_ZOOM_BOX_HEIGHT 240 |
#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.
Definition at line 102 of file gui.c.
References gui_cpu_hz, and gui_fs.
Referenced by gui_init().
00103 { 00104 gui_fs.time_ms = time_ms; 00105 cpu_set_timeout(cpu_ms_2_cy(gui_fs.time_ms, gui_cpu_hz), &gui_fs.cpu_time); 00106 }
void gui_clear_view | ( | void | ) |
Definition at line 127 of file gui.c.
References gui_draw_background().
Referenced by gui_init(), and state_machine_task().
00128 { 00129 gui_draw_background(0, 0, ET024006_WIDTH, ET024006_HEIGHT); 00130 }
uint32_t gui_get_update_fs | ( | void | ) |
void gui_init | ( | int | cpu_hz, | |
int | hsb_hz, | |||
int | pba_hz, | |||
int | pbb_hz | |||
) |
Definition at line 113 of file gui.c.
References DEFAULT_SCREEN_UPDATE_FS_MS, gui_change_update_fs(), gui_clear_view(), and gui_cpu_hz.
Referenced by main().
00114 { 00115 gui_cpu_hz = cpu_hz; 00116 // Init the delay function 00117 delay_init(cpu_hz); 00118 // Init the display 00119 et024006_Init(cpu_hz, hsb_hz); 00120 gpio_set_gpio_pin(ET024006DHU_BL_PIN); 00121 // Draw the background 00122 gui_clear_view(); 00123 // Set the frequency rate of the update of the display 00124 gui_change_update_fs(DEFAULT_SCREEN_UPDATE_FS_MS); 00125 }
void gui_set_selection | ( | int | box_id | ) |
Select a new box (can select only one box a time).
Definition at line 148 of file gui.c.
References gui_box::bg_color, gui_draw_background(), GUI_NO_COLOR, GUI_NO_SEL, GUI_SELECTION_COLOR, gui_box::height, gui_box::width, gui_box::x, and gui_box::y.
Referenced by state_machine_global().
00149 { 00150 static int prev_selection = GUI_NO_SEL; 00151 struct gui_box *sb; 00152 int i; 00153 00154 // Clear previous selections 00155 if (prev_selection != GUI_NO_SEL && prev_selection != box_id) 00156 { 00157 i = prev_selection; 00158 sb = (struct gui_box *) &box[i]; 00159 // Don't do anything if the color is transparent 00160 if (sb->bg_color == GUI_NO_COLOR) 00161 { 00162 gui_draw_background(sb->x - 2, sb->y - 2, sb->width + 4, 2); 00163 gui_draw_background(sb->x - 2, sb->y + sb->height, sb->width + 4, 2); 00164 gui_draw_background(sb->x - 2, sb->y - 2, 2, sb->height + 4); 00165 gui_draw_background(sb->x + sb->width, sb->y - 2, 2, sb->height + 4); 00166 } 00167 else 00168 { 00169 et024006_DrawFilledRect(sb->x - 2, sb->y - 2, sb->width + 4, 2, sb->bg_color); 00170 et024006_DrawFilledRect(sb->x - 2, sb->y + sb->height, sb->width + 4, 2, sb->bg_color); 00171 et024006_DrawFilledRect(sb->x - 2, sb->y - 2, 2, sb->height + 4, sb->bg_color); 00172 et024006_DrawFilledRect(sb->x + sb->width, sb->y - 2, 2, sb->height + 4, sb->bg_color); 00173 } 00174 } 00175 00176 prev_selection = box_id; 00177 00178 if (box_id == GUI_NO_SEL) 00179 return; 00180 // Draw the selection 00181 sb = (struct gui_box *) &box[box_id]; 00182 et024006_DrawFilledRect(sb->x - 2, sb->y - 2, sb->width + 4, 2, GUI_SELECTION_COLOR); 00183 et024006_DrawFilledRect(sb->x - 2, sb->y + sb->height, sb->width + 4, 2, GUI_SELECTION_COLOR); 00184 et024006_DrawFilledRect(sb->x - 2, sb->y - 2, 2, sb->height + 4, GUI_SELECTION_COLOR); 00185 et024006_DrawFilledRect(sb->x + sb->width, sb->y - 2, 2, sb->height + 4, GUI_SELECTION_COLOR); 00186 }
void gui_task | ( | void | ) |
Definition at line 132 of file gui.c.
References gui_cpu_hz, gui_fs, GUI_OUTPUT1_ID, GUI_OUTPUT2_ID, GUI_OUTPUT3_ID, gui_print_signal_box(), GUI_SOURCE1_ID, signal1_buf, signal2_buf, signal3_buf, and signal4_buf.
Referenced by main().
00133 { 00134 extern volatile Bool source1_zoom_view; 00135 00136 // Check the last time the printing has been done 00137 if (cpu_is_timeout(&gui_fs.cpu_time)) 00138 { 00139 gui_print_signal_box(GUI_SOURCE1_ID, signal1_buf, sizeof(signal1_buf)/sizeof(signal1_buf[0])); 00140 gui_print_signal_box(GUI_OUTPUT3_ID, signal2_buf, sizeof(signal2_buf)/sizeof(signal2_buf[0])); 00141 gui_print_signal_box(GUI_OUTPUT2_ID, signal3_buf, sizeof(signal3_buf)/sizeof(signal3_buf[0])); 00142 gui_print_signal_box(GUI_OUTPUT1_ID, signal4_buf, sizeof(signal4_buf)/sizeof(signal4_buf[0])); 00143 00144 cpu_set_timeout(cpu_ms_2_cy(gui_fs.time_ms, gui_cpu_hz), &gui_fs.cpu_time); 00145 } 00146 }