SRK Version of mDot LoRa_Sensormode_SRK

Dependencies:   libmDot mbed-rtos mbed

Fork of mDot_LoRa_Sensornode by Adrian Mitevski

Committer:
skramer
Date:
Mon Aug 15 18:57:35 2016 +0000
Revision:
6:e2ae47490f60
Parent:
0:f2815503561f
Uptodate with last changes

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mitea1 0:f2815503561f 1 /**
mitea1 0:f2815503561f 2 * @file I2C_RT.h
mitea1 0:f2815503561f 3 *
mitea1 0:f2815503561f 4 * @author Adrian
mitea1 0:f2815503561f 5 * @date 19.05.2016
mitea1 0:f2815503561f 6 */
mitea1 0:f2815503561f 7
mitea1 0:f2815503561f 8 #ifndef APP_I2C_RT_H_
mitea1 0:f2815503561f 9 #define APP_I2C_RT_H_
mitea1 0:f2815503561f 10
mitea1 0:f2815503561f 11 #include <I2C.h>
mitea1 0:f2815503561f 12 #include <rtos.h>
mitea1 0:f2815503561f 13
mitea1 0:f2815503561f 14
mitea1 0:f2815503561f 15 /**
mitea1 0:f2815503561f 16 * @class I2C_RT
mitea1 0:f2815503561f 17 * @brief Controls the I2C device of the mDot. mbed::I2C functionality is wrapped
mitea1 0:f2815503561f 18 * inside it's methods. It's possible to wrap other I2C functionality from different Libraries
mitea1 0:f2815503561f 19 * or write an own implementation.
mitea1 0:f2815503561f 20 */
mitea1 0:f2815503561f 21 class I2C_RT{
mitea1 0:f2815503561f 22 public:
mitea1 0:f2815503561f 23 I2C_RT();
mitea1 0:f2815503561f 24 virtual ~I2C_RT();
mitea1 0:f2815503561f 25
mitea1 0:f2815503561f 26 /**
mitea1 0:f2815503561f 27 * @brief Reads data from a specific register
mitea1 0:f2815503561f 28 * @param address address of the I2C Slave device
mitea1 0:f2815503561f 29 * @param reg register from which the data has to be read
mitea1 0:f2815503561f 30 * @param twoBytes defines if two Bytes at once has to be read
mitea1 0:f2815503561f 31 * @param readData storage for the read Data
mitea1 0:f2815503561f 32 * @param dataLength length of the storage in bytes
mitea1 0:f2815503561f 33 */
mitea1 0:f2815503561f 34 void read_RT(uint8_t address, uint16_t reg, bool twoBytes, uint8_t* readData, uint8_t dataLength);
mitea1 0:f2815503561f 35
mitea1 0:f2815503561f 36 /**
mitea1 0:f2815503561f 37 * @brief Write data to a specific register
mitea1 0:f2815503561f 38 * @param address address of the I2C Slave device
mitea1 0:f2815503561f 39 * @param reg register where the data has to be write
mitea1 0:f2815503561f 40 * @param twoBytes defines if two bytes at once has to be write
mitea1 0:f2815503561f 41 * @param dataToWrite the actual data that has to be written
mitea1 0:f2815503561f 42 * @param dataLenght the length of the data in bytes
mitea1 0:f2815503561f 43 */
mitea1 0:f2815503561f 44 void write_RT(uint8_t address,uint16_t reg, bool twoBytes ,uint8_t* dataToWrite ,uint8_t dataLenght);
mitea1 0:f2815503561f 45
mitea1 0:f2815503561f 46 private:
mitea1 0:f2815503561f 47
mitea1 0:f2815503561f 48
mitea1 0:f2815503561f 49
mitea1 0:f2815503561f 50 };
mitea1 0:f2815503561f 51
mitea1 0:f2815503561f 52 #endif /* APP_I2C_RT_H_ */