12.07.2015 Views

Nios Software Tutorial - Faculty.lasierra.edu

Nios Software Tutorial - Faculty.lasierra.edu

Nios Software Tutorial - Faculty.lasierra.edu

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Tutorial</strong> Overview<strong>Nios</strong> <strong>Software</strong> Development <strong>Tutorial</strong>// ----------------------------------------------// Timer Peripheral// Timer Registerstypedef volatile struct{int np_timerstatus; // read only, 2 bits (any write to clear TO)int np_timercontrol; // write/readable, 4 bitsint np_timerperiodl; // write/readable, 16 bitsint np_timerperiodh; // write/readable, 16 bitsint np_timersnapl; // read only, 16 bitsint np_timersnaph; // read only, 16 bits} np_timer;// Timer Register Bitsenum{np_timerstatus_run_bitnp_timerstatus_to_bit= 1, // timer is running= 0, // timer has timed outnp_timercontrol_stop_bit = 3, // stop the timernp_timercontrol_start_bit = 2, // start the timernp_timercontrol_cont_bit = 1, // continuous modenp_timercontrol_ito_bit = 0, // enable time out interruptnp_timerstatus_run_masknp_timerstatus_to_mask= (1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!