CRpi
A library for rpi with intefaces to: gpio, pwm, dma
Functions
physMemoryManagement.cpp File Reference

Helper functions to map and unmap physical memory regions. More...

#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/mman.h>
#include <CCRCodingUtils/include/errorManagement.h>
#include <memoryManagement/physMemoryManagement.h>

Functions

void * mapPhysMemArea (uintptr_t areaBaseAddrPhys, size_t size)
 Maps the specified physical memory area to a virtual memory area. More...
 
int unmapPhysMemArea (void *areaBaseAddrVirt, size_t size)
 Unmaps a physical memory area mapped using mapPhysMemArea() More...
 

Detailed Description

Helper functions to map and unmap physical memory regions.

Function Documentation

void* mapPhysMemArea ( uintptr_t  areaBaseAddrPhys,
size_t  size 
)

Maps the specified physical memory area to a virtual memory area.

Parameters
areaBaseAddrPhysThe physical base address of the area
sizeThe size of the area to map
Returns
The generated virtual address, or zero in case of error
int unmapPhysMemArea ( void *  areaBaseAddrVirt,
size_t  size 
)

Unmaps a physical memory area mapped using mapPhysMemArea()

Parameters
areaBaseAddrVirtThe virtual base address of the peripheral
sizeThe size of the mapped area
Returns
negative in case of error