#ifndef _I2C_HPP_ #define _I2C_HPP_ #include #include #include #include namespace hw { // i2c channels enum i2c_ch { i2c_ch0, i2c_ch1 }; // // template // template class I2C { public: I2C(); void writeByte(uint8_t address, uint8_t byte); private: }; // // implementation CH0 // template<> I2C::I2C() { std::cout << "i2c_ch0 has been created" << std::endl; } template<> void I2C::writeByte(uint8_t address, uint8_t byte) { std::cout << "wrtiteByte() of i2c CH0 has been called!" << std::endl; } // // implementation CH1 // template<> I2C::I2C() { std::cout << "i2c_ch1 has been created" << std::endl; } template<> void I2C::writeByte(uint8_t address, uint8_t byte) { std::cout << "wrtiteByte() of i2c CH1 has been called!" << std::endl; } }; // namespace hw #endif // _I2C_HPP_