#ifndef _II2C_HPP_
#define _II2C_HPP_

#include <memory>
#include <stdint.h>

/**
 * Interface class for i2c
 *
 * It's basedon the pointer to implementation idom (pImpl idom).
 */
class I2C
{
	public:
		I2C();
		~I2C();
		
		uint8_t readByte(const uint8_t& address,
			         const uint8_t& reg);

		void writeByte(const uint8_t& address,
			       const uint8_t& reg,
			       const uint8_t& byte);

		uint16_t readWord(const uint8_t& address,
			      const uint8_t& reg);

		void writeWord(const uint8_t& address,
			       const uint8_t& reg,
			       const uint16_t& word);

		void readBuffer(const uint8_t& address,
				const uint8_t& reg,
				uint8_t data[],
				uint8_t len);

		void writeBuffer(const uint8_t& address,
				const uint8_t& reg,
				const uint8_t data[],
				uint8_t len);

	private:
		class I2C_impl;//< forward declaration
		std::unique_ptr<I2C_impl> impl; // pointer to implementation

};

#endif // _II2C_HPP_

