Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12747 Discussions

Very simple question about PIO

Altera_Forum
Honored Contributor II
1,283 Views

typedef volatile struct 

int np_piodata; // read/write, up to 32 bits 

int np_piodirection; // write/readable, up to 32 bits, 1->output bit 

int np_piointerruptmask; // write/readable, up to 32 bits, 1->enable interrupt 

int np_pioedgecapture; // read, up to 32 bits, cleared by any write 

} np_pio; 

 

can you explain me how to use PIO register...for example if i want to read 

a pio register... i do PIO->np_piodata.. 

Why does the function of " np_piodirection" 

http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/ph34r.gif http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/ph34r.gif http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/ph34r.gif http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/ph34r.gif
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
456 Views

Hi, 

 

in general if you want learn something about the peripherials, you might want to read "Altera Embeeded Peripherals Handbook" (n2cpu_nii5v3.pdf). 

 

However you should use inl(...) for reading and outl(...) for writing the hardware register.  

 

Accessing the hardware register with such a structure is a "Nios speciality".
0 Kudos
Reply