#ifndef _I2C_H_
#define _I2C_H_

#include <unistd.h>
#include <stdint.h>
#include <memory>
#include <ostream>
#include <iostream>
#include "../../config.h"

class I2C
{
	public: 
		enum errors 
		{
			noError,
			writeFailed, 
			readFailed, 
			bufferFull, 
			fasleAddrs, 
			initFailed
		}; 

		I2C();
		~I2C();
		uint8_t readByte(const uint8_t& address, const uint8_t& reg); 
		uint16_t readWord(const uint8_t& address, const uint8_t& reg); 
		uint8_t writeByte(const uint8_t& address, const uint8_t& data); 
		uint8_t writeWord(const uint8_t& address, const uint8_t& reg, const uint8_t& data);	
		uint8_t writeBuffer(const uint8_t& address, const uint8_t& buffer, uint8_t len);	
		uint8_t readBuffer(const uint8_t& address, const uint8_t& buffer, uint8_t len);	
		int8_t getError(); 	

	private:
		struct i2cImpl; 
		std::unique_ptr<i2cImpl> i2cPimpl; 

};
#endif // _I2C_H_
#define _I2C_H_
