#include <nitro/os.h>
void OS_StartTimer(
OS_TimerId id ,
u16 count ,
OS_TimerPrescaler preScale );
void OS_StartTimer32(
OS_Timer32Id id ,
u32 count ,
OS_TimerPrescaler preScale );
void OS_StartTimer48(
OS_Timer48Id id ,
u64 count ,
OS_TimerPrescaler preScale );
void OS_StartTimer64(
u64 count ,
OS_TimerPrescaler preScale );
Sets and starts the internal timer
Nintendo DS has four 16-bit counter timers. Each can be used independently or two or more timers can be connected to create a count timer of greater than 16 bits.
The OS_StartTimer() function uses 16-bit timers individually.
The OS_StartTimer32() function uses two consecutive timers as a timer with a 32-bit count maximum.
The OS_StartTimer48() function uses three consecutive timers as a timer with a 48-bit count maximum.
The OS_StartTimer64() function uses four consecutive timers as a timer with a 64-bit count maximum.
id specifies the Timer ID of the timer to use, as shown below.
For 16-bit timers (id specification for OS_StartTimer(), OS_StopTimer() )
id |
Timer |
|---|---|
OS_TIMER_0 |
Timer 0 |
OS_TIMER_1 |
Timer 1 |
OS_TIMER_2 |
Timer 2 |
OS_TIMER_3 |
Timer 3 |
id |
Timer |
|---|---|
OS_TIMER32_01 |
Timers 0 and 1 |
OS_TIMER32_12 |
Timers 1 and 2 |
OS_TIMER32_23 |
Timers 2 and 3 |
id |
Timer |
|---|---|
OS_TIMER48_012 |
Timers 0, 1, and 2 |
OS_TIMER48_123 |
Timers 1, 2, and 3 |
| Set Value | Prescaler (count interval) |
|---|---|
OS_TIMER_PRESCALE_1 |
System Clock |
OS_TIMER_PRESCALE_64 |
1/64th of the System Clock |
OS_TIMER_PRESCALE_256 |
1/256th of the System Clock |
OS_TIMER_PRESCALE_1024 |
1/1024th of the System Clock |
id |
Timer ID of the timer to use (differs according to number of timers used) |
count |
Timer count |
preScale |
Timer scale |
None
11/24/2004 Revised timer id
06/03/2004 Added caution about timer interrupts
12/01/2003 Initial version