![]() |
Defines | |
#define | NUT_TICK_FREQ 1000UL |
Functions | |
void | NutDelay (u_char ms) |
Loop for a specified number of milliseconds. | |
void | NutRegisterTimer (void(*handler)(void *)) |
Initialize system timer. | |
u_long | NutGetCpuClock (void) |
Return the CPU clock in Hertz. | |
u_long | NutGetTickClock (void) |
Return the number of system ticks per second. | |
u_long | NutTimerMillisToTicks (u_long ms) |
Calculate system ticks for a given number of milliseconds. |
#define NUT_TICK_FREQ 1000UL |
Definition at line 134 of file ostimer_at91.c.
void NutDelay | ( | u_char | ms | ) |
Loop for a specified number of milliseconds.
This call will not release the CPU and will not switch to another thread. However, because of absent thread switching, this delay time is very exact.
Use NutSleep() to avoid blocking the CPU, if no exact timing is needed.
ms | Delay time in milliseconds, maximum is 255. |
Definition at line 152 of file ostimer_at91.c.
References _NOP.
void NutRegisterTimer | ( | void(*)(void *) | handler | ) |
Initialize system timer.
Initialize system timer hardware.
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 174 of file ostimer_at91.c.
References _BV, handler, 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.
u_long NutGetCpuClock | ( | void | ) |
Return the CPU clock in Hertz.
On several AT91 CPUs the processor clock may differ from the clock driving the peripherals. In this case At91GetMasterClock() will provide the correct master clock.
Definition at line 363 of file ostimer_at91.c.
References Cy2239xGetFreq(), and NUT_CPU_FREQ.
u_long NutGetTickClock | ( | void | ) |
Return the number of system ticks per second.
Definition at line 382 of file ostimer_at91.c.
References inr, NUT_TICK_FREQ, NutGetCpuClock(), PIT_MR, PIT_PIV, and TC0_RC.
Calculate system ticks for a given number of milliseconds.
Definition at line 405 of file ostimer_at91.c.
References NutGetTickClock().