Display Control LCD(GPIO)

void nibble_cmd(unsigned char LCD_value)
{
unsigned char display_nibble;
display_nibble=LCD_value&0xF0;           //mask lower nibble because DD4-DD7 pins are used
LCD_cmd(display_nibble);                 //Send upper Nibble
display_nibble=((LCD_value<<4) & 0xF0);  //mask the upper Nibble
LCD_cmd(display_nibble);                 //Send lower Nibble
}

void LCD_cmd(unsigned char cmd)
{
	HAL_GPIO_WritePin(GPIOC, GPIO_PIN_0,GPIO_PIN_RESET);                 // LCD_RS low
	if(cmd_4BIT&0x80) HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1,GPIO_PIN_SET); // LCD_D7 high
	else HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1,GPIO_PIN_RESET);            // LCD_D7 low
	if(cmd_4BIT&0x40) HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0,GPIO_PIN_SET); // LCD_D6 high
	else HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0,GPIO_PIN_RESET);            // LCD_D6 low
	if(cmd_4BIT&0x20) HAL_GPIO_WritePin(GPIOC, GPIO_PIN_3,GPIO_PIN_SET); // LCD_D5 high
	else HAL_GPIO_WritePin(GPIOC, GPIO_PIN_3,GPIO_PIN_RESET);            // LCD_D5 low
	if(cmd_4BIT&0x10) HAL_GPIO_WritePin(GPIOC, GPIO_PIN_2,GPIO_PIN_SET); // LCD_D4 high
	else HAL_GPIO_WritePin(GPIOC, GPIO_PIN_2,GPIO_PIN_RESET);            // LCD_D4 low
	HAL_GPIO_WritePin(GPIOC, GPIO_PIN_1,GPIO_PIN_SET);                   // LCD_E high
	for(uint8_t i=0;i<200;i++);
	__nop();
	HAL_GPIO_WritePin(GPIOC, GPIO_PIN_1,GPIO_PIN_RESET);                 // LCD_E low
	HAL_Delay(3);
}

void LCD_write(unsigned char data)
{
	HAL_GPIO_WritePin(GPIOC, GPIO_PIN_0,GPIO_PIN_SET);                   // LCD_RS high
	if(cmd_4BIT&0x80) HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1,GPIO_PIN_SET); // LCD_D7 high
	else HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1,GPIO_PIN_RESET);            // LCD_D7 low
	if(cmd_4BIT&0x40) HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0,GPIO_PIN_SET); // LCD_D6 high
	else HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0,GPIO_PIN_RESET);            // LCD_D6 low
	if(cmd_4BIT&0x20) HAL_GPIO_WritePin(GPIOC, GPIO_PIN_3,GPIO_PIN_SET); // LCD_D5 high
	else HAL_GPIO_WritePin(GPIOC, GPIO_PIN_3,GPIO_PIN_RESET);            // LCD_D5 low
	if(cmd_4BIT&0x10) HAL_GPIO_WritePin(GPIOC, GPIO_PIN_2,GPIO_PIN_SET); // LCD_D4 high
	else HAL_GPIO_WritePin(GPIOC, GPIO_PIN_2,GPIO_PIN_RESET);            // LCD_D4 low
	HAL_GPIO_WritePin(GPIOC, GPIO_PIN_1,GPIO_PIN_SET);                   // LCD_E high
	for(uint8_t i=0;i<200;i++);
	__nop();
	HAL_GPIO_WritePin(GPIOC, GPIO_PIN_1,GPIO_PIN_RESET);                 // LCD_E low
	HAL_Delay(3);
} 

void LCD_write_string(unsigned char x, unsigned char y, unsigned char *str)     
{
  unsigned char lcd_address[4]={0x80,0xc0,0x90,0xd0};
  nibble_cmd(lcd_address[y-1]+x-1);
  uint8_t i=0;
	while(str[i]!='\0')       // loop will go on till the NULL character in the string
	{
	  nibble_data(str[i]);      // sending data on LCD byte by byte
	  i++;
	}
}

        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);