modm API documentation
|
#include <modm/architecture/interface/peripheral.hpp>
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 () |
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.
|
static |
Acknowledge an interrupt flag.
We use acknowledge here, since it describes the intention rather than the actual implementation.
|
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.