Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef LCD_H_
- #define LCD_H_
- #define RS_PIN 2
- #define RW_PIN 1
- #define EN_PIN 3
- #define RS_PORT PORTD
- #define RW_PORT PORTD
- #define EN_PORT PORTD
- #define RS_DDR DDRD
- #define RW_DDR DDRD
- #define EN_DDR DDRD
- //if defined LCD4, use 4-bit interface, else use 8-bit interface
- #define LCD4
- void LCDInit(void);
- void LCDBusy(void);
- void LCDData(unsigned char data);
- void LCDCommand(unsigned char cmd);
- inline void LCDSetPosition(unsigned char line, unsigned char col)
- {
- LCDBusy();
- unsigned char addr;
- if(line==2)addr=0xA8;
- else addr=0x80;
- addr+=col;
- LCDCommand(addr);
- }
- inline void LCDWriteChar(char ch)
- {
- LCDBusy();
- LCDData(ch);
- }
- void LCDWriteString(char* str, unsigned char strLen);
- void LCDWriteStringZ(char* str);
- #endif /* LCD_H_ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement