Contains necessary classes and functions for ELEC351

/media/uploads/Luka_Danilovic/elec_315_prototype_assembly.jpg

displayMaster/displayMaster.hpp

Committer:
Luka_Danilovic
Date:
2017-12-28
Revision:
3:e84fa53173e6
Child:
5:becb1545229d

File content as of revision 3:e84fa53173e6:

#ifndef displayMaster
#define displayMaster

#define defaultD1 D7
#define defaultD2 D6
#define defaultD3 D4
#define defaultD4 D2
#define defaultRS D9
#define defaultRW D0
#define defaultEN D8

/* Instructions on using the 16x2 LCD panel are found here:
[https://www.8051projects.net/lcd-interfacing/lcd-4-bit.php] */

/* N.B. This class contains blocking function */

class C_displayMaster // Custom 16x2 LCD display driver (4 bit mode only)
{
    private:
    enum REGISTER {INSTRUCTION, DATA};
    enum MODE     {WRITE, READ};
    enum ENABLE   {DISABLE, ENABLE};
    
    BusInOut      _commsBus;
    DigitalOut    _registerSel;
    DigitalOut    _modeSel;
    DigitalOut    _enable;
    void writeChar(char, bool);
//    void writeData(char);
    void busyCheck(); 
    
    public:
    C_displayMaster(PinName D1 = defaultD1, PinName D2 = defaultD2, PinName D3 = defaultD3, PinName D4 = defaultD4, PinName RS = defaultRS, PinName RW = defaultRW, PinName EN = defaultEN);
  //  void write(string text);
//    void clear();
};

#endif