- #include "lcd_st7735.h"
- #include "at32m412_416_board.h"
- #include "at32m412_416_conf.h"
- #include "lcdfont.h"
- #include "pics.h"
- #define SOFTWARE_SPI_ENABLE 1
- /*
- AT32M412 LCD屏
- GND GND
- 3.3V VCC
- PA0 RES(复位)
- PA1 DC(命令数据选择)
- PA2 CS(片选)
- PA3 SCLK
- PA4 MOSI
- PA5 BL(背光)
- */
- #define TFT_RST_GPIO_PORT GPIOA
- #define TFT_RST_PIN GPIO_PINS_0
- #define TFT_DC_GPIO_PORT GPIOA
- #define TFT_DC_PIN GPIO_PINS_1
- #define TFT_CS_GPIO_PORT GPIOA
- #define TFT_CS_PIN GPIO_PINS_2
- #define TFT_SCLK_GPIO_PORT GPIOA
- #define TFT_SCLK_PIN GPIO_PINS_3
- #define TFT_MOSI_GPIO_PORT GPIOA
- #define TFT_MOSI_PIN GPIO_PINS_4
- #define TFT_BLK_GPIO_PORT GPIOA
- #define TFT_BLK_PIN GPIO_PINS_5
-
- #define LCD_RES_LOW() gpio_bits_reset(TFT_RST_GPIO_PORT, TFT_RST_PIN)//RES
- #define LCD_RES_HIGH() gpio_bits_set(TFT_RST_GPIO_PORT, TFT_RST_PIN)
- #define LCD_DC_LOW() gpio_bits_reset(TFT_DC_GPIO_PORT, TFT_DC_PIN) //DC
- #define LCD_DC_HIGH() gpio_bits_set(TFT_DC_GPIO_PORT, TFT_DC_PIN)
- #define LCD_CS_LOW() gpio_bits_reset(TFT_CS_GPIO_PORT, TFT_CS_PIN) //CS
- #define LCD_CS_HIGH() gpio_bits_set(TFT_CS_GPIO_PORT, TFT_CS_PIN)
-
- #define LCD_BLK_LOW() gpio_bits_reset(TFT_BLK_GPIO_PORT, TFT_BLK_PIN) //BLK
- #define LCD_BLK_HIGH() gpio_bits_set(TFT_BLK_GPIO_PORT, TFT_BLK_PIN)
- #if SOFTWARE_SPI_ENABLE
- #define LCD_SCLK_LOW() gpio_bits_reset(TFT_SCLK_GPIO_PORT, TFT_SCLK_PIN) //SCLK
- #define LCD_SCLK_HIGH() gpio_bits_set(TFT_SCLK_GPIO_PORT, TFT_SCLK_PIN)
- #define LCD_MOSI_LOW() gpio_bits_reset(TFT_MOSI_GPIO_PORT, TFT_MOSI_PIN) //MOSI
- #define LCD_MOSI_HIGH() gpio_bits_set(TFT_MOSI_GPIO_PORT, TFT_MOSI_PIN)
- #endif
- #define USE_HORIZONTAL 1 //设置横屏或者竖屏显示 0或1为竖屏 2或3为横屏
- #if USE_HORIZONTAL==0||USE_HORIZONTAL==1
- #define LCD_W 128
- #define LCD_H 160
- #else
- #define LCD_W 160
- #define LCD_H 128
- #endif
- void LcdIoInit(void)
- {
- gpio_init_type gpio_init_struct;
- crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
-
- gpio_init_struct.gpio_pins = TFT_BLK_PIN;
- gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
- gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
- gpio_init(GPIOA, &gpio_init_struct);
-
- gpio_init_struct.gpio_pins = TFT_RST_PIN;
- gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
- gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
- gpio_init(GPIOA, &gpio_init_struct);
-
- gpio_init_struct.gpio_pins = TFT_DC_PIN;
- gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
- gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
- gpio_init(GPIOA, &gpio_init_struct);
-
- gpio_init_struct.gpio_pins = TFT_CS_PIN;
- gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
- gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
- gpio_init(GPIOA, &gpio_init_struct);
-
- gpio_init_struct.gpio_pins = TFT_SCLK_PIN;
- gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
- gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
- gpio_init(GPIOA, &gpio_init_struct);
-
- gpio_init_struct.gpio_pins = TFT_MOSI_PIN;
- gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
- gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
- gpio_init(GPIOA, &gpio_init_struct);
- }
- /******************************************************************************
- 函数说明:LCD串行数据写入函数
- 入口数据:dat 要写入的串行数据
- 返回值: 无
- ******************************************************************************/
- void LCD_Writ_Bus(uint8_t dat)
- {
- uint8_t i;
-
- LCD_CS_LOW();
- #if SOFTWARE_SPI_ENABLE
- for(i=0;i<8;i++)
- {
- LCD_SCLK_LOW();
- if(dat&0x80)
- {
- LCD_MOSI_HIGH();
- }
- else
- {
- LCD_MOSI_LOW();
- }
- LCD_SCLK_HIGH();
- dat<<=1;
- }
- #else
- SPI_SendData(CW_SPI2, dat);
- while(SPI_GetFlagStatus(CW_SPI2, SPI_FLAG_TXE) == RESET);
- #endif
- LCD_CS_HIGH();
- }
- /******************************************************************************
- 函数说明:LCD写入数据
- 入口数据:dat 写入的数据
- 返回值: 无
- ******************************************************************************/
- void LCD_WR_DATA8(uint8_t dat)
- {
- LCD_Writ_Bus(dat);
- }
- /******************************************************************************
- 函数说明:LCD写入数据
- 入口数据:dat 写入的数据
- 返回值: 无
- ******************************************************************************/
- void LCD_WR_DATA(uint16_t dat)
- {
- LCD_Writ_Bus(dat>>8);
- LCD_Writ_Bus(dat);
- }
- /******************************************************************************
- 函数说明:LCD写入命令
- 入口数据:dat 写入的命令
- 返回值: 无
- ******************************************************************************/
- void LCD_WR_REG(uint8_t dat)
- {
- LCD_DC_LOW();//写命令
- LCD_Writ_Bus(dat);
- LCD_DC_HIGH();//写数据
- }
- /******************************************************************************
- 函数说明:设置起始和结束地址
- 入口数据:x1,x2 设置列的起始和结束地址
- y1,y2 设置行的起始和结束地址
- 返回值: 无
- ******************************************************************************/
- void LCD_Address_Set(uint16_t x1,uint16_t y1,uint16_t x2,uint16_t y2)
- {
- if(USE_HORIZONTAL==0)
- {
- LCD_WR_REG(0x2a);//列地址设置
- LCD_WR_DATA(x1+2);
- LCD_WR_DATA(x2+2);
- LCD_WR_REG(0x2b);//行地址设置
- LCD_WR_DATA(y1+1);
- LCD_WR_DATA(y2+1);
- LCD_WR_REG(0x2c);//储存器写
- }
- else if(USE_HORIZONTAL==1)
- {
- LCD_WR_REG(0x2a);//列地址设置
- LCD_WR_DATA(x1+2);
- LCD_WR_DATA(x2+2);
- LCD_WR_REG(0x2b);//行地址设置
- LCD_WR_DATA(y1+1);
- LCD_WR_DATA(y2+1);
- LCD_WR_REG(0x2c);//储存器写
- }
- else if(USE_HORIZONTAL==2)
- {
- LCD_WR_REG(0x2a);//列地址设置
- LCD_WR_DATA(x1+1);
- LCD_WR_DATA(x2+1);
- LCD_WR_REG(0x2b);//行地址设置
- LCD_WR_DATA(y1+2);
- LCD_WR_DATA(y2+2);
- LCD_WR_REG(0x2c);//储存器写
- }
- else
- {
- LCD_WR_REG(0x2a);//列地址设置
- LCD_WR_DATA(x1+1);
- LCD_WR_DATA(x2+1);
- LCD_WR_REG(0x2b);//行地址设置
- LCD_WR_DATA(y1+2);
- LCD_WR_DATA(y2+2);
- LCD_WR_REG(0x2c);//储存器写
- }
- }
- /******************************************************************************
- 函数说明:LCD初始化,包含硬件IO
- 入口数据:无
- 返回值: 无
- ******************************************************************************/
- void LcdInit(void)
- {
- LcdIoInit();
-
- LCD_RES_LOW();
- delay_ms(100);
- LCD_RES_HIGH();
- delay_ms(100);
- LCD_BLK_HIGH();
- delay_ms(100);
-
- LCD_WR_REG(0x11);
- delay_ms(120);
- LCD_WR_REG(0xB1);
- LCD_WR_DATA8(0x05);
- LCD_WR_DATA8(0x3C);
- LCD_WR_DATA8(0x3C);
- LCD_WR_REG(0xB2);
- LCD_WR_DATA8(0x05);
- LCD_WR_DATA8(0x3C);
- LCD_WR_DATA8(0x3C);
- LCD_WR_REG(0xB3);
- LCD_WR_DATA8(0x05);
- LCD_WR_DATA8(0x3C);
- LCD_WR_DATA8(0x3C);
- LCD_WR_DATA8(0x05);
- LCD_WR_DATA8(0x3C);
- LCD_WR_DATA8(0x3C);
- LCD_WR_REG(0xB4);
- LCD_WR_DATA8(0x03);
- LCD_WR_REG(0xC0);
- LCD_WR_DATA8(0x28);
- LCD_WR_DATA8(0x08);
- LCD_WR_DATA8(0x04);
- LCD_WR_REG(0xC1);
- LCD_WR_DATA8(0XC0);
- LCD_WR_REG(0xC2);
- LCD_WR_DATA8(0x0D);
- LCD_WR_DATA8(0x00);
- LCD_WR_REG(0xC3);
- LCD_WR_DATA8(0x8D);
- LCD_WR_DATA8(0x2A);
- LCD_WR_REG(0xC4);
- LCD_WR_DATA8(0x8D);
- LCD_WR_DATA8(0xEE);
- LCD_WR_REG(0xC5);
- LCD_WR_DATA8(0x1A);
- LCD_WR_REG(0x36);
-
- if(USE_HORIZONTAL==0)
- LCD_WR_DATA8(0x00);
- else if(USE_HORIZONTAL==1)
- LCD_WR_DATA8(0xC0);
- else if(USE_HORIZONTAL==2)
- LCD_WR_DATA8(0x70);
- else
- LCD_WR_DATA8(0xA0);
-
- LCD_WR_REG(0xE0);
- LCD_WR_DATA8(0x04);
- LCD_WR_DATA8(0x22);
- LCD_WR_DATA8(0x07);
- LCD_WR_DATA8(0x0A);
- LCD_WR_DATA8(0x2E);
- LCD_WR_DATA8(0x30);
- LCD_WR_DATA8(0x25);
- LCD_WR_DATA8(0x2A);
- LCD_WR_DATA8(0x28);
- LCD_WR_DATA8(0x26);
- LCD_WR_DATA8(0x2E);
- LCD_WR_DATA8(0x3A);
- LCD_WR_DATA8(0x00);
- LCD_WR_DATA8(0x01);
- LCD_WR_DATA8(0x03);
- LCD_WR_DATA8(0x13);
- LCD_WR_REG(0xE1);
- LCD_WR_DATA8(0x04);
- LCD_WR_DATA8(0x16);
- LCD_WR_DATA8(0x06);
- LCD_WR_DATA8(0x0D);
- LCD_WR_DATA8(0x2D);
- LCD_WR_DATA8(0x26);
- LCD_WR_DATA8(0x23);
- LCD_WR_DATA8(0x27);
- LCD_WR_DATA8(0x27);
- LCD_WR_DATA8(0x25);
- LCD_WR_DATA8(0x2D);
- LCD_WR_DATA8(0x3B);
- LCD_WR_DATA8(0x00);
- LCD_WR_DATA8(0x01);
- LCD_WR_DATA8(0x04);
- LCD_WR_DATA8(0x13);
- LCD_WR_REG(0x3A);
- LCD_WR_DATA8(0x05);
- LCD_WR_REG(0x29);
- }
- /******************************************************************************
- 函数说明:在指定区域填充颜色
- 入口数据:xsta,ysta 起始坐标
- xend,yend 终止坐标
- color 要填充的颜色
- 返回值: 无
- ******************************************************************************/
- void LcdFill(uint16_t xsta,uint16_t ysta,uint16_t xend,uint16_t yend,uint16_t color)
- {
- uint16_t i,j;
-
- LCD_Address_Set(xsta,ysta,xend-1,yend-1);//设置显示范围
-
- for(i=ysta;i<yend;i++)
- {
- for(j=xsta;j<xend;j++)
- {
- LCD_WR_DATA(color);
- }
- }
- }
- /******************************************************************************
- 函数说明:在指定位置画点
- 入口数据:x,y 画点坐标
- color 点的颜色
- 返回值: 无
- ******************************************************************************/
- void LcdDrawPoint(uint16_t x,uint16_t y,uint16_t color)
- {
- LCD_Address_Set(x,y,x,y);//设置光标位置
- LCD_WR_DATA(color);
- }
- /******************************************************************************
- 函数说明:画线
- 入口数据:x1,y1 起始坐标
- x2,y2 终止坐标
- color 线的颜色
- 返回值: 无
- ******************************************************************************/
- void LcdDrawLine(uint16_t x1,uint16_t y1,uint16_t x2,uint16_t y2,uint16_t color)
- {
- uint16_t t;
- int xerr=0,yerr=0,delta_x,delta_y,distance;
- int incx,incy,uRow,uCol;
-
- delta_x=x2-x1; //计算坐标增量
- delta_y=y2-y1;
- uRow=x1;//画线起点坐标
- uCol=y1;
- if(delta_x>0)incx=1; //设置单步方向
- else if (delta_x==0)incx=0;//垂直线
- else {incx=-1;delta_x=-delta_x;}
- if(delta_y>0)incy=1;
- else if (delta_y==0)incy=0;//水平线
- else {incy=-1;delta_y=-delta_y;}
- if(delta_x>delta_y)distance=delta_x; //选取基本增量坐标轴
- else distance=delta_y;
-
- for(t=0;t<distance+1;t++)
- {
- LcdDrawPoint(uRow,uCol,color);//画点
- xerr+=delta_x;
- yerr+=delta_y;
- if(xerr>distance)
- {
- xerr-=distance;
- uRow+=incx;
- }
- if(yerr>distance)
- {
- yerr-=distance;
- uCol+=incy;
- }
- }
- }
- /******************************************************************************
- 函数说明:画矩形
- 入口数据:x1,y1 起始坐标
- x2,y2 终止坐标
- color 矩形的颜色
- 返回值: 无
- ******************************************************************************/
- void LcdDrawRectangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2,uint16_t color)
- {
- LcdDrawLine(x1,y1,x2,y1,color);
- LcdDrawLine(x1,y1,x1,y2,color);
- LcdDrawLine(x1,y2,x2,y2,color);
- LcdDrawLine(x2,y1,x2,y2,color);
- }
- /******************************************************************************
- 函数说明:画圆
- 入口数据:x0,y0 圆心坐标
- r 半径
- color 圆的颜色
- 返回值: 无
- ******************************************************************************/
- void LcdDrawCircle(uint16_t x0,uint16_t y0,uint8_t r,uint16_t color)
- {
- int a,b;
-
- a=0;b=r;
- while(a<=b)
- {
- LcdDrawPoint(x0-b,y0-a,color); //3
- LcdDrawPoint(x0+b,y0-a,color); //0
- LcdDrawPoint(x0-a,y0+b,color); //1
- LcdDrawPoint(x0-a,y0-b,color); //2
- LcdDrawPoint(x0+b,y0+a,color); //4
- LcdDrawPoint(x0+a,y0-b,color); //5
- LcdDrawPoint(x0+a,y0+b,color); //6
- LcdDrawPoint(x0-b,y0+a,color); //7
- a++;
- if((a*a+b*b)>(r*r))//判断要画的点是否过远
- {
- b--;
- }
- }
- }
- /******************************************************************************
- 函数说明:显示单个字符
- 入口数据:x,y显示坐标
- ch 要显示的字符
- fc 字的颜色
- bc 字的背景色
- csize 字号
- 返回值: 无
- ******************************************************************************/
- void LcdShowChar(uint16_t x,uint16_t y,uint8_t ch,uint16_t fc,uint16_t bc,uint8_t csize)
- {
- const unsigned char *temp;
- uint8_t i,j,k;
- uint16_t x0=x,y0=y;
- uint8_t row=0,column=0;
-
- row=(csize/8+((csize%8)?1:0)); //计算行
- column=csize/2; //列
- ch=ch-' '; //得到偏移后的值
-
- switch(csize)
- {
- case 12:temp=Ascii_6x12[ch]; break;
- case 16:temp=Ascii_8x16[ch]; break;
- case 24:temp=Ascii_12x24[ch]; break;
- case 32:temp=Ascii_16x32[ch]; break;
- default: temp=Ascii_6x12[ch]; break;
- }
-
- //显示要与取模方式保持一致
- for(i=0;i<row;i++)
- {
- for(j=0;j<column;j++)
- {
- for(k=0;k<8;k++)
- {
- if((*temp)&(0x01<<k))
- {
- LcdDrawPoint(x,y,fc);//画一个点,字体色
- }
- else
- {
- LcdDrawPoint(x,y,bc);//画一个点,背景色
- }
- y++;
- }
- y=y0;
- x++;
- temp++;
- }
- x=x0;
- y0+=8;
- y=y0;
- }
- }
- /******************************************************************************
- 函数说明:显示字符串
- 入口数据:x,y显示坐标
- *p 要显示的字符串
- fc 字的颜色
- bc 字的背景色
- csize 字号
- 返回值: 无
- ******************************************************************************/
- void LcdShowString(uint16_t x,uint16_t y,const char *p,uint16_t fc,uint16_t bc,uint8_t csize)
- {
- while(*p!='\0')
- {
- LcdShowChar(x,y,*p,fc,bc,csize);
- x+=csize/2;
- p++;
- }
- }
- /******************************************************************************
- 函数说明:显示汉字字符
- 入口数据:x,y显示坐标
- index 汉字字符索引
- fc 字的颜色
- bc 字的背景色
- 返回值: 无
- ******************************************************************************/
- void LcdShow16x16Hz(uint32_t x, uint32_t y, uint8_t index, uint16_t fc, uint16_t bc)
- {
- const char *temp=Hzk[index]; // 获取字体数据在数组中的的起始位置
- uint8_t y0=y,x0=x;
- uint8_t i,j,k;
- uint8_t row=0,column=0;
- row=16/8;
- column=16;
-
- //显示要与取模方式保持一致
- for(i=0;i<row;i++)
- {
- for(j=0;j<column;j++)
- {
- for( k=0;k<8;k++)
- {
- if(*temp&(0x01<<k))
- {
- LcdDrawPoint(x,y,fc);//画一个点,字体色
- }
- else
- {
- LcdDrawPoint(x,y,bc);//画一个点,背景色
- }
- y++;
- }
- temp++;
- x++;
- y=y0;
- }
- x=x0;
- y0+=8;
- y=y0;
- }
- }
- /******************************************************************************
- 函数说明:显示图片
- 入口数据:x,y起点坐标
- length 图片长度
- width 图片宽度
- pic[] 图片数组
- 返回值: 无
- ******************************************************************************/
- void LCD_ShowPicture(u16 x,u16 y,u16 length,u16 width,const u8 pic[])
- {
- u16 i,j;
- u32 k=0;
- x=x-5;
- LCD_Address_Set(x,y,x+length-1,y+width-1);
- for(i=0;i<length;i++)
- {
- for(j=0;j<width;j++)
- {
- LCD_WR_DATA8(pic[k*2]);
- LCD_WR_DATA8(pic[k*2+1]);
- k++;
- }
- }
- }
- /******************************************************************************
- 函数说明:显示图片
- 入口数据:x,y显示坐标
- width 图片宽度
- height 图片高度
- image 图片数据
- 返回值: 无
- ******************************************************************************/
- void LcdShowImage(uint16_t x, uint16_t y, uint16_t width, uint16_t height, const uint8_t *image)
- {
- uint16_t colorData=0;
- uint32_t cnt=0;
- uint16_t i,j;
-
- for( i=0; i<height; i++) // 一行一行地显示
- {
- LCD_Address_Set(x, y+i, x+width, y+height); // 重新设置光标位置
- for( j=0; j<width; j++) // 一行中,从左到右,逐个像素处理
- {
- colorData=(image[cnt*2+1]<<8) | image[cnt*2];
- LCD_WR_DATA(colorData); // 写入16位颜色数据
- cnt++;
- }
- }
- }
- #ifndef __LCD_ST7735_H__
- #define __LCD_ST7735_H__
- typedef unsigned int uint32_t;
- typedef unsigned short uint16_t;
- typedef unsigned char uint8_t;
- #define WHITE 0xFFFF
- #define BLACK 0x0000
- #define BLUE 0x001F
- #define BRED 0XF81F
- #define GRED 0XFFE0
- #define GBLUE 0X07FF
- #define RED 0xF800
- #define MAGENTA 0xF81F
- #define GREEN 0x07E0
- #define CYAN 0x7FFF
- #define YELLOW 0xFFE0
- #define BROWN 0XBC40 //棕色
- #define BRRED 0XFC07 //棕红色
- #define GRAY 0X8430 //灰色
- #define DARKBLUE 0X01CF //深蓝色
- #define LIGHTBLUE 0X7D7C //浅蓝色
- #define GRAYBLUE 0X5458 //灰蓝色
- #define LIGHTGREEN 0X841F //浅绿色
- #define LGRAY 0XC618 //浅灰色(PANNEL),窗体背景色
- #define LGRAYBLUE 0XA651 //浅灰蓝色(中间层颜色)
- #define LBBLUE 0X2B12 //浅棕蓝色(选择条目的反色)
- void Display_Test(void);
- void LcdDrawPoint(uint16_t x,uint16_t y,uint16_t color);
- void LcdInit(void);
- #endif
应用相关接口代码如下:
main.c- /* includes */
- #include "at32m412_416_board.h"
- #include "at32m412_416_clock.h"
- #include "lcd_st7735.h"
- /**
- * [url=home.php?mod=space&uid=247401]@brief[/url] main function.
- * @param none
- * @retval none
- */
- int main(void)
- {
- system_clock_config();
- at32_board_init();
- LcdInit();
-
- while(1)
- {
- Display_Test();
- }
- }
在lcd_st7735.c中添加LCD测试接口代码:
- /******************************************************************************
- 函数说明:LCD显示测试
- 入口数据:无
- 返回值: 无
- ******************************************************************************/
- void Display_Test(void)
- {
- LcdFill(0,3,LCD_W,LCD_H,BLACK);
- LcdShow16x16Hz(8, 3, 0, YELLOW, BLACK);
- LcdShow16x16Hz(24, 3, 1, YELLOW, BLACK);
- LcdShow16x16Hz(40, 3, 2, YELLOW, BLACK);
- LcdShow16x16Hz(56, 3, 3, YELLOW, BLACK);
- LcdShow16x16Hz(72, 3, 4, YELLOW, BLACK);
- LcdShow16x16Hz(88, 3, 5, YELLOW, BLACK);
- LcdShow16x16Hz(104,3, 6, YELLOW, BLACK);
- LcdShowString(12,24,"AT32F412",RED, BLACK,24);
- delay_ms(100);
- LcdShow16x16Hz(38,60, 7, BLUE, WHITE);
- delay_ms(100);
- LcdShow16x16Hz(56,60, 8, BLUE, WHITE);
- delay_ms(100);
- LcdShow16x16Hz(74,60, 9, BLUE, WHITE);
- delay_ms(1000);
- LCD_ShowPicture(0,0,128,160,gImage_1);
- delay_ms(1000);
- }
硬件实物连线如下:
这里的中文字符与彩色图片制作,需要借助汉字取模工具“PCtoLCD2002”与图片取模工具“Img2Lcd”。
PCtoLCD2002.zip
(886.17 KB, 下载次数: 0)
Image2Lcd.zip
(506.45 KB, 下载次数: 0)
驱动的效果见B站视频:AT32M412驱动ST7735S彩屏
https://www.bilibili.com/video/BV1KtMizJEAQ/