An improved version of mbed's I2C class.
Dependents: acd52832_Humidity_Temp_Example BB acnSensa_LIS aconnoCellularGnss ... more
aconno_i2c.h@0:bfefd65ef71d, 2017-09-22 (annotated)
- Committer:
- jurica238814
- Date:
- Fri Sep 22 12:46:17 2017 +0000
- Revision:
- 0:bfefd65ef71d
- Child:
- 1:5ae1807e3902
Init commit. Basic methods added.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jurica238814 | 0:bfefd65ef71d | 1 | /* |
jurica238814 | 0:bfefd65ef71d | 2 | * I2C library made by Jurica Resetar @ aconno |
jurica238814 | 0:bfefd65ef71d | 3 | * 2017 |
jurica238814 | 0:bfefd65ef71d | 4 | * More info @ aconno.de |
jurica238814 | 0:bfefd65ef71d | 5 | * jurica_resetar@yahoo.com |
jurica238814 | 0:bfefd65ef71d | 6 | * All right reserved |
jurica238814 | 0:bfefd65ef71d | 7 | * |
jurica238814 | 0:bfefd65ef71d | 8 | */ |
jurica238814 | 0:bfefd65ef71d | 9 | |
jurica238814 | 0:bfefd65ef71d | 10 | #ifndef ACONNO_I2C_H |
jurica238814 | 0:bfefd65ef71d | 11 | #define ACONNO_I2C_H |
jurica238814 | 0:bfefd65ef71d | 12 | |
jurica238814 | 0:bfefd65ef71d | 13 | #include "mbed.h" |
jurica238814 | 0:bfefd65ef71d | 14 | |
jurica238814 | 0:bfefd65ef71d | 15 | class aconno_i2c: public I2C{ |
jurica238814 | 0:bfefd65ef71d | 16 | public: |
jurica238814 | 0:bfefd65ef71d | 17 | aconno_i2c(PinName data, PinName clock, char address); |
jurica238814 | 0:bfefd65ef71d | 18 | uint8_t writeToReg(char regAddress, char *data, int len); |
jurica238814 | 0:bfefd65ef71d | 19 | uint8_t readFromReg(char regAddress, char *dataBuffer, int len); |
jurica238814 | 0:bfefd65ef71d | 20 | uint8_t sendCommand(char *command, uint8_t len, char *response, uint8_t responseLen); |
jurica238814 | 0:bfefd65ef71d | 21 | private: |
jurica238814 | 0:bfefd65ef71d | 22 | uint8_t i2cAddress; |
jurica238814 | 0:bfefd65ef71d | 23 | }; |
jurica238814 | 0:bfefd65ef71d | 24 | |
jurica238814 | 0:bfefd65ef71d | 25 | #endif // ACONNO_I2C_H |