#include "i2c.hpp"

/*
#if PLATFORM == LINUX
#include "i2c_linux.hpp"
#endif

#if PLATFORM == LINUX
#include "i2c_stm.hpp"
#endif
*/

#include "i2c_linux.hpp"

I2C::I2C():i2cPimpl(new i2cImpl()){}

I2C::~I2C(){}

uint8_t I2C::readByte(const uint8_t& address, const uint8_t& reg)
{
	return i2cPimpl->readByte(address,reg); 
} 

uint16_t I2C::readWord(const uint8_t& address, const uint8_t& reg)
{
	return i2cPimpl->readWord(address,reg);
} 

uint8_t I2C::writeByte(const uint8_t& address, const uint8_t& data)
{
	return i2cPimpl->writeByte(address,data);
} 

uint8_t I2C::writeWord(const uint8_t& address, const uint8_t& reg, const uint8_t& data)
{
	return i2cPimpl->writeWord(address,reg,data);
}	

void I2C::writeBuffer(const uint8_t& address, const uint8_t* buffer, uint8_t len)
{
	return i2cPimpl->writeBuffer(address,buffer,len);
}	

void I2C::readBuffer(const uint8_t& address, const uint8_t* buffer, uint8_t len)
{
	return i2cPimpl->readBuffer(address,buffer,len); 
}	

void I2C::throwError(I2C::errors errNo)
{
	i2cPimpl->throwError(errNo);
} 	
