Timers

The kernel implements timing functions using a 1 millisecond tick timer.

The phone hardware must therefore provide a high-speed timer that can provide regular 1 ms interrupts. The ASSP/Variant part of the base port must use this timer hardware to call the kernel every millisecond.

The base port provides the timer service in an interrupt-service routine called a tick handler. The functions used for this are as follows:

  • The tick handler must be started by the Variant's implementation of the Asic::Init3() function.

  • The tick handler calls the kernel's NTImer::TickQ() function.

  • The Variant reports the exact number of microseconds between ticks in its implementation of Asic::MsTickPeriod().

The ASSP/Variant must decide how to implement a repeating tick interrupt for the hardware available. Typically this involves using either a free running timer with a match register, which is reset on each match, or a self-reloading countdown timer, to generate a periodic interrupt.

A base port can implement other timers that are required by peripherals that have sub-millisecond timing requirements. This is optional, and depends on the available hardware.