RV32 SoC DS UG
High-Perf RV32 SoC DS UG
RV64 SoC DS UG API and Examples
Embedded IDE UG
Loading...
Searching...
No Matches

Overview

Function definitions for Timer driver.

Functions

void timer_applyConfig (timer_instance_t *inst)
 Apply the software configuration to the hardware.
void timer_clearValue (timer_instance_t *inst)
 Clear Timer Value to zero.

UserTimer (Get Functions)

Read values from the Timer hardware registers.

u32 timer_getConfig (timer_instance_t *inst)
 Get stored Timer Configuration.
u32 timer_getLimit (timer_instance_t *inst)
 Get stored Timer Limit (Reload Value).
u32 timer_getValue (timer_instance_t *inst)
 Get current Timer Value.
u32 timer_getPrescalerValue (timer_instance_t *inst)
 Get stored Prescaler Value.

UserTimer (Set Functions)

Write values to the Timer registers.

Note
Call timer_applyConfig() to make these changes effective.
u32 timer_setConfig (timer_instance_t *inst, u32 value)
 Set Timer Configuration.
u32 timer_setPrescalerValue (timer_instance_t *inst, u32 value)
 Set Prescaler Value.
u32 timer_setLimit (timer_instance_t *inst, u32 value)
 Get stored Timer Limit (Reload Value).

Function Documentation

◆ timer_applyConfig()

void timer_applyConfig ( timer_instance_t * inst)

#include <timer.h>

Apply the software configuration to the hardware.

Writes all values stored in the timer_instance to the corresponding Timer hardware registers.

Parameters
instPointer to Timer instance.

Writes all values stored in the timer_instance to the corresponding Timer hardware registers.

Definition at line 93 of file timer.c.

◆ timer_clearValue()

void timer_clearValue ( timer_instance_t * inst)

#include <timer.h>

Clear Timer Value to zero.

Parameters
instPointer to Timer instance.

Clear Timer Value to zero.

Definition at line 81 of file timer.c.

◆ timer_getConfig()

u32 timer_getConfig ( timer_instance_t * inst)

#include <timer.h>

Get stored Timer Configuration.

/*

Parameters
instPointer to Timer instance.
Returns
The current configuration bitmask (Enable, Auto-Reload, etc.).

Definition at line 25 of file timer.c.

◆ timer_getLimit()

u32 timer_getLimit ( timer_instance_t * inst)

#include <timer.h>

Get stored Timer Limit (Reload Value).

Parameters
instPointer to Timer instance.
Returns
The count limit value.

Definition at line 57 of file timer.c.

◆ timer_getPrescalerValue()

u32 timer_getPrescalerValue ( timer_instance_t * inst)

#include <timer.h>

Get stored Prescaler Value.

Parameters
instPointer to Timer instance.
Returns
The current clock prescaler divider.

Get stored Prescaler Value.

Definition at line 41 of file timer.c.

◆ timer_getValue()

u32 timer_getValue ( timer_instance_t * inst)

#include <timer.h>

Get current Timer Value.

Parameters
instPointer to Timer instance.
Returns
The current timer count value.

Get current Timer Value.

Definition at line 73 of file timer.c.

◆ timer_setConfig()

u32 timer_setConfig ( timer_instance_t * inst,
u32 value )

#include <timer.h>

Set Timer Configuration.

/*

Parameters
instPointer to Timer instance.
valueConfiguration bitmask (e.g., Enable | Interrupt).

Definition at line 33 of file timer.c.

◆ timer_setLimit()

u32 timer_setLimit ( timer_instance_t * inst,
u32 value )

#include <timer.h>

Get stored Timer Limit (Reload Value).

Parameters
instPointer to Timer instance.
Returns
The count limit value.

Get stored Timer Limit (Reload Value).

Definition at line 65 of file timer.c.

◆ timer_setPrescalerValue()

u32 timer_setPrescalerValue ( timer_instance_t * inst,
u32 value )

#include <timer.h>

Set Prescaler Value.

Parameters
instPointer to Timer instance.
valueClock divider value.

Set Prescaler Value.

Definition at line 49 of file timer.c.