VIメータのプログラムですI2C LCDとINA226を装備しています。

Dependencies:   mbed

Committer:
takeuchi
Date:
Mon May 09 08:38:27 2016 +0000
Revision:
0:27e9d6071e9b
VI?????????????I2C?INA????I2C?LCD?????????

Who changed what in which revision?

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