NEORV32 - Software Framework Documentation
|
General purpose timer (GPTMR) HW driver source file. More...
Functions | |
int | neorv32_gptmr_available (void) |
void | neorv32_gptmr_setup (int prsc, uint32_t threshold, int match_irq) |
void | neorv32_gptmr_capture (int rising, int falling, int filter, int capture_irq) |
void | neorv32_gptmr_disable (void) |
void | neorv32_gptmr_enable (void) |
int | neorv32_gptmr_trigger_matched (void) |
int | neorv32_gptmr_trigger_captured (void) |
void | neorv32_gptmr_restart (void) |
uint32_t | neorv32_gptmr_counter_get (void) |
uint32_t | neorv32_gptmr_capture_get (void) |
General purpose timer (GPTMR) HW driver source file.
int neorv32_gptmr_available | ( | void | ) |
Check if general purpose timer unit was synthesized.
void neorv32_gptmr_capture | ( | int | rising, |
int | falling, | ||
int | filter, | ||
int | capture_irq ) |
Configure timer capture feature.
[in] | rising | Capture on rising edge. |
[in] | falling | Capture on falling edge. |
[in] | filter | Enable filtering of capture input. |
[in] | capture_irq | Fire interrupt when on capture trigger. |
uint32_t neorv32_gptmr_capture_get | ( | void | ) |
Get latest capture value.
uint32_t neorv32_gptmr_counter_get | ( | void | ) |
Get current counter value.
void neorv32_gptmr_disable | ( | void | ) |
Disable general purpose timer.
void neorv32_gptmr_enable | ( | void | ) |
Enable general purpose timer.
void neorv32_gptmr_restart | ( | void | ) |
Reset general purpose timer's counter register (timer-mode only).
void neorv32_gptmr_setup | ( | int | prsc, |
uint32_t | threshold, | ||
int | match_irq ) |
Reset, enable and configure general purpose timer.
[in] | prsc | Clock prescaler select (0..7). See NEORV32_CLOCK_PRSC_enum. |
[in] | threshold | Threshold value, counter will reset to zero when reaching this. |
[in] | match_irq | Fire interrupt when counter matches threshold value. |
int neorv32_gptmr_trigger_captured | ( | void | ) |
Check if capture input has triggered. Clear trigger flag in that case.
int neorv32_gptmr_trigger_matched | ( | void | ) |
Check if timer match has triggered. Clear trigger flag in that case.