Nut/OS  4.10.3
API Reference
AT91 System Timer

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

Collaboration diagram for AT91 System Timer:

Defines

#define NUT_TICK_FREQ   1000UL

Functions

void NutRegisterTimer (void(*handler)(void *))
 Initialize system timer.
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 AT91.


Define Documentation

#define NUT_TICK_FREQ   1000UL

Definition at line 162 of file ostimer_at91.c.

Referenced by NutGetTickClock(), and NutRegisterTimer().


Function Documentation

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 176 of file ostimer_at91.c.

References _BV, inr, NUT_TICK_FREQ, NutGetCpuClock(), NutIrqEnable(), NutIrqSetPriority(), NutRegisterIrqHandler(), NutRegisterSysIrqHandler(), NutSysIrqEnable(), outr, PIT_MR, PIT_PITEN, PIT_PITIEN, PIT_PIV_LSB, PIT_PIVR, PMC_PCER, sig_TC0, syssig_PIT, TC0_CCR, TC0_CMR, TC0_ID, TC0_IDR, TC0_IER, TC0_RC, TC0_SR, TC_CLKDIS, TC_CLKEN, TC_CLKS_MCK32, TC_CPCS, TC_CPCTRG, and TC_SWTRG.

Here is the call graph for this function:

uint32_t NutGetTickClock ( void  )

Return the number of system ticks per second.

Returns:
System tick frequency in Hertz.

Definition at line 399 of file ostimer_at91.c.

References inr, NUT_TICK_FREQ, NutGetCpuClock(), PIT_MR, PIT_PIV, and TC0_RC.

Here is the call graph for this function:

uint32_t NutTimerMillisToTicks ( uint32_t  ms)

Calculate system ticks for a given number of milliseconds.

Definition at line 422 of file ostimer_at91.c.

References NutGetTickClock().

Here is the call graph for this function: