Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: acd52832_Humidity_Temp_Example BB acnSensa_LIS aconnoCellularGnss ... more
aconno_i2c.h
00001 /* 00002 * I2C library made by Jurica Resetar @ aconno 00003 * 2017 00004 * More info @ aconno.de 00005 * jurica_resetar@yahoo.com 00006 * All right reserved 00007 * 00008 */ 00009 00010 #ifndef ACONNO_I2C_H 00011 #define ACONNO_I2C_H 00012 00013 #include "mbed.h" 00014 00015 class aconno_i2c{ 00016 public: 00017 aconno_i2c(I2C *i2c, char address); 00018 uint8_t writeToReg(char regAddress, char *data, int len); 00019 uint8_t readFromReg(char regAddress, char *dataBuffer, int len); 00020 uint8_t sendCommand(char *command, uint8_t len, char *response, 00021 uint8_t responseLen, bool repeated = false); 00022 uint8_t sendCommand(char *command, uint8_t len); 00023 uint8_t readBus(char *dataBuffer, int len); 00024 uint16_t changeRegBits(char regAddress, uint8_t regSize, 00025 uint16_t newValue, uint16_t numOfBits, uint16_t offset); 00026 private: 00027 uint8_t i2cAddress; 00028 I2C *i2c; 00029 }; 00030 00031 #endif // ACONNO_I2C_H
Generated on Fri Jul 22 2022 13:50:46 by
1.7.2