theCore C++ embedded framework
ecl::i2c_bus_cfg< dev > Struct Template Reference

Base template class for the I2C configuration. More...

#include </home/travis/build/forGGe/theCore/platform/particle_electron/export/aux/i2c_bus.hpp>

Detailed Description

template<i2c_device dev>
struct ecl::i2c_bus_cfg< dev >

Base template class for the I2C configuration.

Configuration parameters for given I2C device are set by creating a template specialization. The template specialization must contain following fields to be recognized as valid:

  • unsigned int speed - I2C bus speed.
  • bool stretch_clk - If set to true, then clock stretching is enabled.
    Configuration example.
    namespace ecl
    {
    template<>
    struct i2c_bus_cfg<i2c_device::wire0>
    {
    static constexpr auto speed = 10000; // 10 kHz
    static constexpr auto stretch_clk = true;
    };
    } // namespace ecl

The documentation for this struct was generated from the following file: