FSMC寄存器方式初始化及LCD函数

环境

芯片:STM32F103ZET6
库:stm32f10x.h

原理图

代码

  • Driver.FSMC.h

    • #ifndef __DRIVER_FSMC
      #define __DRIVER_FSMC
      #include "stm32f10x.h"
      
      void Driver_FSMC_Init(void);
      
      #endif
      
  • Driver.FSMC.c

    • #include "Driver_FSMC.h"
      
      /**
       * 配置FSMC(Flexible Static Memory Controller)相关的GPIO端口
       * 该函数的目的是根据FSMC的引脚配置要求,设置相应的GPIO端口模式和功能
       */
      void Driver_FSMC_GPIO_Config(void)
      {
         /* 1 配置 A10 (PG0) 复用推挽输出CNY:10 50MHz速度 MODE:11*/
            /* =============MODE=============== */
      
            GPIOG->CRL |= GPIO_CRL_MODE0;
            GPIOG->CRL |= GPIO_CRL_CNF0_1;
            GPIOG->CRL &= ~GPIO_CRL_CNF0_0;
      
            /*
                  2 数据端口 复用推挽输出
                        在实际应用中,即使数据线被配置为输出模式,FSMC控制器仍然能够管理数据线的方向,使其在需要时成为输入线。
                        这种自动切换是由FSMC控制器硬件管理的,不需要软件干预。
                        因此,即使GPIO配置为复用推挽输出,FSMC依然可以实现读取操作。
            */
            /* =============MODE=============== */
            GPIOD->CRL |= (GPIO_CRL_MODE0 |
                                   GPIO_CRL_MODE1);
            GPIOD->CRH |= (GPIO_CRH_MODE8 |
                                   GPIO_CRH_MODE9 |
                                   GPIO_CRH_MODE10 |
                                   GPIO_CRH_MODE14 |
                                   GPIO_CRH_MODE15);
      
            GPIOE->CRL |= (GPIO_CRL_MODE7);
            GPIOE->CRH |= (GPIO_CRH_MODE8 |
                                   GPIO_CRH_MODE9 |
                                   GPIO_CRH_MODE10 |
                                   GPIO_CRH_MODE11 |
                                   GPIO_CRH_MODE12 |
                                   GPIO_CRH_MODE13 |
                                   GPIO_CRH_MODE14 |
                                   GPIO_CRH_MODE15);
      
            /* =============CNF=============== */
            GPIOD->CRL |= (GPIO_CRL_CNF0_1 |
                                   GPIO_CRL_CNF1_1);
            GPIOD->CRL &= ~(GPIO_CRL_CNF0_0 |
                                    GPIO_CRL_CNF1_0);
      
            GPIOD->CRH |= (GPIO_CRH_CNF8_1 |
                                   GPIO_CRH_CNF9_1 |
                                   GPIO_CRH_CNF10_1 |
                                   GPIO_CRH_CNF14_1 |
                                   GPIO_CRH_CNF15_1);
            GPIOD->CRH &= ~(GPIO_CRH_CNF8_0 |
                                    GPIO_CRH_CNF9_0 |
                                    GPIO_CRH_CNF10_0 |
                                    GPIO_CRH_CNF14_0 |
                                    GPIO_CRH_CNF15_0);
      
            GPIOE->CRL |= (GPIO_CRL_CNF7_1);
            GPIOE->CRL &= ~(GPIO_CRL_CNF7_0);
      
            GPIOE->CRH |= (GPIO_CRH_CNF8_1 |
                                   GPIO_CRH_CNF9_1 |
                                   GPIO_CRH_CNF10_1 |
                                   GPIO_CRH_CNF11_1 |
                                   GPIO_CRH_CNF12_1 |
                                   GPIO_CRH_CNF13_1 |
                                   GPIO_CRH_CNF14_1 |
                                   GPIO_CRH_CNF15_1);
            GPIOE->CRH &= ~(GPIO_CRH_CNF8_0 |
                                    GPIO_CRH_CNF9_0 |
                                    GPIO_CRH_CNF10_0 |
                                    GPIO_CRH_CNF11_0 |
                                    GPIO_CRH_CNF12_0 |
                                    GPIO_CRH_CNF13_0 |
                                    GPIO_CRH_CNF14_0 |
                                    GPIO_CRH_CNF15_0);
      
            /* 3 其他控制端口   复用推挽输出 */
      
            /* 3.1 PD4: 读控制引脚   PD5: 写控制引脚 */
            GPIOD->CRL |= (GPIO_CRL_MODE4 |
                                   GPIO_CRL_MODE5);
            GPIOD->CRL |= (GPIO_CRL_CNF4_1 |
                                   GPIO_CRL_CNF5_1);
            GPIOD->CRL &= ~(GPIO_CRL_CNF4_0 |
                                    GPIO_CRL_CNF5_0);
      
            /* 3.2   PG12:NE4*/
            GPIOG->CRH |= (GPIO_CRH_MODE12);
            GPIOG->CRH |= (GPIO_CRH_CNF12_1);
            GPIOG->CRH &= ~(GPIO_CRH_CNF12_0);
      
            /* 3.3   背光引脚PB0:通用推挽输出*/
            GPIOB->CRL |= GPIO_CRL_MODE0;
            GPIOB->CRL &= ~GPIO_CRL_CNF0;
      
            /* 3.4   重置引脚PG15:通用推挽输出*/
            GPIOG->CRH |= GPIO_CRH_MODE15;
            GPIOG->CRH &= ~GPIO_CRH_CNF15;
      }
      
      /**
       * @brief  初始化FSMC(Flexible Static Memory Controller)模块
       * 
       * 此函数负责配置FSMC模块,使其能够与外部SRAM进行通信。它包括使能相关时钟、配置GPIO引脚模式、
       * 以及设置FSMC控制和刷新寄存器以满足SRAM的时序要求。
       */
      void Driver_FSMC_Init(void)
      {
         /* 1 开启时钟 */
          /* 1.1 开启FSMC时钟 */
          RCC->AHBENR |= RCC_AHBENR_FSMCEN;
      
          /* 1.2 开启用到的 GPIO 时钟:PD PE PF PG */
          RCC->APB2ENR |= (RCC_APB2ENR_IOPDEN |
                           RCC_APB2ENR_IOPBEN |
                           RCC_APB2ENR_IOPEEN |
                           RCC_APB2ENR_IOPFEN |
                           RCC_APB2ENR_IOPGEN);
      
          /* 1.3 AFIO 时钟 */
          RCC->APB2ENR |= RCC_APB2ENR_AFIOEN;
      
          /* 3 配置 FSMC 各个端口的输入输出模式 */
          Driver_FSMC_GPIO_Config();
      
          /* 4. 配置FSMC参数  */
          /* 4.1 存储器块使能 根据接线图可知是 Bank1的 3区   1区对应0 2区对应2 3区对应4 4区对应6  (BCR寄存器)*/
          FSMC_Bank1->BTCR[6] |= FSMC_BCR4_MBKEN;
          /* 4.2 设置存储器类型 00: SRAM ROM 01:PSRAM 10:NOR闪存*/
          FSMC_Bank1->BTCR[6] &= ~FSMC_BCR4_MTYP;
          /* 4.3 闪存访问使能: 禁止访问闪存 */
          FSMC_Bank1->BTCR[6] &= ~FSMC_BCR4_FACCEN;
          /* 4.4 地址和数据总线复用: 不复用 */
          FSMC_Bank1->BTCR[6] &= ~FSMC_BCR4_MUXEN;
          /* 4.5 数据总线宽度 00:8位 01:16位*/
          FSMC_Bank1->BTCR[6] &= ~FSMC_BCR4_MWID_1;
          FSMC_Bank1->BTCR[6] |= FSMC_BCR4_MWID_0;
          /* 4.6 写使能 */
          FSMC_Bank1->BTCR[6] |= FSMC_BCR4_WREN;
      
          /* 5. 配置SRAM的时序参数 BTCR[7] 访问bank1 4区对应的BTR寄存器 */
          /* 5.1 地址建立时间(时钟周期) 0:表示一个时钟周期。 对同步读写来说无效,永远是1个时钟周期*/
          FSMC_Bank1->BTCR[7] &= ~FSMC_BTR4_ADDSET;
          /* 5.2 地址保持时间(时钟周期) 对同步读写来说无效,永远是1个时钟周期*/
          FSMC_Bank1->BTCR[7] &= ~FSMC_BTR4_ADDHLD;
          /* 5.3 数据保持时间(时钟周期)数据在总线上的停留时间 */
          FSMC_Bank1->BTCR[7] &= ~FSMC_BTR4_DATAST; /* 对应的位置位0 */
          FSMC_Bank1->BTCR[7] |= (30 << 8);         /* 设置为1个us. 72个时钟周期 */
          /* 5.4 设置访问模式为A */
          FSMC_Bank1->BTCR[7] &= ~FSMC_BTR4_ACCMOD;
      }
      
  • Inf_LCD.c

    • #include "Inf_LCD.h"
      #include "Inf_Font.h"
      
      /* 初始化LCD */
      void Inf_LCD_Init(void)
      {
          /* 0. 初始化FSMC */
          Driver_FSMC_Init();
          // 1. 重置LCD
          Inf_LCD_Reset();
          // 2. 开启背光
          Inf_LCD_BKOpen();
          // 3. 初始化寄存器
          Inf_LCD_RegConfig();
      }
      
      /* 读取lcd的id,用来测试通讯是否正常 */
      uint32_t Inf_LCD_ReadId(void)
      {
          uint32_t id = 0x0;
          Inf_LCD_WriteCmd(0x04);
          Inf_LCD_ReadData();             // 无用的数据,扔掉即可
          id |= Inf_LCD_ReadData() << 16; // 制造商id
          id |= Inf_LCD_ReadData() << 8;  // 模块/驱动版本号id
          id |= Inf_LCD_ReadData();       // 模块/驱动id
          return id;
      }
      
      /* 初始化寄存器的值 */
      void Inf_LCD_RegConfig(void)
      {
          /* 1. 设置灰阶电压以调整TFT面板的伽马特性, 正校准。一般出厂就设置好了 */
          Inf_LCD_WriteCmd(0xE0);
          Inf_LCD_WriteData(0x00);
          Inf_LCD_WriteData(0x07);
          Inf_LCD_WriteData(0x10);
          Inf_LCD_WriteData(0x09);
          Inf_LCD_WriteData(0x17);
          Inf_LCD_WriteData(0x0B);
          Inf_LCD_WriteData(0x41);
          Inf_LCD_WriteData(0x89);
          Inf_LCD_WriteData(0x4B);
          Inf_LCD_WriteData(0x0A);
          Inf_LCD_WriteData(0x0C);
          Inf_LCD_WriteData(0x0E);
          Inf_LCD_WriteData(0x18);
          Inf_LCD_WriteData(0x1B);
          Inf_LCD_WriteData(0x0F);
      
          /* 2. 设置灰阶电压以调整TFT面板的伽马特性,负校准 */
          Inf_LCD_WriteCmd(0XE1);
          Inf_LCD_WriteData(0x00);
          Inf_LCD_WriteData(0x17);
          Inf_LCD_WriteData(0x1A);
          Inf_LCD_WriteData(0x04);
          Inf_LCD_WriteData(0x0E);
          Inf_LCD_WriteData(0x06);
          Inf_LCD_WriteData(0x2F);
          Inf_LCD_WriteData(0x45);
          Inf_LCD_WriteData(0x43);
          Inf_LCD_WriteData(0x02);
          Inf_LCD_WriteData(0x0A);
          Inf_LCD_WriteData(0x09);
          Inf_LCD_WriteData(0x32);
          Inf_LCD_WriteData(0x36);
          Inf_LCD_WriteData(0x0F);
      
          /* 3.  Adjust Control 3 (F7h)  */
          /*LCD_WriteCmd(0XF7);
          Inf_LCD_WriteData(0xA9);
          Inf_LCD_WriteData(0x51);
          Inf_LCD_WriteData(0x2C);
          Inf_LCD_WriteData(0x82);*/
          /* DSI write DCS command, use loose packet RGB 666 */
      
          /* 4. 电源控制1*/
          Inf_LCD_WriteCmd(0xC0);
          Inf_LCD_WriteData(0x11); /* 正伽马电压 */
          Inf_LCD_WriteData(0x09); /* 负伽马电压 */
      
          /* 5. 电源控制2 */
          Inf_LCD_WriteCmd(0xC1);
          Inf_LCD_WriteData(0x02);
          Inf_LCD_WriteData(0x03);
      
          /* 6. VCOM控制 */
          Inf_LCD_WriteCmd(0XC5);
          Inf_LCD_WriteData(0x00);
          Inf_LCD_WriteData(0x0A);
          Inf_LCD_WriteData(0x80);
      
          /* 7. Frame Rate Control (In Normal Mode/Full Colors) (B1h) */
          Inf_LCD_WriteCmd(0xB1);
          Inf_LCD_WriteData(0xB0);
          Inf_LCD_WriteData(0x11);
      
          /* 8.  Display Inversion Control (B4h) (正负电压反转,减少电磁干扰)*/
          Inf_LCD_WriteCmd(0xB4);
          Inf_LCD_WriteData(0x02);
      
          /* 9.  Display Function Control (B6h)  */
          Inf_LCD_WriteCmd(0xB6);
          Inf_LCD_WriteData(0x0A);
          Inf_LCD_WriteData(0xA2);
      
          /* 10. Entry Mode Set (B7h)  */
          Inf_LCD_WriteCmd(0xB7);
          Inf_LCD_WriteData(0xc6);
      
          /* 11. HS Lanes Control (BEh) */
          Inf_LCD_WriteCmd(0xBE);
          Inf_LCD_WriteData(0x00);
          Inf_LCD_WriteData(0x04);
      
          /* 12.  Interface Pixel Format (3Ah) */
          Inf_LCD_WriteCmd(0x3A);
          Inf_LCD_WriteData(0x55); /* 0x55 : 16 bits/pixel  */
      
          /* 13. Sleep Out (11h) 关闭休眠模式 */
          Inf_LCD_WriteCmd(0x11);
      
          /* 14. 设置屏幕方向和RGB */
          Inf_LCD_WriteCmd(0x36);
          Inf_LCD_WriteData(0x08);
      
          Delay_ms(120);
      
          /* 14. display on */
          Inf_LCD_WriteCmd(0x29);
      }
      
      /* 重置LCD PG15*/
      void Inf_LCD_Reset(void)
      {
          GPIOG->ODR &= ~GPIO_ODR_ODR15; // 低电平重置
          Delay_ms(50);
          GPIOG->ODR |= GPIO_ODR_ODR15; // 高电平正常
          Delay_ms(50);
      }
      
      /* 给LCD开启背光 */
      void Inf_LCD_BKOpen(void)
      {
          GPIOB->ODR |= GPIO_ODR_ODR0; // 高电平开启背光
      }
      /* 给LCD关闭背光 */
      void Inf_LCD_BKClose(void)
      {
          GPIOB->ODR &= ~GPIO_ODR_ODR0; // 低电平关闭背光(最暗)
      }
      
      /* 发送命令 */
      void Inf_LCD_WriteCmd(__IO uint16_t cmd)
      {
          *LCD_ADDR_CMD = cmd;
      }
      
      /* 发送数据 */
      void Inf_LCD_WriteData(__IO uint16_t data)
      {
          *LCD_ADDR_DATA = data;
      }
      
      /* 读取数据 */
      uint16_t Inf_LCD_ReadData(void)
      {
          return *LCD_ADDR_DATA;
      }
      
      /**
       * @description: 在LCD上显示一个Ascii字符
       * @param {uint16_t} x 起始x坐标
       * @param {uint16_t} y 起始y坐标
       * @param {uint8_t} c 要显示的字符
       * @param {uint16_t} fgColor 前景色:字符轮廓的颜色
       * @param {uint16_t} bgColor 背景色:非字符轮廓的颜色  比如白纸黑字:黑色是前景色 白色就是背景色
       * @param {uint8_t} fontHeight 字体高度 12|16|24|32
       */
      void Inf_LCD_DisplayAsciiChar(uint16_t x,
                                    uint16_t y,
                                    uint8_t c,
                                    uint16_t fgColor,
                                    uint16_t bgColor,
                                    uint8_t fontHeight)
      {
          /* 1. 找到字符在字库中的位置 */
          uint8_t cPosition = c - ' ';
          /* 2. 设置要写入的LCD区域 */
          Inf_LCD_SetAddr(x, y, fontHeight >> 1, fontHeight);
          /* 3. 把字库数据写入到GRAM内存中 */
          Inf_LCD_WriteCmd(0x2C);
          uint8_t i, j, tmp, fontWidth = fontHeight >> 1;
          if (fontHeight == 12 || fontHeight == 16)
          {
              for (i = 0; i < fontHeight; i++)
              {
                  // 一个字节控制着一行的8个像素。先低位再高位
                  tmp = fontHeight == 12 ? ascii_1206[cPosition][i] : ascii_1608[cPosition][i];
                  for (j = 0; j < fontWidth; j++)
                  {
                      if (tmp & 0x01) // 如果是 1,则发送前景色
                      {
                          Inf_LCD_WriteData(fgColor);
                      }
                      else // 是0发送背景色
                      {
                          Inf_LCD_WriteData(bgColor);
                      }
                      tmp >>= 1; // 右移一位
                  }
              }
          }
          else if (fontHeight == 24)
          {
              for (i = 0; i < fontHeight << 1; i++)
              {
                  tmp = ascii_2412[cPosition][i];
                  uint8_t jCount = i % 2 ? 4 : 8;
                  for (j = 0; j < jCount; j++)
                  {
                      if (tmp & 0x01) // 如果是 1,则发送前景色
                      {
                          Inf_LCD_WriteData(fgColor);
                      }
                      else // 是0发送背景色
                      {
                          Inf_LCD_WriteData(bgColor);
                      }
                      tmp >>= 1; // 右移一位
                  }
              }
          }
          else if (fontHeight == 32)
          {
              for (i = 0; i < fontHeight << 1; i++)
              {
                  tmp = ascii_3216[cPosition][i];
      
                  for (j = 0; j < 8; j++)
                  {
                      if (tmp & 0x01) // 如果是 1,则发送前景色
                      {
                          Inf_LCD_WriteData(fgColor);
                      }
                      else // 是0发送背景色
                      {
                          Inf_LCD_WriteData(bgColor);
                      }
                      tmp >>= 1; // 右移一位
                  }
              }
          }
      }
      
      /**
       * @description: 显示一行英文字符串
       * @param {uint16_t} x
       * @param {uint16_t} y
       * @param {uint8_t} *str
       * @param {uint16_t} fgColor
       * @param {uint16_t} bgColor
       * @param {uint8_t} fontHeight
       * @return {*}
       */
      void Inf_LCD_DisplayAsciiString(uint16_t x,
                                      uint16_t y,
                                      uint8_t *str,
                                      uint16_t fgColor,
                                      uint16_t bgColor,
                                      uint8_t fontHeight)
      {
          // 字体宽度
          uint8_t fontWidth = fontHeight >> 1;
          uint16_t i = 0;
          while (str[i] != '\0')
          {
              if (str[i] != '\n') // 如果不是换行符
              {
                  if (x + fontWidth > 320) // 水平方向要显示的字符超出了屏幕, 则需要换行显示
                  {
                      y += fontHeight;
                      x = 0;
                  }
                  Inf_LCD_DisplayAsciiChar(x, y, str[i], fgColor, bgColor, fontHeight);
      
                  // 定义下一个字符的x坐标
                  x += fontWidth;
              }
              else // 如果碰到换行符
              {
                  y += fontHeight;
                  x = 0;
              }
              i++;
          }
      }
      
      /**
       * @description: 显示中文字符
       * @param {uint16_t} x
       * @param {uint16_t} y
       * @param {uint8_t} chinesCharPosition
       * @param {uint16_t} fgColor
       * @param {uint16_t} bgColor
       * @return {*}
       */
      void Inf_LCD_DisplayChinesChar(uint16_t x,
                                     uint16_t y,
                                     uint8_t chinesCharPosition,
                                     uint16_t fgColor,
                                     uint16_t bgColor)
      {
          /* 1. 设置要写入的LCD区域 中午字符一般宽高一样*/
          Inf_LCD_SetAddr(x, y, 32, 32);
          /* 3. 把字库数据写入到GRAM内存中 */
          Inf_LCD_WriteCmd(0x2C);
          uint8_t i, j, tmp;
      
          for (i = 0; i < 128; i++)
          {
              tmp = chinese[chinesCharPosition][i];
              for (j = 0; j < 8; j++)
              {
                  if (tmp & 0x01) // 如果是 1,则发送前景色
                  {
                      Inf_LCD_WriteData(fgColor);
                  }
                  else // 是0发送背景色
                  {
                      Inf_LCD_WriteData(bgColor);
                  }
                  tmp >>= 1; // 右移一位
              }
          }
      }
      
      /**
       * @description: 设置要写入的GRAM的起始地址和结束地址。 默认坐标原点是 左上角
       * @param {uint16_t} x 起始x坐标
       * @param {uint16_t} y 起始y坐标
       * @param {uint16_t} w 区域宽
       * @param {uint16_t} h 区域高
       */
      void Inf_LCD_SetAddr(uint16_t x,
                           uint16_t y,
                           uint16_t w,
                           uint16_t h)
      {
      
          /* 设置x坐标(第几列) */
          Inf_LCD_WriteCmd(0x2A);
          /* 1. 起始列 */
          Inf_LCD_WriteData(x >> 8);   // 高8位
          Inf_LCD_WriteData(x & 0xFF); // 低8位
          /* 2. 结束列 */
          Inf_LCD_WriteData((x + w - 1) >> 8);
          Inf_LCD_WriteData((x + w - 1) & 0xFF);
      
          /* 设置y坐标(第行列) */
          Inf_LCD_WriteCmd(0x2B);
          /* 1. 起始行 */
          Inf_LCD_WriteData(y >> 8);   /* 高8位 */
          Inf_LCD_WriteData(y & 0xFF); /* 低8位 */
          /* 2. 结束行 */
          Inf_LCD_WriteData((y + h - 1) >> 8);   /* 高8位 */
          Inf_LCD_WriteData((y + h - 1) & 0xFF); /* 低8位 */
      }
      
      /**
       * @description: 读取显示像素格式
       */
      uint16_t Inf_LCD_ReadDisplayPixelFormat(void)
      {
          Inf_LCD_WriteCmd(0x0C);
          Inf_LCD_ReadData();
          return Inf_LCD_ReadData();
      }
      
      /**
       * @description: 给LCD设置纯背景色
       * @return {*}
       */
      void Inf_LCD_Clear(uint16_t color)
      {
          Inf_LCD_SetAddr(0, 0, 320, 480);
          Inf_LCD_FillColor(320 * 480, color);
      }
      
      /**
       * @description: 填充颜色
       * @param {uint32_t} num 填充的像素数
       * @param {uint16_t} color 填充的具体颜色
       * @return {*}
       */
      void Inf_LCD_FillColor(uint32_t num, uint16_t color)
      {
          Inf_LCD_WriteCmd(0x2C);
          while (num--)
          {
              Inf_LCD_WriteData(color);
          }
      }
      
  • Inf_LCD.h 

    • #ifndef __INF_LCD_H
      #define __INF_LCD_H
      
      #include "Driver_Usart1.h"
      #include "Com_Delay.h"
      #include "Driver_FSMC.h"
      
      #define SRAM_BANK4 0x6C000000
      #define LCD_AX 10                                                           // Inf_LCD的地址线,我们连接的时A10
      #define LCD_ADDR_CMD ((__IO uint16_t *)SRAM_BANK4)                          // 写命令地址
      #define LCD_ADDR_DATA ((__IO uint16_t *)(SRAM_BANK4 + (1 << (LCD_AX + 1)))) // 数据地址(计算地址的时候要左移一位)
      
      /* 常见颜色 */
      #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  // 灰色
      
      void Inf_LCD_Init(void);
      uint32_t Inf_LCD_ReadId(void);
      void Inf_LCD_RegConfig(void);
      void Inf_LCD_Reset(void);
      void Inf_LCD_BKOpen(void);
      void Inf_LCD_BKClose(void);
      void Inf_LCD_WriteCmd(__IO uint16_t cmd);
      void Inf_LCD_WriteData(__IO uint16_t data);
      uint16_t Inf_LCD_ReadData(void);
      void Inf_LCD_DisplayAsciiChar(uint16_t x, uint16_t y, uint8_t c, uint16_t fgColor, uint16_t bgColor, uint8_t fontHeight);
      void Inf_LCD_DisplayAsciiString(uint16_t x, uint16_t y, uint8_t *str, uint16_t fgColor, uint16_t bgColor, uint8_t fontHeight);
      void Inf_LCD_DisplayChinesChar(uint16_t x, uint16_t y, uint8_t chinesCharPosition, uint16_t fgColor, uint16_t bgColor);
      void Inf_LCD_SetAddr(uint16_t x, uint16_t y, uint16_t w, uint16_t h);
      uint16_t Inf_LCD_ReadDisplayPixelFormat(void);
      void Inf_LCD_Clear(uint16_t color);
      void Inf_LCD_FillColor(uint32_t num, uint16_t color);
      #endif
      

ascii 字模 在最上方

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值