memorymap
– Raw memory map access
The memorymap
module allows you to read and write memory addresses in the
address space seen from the processor running CircuitPython. It is usually
the physical address space.
Available on these boards
- class memorymap.AddressRange(*, start, length)
Presents a range of addresses as a bytearray.
The addresses may access memory or memory mapped peripherals.
Some address ranges may be protected by CircuitPython to prevent errors. An exception will be raised when constructing an AddressRange for an invalid or protected address.
Multiple AddressRanges may overlap. There is no “claiming” of addresses.
Example usage on ESP32-S2:
import memorymap rtc_slow_mem = memorymap.AddressRange(start=0x50000000, length=0x2000) rtc_slow_mem[0:3] = b"\xcc\x10\x00"
Constructs an address range starting at
start
and ending atstart + length
. An exception will be raised if any of the addresses are invalid or protected.