Convert format

This commit is contained in:
NU-LL 2021-10-15 00:52:10 +08:00
parent 025b71530f
commit 8a180d5dd3
4 changed files with 44 additions and 44 deletions

View File

@ -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);//22全局性函数仅需设置一次
SystemClk_HSEInit(RCC_PLLMul_20);//启动PLL时钟12MHz*20=240MHz
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//22全局性函数仅需设置一次
uint32_t sysclk = 0;
getSystemClock(&sysclk);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*

View File

@ -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++];
// // }
// }
//=============== 在xy 坐标上打一个颜色为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):

View File

@ -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为高电平 背光打开