In SAM D20 Flash and SRAM memories are mapped into different areas of 32-bits address space:
Flash = 0x00000000-0x20000000
SRAM = 0x20000000-0x20008000
I can use standard C statements to access both memories.
What about EEPROM emulator service that ASF provides?
What is the best method to implement a "flexible" function that could read from Flash, SRAM or EEPROM?
I'm thinking to map EEPROM virtual address space to an undefined/reserved region, such as 0x60000000-0x60000200.
The "flexible" function should decode the address and call EEPROM functions (instead of "normal" C instructions) when the address is in the 0x60000000-0x60000200 region.
Is there a better method?