NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
|
General purpose timer (GPTMR) HW driver header file. More...
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | neorv32_gptmr_t |
Functions | |
Prototypes | |
int | neorv32_gptmr_available (void) |
void | neorv32_gptmr_setup (int prsc, uint32_t threshold, int cont_mode) |
void | neorv32_gptmr_disable (void) |
void | neorv32_gptmr_enable (void) |
void | neorv32_gptmr_irq_ack (void) |
IO Device: General Purpose Timer (GPTMR) | |
#define | NEORV32_GPTMR ((neorv32_gptmr_t*) (NEORV32_GPTMR_BASE)) |
enum | NEORV32_GPTMR_CTRL_enum { GPTMR_CTRL_EN = 0 , GPTMR_CTRL_PRSC0 = 1 , GPTMR_CTRL_PRSC1 = 2 , GPTMR_CTRL_PRSC2 = 3 , GPTMR_CTRL_MODE = 4 , GPTMR_CTRL_IRQ_CLR = 30 , GPTMR_CTRL_IRQ_PND = 31 } |
General purpose timer (GPTMR) HW driver header file.
#define NEORV32_GPTMR ((neorv32_gptmr_t*) (NEORV32_GPTMR_BASE)) |
GPTMR module hardware access (neorv32_gptmr_t)
GPTMR control register bits
int neorv32_gptmr_available | ( | void | ) |
Check if general purpose timer unit was synthesized.
void neorv32_gptmr_disable | ( | void | ) |
Disable general purpose timer.
void neorv32_gptmr_enable | ( | void | ) |
Enable general purpose timer.
void neorv32_gptmr_irq_ack | ( | void | ) |
Clear pending timer interrupt.
void neorv32_gptmr_setup | ( | int | prsc, |
uint32_t | threshold, | ||
int | cont_mode ) |
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] | cont_mode | Set to operate timer in continuous mode (instead of single-shot mode). |