modm API documentation
modm::PeripheralDriver Class Reference

#include <modm/architecture/interface/peripheral.hpp>

Inheritance diagram for modm::PeripheralDriver:
modm::Adc modm::Can modm::I2cMaster modm::platform::Iwdg modm::SpiMaster modm::Uart modm::AdcInterrupt modm::platform::Adc1 modm::Mcp2515< SPI, CS, INT > modm_test::platform::CanDriver modm::I2cMultiplexerChannel< multiplexer, channel > modm::platform::BitBangI2cMaster< Scl, Sda > modm::platform::I2cMaster1 modm::platform::I2cMaster2 modm::platform::BitBangSpiMaster< Sck, Mosi, Miso > modm::platform::SpiMaster1 modm::platform::SpiMaster2 modm::platform::UartSpiMaster1 modm::platform::UartSpiMaster2 modm::platform::UartSpiMaster3 modm::platform::UartSpiMaster4 modm_test::platform::SpiMaster modm::platform::BufferedUart< Hal, Buffers > modm::platform::Rtt

Static Public Member Functions

static void initialize ()
 initializes the peripheral, must be called before use.
 
static void configurePurpose ()
 configures a peripheral for a specific purpose
 
static void setParameter ()
 sets a parameter
 
static void getParameter ()
 returns a parameter
 
static bool getInterruptFlag ()
 Read an interrupt flag.
 
static void acknowledgeInterruptFlag ()
 
template<uint64_t available, uint64_t requested, percent_t tolerance>
static void assertBaudrateInTolerance ()
 
template<double available, double requested, percent_t tolerance>
static void assertDurationInTolerance ()
 

Detailed Description

Peripheral class

This class acts as a base class for all classes describing the public interface of common peripheral drivers. As there is no implementation given, the classes specific to the platform inherit from their respective base classes and must shadow the methods of them.

The inheritance is only visible for the documentation, it is completely removed during compile time keeping a possible error at platform level. This is safe, because only one platform can be compiled at once.

This way, no virtual functions are needed and no overhead is generated, but we still have clean inheritance in the documentation. There is no need to document the platform specific implementation, since it is taken from the base class.

Author
Niklas Hauser

Member Function Documentation

static void modm::PeripheralDriver::acknowledgeInterruptFlag ( )
static

Acknowledge an interrupt flag.

We use acknowledge here, since it describes the intention rather than the actual implementation.

template<uint64_t available, uint64_t requested, percent_t tolerance>
static void modm::PeripheralDriver::assertBaudrateInTolerance ( )
inlinestatic

Since baudrates are usually generated by prescaling a system clock, only several distinct values can be generated. This method checks if the user requested baudrate is within error tolerance of the system achievable baudrate.


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