I want to write a function, that can either read or write directly to memory.
It should have variable parameters, so that:
Code: Select all
mem32(address, data)
Code: Select all
result = mem32(address)
The problem is, to be able to access the memory directly, I have to use @micropython.viper, to be able to use pointers.
Does anybody know how to write such a function? As I'm in viper, I obviously can't check a parameter for being 'none', and I've got no idea how to do it in another way.
Thanks in advance.