/*!
 * @file        main.c
 *
 * @brief       Main program body
 *
 * @version     V2.5
 *
 * @date        2024-08-08
 *
 * @attention
 *
 *  Copyright (C) 2020-2022 Geehy Semiconductor
 *
 *  You may not use this file except in compliance with the
 *  GEEHY COPYRIGHT NOTICE (GEEHY SOFTWARE PACKAGE LICENSE).
 *
 *  The program is only for reference, which is distributed in the hope
 *  that it will be useful and instructional for customers to develop
 *  their software. Unless required by applicable law or agreed to in
 *  writing, the program is distributed on an "AS IS" BASIS, WITHOUT
 *  ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the GEEHY SOFTWARE PACKAGE LICENSE for the governing permissions
 *  and limitations under the License.
 */
#include "include.h"

#include "lcd.h"
#include "pic.h"

/*!
 * @brief       Main program,LCD
 *
 * @param       None
 *
 * @retval      None
 *
 */
int main(void)
{
    printf("Hello GW3323 SPI LCD!\n");
    bsp_sys_init();                     /*System initialization*/
    set_sys_clk(SYS_160M);

    LCD_Init();
    LCD_Fill(0,0,LCD_W,LCD_H,WHITE);

    while (1)
    {
        LCD_Fill(130,0,160,9,GBLUE);                        //填充矩形
        LCD_ShowString(130,10,"Geehy",GRAYBLUE,WHITE,12,1);
        LCD_DrawLine(130,43,160,43,BLACK);                  //画线
        LCD_ShowIntNum(130,30,12345,5,BLACK,WHITE,12);      //显示整形数据
        LCD_Fill(130,45,160,55,GREEN);                      //填充矩形
        LCD_ShowFloatNum(130,60,12.34,4,BLACK,WHITE,12);    //显示浮点型数据
        LCD_DrawRectangle(130,59,159,73,BLACK);             //画矩形
        LCD_ShowChinese(140,80,"电",RED,WHITE,12,1);        //显示汉字
        LCD_ShowChinese(140,100,"子",RED,WHITE,12,1);       //显示汉字
        Draw_Circle(146,86,9,BLACK);                        //画圆
        LCD_Fill(130,120,160,128,BLUE);                     //填充矩形

        /*动图显示*/
        LCD_ShowPicture(0,0,128,128,gImage_pkq1);
        LCD_ShowPicture(0,0,128,128,gImage_pkq3);
        LCD_ShowPicture(0,0,128,128,gImage_pkq4);
        LCD_ShowPicture(0,0,128,128,gImage_pkq5);
        LCD_ShowPicture(0,0,128,128,gImage_pkq6);
        LCD_ShowPicture(0,0,128,128,gImage_pkq7);
        LCD_ShowPicture(0,0,128,128,gImage_pkq8);
        LCD_ShowPicture(0,0,128,128,gImage_pkq9);
    }
    return 0;
}
