NEORV32 - Software Framework Documentation
neorv32_gptmr.c File Reference

General purpose timer (GPTMR) HW driver source file. More...

#include "neorv32.h"
#include "neorv32_gptmr.h"


int neorv32_gptmr_available (void)
void neorv32_gptmr_setup (uint8_t prsc, uint8_t mode, uint32_t threshold)
void neorv32_gptmr_disable (void)
void neorv32_gptmr_enable (void)
void neorv32_gptmr_restart (void)

Detailed Description

General purpose timer (GPTMR) HW driver source file.

These functions should only be used if the GPTMR unit was synthesized (IO_GPTMR_EN = true).

Function Documentation

◆ neorv32_gptmr_available()

int neorv32_gptmr_available ( void  )

Check if GPTMR unit was synthesized.

0 if GPTMR was not synthesized, 1 if GPTMR is available.

◆ neorv32_gptmr_disable()

void neorv32_gptmr_disable ( void  )

Disable GP timer.

◆ neorv32_gptmr_enable()

void neorv32_gptmr_enable ( void  )

Enable GP timer.

◆ neorv32_gptmr_restart()

void neorv32_gptmr_restart ( void  )

Reset GP timer's counter register.

◆ neorv32_gptmr_setup()

void neorv32_gptmr_setup ( uint8_t  prsc,
uint8_t  mode,
uint32_t  threshold 

Enable and configure GP timer.

[in]prscClock prescaler select (0..7). See NEORV32_CLOCK_PRSC_enum.
[in]mode0=single-shot mode, 1=continuous mode
[in]thresholdThreshold value to trigger interrupt.