MOXA linux-2.6.x / linux-2.6.19-uc1 from UC-7110-LX-BOOTLOADER-1.9_VERSION-4.2.tgz
[linux-2.6.19-moxart.git] / include / asm-nios2nommu / timer_struct.h
blobd811a378e9ca58a383eabc126b72b54984f0dba7
2 // ----------------------------------------------
3 // Timer Peripheral
5 // Timer Registers
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
14 } np_timer;
16 // Timer Register Bits
17 enum
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
36 // Timer Routines
37 int nr_timer_milliseconds(void); // Starts on first call, hogs timer1.