PMSIS API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
DMACPY

Memory copy using UDMA. More...

Data Structures

struct  pi_dmacpy_conf
 DMA Memcpy configuration options. More...
 

Enumerations

enum  pi_dmacpy_dir_e
 Memcpy direction. More...
 

Functions

void pi_dmacpy_conf_init (struct pi_dmacpy_conf *conf)
 Initialize DMA memcpy config. More...
 
int pi_dmacpy_open (struct pi_device *device)
 Open a DMA Memcpy device. More...
 
void pi_dmacpy_close (struct pi_device *device)
 Close an opened DMA Memcpy device. More...
 
int pi_dmacpy_copy (struct pi_device *device, void *src, void *dst, uint32_t size, pi_dmacpy_dir_e dir)
 Synchronous copy. More...
 
int pi_dmacpy_copy_async (struct pi_device *device, void *src, void *dst, uint32_t size, pi_dmacpy_dir_e dir, struct pi_task *task)
 Asynchronous copy. More...
 

Description

This API provides support for UDMA memory copy(DMACPY). The DMACPY allows memory copy between FC L1 memory and L2 memory.

Enumeration Type Documentation

Enumerator
PI_DMACPY_FC_L1_L2 

Memcpy from FC_L1 to L2.

PI_DMACPY_L2_FC_L1 

Memcpy from L2 to FC_L1.

PI_DMACPY_L2_L2 

Memcpy from L2 to L2.

Function Documentation

void pi_dmacpy_close ( struct pi_device *  device)

This function closes a DMA Memcpy device.

Parameters
devicePointer to device structure.
void pi_dmacpy_conf_init ( struct pi_dmacpy_conf conf)

This function initializes DMA memcpy configuration struct with default values.

Parameters
confPointer to DMA Memcpy conf struct.
int pi_dmacpy_copy ( struct pi_device *  device,
void *  src,
void *  dst,
uint32_t  size,
pi_dmacpy_dir_e  dir 
)

A memory copy is done from FC l1 memory or L2 memory and L2 memory, depending on memcpy direction.

Parameters
devicePointer to device structure.
srcPointer to source buffer.
dstPointer to dest buffer.
sizeSize of data to copy.
dirDirection of memcpy.
Return values
0If operation is successfull.
ERRNOAn error code otherwise.
Note
Both src and dst buffers must be aligned on 4 bytes.
The size must be a multiple of 4 bytes.
int pi_dmacpy_copy_async ( struct pi_device *  device,
void *  src,
void *  dst,
uint32_t  size,
pi_dmacpy_dir_e  dir,
struct pi_task *  task 
)

A memory copy is done from FC l1 memory or L2 memory and L2 memory, depending on memcpy direction.

Parameters
devicePointer to device structure.
srcPointer to source buffer.
dstPointer to dest buffer.
sizeSize of data to copy.
dirDirection of memcpy.
taskEvent task used to notify end of copy.
Return values
0If operation is successfull.
ERRNOAn error code otherwise.
Note
Both src and dst buffers must be aligned on 4 bytes.
The size must be a multiple of 4 bytes.
int pi_dmacpy_open ( struct pi_device *  device)

This function opens a DMA Memcpy device. Once it is opened, user can do memory copy between FC memory and L2 memory.

Parameters
devicePointer to device structure.
Return values
0If operation is successfull.
ERRNOAn error code otherwise.
Note
This function must be called before any use of the device.