forked from SZV10X_Software/SZV103_FM33A0xxEV_SiZhu

wujiazhi
2024-06-13 72def895431ad7a08e635b11f3da738e2b2c4618
Function/LCD/lcd_io_api.c
@@ -19,16 +19,16 @@
#include "math.h"
#include "gpio.h"
uint8_t   LCD_Buffer[SEGNUM] = {0};
uint8_t   LCD_buffer[Segnum] = {0};
void Lcd_GPIO_Init(void)
void Lcd_IO_Init(void)
{
   CMU_PERCLK_SetableEx(PADCLK, ENABLE);  //PADʱÖÓ£¨GPIO£©Ê¹Äܺ¯Êý
   
   OutputIO(LCD_PWR_GPIO_PORT,LCD_PWR_PIN,OUT_PUSHPULL);
//   OutputIO(LCD_BACKLIGHT_PWR_GPIO_PORT,LCD_BACKLIGHT_PWR_PIN,OUT_PUSHPULL);
//   LCD_BACKLIGHT_OFF;
   OutputIO(LCD_BACKLIGHT_PWR_GPIO_PORT,LCD_BACKLIGHT_PWR_PIN,OUT_PUSHPULL);
   LCD_BACKLIGHT_OFF;
   LCD_PWR_OFF;
}
@@ -40,16 +40,16 @@
   uint8_t i = 0;
#if SOFT_OR_HARD   
  I2c_Start();
   I2c_Send(LCD_ADDR_WRITE);
   I2c_Send(LCD_REG_DATA_ADDR);
   I2c_Send(LCD_WRITE);
   I2c_Send(LCD_REG_DATA);
   I2c_Send(sadd);
   for(i = 0 ;i < len;i++)
      I2c_Send(pBuffer[i]);
   I2c_Stop();
#else
   I2C_Send_Bit(I2C0,STARTBIT);
   I2C_Send_Byte(I2C0,LCD_ADDR_WRITE);
   I2C_Send_Byte(I2C0,LCD_REG_DATA_ADDR);
   I2C_Send_Byte(I2C0,LCD_WRITE);
   I2C_Send_Byte(I2C0,LCD_REG_DATA);
   I2C_Send_Byte(I2C0,sadd);
   for(i = 0 ;i < len;i++)
      I2C_Send_Byte(I2C0,pBuffer[i]);
@@ -62,14 +62,14 @@
   uint8_t i = 0;
#if SOFT_OR_HARD      
  I2c_Start();
   I2c_Send(LCD_ADDR_WRITE);
   I2c_Send(LCD_WRITE);
   I2c_Send(cmd_add);
   for(i = 0 ;i < len;i++)
      I2c_Send(pBuffer[i]);
   I2c_Stop();
#else
   I2C_Send_Bit(I2C0,STARTBIT);
   I2C_Send_Byte(I2C0,LCD_ADDR_WRITE);
   I2C_Send_Byte(I2C0,LCD_WRITE);
   I2C_Send_Byte(I2C0,cmd_add);
   for(i = 0 ;i < len;i++)
      I2C_Send_Byte(I2C0,pBuffer[i]);