提交 8a180d5d 编写于 作者: csdn_JZ_'s avatar csdn_JZ_

Convert format

上级 025b7153
......@@ -26,8 +26,8 @@ MSH_CMD_EXPORT(reboot, Reboot System);
static void bsp_clock_config(void)
{
RemapVtorTable();
SystemClk_HSEInit(RCC_PLLMul_20);//启动PLL时钟,12MHz*20=240MHz
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//2:2,全局性函数,仅需设置一次
SystemClk_HSEInit(RCC_PLLMul_20);//启动PLL时钟,12MHz*20=240MHz
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//2:2,全局性函数,仅需设置一次
uint32_t sysclk = 0;
getSystemClock(&sysclk);
......
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
......
......@@ -187,7 +187,7 @@ void BlockWrite(unsigned int Xstart, unsigned int Xend, unsigned int Ystart, uns
SPI_WriteData(Yend & 0xff);
SPI_WriteComm(0x2c00);
// for(Xstart=0;Xstart<1000;Xstart++)SPI_WriteData(0x55);
// for(Xstart=0;Xstart<1000;Xstart++)SPI_WriteData(0x55);
}
void Lcd_Initialize(void)
{
......@@ -1040,23 +1040,23 @@ void LCD_Initial(rt_uint32_t LTDC_Buf1, rt_uint32_t LTDC_Buf2) //LCD初始化函
// LTDC_Buf[yStart + i + YSIZE_PHYS * j + temp] = Color;
// }
// // rt_uint16_t i,j;
// // rt_uint32_t temp;
// // temp = XSIZE_PHYS*yStart;
// // for(i=0;i<yLong;i++)
// // {
// // for(j=0;j<xLong;j++)
// // LTDC_Buf[xStart+j+XSIZE_PHYS*i+temp]=Color;
// // }
// // rt_uint16_t i,j;
// // rt_uint32_t temp;
// // temp = XSIZE_PHYS*yStart;
// // for(i=0;i<yLong;i++)
// // {
// // for(j=0;j<xLong;j++)
// // LTDC_Buf[xStart+j+XSIZE_PHYS*i+temp]=Color;
// // }
// }
/******************************************
函数名:Lcd图像填充
功能:向Lcd指定位置填充图像
入口参数:
(x,y): 图片左上角起始坐标
(pic_H,pic_V): 图片的宽高
pic 指向存储图片数组的指针
(x,y): 图片左上角起始坐标
(pic_H,pic_V): 图片的宽高
pic 指向存储图片数组的指针
LCD_Fill_Pic(400,100,320,480,(rt_uint32_t*)gImage_MM_T035);
******************************************/
// void LCD_Fill_Pic(rt_uint16_t x, rt_uint16_t y, rt_uint16_t pic_H, rt_uint16_t pic_V, rt_uint32_t *pic)
......@@ -1070,20 +1070,20 @@ LCD_Fill_Pic(400,100,320,480,(rt_uint32_t*)gImage_MM_T035);
// LTDC_Buf[Xstart + i + YSIZE_PHYS * j + y] = pic[k++];
// }
// // rt_uint16_t i,j;
// // rt_uint32_t Ystart,k=0;
// // Ystart = YSIZE_PHYS*y;
// // for(i=0;i<pic_V;i++)
// // {
// // for(j=0;j<pic_H;j++)
// // LTDC_Buf[x+j+YSIZE_PHYS*i+Ystart]=pic[k++];
// // }
// // rt_uint16_t i,j;
// // rt_uint32_t Ystart,k=0;
// // Ystart = YSIZE_PHYS*y;
// // for(i=0;i<pic_V;i++)
// // {
// // for(j=0;j<pic_H;j++)
// // LTDC_Buf[x+j+YSIZE_PHYS*i+Ystart]=pic[k++];
// // }
// }
//=============== 在x,y 坐标上打一个颜色为Color的点 ===============
// void DrawPixel(rt_uint16_t x, rt_uint16_t y, int Color)
// {
// LTDC_Buf[y + YSIZE_PHYS * x] = Color;
// // LTDC_Buf[x+XSIZE_PHYS*y] = Color;
// // LTDC_Buf[x+XSIZE_PHYS*y] = Color;
// }
/**********8*16字体 ASCII码 显示*************
(x,y): 显示字母的起始坐标
......
......@@ -13,27 +13,27 @@
// #define XSIZE_PHYS 800
// #define YSIZE_PHYS 480
// extern __align(256) rt_uint32_t LTDC_Buf[XSIZE_PHYS*YSIZE_PHYS];
#define LCD_SPI_CS(a) \
if (a) \
GPIOB->BSRR = GPIO_Pin_11; \
else \
GPIOB->BRR = GPIO_Pin_11;
#define SPI_DCLK(a) \
if (a) \
GPIOB->BSRR = GPIO_Pin_9; \
else \
GPIOB->BRR = GPIO_Pin_9;
#define SPI_SDA(a) \
if (a) \
GPIOB->BSRR = GPIO_Pin_0; \
else \
GPIOB->BRR = GPIO_Pin_0;
#define LCD_SPI_CS(a) \
if (a) \
GPIOB->BSRR = GPIO_Pin_11; \
else \
GPIOB->BRR = GPIO_Pin_11;
#define SPI_DCLK(a) \
if (a) \
GPIOB->BSRR = GPIO_Pin_9; \
else \
GPIOB->BRR = GPIO_Pin_9;
#define SPI_SDA(a) \
if (a) \
GPIOB->BSRR = GPIO_Pin_0; \
else \
GPIOB->BRR = GPIO_Pin_0;
#define LCD_RST(a) \
if (a) \
GPIOD->BSRR = GPIO_Pin_6; \
else \
GPIOD->BRR = GPIO_Pin_6;
#define LCD_RST(a) \
if (a) \
GPIOD->BSRR = GPIO_Pin_6; \
else \
GPIOD->BRR = GPIO_Pin_6;
#define Set_Rst GPIOD->BSRR = GPIO_Pin_6
#define Clr_Rst GPIOD->BRR = GPIO_Pin_6
#define Lcd_Light_ON GPIOD->BSRR = GPIO_Pin_8 //PD8为高电平 背光打开
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册