liamgrazier lcd library 16x02
lglcd.h@0:ef052de2d7d0, 2018-01-05 (annotated)
- Committer:
- liam_grazier
- Date:
- Fri Jan 05 14:13:07 2018 +0000
- Revision:
- 0:ef052de2d7d0
mylcd driver for nucleof429ZI
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
liam_grazier | 0:ef052de2d7d0 | 1 | #ifndef __LGLCD_H |
liam_grazier | 0:ef052de2d7d0 | 2 | #define __LGLCD_H |
liam_grazier | 0:ef052de2d7d0 | 3 | |
liam_grazier | 0:ef052de2d7d0 | 4 | #define CMD 0 |
liam_grazier | 0:ef052de2d7d0 | 5 | #define TXT 1 |
liam_grazier | 0:ef052de2d7d0 | 6 | #define CLEAR 1 |
liam_grazier | 0:ef052de2d7d0 | 7 | #define HOME 2 |
liam_grazier | 0:ef052de2d7d0 | 8 | #define READ 1 |
liam_grazier | 0:ef052de2d7d0 | 9 | #define WRITE 0 |
liam_grazier | 0:ef052de2d7d0 | 10 | #define LEFT 0 |
liam_grazier | 0:ef052de2d7d0 | 11 | #define RIGHT 1 |
liam_grazier | 0:ef052de2d7d0 | 12 | |
liam_grazier | 0:ef052de2d7d0 | 13 | #define LINE1 0x80 // Start address of first line |
liam_grazier | 0:ef052de2d7d0 | 14 | #define LINE2 0xC0 // Start address of second line |
liam_grazier | 0:ef052de2d7d0 | 15 | |
liam_grazier | 0:ef052de2d7d0 | 16 | #define LCD_CLR (writedata(CLEAR,CMD)) |
liam_grazier | 0:ef052de2d7d0 | 17 | #define LCD_HOME (writedata(HOME,CMD)) |
liam_grazier | 0:ef052de2d7d0 | 18 | #define LCD_BUSYBIT 0x8000 //correct value for the lcd BUSYBIT |
liam_grazier | 0:ef052de2d7d0 | 19 | |
liam_grazier | 0:ef052de2d7d0 | 20 | |
liam_grazier | 0:ef052de2d7d0 | 21 | class lglcd |
liam_grazier | 0:ef052de2d7d0 | 22 | { |
liam_grazier | 0:ef052de2d7d0 | 23 | public: |
liam_grazier | 0:ef052de2d7d0 | 24 | lglcd(PinName rs, PinName e, PinName d4, PinName d5,PinName d6, PinName d7); |
liam_grazier | 0:ef052de2d7d0 | 25 | void clear(void); |
liam_grazier | 0:ef052de2d7d0 | 26 | void writedata(unsigned char info, unsigned char type); |
liam_grazier | 0:ef052de2d7d0 | 27 | void write(char charq[]); |
liam_grazier | 0:ef052de2d7d0 | 28 | int l; |
liam_grazier | 0:ef052de2d7d0 | 29 | protected: |
liam_grazier | 0:ef052de2d7d0 | 30 | BusOut _lcdinfo; |
liam_grazier | 0:ef052de2d7d0 | 31 | DigitalOut _lcdrs; |
liam_grazier | 0:ef052de2d7d0 | 32 | DigitalOut _lcde; |
liam_grazier | 0:ef052de2d7d0 | 33 | int cline; |
liam_grazier | 0:ef052de2d7d0 | 34 | int cpos; |
liam_grazier | 0:ef052de2d7d0 | 35 | }; |
liam_grazier | 0:ef052de2d7d0 | 36 | #endif |