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 NUT_TICK_FREQ 1000UL |
Referenced by NutArchMicroDelay(), NutGetTickClock(), and NutRegisterTimer().
void NutArchMicroDelay | ( | uint32_t | us | ) |
References NUT_TICK_FREQ, nut_ticks, NutSleep(), SysTick, SysTick_CTRL_ENABLE_Msk, and SysTick_CTRL_TICKINT_Msk.
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.
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.
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.
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.
Return the number of system ticks per second.
References NUT_TICK_FREQ.
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.
ms | Number of milliseconds. |
References NutGetTickClock().
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
us | Delay time in microseconds. |
Referenced by NutArchMicroDelay(), NutGetTickCount(), and NutTimerIntr().