Templated interface for Quad Timer 1 channels for Gate Counting. The module uses the macro _TMR1_CONTROLLER_CH_
to identify the main channel and then assigns the next channel's (TMR1_CONTROLLER_CH + 1) external pin to the TMR1_CONTROLLER_CH as the "Capture Pin" or the "Secondary Count Source".
More...
#include <qtmr1.hpp>
Templated interface for Quad Timer 1 channels for Gate Counting. The module uses the macro _TMR1_CONTROLLER_CH_
to identify the main channel and then assigns the next channel's (TMR1_CONTROLLER_CH + 1) external pin to the TMR1_CONTROLLER_CH as the "Capture Pin" or the "Secondary Count Source".
◆ TMR1Controller()
TMR1Controller::TMR1Controller |
( |
| ) |
|
|
inline |
Default Constructor that assers if the user constructed object with a valid TMR1_CONTROLLER_CH, and asserts a singleton template.
◆ clear_input_edge_flag()
void TMR1Controller::clear_input_edge_flag |
( |
| ) |
|
|
inline |
◆ clear_overflow_flag()
void TMR1Controller::clear_overflow_flag |
( |
| ) |
|
|
inline |
◆ get_capture_double_range()
counter_t TMR1Controller::get_capture_double_range |
( |
| ) |
|
Returns a value that has range (2 X 2**n - 1). This is done by checking the overflow flag.
◆ get_capture_val()
counter_t TMR1Controller::get_capture_val |
( |
| ) |
|
|
inline |
Reads and returns the Capture Register.
◆ get_extern_capture_signal_pin()
int TMR1Controller::get_extern_capture_signal_pin |
( |
| ) |
|
|
inline |
Returns the pin number on which the capture signal must be connected.
- Attention
- This function does not configure the pin and assign it to the QTMR module, for that TMR1Controller::init_pin() must be called. It can only be used if the input is actually routed to GPIO instead of XBAR.
◆ get_ttl_input_pin()
int TMR1Controller::get_ttl_input_pin |
( |
| ) |
|
|
inline |
Returns the pin number on which the TTL input must be connected.
- Attention
- This function does not configure the pin or assign it to the QTMR module. For that TMR1Controller::init_pin() must be called.
◆ get_xbar_out_pin()
unsigned int TMR1Controller::get_xbar_out_pin |
( |
| ) |
|
|
inline |
Returns the corresponding XBAR Output Pin to use for routing the Capture Signal. Reference Manual Page 70.
◆ init()
void TMR1Controller::init |
( |
| ) |
|
|
inline |
◆ init_pins()
void TMR1Controller::init_pins |
( |
| ) |
|
|
inline |
Sets the Primary and Secondary inputs for Capture Mode, routed through XBAR. Reference XBAR and IOMUX input selections → IOMUXC_GPR_GPR6 Manual Page 347.
◆ is_overflow()
bool TMR1Controller::is_overflow |
( |
| ) |
|
|
inline |
Returns the overflow status of the Counter. Reads the TOF - Timer Overflow Flag.
◆ reset()
void TMR1Controller::reset |
( |
| ) |
|
|
inline |
Resets the counter to zero. It also cleares the capture register and unsets the Input Edge Flag.
◆ start()
void TMR1Controller::start |
( |
| ) |
|
|
inline |
Starts up-counting from the set counter value.
◆ stop()
void TMR1Controller::stop |
( |
| ) |
|
|
inline |
Stops counting and freezes the current counter value.
◆ timers_anti_freeze()
static void TMR1Controller::timers_anti_freeze |
( |
| ) |
|
|
inlinestatic |
Enable counting normally. Reference Manual Page 332.
- Attention
- This setting applies to all the channels of the Timer 1 group.
◆ timers_freeze()
static void TMR1Controller::timers_freeze |
( |
| ) |
|
|
inlinestatic |
Reset Counter and output flags. Reference Manual Page 332.
- Attention
- This setting applies to all the channels of the Timer 1 group.
◆ always_inline
Initial value:{
bool is_overflow() __attribute__((always_inline))
Returns the overflow status of the Counter. Reads the TOF - Timer Overflow Flag.
Definition: qtmr1.hpp:63
counter_t get_capture_val() __attribute__((always_inline))
Reads and returns the Capture Register.
Definition: qtmr1.hpp:47
◆ Singleton_flag
constexpr bool TMR1Controller::Singleton_flag = false |
|
staticconstexprprivate |
The documentation for this class was generated from the following file: