2 // ----------------------------------------------
6 typedef volatile struct
8 int np_timerstatus
; // read only, 2 bits (any write to clear TO)
9 int np_timercontrol
; // write/readable, 4 bits
10 int np_timerperiodl
; // write/readable, 16 bits
11 int np_timerperiodh
; // write/readable, 16 bits
12 int np_timersnapl
; // read only, 16 bits
13 int np_timersnaph
; // read only, 16 bits
16 // Timer Register Bits
19 np_timerstatus_run_bit
= 1, // timer is running
20 np_timerstatus_to_bit
= 0, // timer has timed out
22 np_timercontrol_stop_bit
= 3, // stop the timer
23 np_timercontrol_start_bit
= 2, // start the timer
24 np_timercontrol_cont_bit
= 1, // continous mode
25 np_timercontrol_ito_bit
= 0, // enable time out interrupt
27 np_timerstatus_run_mask
= (1<<1), // timer is running
28 np_timerstatus_to_mask
= (1<<0), // timer has timed out
30 np_timercontrol_stop_mask
= (1<<3), // stop the timer
31 np_timercontrol_start_mask
= (1<<2), // start the timer
32 np_timercontrol_cont_mask
= (1<<1), // continous mode
33 np_timercontrol_ito_mask
= (1<<0) // enable time out interrupt
37 int nr_timer_milliseconds(void); // Starts on first call, hogs timer1.