void screenRedrawBall(int oldX, int oldY, int x, int y) { hx8347a_set_top_left_limit(oldX-5, oldY-5); hx8347a_set_bottom_right_limit(oldX+5, oldY+5); hx8347a_duplicate_pixel(HX8347A_BLACK, 100); hx8347a_set_top_left_limit(x-5, y-5); hx8347a_set_bottom_right_limit(x+5, y+5); hx8347a_duplicate_pixel(HX8347A_BLUE, 100); }
void screenDrawMenu() { screenBlankScreen(); hx8347a_set_top_left_limit(5, 5); hx8347a_set_bottom_right_limit(215, 145); hx8347a_duplicate_pixel(HX8347A_BLUE, 210*150); hx8347a_set_top_left_limit(5, 155); hx8347a_set_bottom_right_limit(215, 315); hx8347a_duplicate_pixel(HX8347A_RED, 210*150); }
void screenDrawRectangle(int upperX, int leftY, int lowerX, int rightY, gfx_color_t color) { hx8347a_set_top_left_limit(upperX,leftY); hx8347a_set_bottom_right_limit(lowerX, rightY); hx8347a_duplicate_pixel(color, (lowerX - upperX)*(rightY - leftY)); }
void screenBlankScreen() { hx8347a_set_top_left_limit(0, 0); hx8347a_set_bottom_right_limit(240, 320); hx8347a_duplicate_pixel(HX8347A_BLACK, 76800); }
void screenDrawCalibrate(int x, int y) { screenBlankScreen(); hx8347a_set_top_left_limit(x-5, y-5); hx8347a_set_bottom_right_limit(x+5, y+5); hx8347a_duplicate_pixel(HX8347A_BLUE, 100); }
/** * \brief The main application routine */ int main(void) { board_init(); sysclk_init(); /* Make sure to initialize the display controller */ hx8347a_init(); /* Turn on the back light */ hx8347a_backlight_on(); /* Blank the screen by drawing a black background. Notice how the * drawing boundaries/limits are set to the entire screen */ hx8347a_set_top_left_limit(0, 0); hx8347a_set_bottom_right_limit(HX8347A_DEFAULT_WIDTH, HX8347A_DEFAULT_HEIGHT); hx8347a_duplicate_pixel(HX8347A_BLACK, TOTAL_PIXELS); /* Draw five squares in different colors to generate a test pattern for * the screen */ /* First draw a red square */ hx8347a_set_top_left_limit(60, 204); hx8347a_set_bottom_right_limit(180, 294); hx8347a_duplicate_pixel(HX8347A_RED, 11040); /* Then draw a green square */ hx8347a_set_top_left_limit(60, 204); hx8347a_set_top_left_limit(60, 114); hx8347a_set_bottom_right_limit(180, 194); hx8347a_duplicate_pixel(HX8347A_GREEN, 11040); /* Then draw a blue square */ hx8347a_set_top_left_limit(60, 204); hx8347a_set_top_left_limit(60, 12); hx8347a_set_bottom_right_limit(180, 102); hx8347a_duplicate_pixel(HX8347A_BLUE, 11040); /* Then draw a white square */ hx8347a_set_top_left_limit(60, 204); hx8347a_set_top_left_limit(15, 12); hx8347a_set_bottom_right_limit(45, 294); hx8347a_duplicate_pixel(HX8347A_WHITE, 11040); /* Then draw a gray square */ hx8347a_set_top_left_limit(60, 204); hx8347a_set_top_left_limit(195, 12); hx8347a_set_bottom_right_limit(225, 294); hx8347a_duplicate_pixel(HX8347A_GRAY, 11040); /* Application end */ while (true) { /* Do nothing */ } }