金牌会员
 
- 积分
- 1525
- 金钱
- 1525
- 注册时间
- 2015-11-11
- 在线时间
- 163 小时
|
5金钱
代码如下:
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA|RCC_APB2Periph_GPIOD|RCC_APB2Periph_AFIO, ENABLE);
GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable , ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4; //RS,CS,WR,RD
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOA, &GPIO_InitStructure);
GPIO_SetBits(GPIOA,GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All; //
GPIO_Init(GPIOD, &GPIO_InitStructure); //GPIOB
GPIO_SetBits(GPIOD,GPIO_Pin_All);
delay_ms(50); // delay 50 ms
LCD_WriteReg(0x0000,0x0001);
delay_ms(50); // delay 50 ms
DeviceCode = LCD_ReadReg(0x0000);
if(DeviceCode==0||DeviceCode==0XFFFF)//如果是9341
{
LCD_WR_REG(0XD3);
LCD_RD_DATA(); //dummy read
LCD_RD_DATA();
DeviceCode=LCD_RD_DATA()&0XBF;
DeviceCode<<=8;
DeviceCode|=LCD_RD_DATA();
}
printf(" LCD ID:%x\r\n",DeviceCode); //LCD ID
最终得到的ID居然是8080,请问哪里有问题了
|
|