libteak
Macros | Functions
timer.h File Reference

Timer utilities. More...

#include <teak/types.h>

Macros

#define TMR_CONTROL_BREAKPOINT   (1 << 11)
 Cause a trap when the timer reaches 0. Remember to enable autoclear.
 

Functions

u32 timerRead (u16 index)
 Safely reads the 32-bit counter value of a timer. More...
 
void timerStart (u16 index, u16 config, u32 reload_value)
 Starts a timer with the specified starting value. More...
 
static void timerStop (u16 index)
 Stops a timer. More...
 

Detailed Description

Timer utilities.

Function Documentation

◆ timerRead()

u32 timerRead ( u16  index)

Safely reads the 32-bit counter value of a timer.

Parameters
indexTimer index (0 or 1).
Returns
The counter value.

◆ timerStart()

void timerStart ( u16  index,
u16  config,
u32  reload_value 
)

Starts a timer with the specified starting value.

Parameters
indexTimer index (0 or 1).
configConfiguration flags.
reload_valueStarting value. In mode reload, it is also used as reload value. It is ignored in freerun mode.

◆ timerStop()

static void timerStop ( u16  index)
inlinestatic

Stops a timer.

Parameters
indexTimer index (0 or 1).