theCore C++ embedded framework
ecl::skel::spi_cfg< ch > Struct Template Reference

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

#include </home/travis/build/forGGe/theCore/platform/skel/export/aux/spi.hpp>

Detailed Description

template<spi_channel ch>
struct ecl::skel::spi_cfg< ch >

Base template class for the SPI configuration.

In order to advertise configuration parameters user must create template specialization for required SPI device.

SPI-specific fields must be present:

SPI configuration example. In order to use this configuration class one must create configuration class in the ecl namespace before any access to SPI instance.

namespace ecl
{
template<>
struct spi_cfg<spi_channel::ch1>
{
static constexpr auto type = spi_type::master;
static constexpr auto cpol = spi_cpol::high;
static constexpr auto cpha = spi_cpha::low;
};
} // namespace ecl
Warning
To avoid potential problems with multiple configurations for single SPI bus, make sure that full specialization is placed in the header included (directly or indirectly) by all dependent modules.. Thus, redefinition of the config class for given SPI will result in compilation errors. Good practice is to place all SPI configuration class in the single target-related header.

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