UDMA Datamove

group UDMA_DATAMOVE

The UDMA DATAMOVE driver provides an interface to use UDMA DATAMOVE channel.

Unnamed Group

enum pi_udma_datamove_transf_type_e

type of transfer

Values:

enumerator PI_UDMA_DATAMOVE_TRF_LINEAR
enumerator PI_UDMA_DATAMOVE_TRF_2D
typedef struct pi_udma_datamove_transf_cfg_s pi_udma_datamove_transf_cfg_t
typedef struct pi_udma_datamove_conf_s pi_udma_datamove_conf_t

UDMA DATAMOVE configuration structure.

This structure is used to pass the desired UDMA DATAMOVE configuration to the runtime when opening a device.

void pi_udma_datamove_conf_init(pi_udma_datamove_conf_t *conf)

Initialize an UDMA DATAMOVE configuration with default values.

This function can be called to get default values for all parameters before setting some of them. The structure containing the configuration must be kept alive until the UDMA DATAMOVE device is opened.

Parameters:
  • conf – A pointer to the UDMA DATAMOVE configuration.

int pi_udma_datamove_open(pi_device_t *device)

Open an UDMA DATAMOVE device.

This function must be called before the UDMA DATAMOVE device can be used. It will do all the needed configuration to make it usable and initialize the handle used to refer to this opened device when calling other functions.

Warning

The datamove needs at least one UDMA peripheral enabled to be enabled. Else configuration will not be set, and application will get stuck on push/pop commands.

Parameters:
  • device – A pointer to the device structure of the device to open. This structure is allocated by the called and must be kept alive until the device is closed.

Returns:

0 if the operation is successfull, -1 if there was an error.

void pi_udma_datamove_close(pi_device_t *device)

Close an opened UDMA DATAMOVE device.

This function can be called to close an opened UDMA DATAMOVE device once it is not needed anymore, in order to free all allocated resources. Once this function is called, the device is not accessible anymore and must be opened again before being used.

Parameters:
  • device – The device structure of the device to close.

int32_t pi_udma_datamove_copy(pi_device_t *device, void *src, void *dst, uint32_t len)

copy data from L2 to L2 (blocking)

Parameters:
  • device – udma_datamove device pointer

  • src – source address

  • dst – destination address

  • len – length of the transfer in bytes

Returns:

PI_OK if operation succeeded, else error code

int32_t pi_udma_datamove_copy_async(pi_device_t *device, void *src, void *dst, uint32_t len, pi_evt_t *task)

copy data from L2 to L2 (asynchronous)

Parameters:
  • device – udma_datamove device pointer

  • src – source address

  • dst – destination address

  • len – length of the transfer in bytes

  • task – task executed at the end of transfer

Returns:

PI_OK if operation succeeded, else error code

struct pi_udma_datamove_transf_cfg_s
struct pi_udma_datamove_conf_s
#include <udma_datamove.h>

UDMA DATAMOVE configuration structure.

This structure is used to pass the desired UDMA DATAMOVE configuration to the runtime when opening a device.

Public Members

uint8_t device_id

device id

pi_udma_datamove_transf_cfg_t src_trf_cfg

Source data transfer configuration

pi_udma_datamove_transf_cfg_t dst_trf_cfg

Destination data transfer configuration