- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 asm/io. My first question. Is that correct? But i have not this header. So what can i do. Have anyone an idea? Have anyone this header? ThanksLink Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you can copy & paste the routine from asm/io
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
#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)); })
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page