Forum Discussion
Altera_Forum
Honored Contributor
19 years agoC example under uClinux
Hallo I want to write a C program. This C program should use a led on my NIOS II Evaluation Kit, Cyclone Edition. I think i can use the command outl but i believe i must use the include header ...
Altera_Forum
Honored Contributor
19 years ago#define inl(addr)
({ unsigned int __res; __asm__ __volatile__( "ldwio %0, 0(%1)" : "=r"(__res) : "r" (addr)); __res; }) //----------------------------------------------------------------------- # define inb(addr) ({ unsigned int __res; __asm__ __volatile__( "ldbio %0, 0(%1)" : "=r"(__res) : "r" (addr)); __res; }) //----------------------------------------------------------------------- # define outl(b,addr) ({ __asm__ __volatile__( "stwio %0, 0(%1)" : : "r"(http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/cool.gif , "r" (addr)); }) //----------------------------------------------------------------------- # define outw(b,addr) ({ __asm__ __volatile__( "sthio %0, 0(%1)" : : "r"(http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/cool.gif , "r" (addr)); }) //----------------------------------------------------------------------- # define outb(b,addr) ({ __asm__ __volatile__( "stbio %0, 0(%1)" : : "r"(http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/cool.gif , "r" (addr)); })