Ben Gordon
/
ELEC351_GroupA-branch1
Troubleshooting
LCD.hpp
- Committer:
- Jonathan738
- Date:
- 2018-11-04
- Revision:
- 6:f3d1ab8a9e99
- Parent:
- 0:f8fe58d43763
- Child:
- 7:0213c3702c99
File content as of revision 6:f3d1ab8a9e99:
#ifndef _LCD_HPP #define _LCD_HPP #include "mbed.h" #include "DataTypes.hpp" #define CLEAR 0x01 #define RETURN 0x02 #define ENTRYMODE 0x04 #define I 0x02 #define shift 0x01 #define DISPLAY 0x08 #define on 0x04 #define cursor 0x02 #define blink 0x01 #define DDRAM 0x20 #define bit8 0x10 #define lines2 0x08 #define dots11 0x04 #define control 0 #define text 1 #define write 0 #define read 1 #define LINE1 0x80 #define LINE2 0xc0 class LCD{ public: LCD(PinName rs, PinName e, PinName d4, PinName d5, PinName d6, PinName d7) : _LCD_RS(rs), _LCD_E(e), LCD_DDRAM(d7,d6,d5,d4) {} void INIT(); void clear(); void display(BYTE* str, INT_32 line, INT_32 position); void putt(BYTE c); private: DigitalOut _LCD_RS; DigitalOut _LCD_E; BusOut LCD_DDRAM; private: void cmdLCD(U_BYTE cmd); void LCD_strobe(void); void set_LCD_data(U_BYTE d); UINT_32 findSpace(BYTE* str); }; #endif