Forum Discussion
Altera_Forum
Honored Contributor
11 years agowriting information into avalon slave in c
Hi, I have a NIOS II which is connected to a vga component with avalon memory mapped slave. In the VHDL entity, i have address, writedata, readdata, and chip select. the address base of the ...
Altera_Forum
Honored Contributor
11 years agoFrom NIOS you just treat it as if it is any other bit of memory and the processor will take care of the signalling (hence they are called memory-mapped).
There are handy functions provided in the NIOS BSP that are useful when writing to slave devices such as: IOWR_32DIRECT(<base address>,<offset in bytes>,<32bit data>); IORD_32DIRECT(<base address>,<offset in bytes>); And similar ones for 8bit and 16 bit data. Alternative you can do something like: int main(){ char* x = 0x3008; *x = 0x0F; }