1)主副摄像头都是同一个摄像头(前)
2)摄像、照相关闭,待机电流过大(min大于20mA)
3)蓝牙关闭,待机电流过大(min大于70mA)
GPIO没有关全。
今天在23D+Sp5368调试Z24130S02屏(IC:7783)
初始化的时候:
void LCD_Init_ST7781(kal_uint32 bkground, void **buf_addr)
{
kal_uint16 LCD_x;
kal_uint16 LCD_y;
kal_uint16 LCD_Device_ID = 0;
kal_uint32 DrvId;
kal_uint16 CheckDrvId;
SET_LCD_CTRL_RESET_PIN;
Delay_ms(1);
CLEAR_LCD_CTRL_RESET_PIN;
Delay_ms(10);
SET_LCD_CTRL_RESET_PIN;
//------------------------------------Display Control Setting----------------------------------------------//
SP5368_LCD_Reg (0x0001, 0x0100); //Output Direct
SP5368_LCD_Reg (0x0002, 0x0700); //Line Inversion
SP5368_LCD_Reg (0x0003, 0x1030); //Entry Mode (65K, BGR)
SP5368_LCD_Reg (0x0007, 0x0121); //Display Control1
SP5368_LCD_Reg (0x0008, 0x0807); //Porch setting
SP5368_LCD_Reg (0x0009, 0x0200); //Scan Cycle
SP5368_LCD_Reg (0x000A, 0x0000); //FMARK off
//-----------------------------------End Display Control setting-----------------------------------------//
//-------------------------------- Power Control Registers Initial --------------------------------------//
SP5368_LCD_Reg (0x0010, 0x0790); //Power Control1
SP5368_LCD_Reg (0x0011, 0x0005); //Power Control2
SP5368_LCD_Reg (0x0012, 0x0000); //Power Control3
SP5368_LCD_Reg (0x0013, 0x0000); //Power Control4
//---------------------------------End Power Control Registers Initial -------------------------------//
Delay_ms (100); //Delay 100ms
//--------------------------------- Power Supply Startup 1 Setting------------------------------------//
SP5368_LCD_Reg (0x0010, 0x1290); //Power Control1
Delay_ms (50); //Delay 50ms
SP5368_LCD_Reg (0x0011, 0x0007); //Power Control2
//--------------------------------- End Power Supply Startup 1 Setting------------------------------//
Delay_ms (50); //Delay 50ms
//--------------------------------- Power Supply Startup 2 Setting------------------------------------//
SP5368_LCD_Reg (0x0012, 0x008a); //Power Control3
SP5368_LCD_Reg (0x0013, 0x1900); //Power Control4
SP5368_LCD_Reg (0x0029, 0x0034); //VCOMH setting
//--------------------------------- End Power Supply Startup 2 Setting------------------------------//
Delay_ms (50); //Delay 50ms
//-------------------------------------Gamma Cluster Setting-------------------------------------------//
SP5368_LCD_Reg (0x0030, 0x0301);
SP5368_LCD_Reg (0x0031, 0x0107);
SP5368_LCD_Reg (0x0032, 0x0301);
SP5368_LCD_Reg (0x0035, 0x0003);
SP5368_LCD_Reg (0x0036, 0x0000);
SP5368_LCD_Reg (0x0037, 0x0000);
SP5368_LCD_Reg (0x0038, 0x0706);
SP5368_LCD_Reg (0x0039, 0x0206);
SP5368_LCD_Reg (0x003c, 0x0004);
SP5368_LCD_Reg (0x003d, 0x0000);
//---------------------------------------End Gamma Setting---------------------------------------------//
//----------------------------------Display Windows 240 X 320----------------------------------------//
SP5368_LCD_Reg (0x0050, 0x0000); // Horizontal Address Start Position
SP5368_LCD_Reg (0x0051, 0x00ef); // Horizontal Address End Position
SP5368_LCD_Reg (0x0052, 0x0000); //Vertical Address Start Position
SP5368_LCD_Reg (0x0053, 0x013f); // Vertical Address End Position
//----------------------------------End Display Windows 240 X 320----------------------------------//
//-------------------------------------------Frame Rate Setting-------------------------------------------//
SP5368_LCD_Reg (0x0060, 0xa700); //Gate scan control
SP5368_LCD_Reg (0x0061, 0x0001); //Non-display Area setting
SP5368_LCD_Reg (0x0090, 0x0033); //RTNI setting
//-------------------------------------------END Frame Rate setting------------------------------------//
SP5368_LCD_Reg (0x0009, 0x0000); //Scan Cycle
SP5368_LCD_Reg (0x0007, 0x0133); //Display Control1
SP5368_LCD_Reg (0x0020,0x0000);
SP5368_LCD_Reg (0x0021,0x0000);
SP5368_LCD_CTL_Write (0x0022);
Delay_ms (50); //Delay 50ms
}
函数如上。结果颜色反黄,并且左右镜像。
修改0x0100寄存器为0x0000,还是左右镜像。接着修改0x0060寄存器为0x0270,结果还是镜像
最后发现原因,原来是忘记加一个 LCD_Delay(10);
正确代码如下:
void LCD_Init_ST7781(kal_uint32 bkground, void **buf_addr)
{
kal_uint16 LCD_x;
kal_uint16 LCD_y;
kal_uint16 LCD_Device_ID = 0;
kal_uint32 DrvId;
kal_uint16 CheckDrvId;
SET_LCD_CTRL_RESET_PIN;
Delay_ms(1);
CLEAR_LCD_CTRL_RESET_PIN;
Delay_ms(10);
SET_LCD_CTRL_RESET_PIN;
LCD_Delay(10);
//------------------------------------Display Control Setting----------------------------------------------//
SP5368_LCD_Reg (0x0001, 0x0100); //Output Direct
SP5368_LCD_Reg (0x0002, 0x0700); //Line Inversion
SP5368_LCD_Reg (0x0003, 0x1030); //Entry Mode (65K, BGR)
SP5368_LCD_Reg (0x0007, 0x0121); //Display Control1
SP5368_LCD_Reg (0x0008, 0x0807); //Porch setting
SP5368_LCD_Reg (0x0009, 0x0200); //Scan Cycle
SP5368_LCD_Reg (0x000A, 0x0000); //FMARK off
//-----------------------------------End Display Control setting-----------------------------------------//
//-------------------------------- Power Control Registers Initial --------------------------------------//
SP5368_LCD_Reg (0x0010, 0x0790); //Power Control1
SP5368_LCD_Reg (0x0011, 0x0005); //Power Control2
SP5368_LCD_Reg (0x0012, 0x0000); //Power Control3
SP5368_LCD_Reg (0x0013, 0x0000); //Power Control4
//---------------------------------End Power Control Registers Initial -------------------------------//
Delay_ms (100); //Delay 100ms
//--------------------------------- Power Supply Startup 1 Setting------------------------------------//
SP5368_LCD_Reg (0x0010, 0x1290); //Power Control1
Delay_ms (50); //Delay 50ms
SP5368_LCD_Reg (0x0011, 0x0007); //Power Control2
//--------------------------------- End Power Supply Startup 1 Setting------------------------------//
Delay_ms (50); //Delay 50ms
//--------------------------------- Power Supply Startup 2 Setting------------------------------------//
SP5368_LCD_Reg (0x0012, 0x008a); //Power Control3
SP5368_LCD_Reg (0x0013, 0x1900); //Power Control4
SP5368_LCD_Reg (0x0029, 0x0034); //VCOMH setting
//--------------------------------- End Power Supply Startup 2 Setting------------------------------//
Delay_ms (50); //Delay 50ms
//-------------------------------------Gamma Cluster Setting-------------------------------------------//
SP5368_LCD_Reg (0x0030, 0x0301);
SP5368_LCD_Reg (0x0031, 0x0107);
SP5368_LCD_Reg (0x0032, 0x0301);
SP5368_LCD_Reg (0x0035, 0x0003);
SP5368_LCD_Reg (0x0036, 0x0000);
SP5368_LCD_Reg (0x0037, 0x0000);
SP5368_LCD_Reg (0x0038, 0x0706);
SP5368_LCD_Reg (0x0039, 0x0206);
SP5368_LCD_Reg (0x003c, 0x0004);
SP5368_LCD_Reg (0x003d, 0x0000);
//---------------------------------------End Gamma Setting---------------------------------------------//
//----------------------------------Display Windows 240 X 320----------------------------------------//
SP5368_LCD_Reg (0x0050, 0x0000); // Horizontal Address Start Position
SP5368_LCD_Reg (0x0051, 0x00ef); // Horizontal Address End Position
SP5368_LCD_Reg (0x0052, 0x0000); //Vertical Address Start Position
SP5368_LCD_Reg (0x0053, 0x013f); // Vertical Address End Position
//----------------------------------End Display Windows 240 X 320----------------------------------//
//-------------------------------------------Frame Rate Setting-------------------------------------------//
SP5368_LCD_Reg (0x0060, 0xa700); //Gate scan control
SP5368_LCD_Reg (0x0061, 0x0001); //Non-display Area setting
SP5368_LCD_Reg (0x0090, 0x0033); //RTNI setting
//-------------------------------------------END Frame Rate setting------------------------------------//
SP5368_LCD_Reg (0x0009, 0x0000); //Scan Cycle
SP5368_LCD_Reg (0x0007, 0x0133); //Display Control1
SP5368_LCD_Reg (0x0020,0x0000);
SP5368_LCD_Reg (0x0021,0x0000);
SP5368_LCD_CTL_Write (0x0022);
Delay_ms (50); //Delay 50ms
}
下一步的工作计划:思考如何用23D方案做32+8的老人机与儿童机。