I2cLCD library that can display cursor.

Dependents:   LcdClock

Fork of I2cLCD by Junichi Katsu

Committer:
togayan
Date:
Sun Feb 09 09:04:30 2014 +0000
Revision:
1:f973d1359998
Parent:
0:b3cc6ae3dfd8
Child:
2:4e32baaf019b
I2C is given from outside the I2cLCD.

Who changed what in which revision?

UserRevisionLine numberNew 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
togayan 1:f973d1359998 7 class I2cLCD : public Stream
togayan 1:f973d1359998 8 {
jksoft 0:b3cc6ae3dfd8 9 public:
jksoft 0:b3cc6ae3dfd8 10
jksoft 0:b3cc6ae3dfd8 11 enum IconType {
jksoft 0:b3cc6ae3dfd8 12 Mark = 0x0001,
jksoft 0:b3cc6ae3dfd8 13 Battery_1 = 0x0004,
jksoft 0:b3cc6ae3dfd8 14 Battery_2 = 0x0002,
jksoft 0:b3cc6ae3dfd8 15 Battery_3 = 0x0010,
jksoft 0:b3cc6ae3dfd8 16 Battery_4 = 0x0008,
jksoft 0:b3cc6ae3dfd8 17 NoSound = 0x0020,
jksoft 0:b3cc6ae3dfd8 18 Lock = 0x0040,
jksoft 0:b3cc6ae3dfd8 19 ArrowDown = 0x0080,
jksoft 0:b3cc6ae3dfd8 20 ArrowUp = 0x0100,
jksoft 0:b3cc6ae3dfd8 21 Input = 0x0200,
jksoft 0:b3cc6ae3dfd8 22 Alarm = 0x0400,
jksoft 0:b3cc6ae3dfd8 23 Tell = 0x0800,
jksoft 0:b3cc6ae3dfd8 24 Antenna = 0x1000,
jksoft 0:b3cc6ae3dfd8 25 };
jksoft 0:b3cc6ae3dfd8 26
togayan 1:f973d1359998 27 I2cLCD(I2C& i2c, PinName rp);
jksoft 0:b3cc6ae3dfd8 28 #if DOXYGEN_ONLY
jksoft 0:b3cc6ae3dfd8 29 int putc(int c);
jksoft 0:b3cc6ae3dfd8 30 int printf(const char* format, ...);
jksoft 0:b3cc6ae3dfd8 31 #endif
jksoft 0:b3cc6ae3dfd8 32 void locate(int column, int row);
jksoft 0:b3cc6ae3dfd8 33 void cls();
jksoft 0:b3cc6ae3dfd8 34 int rows();
jksoft 0:b3cc6ae3dfd8 35 int columns();
jksoft 0:b3cc6ae3dfd8 36 void seticon(IconType type);
jksoft 0:b3cc6ae3dfd8 37 void clearicon(IconType type);
jksoft 0:b3cc6ae3dfd8 38 void puticon(int flg);
togayan 1:f973d1359998 39
jksoft 0:b3cc6ae3dfd8 40 protected:
jksoft 0:b3cc6ae3dfd8 41 virtual int _putc(int value);
jksoft 0:b3cc6ae3dfd8 42 virtual int _getc();
jksoft 0:b3cc6ae3dfd8 43
jksoft 0:b3cc6ae3dfd8 44 int address(int column, int row);
jksoft 0:b3cc6ae3dfd8 45 void character(int column, int row, int c);
jksoft 0:b3cc6ae3dfd8 46 void writeCommand( int cmd );
jksoft 0:b3cc6ae3dfd8 47 void writeData( int data );
togayan 1:f973d1359998 48
jksoft 0:b3cc6ae3dfd8 49 DigitalOut _rs;
togayan 1:f973d1359998 50 I2C& _i2c;
jksoft 0:b3cc6ae3dfd8 51 int _column;
jksoft 0:b3cc6ae3dfd8 52 int _row;
togayan 1:f973d1359998 53
jksoft 0:b3cc6ae3dfd8 54 char contrast;
jksoft 0:b3cc6ae3dfd8 55 int icon;
togayan 1:f973d1359998 56
jksoft 0:b3cc6ae3dfd8 57 };
jksoft 0:b3cc6ae3dfd8 58
jksoft 0:b3cc6ae3dfd8 59 #endif