Nut/OS  5.0.5
API Reference
XgNutArchArmOsTimerCm3

Defines

#define NUT_TICK_FREQ   1000UL

Functions

void NutArchMicroDelay (uint32_t us)
void NutRegisterTimer (void(*handler)(void *))
 Initialize system timer.
uint32_t NutArchClockGet (int idx)
 Return the CPU clock in Hertz. Or peripheral clock in hertz On cortex this the same.
u_long NutGetTickClock (void)
 Return the CPU clock in Hertz.
u_long NutTimerMillisToTicks (u_long ms)
 Calculate system ticks for a given number of milliseconds.

Variables

uint32_t nut_ticks
 Loop for a specified number of microseconds.

Define Documentation

#define NUT_TICK_FREQ   1000UL

Function Documentation

void NutArchMicroDelay ( uint32_t  us)

References NUT_TICK_FREQ, nut_ticks, NutSleep(), SysTick, SysTick_CTRL_ENABLE_Msk, and SysTick_CTRL_TICKINT_Msk.

Here is the call graph for this function:

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

Initialize system timer.

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

Nut/OS uses CortexM SysTick timer via CMSIS for its timer services. Applications should not modify any registers of this timer, but make use of the Nut/OS timer API.

References IntRegister(), NUT_TICK_FREQ, SysCtlClockGet(), SysTick_Config(), and SysTick_IRQn.

Here is the call graph for this function:

uint32_t NutArchClockGet ( int  idx)

Return the CPU clock in Hertz. Or peripheral clock in hertz On cortex this the same.

Return the CPU clock in Hertz.

Returns:
CPU clock frequency in Hertz.

References RCC_ClocksTypeDef::ADCCLK_Frequency, RCC_ClocksTypeDef::HCLK_Frequency, Lpc17xx_ClockGet(), NUT_HWCLK_CPU, RCC_ClocksTypeDef::PCLK1_Frequency, RCC_ClocksTypeDef::PCLK2_Frequency, RCC_GetClocksFreq(), and RCC_ClocksTypeDef::SYSCLK_Frequency.

Here is the call graph for this function:

u_long NutGetTickClock ( void  )

Return the CPU clock in Hertz.

Return the number of system ticks per second.

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.

Returns:
CPU clock frequency in Hertz.

Return the number of system ticks per second.

Returns:
System tick frequency in Hertz.

References NUT_TICK_FREQ.

u_long NutTimerMillisToTicks ( u_long  ms)

Calculate system ticks for a given number of milliseconds.

This routine is used by Nut/OS to retrieve the number of system ticks for a given timeout.

Parameters:
msNumber of milliseconds.
Returns:
Number of system ticks. The resolution is limited to the granularity of the system timer.

References NutGetTickClock().

Here is the call graph for this function:


Variable Documentation

Loop for a specified number of microseconds.

This call will release the CPU for delays longer than 2 ms at the expense of waiting 1 ms longer in very rare cases

Parameters:
usDelay time in microseconds.

Referenced by NutArchMicroDelay(), NutGetTickCount(), and NutTimerIntr().