modm API documentation
|
#include <modm/architecture/interface/adc_interrupt.hpp>
Public Typedefs | |
typedef uint8_t | Channel |
this type may also be an enum or enum class | |
Static Public Member Functions | |
static void | attachInterruptHandler (Handler handler) |
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 () |
static void | configurePurpose () |
configures a peripheral for a specific purpose | |
template<class... Signals> | |
static void | connect () |
static void | disable () |
static void | disableFreeRunningMode () |
static void | enableFreeRunningMode () |
static uint8_t | getChannel () |
static bool | getInterruptFlag () |
Read an interrupt flag. | |
static void | getParameter () |
returns a parameter | |
static uint16_t | getValue () |
template<class SystemClock , frequency_t frequency = 200_kHz, percent_t tolerance = 10_pct> | |
static void | initialize () |
static bool | isConversionFinished () |
static uint16_t | readChannel (Channel channel) |
static bool | setChannel (Channel channel) |
static void | setLeftAdjustResult () |
Change the presentation of the ADC conversion result to left adjusted. | |
static void | setParameter () |
sets a parameter | |
static void | setRightAdjustResult () |
Change the presentation of the ADC conversion result to right adjusted. | |
static void | startConversion () |
Static Public Attributes | |
static constexpr uint8_t | Resolution |
describes the maximum resolution in bits | |
Protected Typedefs | |
typedef void (* | Handler) () |
Basic interrupt-based interface of an ADC.
This class allows you to attach functions to the ADC Conversion Complete Interrupt via function pointers. Be aware however, that this implementation is slower and requires more resources than writing the function code directly into the interrupt service routines.
This interface allows for asynchronous operation:
|
inheritedstatic |
Acknowledge an interrupt flag.
We use acknowledge here, since it describes the intention rather than the actual implementation.
|
inheritedinlinestatic |
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.
|
inheritedstatic |
Configures the input signals and connects them.
Signals | At least one input signal is required and can be passed out-of-order. |
|
inheritedstatic |
|
inheritedstatic |
|
inheritedstatic |
|
inheritedstatic |
|
inheritedstatic |
Initializes the hardware and sets the datarate.
SystemClock | the currently active system clock |
frequency | the desired clock frequency in Hz |
tolerance | the allowed relative tolerance for the resulting clock frequency |
|
inheritedstatic |
true
if all conversion have finished, false
otherwise
|
inheritedstatic |
Convenience function:
|
inheritedstatic |
Analog channel selection.
true
if the channel exists and was available, false
otherwise
|
inheritedstatic |
starts a conversion on the selected analog channel