#define D7_ANSEL ANSELEbits.ANSE7
#define D6_ANSEL ANSELEbits.ANSE6
#define D5_ANSEL ANSELEbits.ANSE5
#define D4_ANSEL ANSELEbits.ANSE4
#define D2_ANSEL ANSELEbits.ANSE2
#define RS_ANSEL ANSELBbits.ANSB15

#define D7_TRIS TRISEbits.TRISE7
#define D6_TRIS TRISEbits.TRISE6
#define D5_TRIS TRISEbits.TRISE5
#define D4_TRIS TRISEbits.TRISE4
#define D3_TRIS TRISEbits.TRISE3
#define D2_TRIS TRISEbits.TRISE2
#define D1_TRIS TRISEbits.TRISE1
#define D0_TRIS TRISEbits.TRISE0
#define RS_TRIS TRISBbits.TRISB15
#define RW_TRIS TRISDbits.TRISD5
#define E_TRIS  TRISDbits.TRISD4

#define D7 LATEbits.LATE7
#define D6 LATEbits.LATE6
#define D5 LATEbits.LATE5
#define D4 LATEbits.LATE4
#define D3 LATEbits.LATE3
#define D2 LATEbits.LATE2
#define D1 LATEbits.LATE1
#define D0 LATEbits.LATE0
#define RS LATBbits.LATB15 //H=data, L=command
#define RW LATDbits.LATD5  //H=read, L=write
#define E  LATDbits.LATD4  //aktivni na sestupnou hranu

void initLcd(void);
void cmdLcd(unsigned char cmd);
void dataLcd(unsigned char data);
void writeLineLcd(char* text);
void homeLcd(void);
void clearLcd(void);
void setAddrLcd(unsigned char row, unsigned char col);
void writeStringLcd(unsigned char* text, unsigned char n);