[mw_shl_code=c,true]int main(void)
{
u8 h;
u8 i;
/* System Clocks Configuration */
RCC_Configuration();
delay_init(72); //input system clock for delay initial
USART_Configuration();//set BaudRate
GPIO_Configuration();
NVIC_Configuration();
SPI_Peripheral_Init();
EXTI_Configuration();
/*RTC?ì©l¤?*/
RTC_Config();
time_now = Time_GetCalendarTime();
if (time_now.tm_year<2011)
{
time_now.tm_year = 2011;
time_now.tm_mon = 10;//
time_now.tm_mday = 16;
time_now.tm_hour = 23;
time_now.tm_min = 59;
time_now.tm_sec = 55;
Time_SetCalendarTime(time_now);
}
/* Configure FSMC Bank1 NOR/PSRAM */
FSMC_LCD_Init();
/*RA8875 controller reset*/
//lcd_rst();
/*RA8875 controller initial with PLL setting*/
RA8875_LCD_Initial();
printf("LCD_Initial! ");
//????RA8875 GPIO?????????ò??
GPO_data(0x09);
/*setting RA8875 display on*/
LCD_CmdWrite(0x01); //
LCD_DataWrite(0x80); //
delay_ms(20);
/*RA8875 TP controller initial*/
Touch_Panel_Interrupt_Enable();// demo code using Auto mode + polling 8Fh to confirm touch
TP_auto_mode(); //enable auto mode
//TP_manual_mode();
LCD_CmdWrite(0x71);//set TP sample time & ADC clock
LCD_DataWrite(0x04);//
LCD_CmdWrite(0x70);//set TP sample time & ADC clock
//LCD_DataWrite(0xb3);//
LCD_DataWrite(0xc3);//
Enable_TP();
//Enable_Touch_WakeUp();
/*RA8875 DMA function setting*/
SROM_CLK_DIV(0); //set serial interface clock rate
Serial_ROM_select1();
Select_Serial_Waveform_mode3();
SERIAL_ROM_Read_Cycle_5bus();
SERIAL_ROM_DMA_mode();
SERIAL_ROM_Signal_mode();
//SERIAL_ROM_Dual_mode0();
DMA_Block_mode();
/*setting RA8875 memory clear with active window*/
Clear_Active_Window();
/*setting backlight on RA8875 PWM1 control*/
PWM1_enable();
PWM1_fnuction_sel();
PWM1_clock_ratio(0x02); //bit0~3 58KHZ
PWM1_duty_cycle(0xff); // ???G
//Brightness_level=10;
LcdClear(color_red);
printf("LcdClear!");
///////////????/////////////////////////
lcd_drawpoint(200,200,color_red);
printf("lcd_drawpoint ");
//////////????////////////////////////////
LCD_DrawLine(100,100,50,Horizontal);
printf("LCD_DrawLine ");
// LCD_DrawLine1(200, 300, 200, 350);
// printf("LCD_DrawLine111 ");
//LCD_Clear(0xf800);//
//LCD_DisplayStringLine(Line0,"test FSMC OK...",White,Blue);
//printf("\r\n test FSMC OK...\r\n");
[/mw_shl_code]
[mw_shl_code=c,true]void LcdClear(u16 color)
{
Text_color(color); // ?è?¨????
Geometric_Coordinate(0,479,0,271); // ?è?¨????×?±ê
LCD_CmdWrite(0x90);
LCD_DataWrite(0xB0);
//RA8875_WAITSTATUS();
}[/mw_shl_code]
[mw_shl_code=c,true]void lcd_drawpoint(u16 x, u16 y, u16 color)
{
// XY_Coordinate(x,y);
// LCD_CmdWrite(0x02);//MRWC
// LCD_DataWrite(color);
} [/mw_shl_code]
[mw_shl_code=c,true]void LCD_DrawLine(u16 Xpos, u16 Ypos, u16 Length, u8 Direction)
{
u32 i = 0;
LCD_SetCursor(Xpos,319 - Ypos);
if(Direction == Horizontal)
{
LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
for(i = 0; i < Length; i++)
{
LCD_DataWrite(color_black);
}
}
else
{
for(i = 0; i < Length; i++)
{
LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
LCD_DataWrite(color_black);
Xpos++;
LCD_SetCursor(Xpos, 479 - Ypos);
}
}
}[/mw_shl_code]
入门不深,希望原子哥和各路大神帮忙,程序貌似通不过去,编译没错,串口有输出,但是屏幕上却没有显示,一直是白屏。头文件什么的都放进去了。
|