Re: Docs on s/w interfacing EDK based design

May 30, 2007 0 Replies


I am primarily interested in


> s/w interfaces for accesing DDR memory like reading and writing data
> at a particular address

Unless I misunderstand the question:



#include uint32_t addr = 0x00001234; // some address you want to access uint8_t *ptr = (uint8_t *) addr; foo = *ptr; // read a byte at ptr



*ptr = 0xaa; // write a byte 0xaa at ptr


and also writing on-board LEDs and reading DIP


> switches.

Same as above, but put a "volatile" in the pointer declaration:



volatile uint8_t *switches_ptr = (uint8_t *) 0x02000000; volatile uint8_t *leds_ptr = (uint8_t *) 0x03000000; uint8_t switches = *switches_ptr;



*leds_ptr = 0x55;

Of course, you have to change the addresses to match your system.



Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required