CRpi
A library for rpi with intefaces to: gpio, pwm, dma
|
Provides a way to easily allocate memory areas that are coherent between CPU and DMA. More...
#include <stdint.h>
#include <stdlib.h>
#include "../notMine/mailbox.h"
#include <CCRCodingUtils/include/errorManagement.h>
#include <memoryManagement/physMemoryManagement.h>
#include <memoryManagement/addressing.h>
#include <memoryManagement/cacheCoherentMemoryProvider.h>
Functions | |
int | ccmp_malloc (size_t reqSize, Ccmb_desc *allocatedAreaDesc, unsigned int byteAlignment) |
Provides a way to easily allocate memory areas that are coherent between CPU and DMA. More... | |
int | ccmp_free (Ccmb_desc *allocatedAreaDesc) |
Frees a block allocated with ccmp_malloc() More... | |
uintptr_t | ccmp_virtAddrToBusAddr (Ccmb_desc *desc, void *virtAddr) |
Converts a virtual address inside the block described by desc to it's bus address. More... | |
Provides a way to easily allocate memory areas that are coherent between CPU and DMA.
See cacheCoherentMemoryProvider.h
This file uses the "mailbox property interface". I didn't find a complete and clear documentation but only vague and sparse informations. So I'll use the files mailbox.c and mailbox.h taken from https://github.com/raspberrypi/userland/blob/master/host_applications/linux/apps/hello_pi/hello_fft/ And some information taken from the sources of servoblaster and piblaster. Thanks to servoblaster, piblaster, the raspberry foundation and broadcom.
int ccmp_free | ( | Ccmb_desc * | allocatedAreaDesc | ) |
Frees a block allocated with ccmp_malloc()
int ccmp_malloc | ( | size_t | reqSize, |
Ccmb_desc * | allocatedAreaDesc, | ||
unsigned int | byteAlignment | ||
) |
Provides a way to easily allocate memory areas that are coherent between CPU and DMA.
reqSize | The size of the block to be allocated. |
allocatedAreaDesc | Here will be returned the descriptor for the allocated block |
byteAlignment | The allocated block will be aligned to this value |
uintptr_t ccmp_virtAddrToBusAddr | ( | Ccmb_desc * | desc, |
void * | virtAddr | ||
) |
Converts a virtual address inside the block described by desc to it's bus address.