DIY Auto-Correlator 1.0
Auto-Correlator Card implementation using Teensy 4.x microcontrollers.
|
Interface for PIT timers on Teensy 4.x microcontrollers. More...
#include <pit.hpp>
Public Member Functions | |
PITController () | |
void | start () __attribute__((always_inline)) |
Start counting on the timer. More... | |
void | stop () __attribute__((always_inline)) |
stop counting on the timer. More... | |
Error_t | set_gate_time (double gt_microseconds) __attribute__((flatten)) |
Sets the gate time after which the counter returns to zero and marks the end of onegate interval. More... | |
double | period_error_us () const __attribute__((always_inline)) |
Returns the error in the gate timing period due to the finite resolution of the timers. @Return Error in microseconds. More... | |
double | tick_period_us () __attribute__((always_inline)) |
Returns the value of one Tick - Minimum resolution of the timer. More... | |
void | interrupt () __attribute__((always_inline)) |
Enable Interruptsthat are triggered after one gate time completion. More... | |
void | no_interrupt () __attribute__((always_inline)) |
Disable Interrupts that are triggered after one gate time completion. More... | |
void | clear_interrupt_flag () __attribute__((always_inline)) |
Clears the interrupt flag and hence prepares the timer for the next gate interval. The clearing has to be done manually. If the flag is not cleared, the interrupt will be called again and again. More... | |
void | sel_FBUS_clock () __attribute__((always_inline)) |
Sets the clock source frequency of all PIT channels to the value F_BUS_ACTUAL (= F_CPU_ACTUAL / 4 ) which is nominally 150 MHz. The exact value depends on the CPU clock rate. More... | |
void | sel_24MHz_clock () __attribute__((always_inline)) |
Sets the source clock frequency of all PIT channels to 24 MHz which is the default oscillator clock. This setting is also the default state, if no clock is selected. More... | |
Static Public Member Functions | |
static void | enable_PITs () __attribute__((always_inline)) |
Enable all PIT channels. More... | |
static void | disable_PITs () __attribute__((always_inline)) |
Disable all PIT Channels. More... | |
static void | pause_resume_PITs () __attribute__((always_inline)) |
Pause/Resume - Toggle all PIT Channels. More... | |
unsigned static int | get_xbar_in_pin () __attribute__((always_inline)) |
Returns the correspoding XBAR1-A Input Pins for the corresponding channel TRIGGER signal. More... | |
static void | set_interrupt (void(*isr_fn)(), unsigned int priority) __attribute__((always_inline)) |
Sets a common ISR and its priority for all PIT Channels. More... | |
Public Attributes | |
double | Actual_period = 0 |
Actual Time Period set by the device due to finite resolution. More... | |
double | Req_period = 0 |
Time Period requested by the user. More... | |
uint32_t | Clk_freq = uint32_t(24 * 1e6) |
Clock frequency used by the timer. Initalized to 24MHz → default oscillator clock. More... | |
uint32_t | LoadVal = 0 |
The value loaded in to the counter during after overflow. More... | |
Static Public Attributes | |
static constexpr const uint32_t | PIT_MAX_COUNTER = 4294967295 |
Constant - Maximum possible counter value. 32 bit counter. More... | |
Interface for PIT timers on Teensy 4.x microcontrollers.
|
inline |
|
inline |
Clears the interrupt flag and hence prepares the timer for the next gate interval. The clearing has to be done manually. If the flag is not cleared, the interrupt will be called again and again.
|
inlinestatic |
Disable all PIT Channels.
|
inlinestatic |
Enable all PIT channels.
|
inlinestatic |
Returns the correspoding XBAR1-A Input Pins for the corresponding channel TRIGGER signal.
|
inline |
Enable Interruptsthat are triggered after one gate time completion.
|
inline |
Disable Interrupts that are triggered after one gate time completion.
|
inlinestatic |
Pause/Resume - Toggle all PIT Channels.
|
inline |
Returns the error in the gate timing period due to the finite resolution of the timers. @Return Error in microseconds.
|
inline |
Sets the source clock frequency of all PIT channels to 24 MHz which is the default oscillator clock. This setting is also the default state, if no clock is selected.
|
inline |
Sets the clock source frequency of all PIT channels to the value F_BUS_ACTUAL (= F_CPU_ACTUAL / 4 ) which is nominally 150 MHz. The exact value depends on the CPU clock rate.
|
inline |
Sets the gate time after which the counter returns to zero and marks the end of onegate interval.
|
inlinestatic |
Sets a common ISR and its priority for all PIT Channels.
|
inline |
Start counting on the timer.
|
inline |
stop counting on the timer.
|
inline |
Returns the value of one Tick - Minimum resolution of the timer.
double PITController< ChID >::Actual_period = 0 |
Actual Time Period set by the device due to finite resolution.
uint32_t PITController< ChID >::Clk_freq = uint32_t(24 * 1e6) |
Clock frequency used by the timer. Initalized to 24MHz → default oscillator clock.
uint32_t PITController< ChID >::LoadVal = 0 |
The value loaded in to the counter during after overflow.
|
staticconstexpr |
Constant - Maximum possible counter value. 32 bit counter.
double PITController< ChID >::Req_period = 0 |
Time Period requested by the user.