添加触摸屏
This commit is contained in:
1 parent
d8854fea10
commit
4f8260accc
16 files changed
+306
-313
No files matched your search
+6
-2
@@ -125,12 +125,16 @@ extern "C"
|
||||
*/
|
||||
|
||||
/*#define BSP_USING_I2C1*/
|
||||
#define BSP_USING_I2C1
|
||||
|
||||
#ifdef BSP_USING_I2C1
|
||||
#define BSP_I2C1_SCL_PIN GET_PIN(port, pin)
|
||||
#define BSP_I2C1_SDA_PIN GET_PIN(port, pin)
|
||||
#define BSP_I2C1_SCL_PIN GET_PIN(B, 12)
|
||||
#define BSP_I2C1_SDA_PIN GET_PIN(B, 13)
|
||||
#endif
|
||||
|
||||
/*#define BSP_USING_I2C2*/
|
||||
//#define BSP_USING_I2C2
|
||||
|
||||
#ifdef BSP_USING_I2C2
|
||||
#define BSP_I2C2_SCL_PIN GET_PIN(port, pin)
|
||||
#define BSP_I2C2_SDA_PIN GET_PIN(port, pin)
|
||||
|
||||
+12
-3
@@ -456,9 +456,9 @@ int ltdc_init(void)
|
||||
else if (lcdid == 0X7016)
|
||||
{
|
||||
lcdltdc.pwidth = 1024; lcdltdc.pheight = 600;
|
||||
lcdltdc.hsw = 20; lcdltdc.hbp = 140; lcdltdc.hfp = 160;
|
||||
lcdltdc.vsw = 3; lcdltdc.vbp = 20; lcdltdc.vfp = 12;
|
||||
ltdc_clk_set(129, 32, 5);
|
||||
lcdltdc.hsw = 70; lcdltdc.hbp = 160; lcdltdc.hfp = 160;
|
||||
lcdltdc.vsw = 10; lcdltdc.vbp = 23; lcdltdc.vfp = 12;
|
||||
ltdc_clk_set(128, 32, 5);
|
||||
}
|
||||
else if (lcdid == 0X7018)
|
||||
{
|
||||
@@ -539,18 +539,27 @@ int ltdc_init(void)
|
||||
g_ltdc_handle.Instance = LTDC;
|
||||
|
||||
if (lcdid == 0X8081)
|
||||
{
|
||||
g_ltdc_handle.Init.HSPolarity = LTDC_HSPOLARITY_AH;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_ltdc_handle.Init.HSPolarity = LTDC_HSPOLARITY_AL;
|
||||
}
|
||||
|
||||
g_ltdc_handle.Init.VSPolarity = LTDC_VSPOLARITY_AL;
|
||||
g_ltdc_handle.Init.DEPolarity = LTDC_DEPOLARITY_AL;
|
||||
g_ltdc_handle.State = HAL_LTDC_STATE_RESET;
|
||||
|
||||
|
||||
if (lcdid == 0X1018 || lcdid == 0X8081)
|
||||
{
|
||||
g_ltdc_handle.Init.PCPolarity = LTDC_PCPOLARITY_IIPC;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_ltdc_handle.Init.PCPolarity = LTDC_PCPOLARITY_IPC;
|
||||
}
|
||||
|
||||
g_ltdc_handle.Init.HorizontalSync = lcdltdc.hsw - 1;
|
||||
g_ltdc_handle.Init.VerticalSync = lcdltdc.vsw - 1;
|
||||
|
||||
Reference in new issue
Block a user