
/*************************************************************************
 * Copyright(c) 2023 Levetop Semiconductor Co.,Ltd. All rights reserved.
 *
 * @file   : main.c
 * @Brief  : FreeRTOS demostration program.
 *
 * @Version: V1.1
 * @Date   : 2024-02-26
 *
 * @Author : Bert Lee
 *************************************************************************/

#include "lt_api.h"

#include "FreeRTOS.h"
#include "task.h"

char *version="V1.1";

#define LCD_PIXEL_X		480
#define LCD_PIXEL_Y		320 

// ==========================================================================

static void Printf_Version(void)
{
	printf("/**************************************************/\r\n");
	printf(" LT269 FreeRTOS demo %s\r\n",version);
	printf(" System clock... %dMHz\r\n",g_sys_clk/1000000);
	printf(" IPS clock...... %dMHz\r\n",g_ips_clk/1000000);
	printf(" Panel size..... %dx%d\r\n",LCD_XSIZE_TFT,LCD_YSIZE_TFT);   
	printf(" Date = %s,Time = %s\r\n",( char *)__DATE__,( char *)__TIME__);
	printf("/**************************************************/\r\n");
}

void PeripheralInit(void)
{				
	
	Sys_Init();	
	INTX_ENABLE();
		
	UARTDebugPort_Init(SCI3,115200);
	Printf_Version();
		
	LCD_Init(1,LCD_PIXEL_X,LCD_PIXEL_Y);					//lcdType: for future used (0: SPI, 1: PPI8Bit, 2: PPI16Bit 3: QSPI 4: RGB)
	Screen_Clear(grYELLOW);
		
	Backlight_Init();					 		
	Backlight_Adjust(80);				//Backlight 0~99
}

extern void LTOS_application_define(void);

int main()
{	
	PeripheralInit();
	
	v_application_define();
	
	vTaskStartScheduler();
	
	while(1);

}	

