//********* Alphanumeric LCD Intrface Header File ****
#ifndef  LCD_H
    #define  LCD_H
//*****************
#define LCD_PIN0_NODE        DT_ALIAS(lcd0)
#define LCD_PIN1_NODE        DT_ALIAS(lcd1)
#define LCD_PIN2_NODE        DT_ALIAS(lcd2)
#define LCD_PIN3_NODE        DT_ALIAS(lcd3)

#define LCD_RS_NODE          DT_ALIAS(lcdrs)
#define LCD_EN_NODE          DT_ALIAS(lcden)
//************
static const struct gpio_dt_spec lcd_pin0 = GPIO_DT_SPEC_GET_OR(LCD_PIN0_NODE, gpios,{0});
static const struct gpio_dt_spec lcd_pin1 = GPIO_DT_SPEC_GET_OR(LCD_PIN1_NODE, gpios,{0});
static const struct gpio_dt_spec lcd_pin2 = GPIO_DT_SPEC_GET_OR(LCD_PIN2_NODE, gpios,{0});
static const struct gpio_dt_spec lcd_pin3 = GPIO_DT_SPEC_GET_OR(LCD_PIN3_NODE, gpios,{0});
static const struct gpio_dt_spec rs_pin =   GPIO_DT_SPEC_GET_OR(LCD_RS_NODE, gpios,{0});
static const struct gpio_dt_spec en_pin =   GPIO_DT_SPEC_GET_OR(LCD_EN_NODE, gpios,{0});
//**************
#if !DT_NODE_HAS_STATUS(LCD_PIN0_NODE, okay)
#error "Unsupported board: lcd0 devicetree alias is not defined"
#endif
#if !DT_NODE_HAS_STATUS(LCD_PIN1_NODE, okay)
#error "Unsupported board: lcd1 devicetree alias is not defined"
#endif
#if !DT_NODE_HAS_STATUS(LCD_PIN2_NODE, okay)
#error "Unsupported board: lcd2 devicetree alias is not defined"
#endif
#if !DT_NODE_HAS_STATUS(LCD_PIN3_NODE, okay)
#error "Unsupported board: lcd3 devicetree alias is not defined"
#endif
/**  Function Declaration  Start  **********/
void lcd_init(void);
void lcd_clear(void);
void lcd_data_byte(unsigned char );
void lcd_2Home(void);
void lcd_3Home(void);
void lcd_4Home(void);
void lcd_goto4(unsigned char);
void lcd_goto3(unsigned char);
void lcd_goto2(unsigned char);
void lcd_goto1(unsigned char);
void lcd_blank(unsigned char);
void lcd_cmd_4bit(unsigned char);
void lcd_cmd_byte(unsigned char);
void lcd_command(unsigned char);
void lcd_data(unsigned char);
void lcd_spaces(unsigned char);
void jump_cursor(void);
void update_curser_pos(unsigned char ,unsigned char );
 
//*************
typedef struct
    {
      unsigned char line_no ;
      unsigned char loc_add ;
    }loc_curser;
//*******************************
#endif  
//***************
