| | |
| | | #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; |
| | | } |
| | | |
| | |
| | | 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]); |
| | |
| | | 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]); |