- void LCD_Pins_Config(void)
- {
- GPIO_InitTypeDef GPIO_InitStructure;
- RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOE | RCC_APB2Periph_GPIOD , ENABLE);
- // DB15--0
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
- GPIO_Init(GPIOE, &GPIO_InitStructure);
- //LCD_Pin_WR PB15
- //LCD_Pin_RS PB14
- //LCD_Pin_CS PB10
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10 | GPIO_Pin_14 |GPIO_Pin_15;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
- GPIO_Init(GPIOB, &GPIO_InitStructure);
- //LCD_Pin_RST PD11
- //LCD_Pin_RD PD15
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_11 | GPIO_Pin_15;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
- GPIO_Init(GPIOD, &GPIO_InitStructure);
-
- //LCD_BK PA3
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
- GPIO_Init(GPIOA, &GPIO_InitStructure);
-
- GPIO_SetBits(GPIOA,GPIO_Pin_3);
- }
- void ST7789_BUS_OutPut(void)
- {
- GPIO_InitTypeDef GPIO_InitStructure;
- // DE15--0
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
- GPIO_Init(GPIOE, &GPIO_InitStructure);
- }
- void LCD_DB_AS_InPut(void)
- {
- GPIO_InitTypeDef GPIO_InitStructure;
- // DE15--0
- GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
- GPIO_Init(GPIOE, &GPIO_InitStructure);
- }
2.2、N32G457驱动端口的配置
- void LCD_Pins_Config(void)
- {
- //N32G457设置如下
- GPIO_InitType GPIO_InitStructure;
- RCC_EnableAPB2PeriphClk(RCC_APB2_PERIPH_GPIOA | RCC_APB2_PERIPH_GPIOB | RCC_APB2_PERIPH_GPIOD |RCC_APB2_PERIPH_GPIOE, ENABLE);
- // DB15--0
- GPIO_InitStructure.Pin = GPIO_PIN_ALL;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
- GPIO_InitPeripheral(GPIOE, &GPIO_InitStructure);
-
- //LCD_Pin_WR PB15
- //LCD_Pin_RS PB14
- //LCD_Pin_CS PB10
- GPIO_InitStructure.Pin = GPIO_PIN_10 | GPIO_PIN_14 |GPIO_PIN_15;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
- GPIO_InitPeripheral(GPIOB, &GPIO_InitStructure);
- //LCD_Pin_RST PD11
- //LCD_Pin_RD PD15
- GPIO_InitStructure.Pin = GPIO_PIN_11 | GPIO_PIN_15;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
- GPIO_InitPeripheral(GPIOD, &GPIO_InitStructure);
-
- //LCD_BK PA3
- GPIO_InitStructure.Pin = GPIO_PIN_3;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
- GPIO_InitPeripheral(GPIOA, &GPIO_InitStructure);
-
- GPIO_SetBits(GPIOA,GPIO_PIN_3);
- }
- void ST7789_BUS_OutPut(void)
- {
- GPIO_InitType GPIO_InitStructure;
- // DB15--0
- GPIO_InitStructure.Pin = GPIO_PIN_ALL;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
- GPIO_InitPeripheral(GPIOE, &GPIO_InitStructure);
- }
- void LCD_DB_AS_InPut(void)
- {
- GPIO_InitType GPIO_InitStructure;
- // DB15--0
- GPIO_InitStructure.Pin = GPIO_PIN_ALL;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
- GPIO_InitPeripheral(GPIOE, &GPIO_InitStructure);
- }
从库文件端口配置来看,驱动程序函数定义名称是很相似的,名称定义的大小写有点区别,比如
STM32 -- 使用的引脚定义名称是GPIO_Pin_10
N32G -- 使用的引脚定义名称是GPIO_PIN_10
修改比较容易,程序移植的工作量小。
2.3、显示屏驱动
2.3.1、st7789.c
- #include <stdio.h>
- #include "main.h"
- //#include "lcd.h"
- #include "Image.h"
- #include "delay.h"
- #include "font.h"
- #include "st7789.h"
- #include "delay.h"
- //LCD的画笔颜色和背景色
- u16 POINT_COLOR=0x0000; //画笔颜色
- u16 BACK_COLOR=0xFFFF; //背景色
-
- //管理LCD重要参数
- //默认为竖屏
- _lcd_dev lcddev;
- //设置LCD显示方向
- //dir:0,竖屏;1,横屏
- void LCD_Display_Dir(u8 dir)
- {
- if(dir==0) //竖屏
- {
- lcddev.dir=0; //竖屏
- lcddev.width=240;
- lcddev.height=320;
- }else //横屏
- {
- lcddev.dir=1; //横屏
- lcddev.width=320;
- lcddev.height=240;
- }
- //LCD_Scan_Dir(DFT_SCAN_DIR); //默认扫描方向
- }
- void LCD_Pins_Config(void)
- {
- //N32G457设置如下
- GPIO_InitType GPIO_InitStructure;
- RCC_EnableAPB2PeriphClk(RCC_APB2_PERIPH_GPIOA | RCC_APB2_PERIPH_GPIOB | RCC_APB2_PERIPH_GPIOD |RCC_APB2_PERIPH_GPIOE, ENABLE);
- // DB15--0
- GPIO_InitStructure.Pin = GPIO_PIN_ALL;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
- GPIO_InitPeripheral(GPIOE, &GPIO_InitStructure);
-
- //LCD_Pin_WR PB15
- //LCD_Pin_RS PB14
- //LCD_Pin_CS PB10
- GPIO_InitStructure.Pin = GPIO_PIN_10 | GPIO_PIN_14 |GPIO_PIN_15;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
- GPIO_InitPeripheral(GPIOB, &GPIO_InitStructure);
- //LCD_Pin_RST PD11
- //LCD_Pin_RD PD15
- GPIO_InitStructure.Pin = GPIO_PIN_11 | GPIO_PIN_15;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
- GPIO_InitPeripheral(GPIOD, &GPIO_InitStructure);
-
- //LCD_BK PA3
- GPIO_InitStructure.Pin = GPIO_PIN_3;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
- GPIO_InitPeripheral(GPIOA, &GPIO_InitStructure);
-
- GPIO_SetBits(GPIOA,GPIO_PIN_3);
- }
- void ST7789_BUS_OutPut(void)
- {
- GPIO_InitType GPIO_InitStructure;
- // DB15--0
- GPIO_InitStructure.Pin = GPIO_PIN_ALL;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
- GPIO_InitPeripheral(GPIOE, &GPIO_InitStructure);
- }
- void LCD_DB_AS_InPut(void)
- {
- GPIO_InitType GPIO_InitStructure;
- // DB15--0
- GPIO_InitStructure.Pin = GPIO_PIN_ALL;
- GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
- GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
- GPIO_InitPeripheral(GPIOE, &GPIO_InitStructure);
- }
- void delay_ms(u16 nms)
- {
- systick_delay_ms(nms);
- }
- void LCD_Init(void)
- {
- LCD_Pins_Config();
- }
- void TFT_24_7789_Write_Data(u16 dat)
- {
- LCD_SetRs(); //rs=1
- LCD_ClrCs(); //cs=0
- LCD_SetRd(); //rd=1
- LCD_ClrWr(); //wr=0
- GPIO_Write(GPIOE, dat);
- LCD_SetWr(); //wr=1
- LCD_SetCs(); //cs=1
- }
- void TFT_24_7789_Write_Command(u16 cmd)
- {
- LCD_ClrCs(); //cs=0
- LCD_ClrRs(); //rs=0
- LCD_SetRd(); //rd=1
- LCD_ClrWr(); //wr=0
- GPIO_Write(GPIOE, cmd);
- LCD_SetWr(); //wr=1
- LCD_SetCs(); //cs=1
- LCD_SetRs(); //rs=1
- }
- void ST7789_WriteData(u16 dat)
- {
- LCD_SetRs(); //rs=1
- LCD_ClrCs(); //cs=0
- LCD_SetRd(); //rd=1
- LCD_ClrWr(); //wr=0
- GPIO_Write(GPIOE, dat);
- LCD_SetWr(); //wr=1
- LCD_SetCs(); //cs=1
- }
- void ST7789_WriteCommand(u16 cmd)
- {
- LCD_ClrCs(); //cs=0
- LCD_ClrRs(); //rs=0
- LCD_SetRd(); //rd=1
- LCD_ClrWr(); //wr=0
- GPIO_Write(GPIOE, cmd);
- LCD_SetWr(); //wr=1
- LCD_SetCs(); //cs=1
- LCD_SetRs(); //rs=1
- }
- //void TFT_24_7789_Read_Data(void)
- //{
- // uint16_t id=0;
- // TFT_24_7789_Write_Command(0x0004);
- // LCD_DB_AS_InPut();
- //
- // GPIO_ResetBits(GPIOB, GPIO_Pin_10); //CS=0
- // GPIO_SetBits(GPIOB, GPIO_Pin_14); //RS=1
- // GPIO_SetBits(GPIOB, GPIO_Pin_15); //WR=1
- //
- // //GPIO_SetBits(GPIOD, GPIO_Pin_15); //RD=1
- // GPIO_ResetBits(GPIOD, GPIO_Pin_15); //RD=0
- // //GPIO_Write(GPIOE, dat);//when using 16-bit interface (DB17:10,DB8:1)//when using 8-bit interface (DB17:10)
- // id=LCD_Read();
- // delay_ms(1);
- // GPIO_SetBits(GPIOD, GPIO_Pin_15); //RD=1;
- // delay_ms(1);
- // printf("\n\r ######DeviceIdCode = 0x%x ###### ", id);
- // LCD_DB_AS_OutPut();
- //}
- static void ST7789_Reset(void)
- {
- LCD_SetRst();
- delay_ms(1);
- LCD_ClrRst();
- delay_ms(100); // Delayms 10ms // This delay time is necessary
- LCD_SetRst();
- delay_ms(120); // Delayms 120 ms
- }
- void ST7789_Init(void)
- {
- int n;
-
- LCD_Pins_Config();
- ST7789_Reset();
-
- ST7789_WriteCommand(0x0011); //exit SLEEP mode
- delay_ms(120);
- ST7789_WriteCommand(0x0036);
- ST7789_WriteData(0x0060); //MADCTL: memory data access control
- ST7789_WriteCommand(0x003A);
- ST7789_WriteData(0x0005); //COLMOD: Interface Pixel format *** I use 262K-colors in 18bit/pixel format when using 8-bit interface to allow 3-bytes per pixel
- // TFT_24_7789_Write_Command(0x003A);TFT_24_7789_Write_Data(0x0055);//COLMOD: Interface Pixel format *** I use 65K-colors in 16bit/pixel (5-6-5) format when using 16-bit interface to allow 1-byte per pixel
- ST7789_WriteCommand(0x00B2);
- ST7789_WriteData(0x000C);
- ST7789_WriteData(0x000C);
- ST7789_WriteData(0x0000);
- ST7789_WriteData(0x0033);
- ST7789_WriteData(0x0033); //PORCTRK: Porch setting
- ST7789_WriteCommand(0x00B7);
- ST7789_WriteData(0x0035); //GCTRL: Gate Control
- ST7789_WriteCommand(0x00BB);
- ST7789_WriteData(0x001c); //VCOMS: VCOM setting
- ST7789_WriteCommand(0x00C0);
- ST7789_WriteData(0x002C); //LCMCTRL: LCM Control
- ST7789_WriteCommand(0x00C2);
- ST7789_WriteData(0x0001);
- ST7789_WriteData(0x00FF); //VDVVRHEN: VDV and VRH Command Enable
- ST7789_WriteCommand(0x00C3);
- ST7789_WriteData(0x000B); //VRHS: VRH Set
- ST7789_WriteCommand(0x00C4);
- ST7789_WriteData(0x0020); //VDVS: VDV Set
- ST7789_WriteCommand(0x00C6);
- ST7789_WriteData(0x000F); //FRCTRL2: Frame Rate control in normal mode
- ST7789_WriteCommand(0x00D0);
- ST7789_WriteData(0x00A4);
- ST7789_WriteData(0x00A1); //PWCTRL1: Power Control 1
- ST7789_WriteCommand(0x00E0);
- ST7789_WriteData(0x00D0);
- ST7789_WriteData(0x0000);
- ST7789_WriteData(0x0003);
- ST7789_WriteData(0x0009);
- ST7789_WriteData(0x0013);
- ST7789_WriteData(0x001c);
- ST7789_WriteData(0x003a);
- ST7789_WriteData(0x0055);
- ST7789_WriteData(0x0048);
- ST7789_WriteData(0x0018);
- ST7789_WriteData(0x0012);
- ST7789_WriteData(0x000e);
- ST7789_WriteData(0x0019);
- ST7789_WriteData(0x001e); //PVGAMCTRL: Positive Voltage Gamma control
- ST7789_WriteCommand(0x00E1);
- ST7789_WriteData(0x00D0);
- ST7789_WriteData(0x0000);
- ST7789_WriteData(0x0003);
- ST7789_WriteData(0x0009);
- ST7789_WriteData(0x0005);
- ST7789_WriteData(0x0025);
- ST7789_WriteData(0x003a);
- ST7789_WriteData(0x0055);
- ST7789_WriteData(0x0050);
- ST7789_WriteData(0x003d);
- ST7789_WriteData(0x001c);
- ST7789_WriteData(0x001d);
- ST7789_WriteData(0x001d);
- ST7789_WriteData(0x001e);
- ST7789_WriteCommand(0x0029); //display ON
- ST7789_WriteCommand(0x002c);
- LCD_Display_Dir(1);
- }
- void LCD_WriteOneDot(u16 color)
- {
- TFT_24_7789_Write_Data(color);
- }
- void Lcd_SetBox(u16 xStart,u16 yStart,u16 xlong,u16 ylong)
- {
- u16 xEnd=0, yEnd=0;
- xEnd=xStart+xlong-1;
- yEnd=yStart+ylong-1;
-
- TFT_24_7789_Write_Command(0x2a);
- TFT_24_7789_Write_Data(xStart>>8);
- TFT_24_7789_Write_Data(xStart);
- TFT_24_7789_Write_Data(xEnd>>8);
- TFT_24_7789_Write_Data(xEnd);
- TFT_24_7789_Write_Command(0x2b);
- TFT_24_7789_Write_Data(yStart>>8);
- TFT_24_7789_Write_Data(yStart);
- TFT_24_7789_Write_Data(yEnd>>8);
- TFT_24_7789_Write_Data(yEnd);
- TFT_24_7789_Write_Command(0x2c);
- }
- void Lcd_SetBox1(u16 xStart,u16 xEnd,u16 yStart,u16 yEnd)
- {
- TFT_24_7789_Write_Command(0x2a);
- TFT_24_7789_Write_Data(xStart>>8);
- TFT_24_7789_Write_Data(xStart);
- TFT_24_7789_Write_Data(xEnd>>8);
- TFT_24_7789_Write_Data(xEnd);
- TFT_24_7789_Write_Command(0x2b);
- TFT_24_7789_Write_Data(yStart>>8);
- TFT_24_7789_Write_Data(yStart);
- TFT_24_7789_Write_Data(yEnd>>8);
- TFT_24_7789_Write_Data(yEnd);
- TFT_24_7789_Write_Command(0x2c);
- }
- void LCD_Clear(u16 Color)
- {
- u32 i;
- Lcd_SetBox(0,0,320,240);
- for(i=0;i<78900;i++){
- LCD_WriteOneDot(Color);
- }
- }
- void LCD_Picture(u16 x,u16 y,u16 width,u16 height,const unsigned char *color)
- {
- u16 i,j,temp;
- j=width*height;
- Lcd_SetBox(x,y,width,height);
-
- for(i=0;i<j;i++)
- {
- temp=color[i*2]<<8&0xFF00;
- temp+=color[i*2+1];
- LCD_WriteOneDot(temp);
- }
- }
- void LCD_Clear1(u16 xStart,u16 yStart,u16 xlong,u16 ylong,u16 Color)
- {
- u32 i,j;
- j=xlong*ylong;
- Lcd_SetBox(xStart,yStart,xlong,ylong);
- for(i=0;i<j;i++){
- LCD_WriteOneDot(Color);
- }
- }
- /**********************************************
- 函数名:LCD_write_english
- 功能:选定Lcd上写一个英文或数字
- 入口参数:data 要写的字符
- color 字符的颜色
- xcolor 字符的背景色
- size 字体的大小
- 返回值:无
- ***********************************************/
- static void LCD_write_english(u8 data,u16 color,u16 xcolor ,u8 mode)//写字符
- {
- u8 i=0,j=0,n=0;
- u8 avl=0;
- data -=32;
- for (i=0;i<120;i++) //为 20x40字库
- {
- avl=english[data][i];
- for (j=0;j<8;j++)
- {
- n++;
- if(avl&0x80)LCD_WriteOneDot(color);
- else if(mode==0) LCD_WriteOneDot(xcolor);
- avl<<=1;
- if(n>19) {
- n=0;
- break;
- }//部分字体如英文20*40,形成的字库3个8位一组,每一组最后4位不显示,用该语句进行判断有几位不需要显示
- }
- }
- }
- void LCD_write_english_string(u16 x, u16 y, char *str,u8 mode)//英文字符串显示
- {
- u16 k = 0;
- while ((*str<='~')&&(*str>=' '))
- {
- Lcd_SetBox(x+k,y,20,40);
- LCD_write_english( *str,WORDCOLOR,BACKCOLOR, mode);
- k+=20;
- str++;
- }
- }
- static void LCD_write_chinese(u16 data, u16 color, u16 xcolor,u8 mode )//写字符
- {
- u8 i=0,j=0;
- u32 avl=0;
- //data -=' '; //(ASCII)- 32 = 字库数组行数
- //===========为 48x24字库 32*16=512个像素点保存形式为8位数据故有512/8=64个 每一位代表“字”或“背景”然后再把每个坐标的颜色显示出来========== 要是显示在什么位置 显示的大小为什么是32X16看LCD_write_english_string函数 其中有个Lcd_SetBox
- for (i=0;i<128;i++)
- {
- avl=Chinese[data][i]; //取第一个8位
- for (j=0;j<8;j++) //两个8位组成一个16位循环16次完成16个点的判断 每行显示几个像素点由函数LCD_write_english_string的输入参数定
- {
- if(avl&0x80)LCD_WriteOneDot(color);
- else if(mode==0) LCD_WriteOneDot(xcolor); //“0”显示为背景部分 即 背景颜色
- avl<<=1;
- }
- }
- }
- void LCD_write_chinese_string(u16 x, u16 y,u16 address,u16 len,u8 mode)
- {
- int i;
- u16 k = 0;
- for(i=0;i<len;i++)
- {
- Lcd_SetBox(x+k,y,32,32);
- LCD_write_chinese(address,WORDCOLOR,BACKCOLOR, mode);
- k+=32;
- address++;
-
- }
- }
- void ST7789_SetPoint(u16 x,u16 y,u16 color)
- {
- Lcd_SetBox1(x,x+1,y,y+1);
- LCD_WriteOneDot(color);
- }
- //在指定位置显示一个字符
- //x,y:起始坐标
- //num:要显示的字符:" "--->"~"
- //size:字体大小 12/16/24
- //mode:叠加方式(1)还是非叠加方式(0)
- void LCD_ShowChar(u16 x,u16 y,u8 num,u8 size,u8 mode)
- {
- u8 temp,t1,t;
- u16 y0=y;
- u8 csize=(size/8+((size%8)?1:0))*(size/2); //得到字体一个字符对应点阵集所占的字节数
- num=num-' ';//得到偏移后的值(ASCII字库是从空格开始取模,所以-' '就是对应字符的字库)
- for(t=0;t<csize;t++)
- {
- if(size==12)temp=asc2_1206[num][t]; //调用1206字体
- else if(size==16)temp=asc2_1608[num][t]; //调用1608字体
- else if(size==24)temp=asc2_2412[num][t]; //调用2412字体
- else return; //没有的字库
- for(t1=0;t1<8;t1++)
- {
- if(temp&0x80)ST7789_SetPoint(x,y,POINT_COLOR);
- else if(mode==0)ST7789_SetPoint(x,y,BACK_COLOR);
- temp<<=1;
- y++;
- if(y>=lcddev.height)return; //超区域了
- if((y-y0)==size)
- {
- y=y0;
- x++;
- if(x>=lcddev.width)return; //超区域了
- break;
- }
- }
- }
- }
- //显示字符串
- //x,y:起点坐标
- //width,height:区域大小
- //size:字体大小
- //*p:字符串起始地址
- void LCD_ShowString(u16 x,u16 y,u16 width,u16 height,u8 size,u8 *p)
- {
- u8 x0=x;
- width+=x;
- height+=y;
- while((*p<='~')&&(*p>=' '))//判断是不是非法字符!
- {
- if(x>=width){x=x0;y+=size;}
- if(y>=height)break;//退出
- LCD_ShowChar(x,y,*p,size,0);
- x+=size/2;
- p++;
- }
- }
-
-
2.3.2、main.c
- #include "main.h"
- #include <stdio.h>
- #include <stdint.h>
- #include "led.h"
- #include "delay.h"
- #include "st7789.h"
- int main(void)
- {
- LED_Init();
- ST7789_Init();
- POINT_COLOR=RED;
- LCD_Clear(WHITE);
- LCD_ShowString(30,40,210,24,24,"N32G457");
- LCD_ShowString(30,70,200,16,16,"TFTLCD TEST");
- LCD_ShowString(30,90,200,16,16,"tlled@NATION");
- LCD_ShowString(30,110,200,16,16,"ST7789");
- LCD_ShowString(30,130,200,12,12,"2022/04/05");
- LCD_ShowString(30,150,210,24,24,"www.nationstech.com");
- while (1)
- {
- led0_on();systick_delay_ms(500);
- led0_off();systick_delay_ms(500);
- }
- }
- /**
- * @}
- */
2.4、程序源码:
N32G45x_test.rar
(3.54 MB, 下载次数: 50)
三、运行显示内容
@21小跑堂