AQM0802 library

Dependents:   mbed_EEPROM mbed_UV mbed_DEMO mbed_LPS25H ... more

See https://mbed.org/users/yasuyuki/notebook/AQM0802/

Committer:
yasuyuki
Date:
Tue Jun 24 08:40:21 2014 +0000
Revision:
0:6fa303916aa8
first revision

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yasuyuki 0:6fa303916aa8 1 //**********************
yasuyuki 0:6fa303916aa8 2 // AQM0802.h for mbed
yasuyuki 0:6fa303916aa8 3 //
yasuyuki 0:6fa303916aa8 4 // (C)Copyright 2014 All rights reserved by Y.Onodera
yasuyuki 0:6fa303916aa8 5 // http://einstlab.web.fc2.com
yasuyuki 0:6fa303916aa8 6 //**********************
yasuyuki 0:6fa303916aa8 7
yasuyuki 0:6fa303916aa8 8 #ifndef AQM0802_H_
yasuyuki 0:6fa303916aa8 9 #define AQM0802_H_
yasuyuki 0:6fa303916aa8 10
yasuyuki 0:6fa303916aa8 11 #define AQM0802_ADDR 0x7c
yasuyuki 0:6fa303916aa8 12 #define CMD 0x00
yasuyuki 0:6fa303916aa8 13 #define DAT 0x40
yasuyuki 0:6fa303916aa8 14
yasuyuki 0:6fa303916aa8 15 #include "mbed.h"
yasuyuki 0:6fa303916aa8 16
yasuyuki 0:6fa303916aa8 17 //class AQM0802: public Stream{
yasuyuki 0:6fa303916aa8 18 class AQM0802{
yasuyuki 0:6fa303916aa8 19 public:
yasuyuki 0:6fa303916aa8 20 AQM0802 (PinName sda, PinName scl);
yasuyuki 0:6fa303916aa8 21 AQM0802 (I2C& p_i2c);
yasuyuki 0:6fa303916aa8 22 void init();
yasuyuki 0:6fa303916aa8 23
yasuyuki 0:6fa303916aa8 24 void put(unsigned char a, unsigned char b);
yasuyuki 0:6fa303916aa8 25 void get(unsigned char a);
yasuyuki 0:6fa303916aa8 26 void cls();
yasuyuki 0:6fa303916aa8 27 void locate (int x, int y);
yasuyuki 0:6fa303916aa8 28 void print (const char* a);
yasuyuki 0:6fa303916aa8 29
yasuyuki 0:6fa303916aa8 30 protected:
yasuyuki 0:6fa303916aa8 31
yasuyuki 0:6fa303916aa8 32 I2C _i2c;
yasuyuki 0:6fa303916aa8 33 // virtual int _putc(int value);
yasuyuki 0:6fa303916aa8 34 // virtual int _getc();
yasuyuki 0:6fa303916aa8 35
yasuyuki 0:6fa303916aa8 36 char buf[2];
yasuyuki 0:6fa303916aa8 37
yasuyuki 0:6fa303916aa8 38 };
yasuyuki 0:6fa303916aa8 39
yasuyuki 0:6fa303916aa8 40
yasuyuki 0:6fa303916aa8 41 #endif /* AQM0802_H_ */
yasuyuki 0:6fa303916aa8 42