Every platform should contain at least one available timer interrupt. These functions manage that timer interrupt and any others that may be available.
The DC part is relevant enough here that I'm going to go ahead and document it as well for this part.
Returns the number of seconds and milliseconds since the program was started. This is for fine timing where the time of day doesn't really matter.
Returns non-zero if the requested timer is enabled. The value of which is entirely platform dependent, but you can always use the constant TIMER_ID to refer to the primary timer that is used for threading and such.
Disables interrupts for the requested timer.
Enables interrupts for the requested timer.
Precise spin-loop sleep function. On the DC, this function does not interfere in any way with threading or other timer usage because it uses TMU1. On other platforms, this may be different.
Enable the "primary" timer - start it counting and enable any associated interrupts. This is generally the timer used by pre-emptive threading.
Disable the "primary" timer.
The SH-4 contains four usable timers, and we support three. These are TMU0, TMU1, and TMU2. TMU0 is the "primary" timer, TMU1 is used by timer_spin_sleep, and the other is available for programmer usage.
Pre-initialize a timer; setup the values but don't actually start it running. Timer which will be set to expire in speed milliseconds, and if interrupts is non-zero, interrupts will be enabled for it.
Starts the requested timer actually running.
Stops the requested timer from running.
Returns the count value of the requested timer.
Clears the underflow bit of the requested timer and returns what its count value was.