A multifunctional and modular Firmware for Multitech's mDot based on ARM mBed provides a widerange of functionality for several Sensors such as MAX44009, BME280, MPU9250, SI1143 and uBlox. It allows you to quickly build a Sensornode that measures specific data with its sensors and sends it via LoRaWAN.

Dependencies:   mDot_LoRa_Sensornode_Flowmeter_impl mbed-rtos mbed

Embed: (wiki syntax)

« Back to documentation index

I2C_RT Class Reference

I2C_RT Class Reference

Controls the I2C device of the mDot. More...

#include <I2C_RT.h>

Public Member Functions

void read_RT (uint8_t address, uint16_t reg, bool twoBytes, uint8_t *readData, uint8_t dataLength)
 Reads data from a specific register.
void write_RT (uint8_t address, uint16_t reg, bool twoBytes, uint8_t *dataToWrite, uint8_t dataLenght)
 Write data to a specific register.

Detailed Description

Controls the I2C device of the mDot.

mbed::I2C functionality is wrapped inside it's methods. It's possible to wrap other I2C functionality from different Libraries or write an own implementation.

Definition at line 21 of file I2C_RT.h.


Member Function Documentation

void read_RT ( uint8_t  address,
uint16_t  reg,
bool  twoBytes,
uint8_t *  readData,
uint8_t  dataLength 
)

Reads data from a specific register.

Parameters:
addressaddress of the I2C Slave device
regregister from which the data has to be read
twoBytesdefines if two Bytes at once has to be read
readDatastorage for the read Data
dataLengthlength of the storage in bytes

Definition at line 19 of file I2C_RT.cpp.

void write_RT ( uint8_t  address,
uint16_t  reg,
bool  twoBytes,
uint8_t *  dataToWrite,
uint8_t  dataLenght 
)

Write data to a specific register.

Parameters:
addressaddress of the I2C Slave device
regregister where the data has to be write
twoBytesdefines if two bytes at once has to be write
dataToWritethe actual data that has to be written
dataLenghtthe length of the data in bytes

Definition at line 40 of file I2C_RT.cpp.