Dependents: I2cLCD_temp lpclcd_blink lpclcd_analogIn MASTU-bed_I2CLCD
I2cLCD.h@0:b3cc6ae3dfd8, 2010-06-28 (annotated)
- Committer:
- jksoft
- Date:
- Mon Jun 28 14:20:58 2010 +0000
- Revision:
- 0:b3cc6ae3dfd8
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jksoft | 0:b3cc6ae3dfd8 | 1 | |
jksoft | 0:b3cc6ae3dfd8 | 2 | #ifndef MBED_I2CLCD_H |
jksoft | 0:b3cc6ae3dfd8 | 3 | #define MBED_I2CLCD_H |
jksoft | 0:b3cc6ae3dfd8 | 4 | |
jksoft | 0:b3cc6ae3dfd8 | 5 | #include "mbed.h" |
jksoft | 0:b3cc6ae3dfd8 | 6 | |
jksoft | 0:b3cc6ae3dfd8 | 7 | class I2cLCD : public Stream { |
jksoft | 0:b3cc6ae3dfd8 | 8 | public: |
jksoft | 0:b3cc6ae3dfd8 | 9 | |
jksoft | 0:b3cc6ae3dfd8 | 10 | enum IconType { |
jksoft | 0:b3cc6ae3dfd8 | 11 | Mark = 0x0001, |
jksoft | 0:b3cc6ae3dfd8 | 12 | Battery_1 = 0x0004, |
jksoft | 0:b3cc6ae3dfd8 | 13 | Battery_2 = 0x0002, |
jksoft | 0:b3cc6ae3dfd8 | 14 | Battery_3 = 0x0010, |
jksoft | 0:b3cc6ae3dfd8 | 15 | Battery_4 = 0x0008, |
jksoft | 0:b3cc6ae3dfd8 | 16 | NoSound = 0x0020, |
jksoft | 0:b3cc6ae3dfd8 | 17 | Lock = 0x0040, |
jksoft | 0:b3cc6ae3dfd8 | 18 | ArrowDown = 0x0080, |
jksoft | 0:b3cc6ae3dfd8 | 19 | ArrowUp = 0x0100, |
jksoft | 0:b3cc6ae3dfd8 | 20 | Input = 0x0200, |
jksoft | 0:b3cc6ae3dfd8 | 21 | Alarm = 0x0400, |
jksoft | 0:b3cc6ae3dfd8 | 22 | Tell = 0x0800, |
jksoft | 0:b3cc6ae3dfd8 | 23 | Antenna = 0x1000, |
jksoft | 0:b3cc6ae3dfd8 | 24 | }; |
jksoft | 0:b3cc6ae3dfd8 | 25 | |
jksoft | 0:b3cc6ae3dfd8 | 26 | I2cLCD(PinName sda, PinName scl, PinName rp); |
jksoft | 0:b3cc6ae3dfd8 | 27 | #if DOXYGEN_ONLY |
jksoft | 0:b3cc6ae3dfd8 | 28 | int putc(int c); |
jksoft | 0:b3cc6ae3dfd8 | 29 | int printf(const char* format, ...); |
jksoft | 0:b3cc6ae3dfd8 | 30 | #endif |
jksoft | 0:b3cc6ae3dfd8 | 31 | void locate(int column, int row); |
jksoft | 0:b3cc6ae3dfd8 | 32 | void cls(); |
jksoft | 0:b3cc6ae3dfd8 | 33 | int rows(); |
jksoft | 0:b3cc6ae3dfd8 | 34 | int columns(); |
jksoft | 0:b3cc6ae3dfd8 | 35 | void seticon(IconType type); |
jksoft | 0:b3cc6ae3dfd8 | 36 | void clearicon(IconType type); |
jksoft | 0:b3cc6ae3dfd8 | 37 | void puticon(int flg); |
jksoft | 0:b3cc6ae3dfd8 | 38 | |
jksoft | 0:b3cc6ae3dfd8 | 39 | protected: |
jksoft | 0:b3cc6ae3dfd8 | 40 | virtual int _putc(int value); |
jksoft | 0:b3cc6ae3dfd8 | 41 | virtual int _getc(); |
jksoft | 0:b3cc6ae3dfd8 | 42 | |
jksoft | 0:b3cc6ae3dfd8 | 43 | int address(int column, int row); |
jksoft | 0:b3cc6ae3dfd8 | 44 | void character(int column, int row, int c); |
jksoft | 0:b3cc6ae3dfd8 | 45 | void writeCommand( int cmd ); |
jksoft | 0:b3cc6ae3dfd8 | 46 | void writeData( int data ); |
jksoft | 0:b3cc6ae3dfd8 | 47 | |
jksoft | 0:b3cc6ae3dfd8 | 48 | DigitalOut _rs; |
jksoft | 0:b3cc6ae3dfd8 | 49 | I2C _i2c; |
jksoft | 0:b3cc6ae3dfd8 | 50 | int _column; |
jksoft | 0:b3cc6ae3dfd8 | 51 | int _row; |
jksoft | 0:b3cc6ae3dfd8 | 52 | |
jksoft | 0:b3cc6ae3dfd8 | 53 | char contrast; |
jksoft | 0:b3cc6ae3dfd8 | 54 | int icon; |
jksoft | 0:b3cc6ae3dfd8 | 55 | |
jksoft | 0:b3cc6ae3dfd8 | 56 | }; |
jksoft | 0:b3cc6ae3dfd8 | 57 | |
jksoft | 0:b3cc6ae3dfd8 | 58 | #endif |