modm API documentation
modm::GenericPrescalerCounter< T > Class Template Reference

#include <modm/math/algorithm/prescaler_counter.hpp>

Classes

struct  Result
 

Static Public Member Functions

static constexpr Result from_range (T input_frequency, T desired_frequency, uint32_t max_counter, std::ranges::forward_range auto &&prescalers)
 From any forward range.
 
static constexpr Result from_list (T input_frequency, T desired_frequency, uint32_t max_counter, std::initializer_list< uint32_t > prescalers)
 From a initializer list.
 
template<typename Function >
static constexpr Result from_function (T input_frequency, T desired_frequency, uint32_t max_counter, uint32_t begin, uint32_t end, Function prescaler_modifier)
 
static constexpr Result from_linear (T input_frequency, T desired_frequency, uint32_t max_counter, uint32_t begin, uint32_t end)
 
static constexpr Result from_power (T input_frequency, T desired_frequency, uint32_t max_counter, uint32_t begin, uint32_t end)
 

Detailed Description

template<typename T>
class modm::GenericPrescalerCounter< T >

Computes the best fitting prescaler and counter value from a list.

Note
For ranges the end is inclusive: [begin, end]!

Member Function Documentation

template<typename T >
template<typename Function >
static constexpr Result modm::GenericPrescalerCounter< T >::from_function ( input_frequency,
desired_frequency,
uint32_t  max_counter,
uint32_t  begin,
uint32_t  end,
Function  prescaler_modifier 
)
inlinestaticconstexpr

From any linear range via modifier function.

Note
the range end is inclusive: [begin, end].
template<typename T >
static constexpr Result modm::GenericPrescalerCounter< T >::from_linear ( input_frequency,
desired_frequency,
uint32_t  max_counter,
uint32_t  begin,
uint32_t  end 
)
inlinestaticconstexpr

From any linear range.

Note
the range end is inclusive: [begin, end].
template<typename T >
static constexpr Result modm::GenericPrescalerCounter< T >::from_power ( input_frequency,
desired_frequency,
uint32_t  max_counter,
uint32_t  begin,
uint32_t  end 
)
inlinestaticconstexpr

From any 2-logarithmic range.

Note
the range end is inclusive: [begin, end].
Parameters
beginmust be a power-of-two!
endmust be a power-of-two!

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