Skip to main content

MSS_PDMA_setup_transfer

Function MSS_PDMA_setup_transfer 

Source
pub unsafe extern "C" fn MSS_PDMA_setup_transfer(
    channel_id: mss_pdma_channel_id_t,
    channel_config: *mut mss_pdma_channel_config_t,
    pdma_transfer_handler: mss_pdma_int_handler_t,
) -> mss_pdma_error_id_t
Expand description

The MSS_PDMA_setup_transfer() function is used to configure an individual DMA channel. Apart from selecting the DMA channel the MSS_PDMA_setup_transfer() function will also setup the transfer size, source and destination addresses. This function will also configure the repeat and force order requirements as the PolarFire SoC MSS Peripheral DMA supports multiple simultaneous transfers. Once transfer is setup, it can be started.

@param channel_id The channel_id parameter specifies the Platform DMA channel selected for DMA transaction.

@param channel_config The channel_config parameter structure contains the data needed for a DMA transfer.

  • Source Address
  • Destination address
  • Number of Bytes
  • Enable the Done Interrupt
  • Enable the ErrorInterrupt
  • Set the active transfer type, single or repeat.
  • Force Order.

@param mss_pdma_operation_t A callback function to the application. This function will be invoked when the PDMA transfer done or transfer error interrupt is generated. The callback function handler will be called only interrupt mode. For polling mode, the null pointer can be sent to the function as a parameter.

@return pdma_error_id_t The function returns error signals of type mss_pdma_error_id_t.

Example: The following call will configure channel 0. @code #ifdef MSS_PDMA_INTERRUPT_MODE g_pdma_error_code = MSS_PDMA_setup_transfer(MSS_PDMA_CHANNEL_0, &pdma_config_ch, pdma_isr); #else MSS_PDMA_setup_transfer(MSS_PDMA_CHANNEL_0, &pdma_config_ch, null_ptr); #endif @endcode