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

Provides helper macros for address management. More...

#include <memoryManagement/addressing.h>
#include <CCRCodingUtils/include/errorManagement.h>
#include <unistd.h>
#include <fcntl.h>
#include <inttypes.h>

Functions

int addrVirtToPhys (void *virtAddr, uintptr_t *physAddrRet)
 Gets the physical address corresponding to the provided virtual address. More...
 

Variables

uintptr_t peripheralsBaseAddressPhys = PERIPHERAL_BASE_ADDR_PHYS_RPI2
 Physical base address of the peripherals memory area.
 

Detailed Description

Provides helper macros for address management.

see BCM 2835 pag 4 and following.

See also the doc at addressing.h for some infos

Function Documentation

int addrVirtToPhys ( void *  virtAddr,
uintptr_t *  physAddrRet 
)

Gets the physical address corresponding to the provided virtual address.

Parameters
virtAddrThe virtuall address to convert
physAddrRetThe physical address is rturned here
Returns
0 for success, negative for error, 1 if the virtual address isn't in ram