Handle to the block of memory, as given by esp_himem_alloc
range
Range handle to map the memory in
ram_offset
Offset into the block of physical memory of the block to map
range_offset
Offset into the address range where the block will be mapped
len
Length of region to map
flags
One of ESP_HIMEM_MAPFLAG_*
out_ptr
Pointer to variable to store resulting memory pointer in
Return value
- ESP_OK if the memory could be mapped - ESP_ERR_INVALID_ARG if offset, range or len aren't MMU-block-aligned (32K) - ESP_ERR_INVALID_SIZE if the offsets/lengths don't fit in the allocated memory or range - ESP_ERR_INVALID_STATE if a block in the selected ram offset/length is already mapped, or if a block in the selected range offset/length already has a mapping.
Notes
The region to be mapped needs to have offsets and sizes that are aligned to the SPI RAM MMU block size (32K)
Free a block of physical memory This clears out the associated handle making the memory available for re-allocation again. This will only succeed if none of the memory blocks currently have a mapping.
Examples
esp_himem_map() is referenced by 1 libraries and example projects: