Re: Docs on s/w interfacing EDK based design

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.

Reply to
Eric Smith
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.