int main(void) { uint8_t step = 0; /* 初始化系统时钟 */ system_clock_config(); /* 初始化中断优先级分组 */ nvic_priority_group_config(NVIC_PRIORITY_GROUP_4); /* 初始化延时函数 */ delay_init(); /* 初始化LCD */ lcd_init(LCD_DISPLAY_VERTICAL); while(1) { /* 改变显示颜色 */ switch(step) { case 0: lcd_clear(WHITE ); break; case 1: lcd_clear(BLUE ); break; case 2: lcd_clear(BRED ); break; case 3: lcd_clear(GBLUE ); break; case 4: lcd_clear(RED ); break; case 5: lcd_clear(BRRED ); break; case 6: lcd_clear(GREEN ); break; case 7: lcd_clear(YELLOW); break; default: step = 0; break; } /* 显示信息 */ lcd_string_show(10, 20, 200, 24, 24, (uint8_t *)"TFT LCD Test"); lcd_string_show(10, 60, 200, 24, 24, (uint8_t *)"2021-01-20"); step++; if(step == 7) { step = 0; } delay_ms(1000); } } |