I cannot figure how to get the virtual address of the standard mmap objects in Python (from the mmap module). The documented methods only seem to access the memory as array of bytes or as character strings.
But I need to access the mmap'ped memory by precisely 2 or 4 bytes at once - because this memory in my application is mapped to hardware registers (think /dev/mem or GPIO or such). Accessing memory in this way is possible with ctypes module - but for this I need the pointer - or virtual address - of the mapping.
Currently I overcome this by using the native open() and mmap() functions from libc (thanks to the same ctypes) but would rather not.
Why the mmap module won't provide easy way to get the memory address? Hope I'm missing something obvious...
-- dd