Nut/OS  4.10.3
API Reference
GBA System Timer

Nut/OS System Timer implemented on the GBA. More...

Collaboration diagram for GBA System Timer:

Defines

#define NUT_CPU_FREQ   1000000UL
#define NUT_TICK_FREQ   1000UL

Functions

void Timer3Entry (void *arg)
 Timer 0 interrupt entry.
void NutRegisterTimer (void(*handler)(void *))
 Initialize system timer.
uint32_t NutArchClockGet (int idx)
 Return the CPU clock in Hertz.
uint32_t NutGetTickClock (void)
 Return the number of system ticks per second.
uint32_t NutTimerMillisToTicks (uint32_t ms)
 Calculate system ticks for a given number of milliseconds.

Detailed Description

Nut/OS System Timer implemented on the GBA.


Define Documentation

#define NUT_CPU_FREQ   1000000UL

Definition at line 92 of file ostimer_gba.c.

Referenced by NutArchClockGet().

#define NUT_TICK_FREQ   1000UL

Definition at line 96 of file ostimer_gba.c.

Referenced by NutGetTickClock(), and NutTimerMillisToTicks().


Function Documentation

void Timer3Entry ( void *  arg)

Timer 0 interrupt entry.

Definition at line 104 of file ostimer_gba.c.

References INT_TMR3, outw, and REG_IF.

Referenced by NutRegisterTimer().

void NutRegisterTimer ( void(*)(void *)  handler)

Initialize system timer.

This function is automatically called by Nut/OS during system initialization.

Nut/OS uses on-chip timer 0 for its timer services. Applications should not modify any registers of this timer, but make use of the Nut/OS timer API. Timer 1 and timer 2 are available to applications.

Definition at line 121 of file ostimer_gba.c.

References INT_TMR3, inw, NutRegisterIrqHandler(), outdw, outw, REG_IE, REG_IME, REG_TMR3CNT, sig_TMR3, Timer3Entry(), TMR_ENA, and TMR_IRQ_ENA.

Here is the call graph for this function:

uint32_t NutArchClockGet ( int  idx)

Return the CPU clock in Hertz.

Returns:
CPU clock frequency in Hertz, which is 16780000 for the GBA.

Definition at line 147 of file ostimer_gba.c.

References NUT_CPU_FREQ.

uint32_t NutGetTickClock ( void  )

Return the number of system ticks per second.

Returns:
System tick frequency in Hertz.

Definition at line 157 of file ostimer_gba.c.

References NUT_TICK_FREQ.

uint32_t NutTimerMillisToTicks ( uint32_t  ms)

Calculate system ticks for a given number of milliseconds.

Definition at line 165 of file ostimer_gba.c.

References NUT_TICK_FREQ.