DMACPY
- group DMACPY
Memory copy using UDMA.
This API provides support for UDMA memory copy(DMACPY). The DMACPY allows memory copy between FC L1 memory and L2 memory.
Enums
Functions
-
void pi_dmacpy_conf_init(struct pi_dmacpy_conf *conf)
Initialize DMA memcpy config.
This function initializes DMA memcpy configuration struct with default values.
- Parameters:
conf – Pointer to DMA Memcpy conf struct.
-
int pi_dmacpy_open(struct pi_device *device)
Open a DMA Memcpy device.
This function opens a DMA Memcpy device. Once it is opened, user can do memory copy between FC memory and L2 memory.
Note
This function must be called before any use of the device.
- Parameters:
device – Pointer to device structure.
- Return values:
0 – If operation is successfull.
ERRNO – An error code otherwise.
-
void pi_dmacpy_close(struct pi_device *device)
Close an opened DMA Memcpy device.
This function closes a DMA Memcpy device.
- Parameters:
device – Pointer to device structure.
-
int pi_dmacpy_copy(struct pi_device *device, void *src, void *dst, uint32_t size, pi_dmacpy_dir_e dir)
Synchronous copy.
A memory copy is done from FC l1 memory or L2 memory and L2 memory, depending on memcpy direction.
Note
Both src and dst buffers must be aligned on 4 bytes.
Note
The size must be a multiple of 4 bytes.
- Parameters:
device – Pointer to device structure.
src – Pointer to source buffer.
dst – Pointer to dest buffer.
size – Size of data to copy.
dir – Direction of memcpy.
- Return values:
0 – If operation is successfull.
ERRNO – An error code otherwise.
-
int pi_dmacpy_copy_async(struct pi_device *device, void *src, void *dst, uint32_t size, pi_dmacpy_dir_e dir, struct pi_evt *task)
Asynchronous copy.
A memory copy is done from FC l1 memory or L2 memory and L2 memory, depending on memcpy direction.
Note
Both src and dst buffers must be aligned on 4 bytes.
Note
The size must be a multiple of 4 bytes.
- Parameters:
device – Pointer to device structure.
src – Pointer to source buffer.
dst – Pointer to dest buffer.
size – Size of data to copy.
dir – Direction of memcpy.
task – Event task used to notify end of copy.
- Return values:
0 – If operation is successfull.
ERRNO – An error code otherwise.
-
void pi_dmacpy_conf_init(struct pi_dmacpy_conf *conf)