hadif azli
/
TEST123
BLYNK TEST
I2Cdev.h@3:4cd9171ba989, 2016-06-16 (annotated)
- Committer:
- lixianyu
- Date:
- Thu Jun 16 08:08:30 2016 +0000
- Revision:
- 3:4cd9171ba989
- Parent:
- 2:6cd3b0947188
9600?????ESP8266????????115200??ESP8266?????????9600????????????Timer???????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lixianyu | 2:6cd3b0947188 | 1 | #ifndef _I2CDEV_H_ |
lixianyu | 2:6cd3b0947188 | 2 | #define _I2CDEV_H_ |
lixianyu | 3:4cd9171ba989 | 3 | #if 0 |
lixianyu | 2:6cd3b0947188 | 4 | #include "mbed.h" |
lixianyu | 2:6cd3b0947188 | 5 | |
lixianyu | 2:6cd3b0947188 | 6 | #define I2CDEV_DEFAULT_READ_TIMEOUT 1000 |
lixianyu | 2:6cd3b0947188 | 7 | class I2Cdev { |
lixianyu | 2:6cd3b0947188 | 8 | public: |
lixianyu | 2:6cd3b0947188 | 9 | I2Cdev(); |
lixianyu | 2:6cd3b0947188 | 10 | |
lixianyu | 2:6cd3b0947188 | 11 | static void init(); |
lixianyu | 2:6cd3b0947188 | 12 | static int8_t readBit(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint8_t *data, uint16_t timeout=I2Cdev::readTimeout); |
lixianyu | 2:6cd3b0947188 | 13 | static int8_t readBitW(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint16_t *data, uint16_t timeout=I2Cdev::readTimeout); |
lixianyu | 2:6cd3b0947188 | 14 | static int8_t readBits(uint8_t devAddr, uint8_t regAddr, uint8_t bitStart, uint8_t length, uint8_t *data, uint16_t timeout=I2Cdev::readTimeout); |
lixianyu | 2:6cd3b0947188 | 15 | static int8_t readBitsW(uint8_t devAddr, uint8_t regAddr, uint8_t bitStart, uint8_t length, uint16_t *data, uint16_t timeout=I2Cdev::readTimeout); |
lixianyu | 2:6cd3b0947188 | 16 | static int8_t readByte(uint8_t devAddr, uint8_t regAddr, uint8_t *data, uint16_t timeout=I2Cdev::readTimeout); |
lixianyu | 2:6cd3b0947188 | 17 | static int8_t readWord(uint8_t devAddr, uint8_t regAddr, uint16_t *data, uint16_t timeout=I2Cdev::readTimeout); |
lixianyu | 2:6cd3b0947188 | 18 | static int8_t readBytes(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint8_t *data, uint16_t timeout=I2Cdev::readTimeout); |
lixianyu | 2:6cd3b0947188 | 19 | static int8_t readBytesOnly(uint8_t devAddr, uint8_t length, uint8_t *data, uint16_t timeout=I2Cdev::readTimeout); |
lixianyu | 2:6cd3b0947188 | 20 | static int8_t readWords(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint16_t *data, uint16_t timeout=I2Cdev::readTimeout); |
lixianyu | 2:6cd3b0947188 | 21 | |
lixianyu | 2:6cd3b0947188 | 22 | static bool writeBit(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint8_t data); |
lixianyu | 2:6cd3b0947188 | 23 | static bool writeBitW(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint16_t data); |
lixianyu | 2:6cd3b0947188 | 24 | static bool writeBits(uint8_t devAddr, uint8_t regAddr, uint8_t bitStart, uint8_t length, uint8_t data); |
lixianyu | 2:6cd3b0947188 | 25 | static bool writeBitsW(uint8_t devAddr, uint8_t regAddr, uint8_t bitStart, uint8_t length, uint16_t data); |
lixianyu | 2:6cd3b0947188 | 26 | static bool writeByte(uint8_t devAddr, uint8_t regAddr, uint8_t data); |
lixianyu | 2:6cd3b0947188 | 27 | static bool writeWord(uint8_t devAddr, uint8_t regAddr, uint16_t data); |
lixianyu | 2:6cd3b0947188 | 28 | static bool writeBytes(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint8_t *data); |
lixianyu | 2:6cd3b0947188 | 29 | static bool writeWords(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint16_t *data); |
lixianyu | 2:6cd3b0947188 | 30 | |
lixianyu | 2:6cd3b0947188 | 31 | static uint16_t readTimeout; |
lixianyu | 2:6cd3b0947188 | 32 | }; |
lixianyu | 2:6cd3b0947188 | 33 | |
lixianyu | 2:6cd3b0947188 | 34 | #endif /* _I2CDEV_H_ */ |
lixianyu | 3:4cd9171ba989 | 35 | #endif |