Display Control LCD (I2C)

HAL_StatusTypeDef HAL_I2C_Master_Receive(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout);
HAL_StatusTypeDef HAL_I2C_Master_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_I2C_Master_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_I2C_Master_Transmit(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout);
HAL_StatusTypeDef HAL_I2C_Master_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size);
HAL_StatusTypeDef HAL_I2C_Master_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size);

HAL_StatusTypeDef HAL_I2C_Master_Transmit(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout);
  #define  Address 0x27  // if PCF8574   
  //#define  Address 0x3F  // if PCF8574A
void LCD_cmd(unsigned char cmd)
 {
    unsigned char data[3];
	data[0]=cmd;
	data[1]=cmd|0b00001100; // EN = 1 and Backlight ON(Pin –P3)
    HAL_I2C_Master_Transmit(&hi2cx,(Address<<1)|0,data,2,100); // x is 1/2 etc
	HAL_Delay(2);
	data[0]=cmd|0b00001000; //EN = 0 and Backlight ON
    HAL_I2C_Master_Transmit(&hi2cx,(Address<<1)|0,data,1,100); // x is 1/2 etc
} 
void LCD_write(unsigned char data)
 {
    unsigned char display[3];
	display[0]=data;
	display[1]=data|0b00001101; // EN = 1, R/S=1 and Backlight ON
    HAL_I2C_Master_Transmit(&hi2cx,(Address<<1)|0,display,2,100); // x is 1/2 etc
	HAL_Delay(2);
	display[0]=data|0b00001001; // EN = 0, R/S=1 and Backlight ON
    HAL_I2C_Master_Transmit(&hi2cx,(Address<<1)|0,display,1,100); // x is 1/2 etc
 }

extern I2C_HandleTypeDef hi2c1; or extern I2C_HandleTypeDef hi2c2;
        LCD_write_custom(1,1,0);
		LCD_write_custom(2,1,1);
		LCD_write_custom(2,2,2);
		LCD_write_custom(1,2,4);
		LCD_write_custom(5,2,3);
		LCD_write_string(6,2,"IoTthingHuB");
		LCD_write_string(5,1,"        www");HAL_Delay(500);
		LCD_write_string(5,1,"       www.");HAL_Delay(500);
		LCD_write_string(5,1,"      www.i");HAL_Delay(500);
		LCD_write_string(5,1,"     www.io");HAL_Delay(500);
		LCD_write_string(5,1,"    www.iot");HAL_Delay(500);
		LCD_write_string(5,1,"   www.iott");HAL_Delay(500);
		LCD_write_string(5,1,"  www.iotth");HAL_Delay(500);
		LCD_write_string(5,1," www.iotthi");HAL_Delay(500);
		LCD_write_string(5,1,"www.iotthin");HAL_Delay(500);
		LCD_write_string(5,1,"ww.iotthing");HAL_Delay(500);
		LCD_write_string(5,1,"w.iotthingh");HAL_Delay(500);
		LCD_write_string(5,1,".iotthinghu");HAL_Delay(500);
		LCD_write_string(5,1,"iotthinghub");HAL_Delay(500);
		LCD_write_string(5,1,"otthinghub.");HAL_Delay(500);
		LCD_write_string(5,1,"tthinghub.c");HAL_Delay(500);
		LCD_write_string(5,1,"thinghub.co");HAL_Delay(500);
		LCD_write_string(5,1,"hinghub.com");HAL_Delay(500);
		LCD_write_string(5,1,"inghub.com ");HAL_Delay(500);
		LCD_write_string(5,1,"nghub.com  ");HAL_Delay(500);
		LCD_write_string(5,1,"ghub.com   ");HAL_Delay(500);
		LCD_write_string(5,1,"hub.com    ");HAL_Delay(500);
		LCD_write_string(5,1,"ub.com     ");HAL_Delay(500);
		LCD_write_string(5,1,"b.com      ");HAL_Delay(500);
		LCD_write_string(5,1,".com       ");HAL_Delay(500);
		LCD_write_string(5,1,"com        ");HAL_Delay(500);
		LCD_write_string(5,1,"om        w");HAL_Delay(500);
		LCD_write_string(5,1,"m        ww");HAL_Delay(500);
		LCD_write_string(5,1,"        www");HAL_Delay(500);