![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
TextLCD.h@0:8e3468376286, 2011-05-07 (annotated)
- Committer:
- faker
- Date:
- Sat May 07 12:37:10 2011 +0000
- Revision:
- 0:8e3468376286
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
faker | 0:8e3468376286 | 1 | /* draft mbed TextLCD |
faker | 0:8e3468376286 | 2 | * (c) 2007/8, sford |
faker | 0:8e3468376286 | 3 | */ |
faker | 0:8e3468376286 | 4 | |
faker | 0:8e3468376286 | 5 | #ifndef MBED_TEXTLCD_H |
faker | 0:8e3468376286 | 6 | #define MBED_TEXTLCD_H |
faker | 0:8e3468376286 | 7 | |
faker | 0:8e3468376286 | 8 | #include "Stream.h" |
faker | 0:8e3468376286 | 9 | #include "DigitalOut.h" |
faker | 0:8e3468376286 | 10 | #include "BusOut.h" |
faker | 0:8e3468376286 | 11 | #include "mbed.h" |
faker | 0:8e3468376286 | 12 | |
faker | 0:8e3468376286 | 13 | namespace mbed { |
faker | 0:8e3468376286 | 14 | |
faker | 0:8e3468376286 | 15 | class TextLCD : public Stream { |
faker | 0:8e3468376286 | 16 | |
faker | 0:8e3468376286 | 17 | public: |
faker | 0:8e3468376286 | 18 | |
faker | 0:8e3468376286 | 19 | TextLCD(PinName rs, PinName rw, PinName e, PinName d0, PinName d1, |
faker | 0:8e3468376286 | 20 | PinName d2, PinName d3); |
faker | 0:8e3468376286 | 21 | |
faker | 0:8e3468376286 | 22 | void rows(int rows); |
faker | 0:8e3468376286 | 23 | void columns(int columns); |
faker | 0:8e3468376286 | 24 | |
faker | 0:8e3468376286 | 25 | virtual void locate(int row, int column); |
faker | 0:8e3468376286 | 26 | virtual void cls(); |
faker | 0:8e3468376286 | 27 | virtual void reset(); |
faker | 0:8e3468376286 | 28 | |
faker | 0:8e3468376286 | 29 | protected: |
faker | 0:8e3468376286 | 30 | |
faker | 0:8e3468376286 | 31 | void clock(); |
faker | 0:8e3468376286 | 32 | void writeData(int data); |
faker | 0:8e3468376286 | 33 | void writeCommand(int command); |
faker | 0:8e3468376286 | 34 | void writeByte(int value); |
faker | 0:8e3468376286 | 35 | void writeNibble(int value); |
faker | 0:8e3468376286 | 36 | virtual int _putc(int c); |
faker | 0:8e3468376286 | 37 | virtual int _getc(); |
faker | 0:8e3468376286 | 38 | virtual void newline(); |
faker | 0:8e3468376286 | 39 | |
faker | 0:8e3468376286 | 40 | int _rows; |
faker | 0:8e3468376286 | 41 | int _columns; |
faker | 0:8e3468376286 | 42 | int _row; |
faker | 0:8e3468376286 | 43 | int _column; |
faker | 0:8e3468376286 | 44 | DigitalOut _rw, _rs, _e; |
faker | 0:8e3468376286 | 45 | BusOut _d; |
faker | 0:8e3468376286 | 46 | |
faker | 0:8e3468376286 | 47 | }; |
faker | 0:8e3468376286 | 48 | |
faker | 0:8e3468376286 | 49 | } |
faker | 0:8e3468376286 | 50 | |
faker | 0:8e3468376286 | 51 | #endif |