SRK Version of mDot LoRa_Sensormode_SRK
Dependencies: libmDot mbed-rtos mbed
Fork of mDot_LoRa_Sensornode by
I2C_RT.h
00001 /** 00002 * @file I2C_RT.h 00003 * 00004 * @author Adrian 00005 * @date 19.05.2016 00006 */ 00007 00008 #ifndef APP_I2C_RT_H_ 00009 #define APP_I2C_RT_H_ 00010 00011 #include <I2C.h> 00012 #include <rtos.h> 00013 00014 00015 /** 00016 * @class I2C_RT 00017 * @brief Controls the I2C device of the mDot. mbed::I2C functionality is wrapped 00018 * inside it's methods. It's possible to wrap other I2C functionality from different Libraries 00019 * or write an own implementation. 00020 */ 00021 class I2C_RT{ 00022 public: 00023 I2C_RT(); 00024 virtual ~I2C_RT(); 00025 00026 /** 00027 * @brief Reads data from a specific register 00028 * @param address address of the I2C Slave device 00029 * @param reg register from which the data has to be read 00030 * @param twoBytes defines if two Bytes at once has to be read 00031 * @param readData storage for the read Data 00032 * @param dataLength length of the storage in bytes 00033 */ 00034 void read_RT(uint8_t address, uint16_t reg, bool twoBytes, uint8_t* readData, uint8_t dataLength); 00035 00036 /** 00037 * @brief Write data to a specific register 00038 * @param address address of the I2C Slave device 00039 * @param reg register where the data has to be write 00040 * @param twoBytes defines if two bytes at once has to be write 00041 * @param dataToWrite the actual data that has to be written 00042 * @param dataLenght the length of the data in bytes 00043 */ 00044 void write_RT(uint8_t address,uint16_t reg, bool twoBytes ,uint8_t* dataToWrite ,uint8_t dataLenght); 00045 00046 private: 00047 00048 00049 00050 }; 00051 00052 #endif /* APP_I2C_RT_H_ */
Generated on Wed Jul 13 2022 09:23:47 by 1.7.2