RISC OS Open
Safeguarding the past, present and future of RISC OS for everyone
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

HAL timer API

Hardware Abstraction Layer
» List of HAL APIs
» HAL timer API

The HAL must supply at least one timer capable of generating periodic interrupts. Each timer should generate a separate logical interrupt, and the interrupt must be latched (either in the timer, the main interrupt controller, or both).

Terminology

  • Granularity – The base clock rate of the timer – i.e. how many times per second the timer value changes.
  • Period – Controls how often the timer will generate interrupts. If a timer is programmed with a period of N, its interrupt rate will be granularity/N Hz.

Notes

The HAL API does not allow or expect the granularity of a timer to change while the system is running – if multiple clock sources are available then the HAL must pick a suitable clock source on startup and stick to it.

The timers must either be variable rate (period is a multiple of a basic granularity), or be fixed rate (period is fixed at 1). Optionally, the timer should be capable of reporting the time until the next interrupt, in units of the granularity (HAL_TimerReadCountdown).

RISC OS expects timer 0 to be capable of generating interrupts at a rate of 100Hz (preferably with the ability to fine-tune the value, so that the RTC module can smoothly adjust the real-time clock). It’s recommended that timers have granularities of at least 1MHz or greater, so that they can be used for timing events at much greater precision than the 100Hz RISC OS system timer allows for.

Entry points

  • HAL_Timers
  • HAL_TimerDevice
  • HAL_TimerGranularity
  • HAL_TimerMaxPeriod
  • HAL_TimerSetPeriod
  • HAL_TimerPeriod
  • HAL_TimerReadCountdown
  • HAL_TimerIRQClear
  • HAL_TimerIRQStatus

See also

  • HAL counter API
Information source: Kernel.Docs.HAL.HAL_API in CVS
Revised on February 20, 2018 13:33:46 by Jeffrey Lee (213) (62.252.28.250)
Edit | Back in time (1 revision) | See changes | History | Views: Print | Source | Linked from: HAL entry points from RISC OS, HAL_CounterPeriod, HAL_CounterRead, HAL_TimerGranularity, HAL_TimerMaxPeriod, HAL_TimerReadCountdown, HAL_Timers, HAL_TimerSetPeriod, HAL_CounterRate, HAL_TimerDevice, HAL_TimerPeriod, HAL_IRQClear, OMAP3 HAL, List of HAL APIs

Search the Wiki

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
Site design © RISC OS Open Limited 2018 except where indicated
The RISC OS Open Instiki theme is based on Insitki's default layout

Valid XHTML 1.0  |  Valid CSS

Instiki 0.19.1(MML+)
This site runs on Rails

Hosted by Arachsys