liamgrazier lcd library 16x02

Dependents:   Final351CW_FINAL

Fork of LGLCDv2 by Liam Grazier

lglcd.h

Committer:
liam_grazier
Date:
2018-01-09
Revision:
2:d812a2a643bc
Parent:
1:9020af47a312

File content as of revision 2:d812a2a643bc:

/*   ELEC351 COURSEWORK 2018 
DESIGNED USING MBED ONLINE COMPILER IMPORTED TO KEIL
LIAM GRAZIER // DOUG TILLEY // ALEX BARON 
 */
#ifndef __LGLCD_H 
#define __LGLCD_H
#define CMD      0 //adapted from 2nd year code
#define TXT      1
#define CLEAR    1
#define HOME     2
#define READ     1
#define WRITE    0
#define LEFT     0
#define RIGHT    1
#define LINE1    0x80        // Start address of first line
#define LINE2    0xC0        // Start address of second line
#define LCD_CLR             (writedata(CLEAR,CMD))
#define LCD_HOME            (writedata(HOME,CMD))
#define LCD_BUSYBIT 0x8000  //correct value for the lcd BUSYBIT
//mylcdclass 
class lglcd
{
public:
lglcd(PinName RS, PinName E, PinName D4, PinName D5,PinName D6, PinName D7); //statement for pin enables
void clear(void); //function for clearlcd
void writedata(unsigned char info, unsigned char type); //function forwiring data on the screen 
void lglcd::setline(int row,int column); //setline command row/column
void write(char charq[]); //wirint char/str on mylcd.
int l; 
protected:
BusOut _lcdinfo; //output define for D4-D7
DigitalOut _lcdrs; //output define for RS Pin
DigitalOut _lcde; //output define for E pin
};
#endif