00001
00029 #include "gui.h"
00030
00031 #include "intc.h"
00032 #include "board.h"
00033 #include "pm.h"
00034 #include "gpio.h"
00035 #include "printf-stdarg.h"
00036 #include "print_funcs.h"
00037 #include "delay.h"
00038 #include "spi.h"
00039 #if BOARD == EVK1104 || BOARD == EVK1105
00040 #include "conf_et024006dhu.h"
00041 #include "et024006dhu.h"
00042 #endif
00043 #include "console.h"
00044 #if 0
00045 #include "bmp_reader.h"
00046 #endif
00047 #include "clocks.h"
00048 #include <avr32/io.h>
00049 #include <string.h>
00050
00051
00052 #if BOARD == EVK1100
00053 #include "dip204.h"
00054
00055
00056 int button[] = {GPIO_JOYSTICK_LEFT,
00057 GPIO_JOYSTICK_RIGHT,
00058 GPIO_JOYSTICK_UP,
00059 GPIO_JOYSTICK_DOWN,
00060 GPIO_JOYSTICK_PUSH };
00061
00062 #define BUTTON_PRESSED GPIO_JOYSTICK_DOWN_PRESSED
00063
00064 #elif BOARD == EVK1104
00065 #include "qt60168.h"
00066 #include "conf_qt60168.h"
00067
00068 static short idx_to_button_map[] = {
00069 QT60168_TOUCH_SENSOR_BUTTON_0,
00070 QT60168_TOUCH_SENSOR_BUTTON_1,
00071 QT60168_TOUCH_SENSOR_BUTTON_2,
00072 QT60168_TOUCH_SENSOR_BUTTON_3,
00073 QT60168_TOUCH_SENSOR_WHEEL_UP};
00074
00075 #elif BOARD == EVK1105
00076 #include "qt1081.h"
00077 int button[] = {QT1081_TOUCH_SENSOR_3,
00078 QT1081_TOUCH_SENSOR_2,
00079 QT1081_TOUCH_SENSOR_0,
00080 QT1081_TOUCH_SENSOR_1,
00081 QT1081_TOUCH_SENSOR_4 };
00082
00083 #define BUTTON_PRESSED QT1081_TOUCH_SENSOR_0_PRESSED
00084
00085 #endif
00086
00087 #if __GNUC__
00088 __attribute__((__always_inline__))
00089 #endif
00090 static __inline__ int is_pressed(short idx) {
00091 #if BOARD == EVK1104
00092 return qt60168_is_key_pressed(idx_to_button_map[idx]);
00093 #else
00094 return (gpio_get_pin_value(button[idx]) == BUTTON_PRESSED);
00095 #endif
00096 }
00097
00098 #define YELLOW 0xFFE0
00099
00100
00101 #define TITLE_X 0
00102 #define TITLE_Y 0
00103 #define TITLE_W 320
00104 #define TITLE_H 40
00105 #define TITLE_BG_COLOR BLACK
00106 #define TITLE_FG_COLOR WHITE
00107
00108
00109 #define SCROLL_X 0
00110 #define SCROLL_Y 40
00111 #define SCROLL_W 320
00112 #define SCROLL_H 160
00113 #define SCROLL_BG_COLOR WHITE
00114 #define SCROLL_FG_COLOR BLACK
00115 #define CURSOR_BG_COLOR BLUE
00116 #define CURSOR_FG_COLOR WHITE
00117 #define INFO_FG_COLOR WHITE
00118 #define INFO_BG_COLOR BLACK
00119
00120 #define BUTTON_X 0
00121 #define BUTTON_Y 200
00122 #define BUTTON_W 320
00123 #define BUTTON_H 40
00124 #define BUTTON_BG_COLOR BLACK
00125 #define BUTTON_FG_COLOR WHITE
00126
00127
00128
00129 short mod = 0;
00130 #define SCROLL_MAX_LINES 50
00131 #if BOARD == EVK1100
00132 #define SCROLL_DISP_LINES 3
00133 #define MAX_LINE_LEN 20
00134 #else
00135 #define SCROLL_DISP_LINES 11
00136 #define MAX_LINE_LEN 37
00137 #endif
00138
00139 struct {
00140 int bg_color;
00141 int cnt;
00142 int cursor;
00143 int dispstart;
00144 char lines[SCROLL_MAX_LINES][MAX_LINE_LEN];
00145 } scroll_box_contents;
00146
00147 enum {
00148 GUI_LIST,
00149 GUI_INFOBOX,
00150 GUI_GETSTRING
00151 } display_mode = GUI_LIST;
00152
00153
00154
00155 #if BOARD == EVK1100
00156 #define INFO_MAX_LINES 3
00157 #else
00158 #define INFO_MAX_LINES 12
00159 #endif
00160 struct {
00161 int bg_color;
00162 char lines[INFO_MAX_LINES][MAX_LINE_LEN];
00163 } infobox_contents;
00164
00165 struct {
00166 int width;
00167 int height;
00168 char *data;
00169 size_t data_len;
00170 } info_bitmap;
00171
00172 #define TITLE_MAX_LINES 3
00173
00174 struct {
00175 char title[TITLE_MAX_LINES][MAX_LINE_LEN];
00176 } title_contents;
00177
00178 #define NUM_BUTTONS 5
00179
00180 struct {
00181 char labels[NUM_BUTTONS][MAX_LINE_LEN];
00182 button_cb_t cbs[NUM_BUTTONS];
00183 } button_contents, saved_buttons;
00184
00185 int led_array[4] = {LED0,LED1,LED2,LED3};
00186
00189 #if BOARD == EVK1104
00190 static void qt60168_resources_init(const pm_freq_param_t *pm_freq_param)
00191 {
00192 static const gpio_map_t QT60168_SPI_GPIO_MAP =
00193 {
00194 {QT60168_SPI_SCK_PIN, QT60168_SPI_SCK_FUNCTION },
00195 {QT60168_SPI_MISO_PIN, QT60168_SPI_MISO_FUNCTION },
00196 {QT60168_SPI_MOSI_PIN, QT60168_SPI_MOSI_FUNCTION },
00197 {QT60168_SPI_NPCS0_PIN, QT60168_SPI_NPCS0_FUNCTION}
00198 };
00199
00200
00201 spi_options_t spiOptions =
00202 {
00203 .reg = QT60168_SPI_NCPS,
00204 .baudrate = QT60168_SPI_MASTER_SPEED,
00205 .bits = QT60168_SPI_BITS,
00206 .spck_delay = 0,
00207 .trans_delay = 0,
00208 .stay_act = 0,
00209 .spi_mode = 3,
00210 .modfdis = 1
00211 };
00212
00213
00214 gpio_enable_module(QT60168_SPI_GPIO_MAP,
00215 sizeof(QT60168_SPI_GPIO_MAP) / sizeof(QT60168_SPI_GPIO_MAP[0]));
00216
00217
00218 spi_initMaster(QT60168_SPI, &spiOptions);
00219
00220
00221 spi_selectionMode(QT60168_SPI, 0, 0, 0);
00222
00223
00224 spi_enable(QT60168_SPI);
00225
00226
00227 spi_setupChipReg(QT60168_SPI, &spiOptions, pm_freq_param->cpu_f);
00228 }
00229 #endif
00230
00231
00232
00233 void gui_init(const pm_freq_param_t *pm_freq_param) {
00234 #if BOARD == EVK1100
00235 static const gpio_map_t DIP204_SPI_GPIO_MAP =
00236 {
00237 {DIP204_SPI_SCK_PIN, DIP204_SPI_SCK_FUNCTION },
00238 {DIP204_SPI_MISO_PIN, DIP204_SPI_MISO_FUNCTION},
00239 {DIP204_SPI_MOSI_PIN, DIP204_SPI_MOSI_FUNCTION},
00240 {DIP204_SPI_NPCS_PIN, DIP204_SPI_NPCS_FUNCTION}
00241 };
00242 spi_options_t spiOptions =
00243 {
00244 .reg = DIP204_SPI_NPCS,
00245 .baudrate = 1000000,
00246 .bits = 8,
00247 .spck_delay = 0,
00248 .trans_delay = 0,
00249 .stay_act = 1,
00250 .spi_mode = 3,
00251 .modfdis = 1
00252 };
00253 #endif
00254
00255 memset(&scroll_box_contents, 0, sizeof scroll_box_contents);
00256 memset(&title_contents, 0, sizeof title_contents);
00257 memset(&button_contents, 0, sizeof button_contents);
00258 memset(&infobox_contents, 0, sizeof infobox_contents);
00259 memset(&info_bitmap, 0, sizeof info_bitmap);
00260 #if BOARD == EVK1104
00261
00262 qt60168_resources_init(pm_freq_param);
00263
00264 qt60168_init(pm_freq_param->cpu_f);
00265 #endif
00266 #if BOARD == EVK1100
00267
00268 gpio_enable_module(DIP204_SPI_GPIO_MAP,
00269 sizeof(DIP204_SPI_GPIO_MAP) / sizeof(DIP204_SPI_GPIO_MAP[0]));
00270 #if 0
00271
00272 spi_initMaster(DIP204_SPI, &spiOptions);
00273
00274
00275 spi_selectionMode(DIP204_SPI, 0, 0, 0);
00276
00277
00278 spi_enable(DIP204_SPI);
00279 #endif
00280
00281 spi_setupChipReg(DIP204_SPI, &spiOptions, FOSC0);
00282
00283
00284 delay_init( FPBA_HZ );
00285
00286
00287 dip204_init(backlight_PWM, TRUE);
00288 dip204_set_cursor_position(1,1);
00289 dip204_write_string("http server demo!");
00290 #else
00291
00292 et024006_Init( pm_freq_param->cpu_f, pm_freq_param->cpu_f );
00293
00294 gpio_set_gpio_pin(ET024006DHU_BL_PIN);
00295 #endif
00296 mod = 1;
00297 }
00298
00299
00300 void gui_set_title(const char *str, unsigned char line)
00301 {
00302 int len;
00303
00304 Assert(line < 3);
00305
00306 memset(&title_contents.title[line], 0, sizeof title_contents.title[0]);
00307 len = strlen(str);
00308
00309 if (len >= sizeof title_contents.title[0]) {
00310 len = sizeof title_contents.title[0] - 1;
00311 }
00312 strncpy(title_contents.title[line], str, len);
00313
00314 mod = 1;
00315 }
00316
00317 int gui_set_button(short id, const char *label, size_t len, button_cb_t cb)
00318 {
00319
00320 if (id >= NUM_BUTTONS) {
00321 return 0;
00322 }
00323 if (len >= sizeof button_contents.labels[id]) {
00324 len = sizeof button_contents.labels[id] - 1;
00325 }
00326 button_contents.cbs[id] = cb;
00327 strncpy(button_contents.labels[id], label, len);
00328 mod = 1;
00329
00330 return 1;
00331 }
00332
00333 void gui_clear_scroll_box(void)
00334 {
00335
00336 memset(&scroll_box_contents, 0, sizeof scroll_box_contents);
00337 scroll_box_contents.dispstart = 0;
00338 }
00339
00340 void gui_set_bg_color(short color)
00341 {
00342 scroll_box_contents.bg_color = color;
00343 }
00344
00345 void gui_inc_scroll_cursor(void)
00346 {
00347
00348 #ifdef DEBUG
00349 printk("inc1: cur=%d, dstrt=%d\n", scroll_box_contents.cursor,
00350 scroll_box_contents.dispstart);
00351 #endif
00352 scroll_box_contents.cursor++;
00353 if (scroll_box_contents.cursor > (scroll_box_contents.dispstart
00354 + SCROLL_DISP_LINES))
00355 {
00356 scroll_box_contents.dispstart++;
00357 }
00358 if (scroll_box_contents.cursor >= scroll_box_contents.cnt)
00359 {
00360 scroll_box_contents.dispstart = 0;
00361 scroll_box_contents.cursor = 1;
00362 }
00363 #ifdef DEBUG
00364 printk("inc2: cur=%d, dstrt=%d\n", scroll_box_contents.cursor,
00365 scroll_box_contents.dispstart);
00366 #endif
00367 mod = 1;
00368 }
00369
00370
00371 void gui_dec_scroll_cursor(void)
00372 {
00373 #ifdef DEBUG
00374 printk("dec1: cur:%d,dstrt=%d\n", scroll_box_contents.cursor,
00375 scroll_box_contents.dispstart);
00376 #endif
00377 scroll_box_contents.cursor--;
00378
00379 if (scroll_box_contents.cursor <= 0)
00380 {
00381 scroll_box_contents.dispstart = scroll_box_contents.cnt - SCROLL_DISP_LINES;
00382 if (scroll_box_contents.dispstart < 0) scroll_box_contents.dispstart = 0;
00383 scroll_box_contents.cursor = scroll_box_contents.cnt - 1;
00384 }
00385 if (scroll_box_contents.cursor < scroll_box_contents.dispstart)
00386 {
00387 scroll_box_contents.dispstart--;
00388 }
00389 #ifdef DEBUG
00390 printk("dec2: cur:%d,dstrt=%d\n", scroll_box_contents.cursor,
00391 scroll_box_contents.dispstart);
00392 #endif
00393 mod = 1;
00394 }
00395
00396 int gui_scroll_idx(void)
00397 {
00398 return scroll_box_contents.cursor;
00399 }
00400
00401 int gui_get_scroll_box_focused_item(char **str, size_t *len) {
00402 if (scroll_box_contents.cursor <= 0) {
00403 return FALSE;
00404 }
00405 *str = scroll_box_contents.lines[scroll_box_contents.cursor];
00406 *len = strlen(*str);
00407
00408 return TRUE;
00409 }
00410
00411
00412 void gui_add_scroll_box_item(const char *str, size_t len) {
00413
00414 int cnt = scroll_box_contents.cnt;
00415 int i;
00416
00417 if (cnt >= SCROLL_MAX_LINES) return;
00418
00419 for (i = 0; i < cnt; i++) {
00420 if (strncmp(str, scroll_box_contents.lines[i], len) == 0) {
00421 return;
00422 }
00423 }
00424
00425 if (len >= sizeof scroll_box_contents.lines[cnt]) {
00426 len = sizeof scroll_box_contents.lines[cnt] - 1;
00427 }
00428 strncpy(scroll_box_contents.lines[cnt], str, len);
00429 scroll_box_contents.cnt++;
00430 mod = 1;
00431 }
00432
00433
00434
00435 void gui_del_scroll_box_item(const char *str, size_t len) {
00436
00437 int cnt = scroll_box_contents.cnt;
00438 int i;
00439 int moving = 0;
00440
00441 printk("Delete %s\n", str);
00442 for (i = 0; i < cnt; i++) {
00443 if (! moving && strncmp(str, scroll_box_contents.lines[i], len) == 0) {
00444 printk("Found it at %d\n", i);
00445
00446 moving = 1;
00447 }
00448 if (moving) {
00449 if (scroll_box_contents.lines[i+1][0] == '\0') {
00450 memset(scroll_box_contents.lines[i], 0, sizeof scroll_box_contents.lines[i]);
00451 break;
00452 }
00453 printk("Moving \"%s\" to %i\n", scroll_box_contents.lines[i+1], i);
00454 memcpy(scroll_box_contents.lines[i], scroll_box_contents.lines[i+1],
00455 strlen(scroll_box_contents.lines[i+1]) + 1);
00456 memset(scroll_box_contents.lines[i+1], 0, sizeof scroll_box_contents.lines[i+1]);
00457 }
00458 }
00459 if (i < cnt) {
00460 scroll_box_contents.cnt--;
00461 }
00462
00463 mod = 1;
00464 }
00465
00466
00467 #define BUTTON_SENSITIVITY_TICKS 3
00468
00469 int poll_button(uint32_t tick) {
00470 static int pressed_button = -1;
00471 static int press_start_tick = 0;
00472 static int action_ok = 0;
00473 static int poll_limit_ts = 0;
00474 int ret, i;
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485 if ( pressed_button >= 0 ) {
00486 if ( is_pressed(pressed_button) ) {
00487
00488 if ( tick - press_start_tick > BUTTON_SENSITIVITY_TICKS ) {
00489 action_ok = 1;
00490 }
00491 return -1;
00492 }
00493
00494 ret = pressed_button;
00495 pressed_button = -1;
00496 press_start_tick = 0;
00497 if (action_ok) {
00498 action_ok = 0;
00499 return ret;
00500 }
00501
00502 return -1;
00503 }
00504
00505
00506
00507
00508 #if BOARD != EVK1104
00509 poll_limit_ts = 0;
00510 #endif
00511 if ( poll_limit_ts == 0 || tick - poll_limit_ts > 100 ) {
00512 for (i = 0; i < NUM_BUTTONS; i++) {
00513
00514 if ( is_pressed(i) )
00515 {
00516 pressed_button = i;
00517 press_start_tick = tick;
00518 break;
00519 }
00520 }
00521 poll_limit_ts = tick;
00522 }
00523 return -1;
00524 }
00525
00526 void gui_infobox_onoff(int state)
00527 {
00528 if (state)
00529 display_mode = GUI_INFOBOX;
00530 else
00531 display_mode = GUI_LIST;
00532
00533 mod = 1;
00534 }
00535
00536 int gui_infobox_state(void) {
00537 return (GUI_INFOBOX == display_mode);
00538 }
00539
00540
00541 void gui_clear_infobox(short color)
00542 {
00543 memset(&infobox_contents, 0, sizeof infobox_contents);
00544 infobox_contents.bg_color = color;
00545 }
00546
00547 void gui_add_infobox_item(const char *str, int line)
00548 {
00549 if (line < INFO_MAX_LINES) {
00550 strncpy(infobox_contents.lines[line], str, sizeof infobox_contents.lines[line]);
00551 mod = 1;
00552 }
00553 }
00554
00555 #if 0
00556 void gui_display_pic(void *pic, size_t len)
00557 {
00558 if (info_bitmap.data) {
00559 free(info_bitmap.data);
00560 info_bitmap.data = NULL;
00561 info_bitmap.data_len = 0;
00562 }
00563 if (NULL == pic) {
00564 return;
00565 }
00566 printk("Allocating %d bytes for pic\n", len);
00567 info_bitmap.data = malloc(len);
00568 printk("Allocated pointer %p\n", info_bitmap.data);
00569 if (info_bitmap.data) {
00570 printk("Copying pic data\n");
00571 info_bitmap.data_len = bmp_parse(info_bitmap.data,
00572 pic,
00573 len,
00574 &info_bitmap.height,
00575 &info_bitmap.width);
00576
00577
00578
00579 printk("Parsed width %d, height %d\n",
00580 info_bitmap.width,
00581 info_bitmap.height);
00582 }
00583
00584 }
00585
00586 #endif
00587
00588 void gui_display_infobox(void)
00589 {
00590 int i;
00591
00592 #if BOARD != EVK1100
00593
00594 et024006_DrawFilledRect(SCROLL_X,
00595 SCROLL_Y,
00596 SCROLL_W,
00597 SCROLL_H,
00598 infobox_contents.bg_color);
00599
00600 for (i = 0; i < INFO_MAX_LINES; i++)
00601 {
00602 if (strlen(infobox_contents.lines[i]))
00603 {
00604 int x;
00605 x = 160 - ((strlen(infobox_contents.lines[i]) / 2)*10);
00606 if (x < 0) x = 10;
00607 et024006_PrintString(infobox_contents.lines[i],
00608 (const unsigned char*)&FONT8x8,
00609 x,
00610 (i+1)*12+SCROLL_Y,
00611 INFO_FG_COLOR,
00612 infobox_contents.bg_color);
00613 }
00614 }
00615 if (info_bitmap.data && info_bitmap.data_len) {
00616 printk("Displaying pixmap (size %d)\n", info_bitmap.data_len);
00617 et024006_PutPixmap( (et024006_color_t *)info_bitmap.data,
00618 info_bitmap.width,
00619 0,
00620 0,
00621 40,
00622 40,
00623 info_bitmap.width,
00624 info_bitmap.height);
00625 }
00626 else {
00627 printk("Not displaying picture\n");
00628 }
00629 #else
00630 dip204_clear_display();
00631 for (i = 0; i < INFO_MAX_LINES; i++)
00632 {
00633 int len = strlen(infobox_contents.lines[i]);
00634 int col = (MAX_LINE_LEN/2) - (len/2);
00635 if ( col <= 0) col = 1;
00636 dip204_set_cursor_position(col,i+1);
00637 dip204_write_string(infobox_contents.lines[i]);
00638 dip204_hide_cursor();
00639 }
00640 #endif
00641 }
00642
00643 void gui_display_getstring(void);
00644
00645 void gui_getstring_onoff(int state)
00646 {
00647 if (state)
00648 display_mode = GUI_GETSTRING;
00649 else
00650 display_mode = GUI_LIST;
00651
00652 mod = 1;
00653 }
00654
00655 void gui_save_buttons()
00656 {
00657 memcpy(&saved_buttons, &button_contents, sizeof button_contents);
00658 }
00659
00660 void gui_restore_buttons()
00661 {
00662 memcpy(&button_contents, &saved_buttons, sizeof button_contents);
00663 }
00664
00665 void gui_exec(uint32_t tick) {
00666
00667 int i;
00668 static int pressed_button;
00669 static enum { INPUT, RUN } state = INPUT;
00670
00671 switch (state)
00672 {
00673 case INPUT:
00674 {
00675 i = poll_button(tick);
00676 if ( i < 0 ) {
00677 break;
00678 }
00679 else {
00680 if (button_contents.cbs[i]) {
00681 pressed_button = i;
00682 state = RUN;
00683 }
00684 }
00685 }
00686 break;
00687
00688 case RUN:
00689 {
00690 #ifdef GUI_COMPAT
00691 if (button_contents.cbs[pressed_button]() == CMD_INPROGRESS)
00692 return;
00693 #else
00694 button_contents.cbs[pressed_button]();
00695 #endif
00696 state = INPUT;
00697 pressed_button = -1;
00698 }
00699 }
00700
00701 gui_getstring(NULL, NULL);
00702 gui_draw(1);
00703 }
00704
00705 void gui_draw(int force_draw) {
00706 int i;
00707
00708 if (! mod) {
00709 return;
00710 }
00711 mod = 0;
00712 #if BOARD != EVK1100
00713
00714 et024006_DrawFilledRect(TITLE_X,
00715 TITLE_Y,
00716 TITLE_W,
00717 TITLE_H,
00718 TITLE_BG_COLOR);
00719 if (title_contents.title[0][0]) {
00720 et024006_PrintString(title_contents.title[0],
00721 (const unsigned char*)&FONT8x8,
00722 TITLE_X + 10,
00723 TITLE_Y + 5,
00724 TITLE_FG_COLOR,
00725 TITLE_BG_COLOR);
00726 et024006_PrintString(title_contents.title[1],
00727 (const unsigned char*)&FONT8x8,
00728 TITLE_X + 10,
00729 TITLE_Y + 5 + 12,
00730 TITLE_FG_COLOR,
00731 TITLE_BG_COLOR);
00732 et024006_PrintString(title_contents.title[2],
00733 (const unsigned char*)&FONT8x8,
00734 TITLE_X + 10,
00735 TITLE_Y + 5 + 12 + 12,
00736 TITLE_FG_COLOR,
00737 TITLE_BG_COLOR);
00738
00739 }
00740
00741
00742
00743 et024006_DrawFilledRect(SCROLL_X,
00744 SCROLL_Y,
00745 SCROLL_W,
00746 SCROLL_H,
00747 scroll_box_contents.bg_color);
00748
00749 #endif
00750 switch (display_mode)
00751 {
00752 case GUI_INFOBOX:
00753 gui_display_infobox();
00754 break;
00755
00756 case GUI_GETSTRING:
00757 gui_display_getstring();
00758 break;
00759
00760 case GUI_LIST:
00761 {
00762 #if BOARD == EVK1100
00763 dip204_clear_display();
00764 #endif
00765 for (i = 0; i <= SCROLL_DISP_LINES; i++)
00766 {
00767
00768 #if BOARD == EVK1100
00769
00770 dip204_set_cursor_position(1,i+1);
00771
00772 dip204_write_string(scroll_box_contents.lines[i+scroll_box_contents.dispstart]);
00773
00774 #else
00775
00776 if ((scroll_box_contents.cursor == i + scroll_box_contents.dispstart) &&
00777 scroll_box_contents.cursor != 0)
00778 {
00779
00780 et024006_PrintString(scroll_box_contents.lines[i+scroll_box_contents.dispstart],
00781 (const unsigned char*)&FONT8x8,
00782 SCROLL_X + 10,
00783 (i+1)*12+SCROLL_Y,
00784 scroll_box_contents.bg_color,
00785 CURSOR_BG_COLOR);
00786 }
00787 else
00788 {
00789 et024006_PrintString(scroll_box_contents.lines[i+scroll_box_contents.dispstart],
00790 (const unsigned char*)&FONT8x8,
00791 SCROLL_X + 10,
00792 (i+1)*12+SCROLL_Y,
00793 SCROLL_FG_COLOR,
00794 scroll_box_contents.bg_color);
00795 }
00796 #endif
00797 }
00798 #if BOARD == EVK1100
00799 dip204_set_cursor_position(1, scroll_box_contents.cursor - scroll_box_contents.dispstart+1);
00800 dip204_show_cursor();
00801 #endif
00802 }
00803 }
00804
00805 #if BOARD != EVK1100
00806 et024006_DrawFilledRect(BUTTON_X,
00807 BUTTON_Y,
00808 BUTTON_W,
00809 BUTTON_H,
00810 BUTTON_BG_COLOR);
00811 for (i = 0; i < NUM_BUTTONS-1; i++) {
00812 et024006_DrawVertLine(i*BUTTON_W/NUM_BUTTONS,
00813 BUTTON_Y,
00814 BUTTON_H,
00815 BUTTON_FG_COLOR);
00816
00817 if (button_contents.labels[i]) {
00818 et024006_PrintString(button_contents.labels[i],
00819 (const unsigned char*)&FONT8x8,
00820 i*BUTTON_W/NUM_BUTTONS + 5,
00821 BUTTON_Y + 10,
00822 BUTTON_FG_COLOR,
00823 BUTTON_BG_COLOR);
00824 }
00825 }
00826 #endif
00827 }
00828
00829