Ejemplo n.º 1
0
//!
//! @brief This function displays a box on the LCD.
//!
static void display_box( uint32_t x, uint32_t y, uint32_t size_x, uint32_t size_y, uint16_t color, uint16_t edge_color )
{
  et024006_DrawFilledRect(x, y, size_x, size_y, color);
  et024006_DrawHorizLine(x, y, size_x, edge_color);
  et024006_DrawVertLine(x+size_x-1, y, size_y, edge_color);
  et024006_DrawHorizLine(x, y+size_y-1, size_x, edge_color);
  et024006_DrawVertLine(x, y, size_y, edge_color);
}
Ejemplo n.º 2
0
static void ui_display_draw_textbox(void)
{
	/* Clear the display i.e. make it black */
	et024006_DrawFilledRect(0, 0, ET024006_WIDTH, ET024006_HEIGHT, BLACK );
	/* Draw blue Rectangle */
	et024006_DrawHorizLine(DISPLAY_FIRST_LINE_X - 2,
			DISPLAY_FIRST_LINE_Y - 2, ET024006_WIDTH - 20, BLUE);
	et024006_DrawVertLine(DISPLAY_FIRST_LINE_X - 2,
			DISPLAY_FIRST_LINE_Y - 2, ET024006_HEIGHT - 30, BLUE);
	et024006_DrawHorizLine(DISPLAY_FIRST_LINE_X - 2, ET024006_HEIGHT - 10,
			ET024006_WIDTH - 20, BLUE);
	et024006_DrawVertLine(ET024006_WIDTH - 10, DISPLAY_FIRST_LINE_Y - 2,
			ET024006_HEIGHT - 30, BLUE);
	/* Draw Welcome String */
	et024006_PrintString((char *)"Atmel Android Accessory Demo",
			(const uint8_t *)&FONT8x16, 12, 2, BLUE, WHITE);
}
Ejemplo n.º 3
0
static bool draw_play_button(void)
{
  if(ram_files[AUDIO_PLAYER_IMAGE].start_addr)
  {
    et024006_PutPixmap(ram_files[AUDIO_PLAYER_IMAGE].start_addr,
                       ET024006_WIDTH, PAUSE_BUTTON_POS_X, PAUSE_BUTTON_POS_Y,
                       PAUSE_BUTTON_POS_X, PAUSE_BUTTON_POS_Y, PAUSE_BUTTON_WIDTH, PAUSE_BUTTON_HEIGHT);
  }
  else
  {
    et024006_DrawFilledRect(PAUSE_BUTTON_POS_X, PAUSE_BUTTON_POS_Y,
                            PAUSE_BUTTON_WIDTH, PAUSE_BUTTON_HEIGHT, PAUSE_BUTTON_COLOR);
  }
  et024006_DrawVertLine( PLAY_BUTTON_POS_X+2, PLAY_BUTTON_POS_Y +1, 14, PAUSE_BUTTON_COLOR);
  et024006_DrawVertLine( PLAY_BUTTON_POS_X+3, PLAY_BUTTON_POS_Y+2, 12, PAUSE_BUTTON_COLOR);
  et024006_DrawVertLine( PLAY_BUTTON_POS_X+4, PLAY_BUTTON_POS_Y+3, 10, PAUSE_BUTTON_COLOR);
  et024006_DrawVertLine( PLAY_BUTTON_POS_X+5, PLAY_BUTTON_POS_Y+4, 9, PAUSE_BUTTON_COLOR);
  et024006_DrawVertLine( PLAY_BUTTON_POS_X+6, PLAY_BUTTON_POS_Y+5, 7, PAUSE_BUTTON_COLOR);
  et024006_DrawVertLine( PLAY_BUTTON_POS_X+7, PLAY_BUTTON_POS_Y+5, 6, PAUSE_BUTTON_COLOR);
  et024006_DrawVertLine( PLAY_BUTTON_POS_X+8, PLAY_BUTTON_POS_Y+6, 4, PAUSE_BUTTON_COLOR);
  et024006_DrawVertLine( PLAY_BUTTON_POS_X+9, PLAY_BUTTON_POS_Y+7, 3, PAUSE_BUTTON_COLOR);
  return true;
}
Ejemplo n.º 4
0
Archivo: gui.c Proyecto: InSoonPark/asf
void gui_draw(int force_draw) {
        int i;

        if (! mod) {
                return;
        }
        mod = 0;
#if BOARD != EVK1100
        // Draw title box
        et024006_DrawFilledRect(TITLE_X,
                                TITLE_Y,
                                TITLE_W,
                                TITLE_H,
                                TITLE_BG_COLOR);
        if (title_contents.title[0][0]) {
                et024006_PrintString(title_contents.title[0],
                                     (const unsigned char*)&FONT8x8,
                                     TITLE_X + 10,
                                     TITLE_Y + 5,
                                     TITLE_FG_COLOR,
                                     TITLE_BG_COLOR);
                et024006_PrintString(title_contents.title[1],
                                     (const unsigned char*)&FONT8x8,
                                     TITLE_X + 10,
                                     TITLE_Y + 5 + 12,
                                     TITLE_FG_COLOR,
                                     TITLE_BG_COLOR);
                et024006_PrintString(title_contents.title[2],
                                     (const unsigned char*)&FONT8x8,
                                     TITLE_X + 10,
                                     TITLE_Y + 5 + 12 + 12,
                                     TITLE_FG_COLOR,
                                     TITLE_BG_COLOR);

        }


        // Draw scroll box
        et024006_DrawFilledRect(SCROLL_X,
                                SCROLL_Y,
                                SCROLL_W,
                                SCROLL_H,
                                scroll_box_contents.bg_color);

#endif
        switch (display_mode)
        {
        case GUI_INFOBOX:
                gui_display_infobox();
                break;

        case GUI_GETSTRING:
                gui_display_getstring();
                break;

        case GUI_LIST:
        {
#if BOARD == EVK1100
                dip204_clear_display();
#endif
                for (i = 0; i <= SCROLL_DISP_LINES; i++)
                {

#if BOARD == EVK1100

                        dip204_set_cursor_position(1,i+1); /* col,line */

                        dip204_write_string(scroll_box_contents.lines[i+scroll_box_contents.dispstart]);

#else

                        if ((scroll_box_contents.cursor == i + scroll_box_contents.dispstart) &&
                            scroll_box_contents.cursor != 0)
                        {
                                /* Print cursor line. */
                                et024006_PrintString(scroll_box_contents.lines[i+scroll_box_contents.dispstart],
                                                     (const unsigned char*)&FONT8x8,
                                                     SCROLL_X + 10,
                                                     (i+1)*12+SCROLL_Y,
                                                     scroll_box_contents.bg_color,
                                                     CURSOR_BG_COLOR);
                        }
                        else
                        {
                                et024006_PrintString(scroll_box_contents.lines[i+scroll_box_contents.dispstart],
                                                     (const unsigned char*)&FONT8x8,
                                                     SCROLL_X + 10,
                                                     (i+1)*12+SCROLL_Y,
                                                     SCROLL_FG_COLOR,
                                                     scroll_box_contents.bg_color);
                        }
#endif
                }
#if BOARD == EVK1100
                dip204_set_cursor_position(1, scroll_box_contents.cursor - scroll_box_contents.dispstart+1);
                dip204_show_cursor();
#endif
        }
        } /* switch */
        // Draw buttons
#if BOARD != EVK1100
        et024006_DrawFilledRect(BUTTON_X,
                                BUTTON_Y,
                                BUTTON_W,
                                BUTTON_H,
                                BUTTON_BG_COLOR);
        for (i = 0; i < NUM_BUTTONS-1; i++) {
                et024006_DrawVertLine(i*BUTTON_W/NUM_BUTTONS,
                                      BUTTON_Y,
                                      BUTTON_H,
                                      BUTTON_FG_COLOR);
                // Display button labels
                if (button_contents.labels[i]) {
                        et024006_PrintString(button_contents.labels[i],
                                             (const unsigned char*)&FONT8x8,
                                             i*BUTTON_W/NUM_BUTTONS + 5,
                                             BUTTON_Y + 10,
                                             BUTTON_FG_COLOR,
                                             BUTTON_BG_COLOR);
                }
        }
#endif
}