How to use EEPROM in TG-LPC11U35-501
Dependencies: AQM0802 EEPROM mbed
AQM0802.h@0:8dfee9f6df54, 2014-06-22 (annotated)
- Committer:
- yasuyuki
- Date:
- Sun Jun 22 09:57:23 2014 +0000
- Revision:
- 0:8dfee9f6df54
first revision
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yasuyuki | 0:8dfee9f6df54 | 1 | //********************** |
yasuyuki | 0:8dfee9f6df54 | 2 | // AQM0802.h for mbed |
yasuyuki | 0:8dfee9f6df54 | 3 | // |
yasuyuki | 0:8dfee9f6df54 | 4 | // (C)Copyright 2014 All rights reserved by Y.Onodera |
yasuyuki | 0:8dfee9f6df54 | 5 | // http://einstlab.web.fc2.com |
yasuyuki | 0:8dfee9f6df54 | 6 | //********************** |
yasuyuki | 0:8dfee9f6df54 | 7 | |
yasuyuki | 0:8dfee9f6df54 | 8 | #ifndef AQM0802_H_ |
yasuyuki | 0:8dfee9f6df54 | 9 | #define AQM0802_H_ |
yasuyuki | 0:8dfee9f6df54 | 10 | |
yasuyuki | 0:8dfee9f6df54 | 11 | #define AQM0802_ADDR 0x7c |
yasuyuki | 0:8dfee9f6df54 | 12 | #define CMD 0x00 |
yasuyuki | 0:8dfee9f6df54 | 13 | #define DAT 0x40 |
yasuyuki | 0:8dfee9f6df54 | 14 | |
yasuyuki | 0:8dfee9f6df54 | 15 | #include "mbed.h" |
yasuyuki | 0:8dfee9f6df54 | 16 | |
yasuyuki | 0:8dfee9f6df54 | 17 | //class AQM0802: public Stream{ |
yasuyuki | 0:8dfee9f6df54 | 18 | class AQM0802{ |
yasuyuki | 0:8dfee9f6df54 | 19 | public: |
yasuyuki | 0:8dfee9f6df54 | 20 | AQM0802 (PinName sda, PinName scl); |
yasuyuki | 0:8dfee9f6df54 | 21 | AQM0802 (I2C& p_i2c); |
yasuyuki | 0:8dfee9f6df54 | 22 | void init(); |
yasuyuki | 0:8dfee9f6df54 | 23 | |
yasuyuki | 0:8dfee9f6df54 | 24 | void put(unsigned char a, unsigned char b); |
yasuyuki | 0:8dfee9f6df54 | 25 | void get(unsigned char a); |
yasuyuki | 0:8dfee9f6df54 | 26 | void cls(); |
yasuyuki | 0:8dfee9f6df54 | 27 | void locate (int x, int y); |
yasuyuki | 0:8dfee9f6df54 | 28 | void print (const char* a); |
yasuyuki | 0:8dfee9f6df54 | 29 | |
yasuyuki | 0:8dfee9f6df54 | 30 | protected: |
yasuyuki | 0:8dfee9f6df54 | 31 | |
yasuyuki | 0:8dfee9f6df54 | 32 | I2C _i2c; |
yasuyuki | 0:8dfee9f6df54 | 33 | // virtual int _putc(int value); |
yasuyuki | 0:8dfee9f6df54 | 34 | // virtual int _getc(); |
yasuyuki | 0:8dfee9f6df54 | 35 | |
yasuyuki | 0:8dfee9f6df54 | 36 | char buf[2]; |
yasuyuki | 0:8dfee9f6df54 | 37 | |
yasuyuki | 0:8dfee9f6df54 | 38 | }; |
yasuyuki | 0:8dfee9f6df54 | 39 | |
yasuyuki | 0:8dfee9f6df54 | 40 | |
yasuyuki | 0:8dfee9f6df54 | 41 | #endif /* AQM0802_H_ */ |
yasuyuki | 0:8dfee9f6df54 | 42 |