RTEMS 6.1-rc2
Loading...
Searching...
No Matches
Data Structures
Asrc_edma_driver

Data Structures

struct  _asrc_p2p_edma_config
 destination peripheral configuration More...
 
struct  _asrc_in_edma_handle
 
struct  _asrc_out_edma_handle
 
struct  _asrc_edma_handle
 ASRC DMA transfer handle. More...
 

Driver version

typedef struct _asrc_edma_handle asrc_edma_handle_t
 
typedef void(* asrc_edma_callback_t) (ASRC_Type *base, asrc_edma_handle_t *handle, status_t status, void *userData)
 ASRC eDMA transfer callback function for finish and error.
 
typedef void(* asrc_start_peripheral_t) (bool start)
 ASRC trigger peripheral function pointer.
 
typedef struct _asrc_p2p_edma_config asrc_p2p_edma_config_t
 destination peripheral configuration
 
typedef struct _asrc_in_edma_handle asrc_in_edma_handle_t
 
typedef struct _asrc_out_edma_handle asrc_out_edma_handle_t
 
#define FSL_ASRC_EDMA_DRIVER_VERSION   (MAKE_VERSION(2, 1, 0))
 
#define ASRC_XFER_IN_QUEUE_SIZE   4U
 ASRC IN edma QUEUE size.
 
#define ASRC_XFER_OUT_QUEUE_SIZE   (ASRC_XFER_QUEUE_SIZE * 2U)
 

eDMA Transactional

void ASRC_TransferInCreateHandleEDMA (ASRC_Type *base, asrc_edma_handle_t *handle, asrc_channel_pair_t channelPair, asrc_edma_callback_t callback, edma_handle_t *inDmaHandle, const asrc_p2p_edma_config_t *periphConfig, void *userData)
 Initializes the ASRC IN eDMA handle.
 
void ASRC_TransferOutCreateHandleEDMA (ASRC_Type *base, asrc_edma_handle_t *handle, asrc_channel_pair_t channelPair, asrc_edma_callback_t callback, edma_handle_t *outDmaHandle, const asrc_p2p_edma_config_t *periphConfig, void *userData)
 Initializes the ASRC OUT eDMA handle.
 
status_t ASRC_TransferSetChannelPairConfigEDMA (ASRC_Type *base, asrc_edma_handle_t *handle, asrc_channel_pair_config_t *asrcConfig, uint32_t inSampleRate, uint32_t outSampleRate)
 Configures the ASRC P2P channel pair.
 
uint32_t ASRC_GetOutSamplesSizeEDMA (ASRC_Type *base, asrc_edma_handle_t *handle, uint32_t inSampleRate, uint32_t outSampleRate, uint32_t inSamplesize)
 Get output sample buffer size can be transferred by edma.
 
status_t ASRC_TransferEDMA (ASRC_Type *base, asrc_edma_handle_t *handle, asrc_transfer_t *xfer)
 Performs a non-blocking ASRC m2m convert using EDMA.
 
void ASRC_TransferInAbortEDMA (ASRC_Type *base, asrc_edma_handle_t *handle)
 Aborts a ASRC IN transfer using eDMA.
 
void ASRC_TransferOutAbortEDMA (ASRC_Type *base, asrc_edma_handle_t *handle)
 Aborts a ASRC OUT transfer using eDMA.
 
void ASRC_TransferInTerminalEDMA (ASRC_Type *base, asrc_edma_handle_t *handle)
 Terminate In ASRC Convert.
 
void ASRC_TransferOutTerminalEDMA (ASRC_Type *base, asrc_edma_handle_t *handle)
 Terminate Out ASRC Convert.
 

Detailed Description

Macro Definition Documentation

◆ ASRC_XFER_IN_QUEUE_SIZE

#define ASRC_XFER_IN_QUEUE_SIZE   4U

ASRC IN edma QUEUE size.

<

◆ FSL_ASRC_EDMA_DRIVER_VERSION

#define FSL_ASRC_EDMA_DRIVER_VERSION   (MAKE_VERSION(2, 1, 0))

Version 2.1.0

Typedef Documentation

◆ asrc_in_edma_handle_t

@ brief asrc in edma handler

◆ asrc_out_edma_handle_t

@ brief asrc out edma handler

Function Documentation

◆ ASRC_GetOutSamplesSizeEDMA()

uint32_t ASRC_GetOutSamplesSizeEDMA ( ASRC_Type base,
asrc_edma_handle_t handle,
uint32_t  inSampleRate,
uint32_t  outSampleRate,
uint32_t  inSamplesize 
)

Get output sample buffer size can be transferred by edma.

Note
This API is depends on the ASRC output configuration, should be called after the ASRC_TransferSetChannelPairConfigEDMA.
Parameters
baseasrc base pointer.
handleASRC channel pair edma handle.
inSampleRateinput sample rate.
outSampleRateoutput sample rate.
inSamplesizeinput sampleS size.
Return values
outputbuffer size in byte.

brief Get output sample buffer size can be transferred by edma.

note This API is depends on the ASRC output configuration, should be called after the ASRC_TransferSetChannelPairConfigEDMA.

param base asrc base pointer. param handle ASRC channel pair edma handle. param inSampleRate input sample rate. param outSampleRate output sample rate. param inSamples input sampleS size. retval output buffer size in byte.

◆ ASRC_TransferEDMA()

status_t ASRC_TransferEDMA ( ASRC_Type base,
asrc_edma_handle_t handle,
asrc_transfer_t xfer 
)

Performs a non-blocking ASRC m2m convert using EDMA.

Note
This interface returns immediately after the transfer initiates.
Parameters
baseASRC base pointer.
handleASRC eDMA handle pointer.
xferPointer to the DMA transfer structure.
Return values
kStatus_SuccessStart a ASRC eDMA send successfully.
kStatus_InvalidArgumentThe input argument is invalid.
kStatus_ASRCQueueFullASRC EDMA driver queue is full.

brief Performs a non-blocking ASRC convert using EDMA.

note This interface returns immediately after the transfer initiates.

param base ASRC base pointer. param handle ASRC eDMA handle pointer. param xfer Pointer to the DMA transfer structure. retval kStatus_Success Start a ASRC eDMA send successfully. retval kStatus_InvalidArgument The input argument is invalid. retval kStatus_ASRCQueueFull ASRC EDMA driver queue is full.

◆ ASRC_TransferInAbortEDMA()

void ASRC_TransferInAbortEDMA ( ASRC_Type base,
asrc_edma_handle_t handle 
)

Aborts a ASRC IN transfer using eDMA.

This function only aborts the current transfer slots, the other transfer slots' information still kept in the handler. If users want to terminate all transfer slots, just call ASRC_TransferTerminalP2PEDMA.

Parameters
baseASRC base pointer.
handleASRC eDMA handle pointer.

brief Aborts a ASRC IN transfer using eDMA.

This function only aborts the current transfer slots, the other transfer slots' information still kept in the handler. If users want to terminate all transfer slots, just call ASRC_TransferTerminalP2PEDMA.

param base ASRC base pointer. param handle ASRC eDMA handle pointer.

◆ ASRC_TransferInCreateHandleEDMA()

void ASRC_TransferInCreateHandleEDMA ( ASRC_Type base,
asrc_edma_handle_t handle,
asrc_channel_pair_t  channelPair,
asrc_edma_callback_t  callback,
edma_handle_t inDmaHandle,
const asrc_p2p_edma_config_t periphConfig,
void *  userData 
)

Initializes the ASRC IN eDMA handle.

This function initializes the ASRC DMA handle, which can be used for other ASRC transactional APIs. Usually, for a specified ASRC channel pair, call this API once to get the initialized handle.

Parameters
baseASRC base pointer.
channelPairASRC channel pair
handleASRC eDMA handle pointer.
callbackPointer to user callback function.
inDmaHandleDMA handler for ASRC in.
periphConfigperipheral configuration.
userDataUser parameter passed to the callback function.

brief Initializes the ASRC IN eDMA handle.

This function initializes the ASRC DMA handle, which can be used for other ASRC transactional APIs. Usually, for a specified ASRC channel pair, call this API once to get the initialized handle.

param base ASRC base pointer. param channelPair ASRC channel pair param handle ASRC eDMA handle pointer. param callback Pointer to user callback function. param txDmaHandle ASRC send edma handle pointer. param periphConfig peripheral configuration. param userData User parameter passed to the callback function.

◆ ASRC_TransferInTerminalEDMA()

void ASRC_TransferInTerminalEDMA ( ASRC_Type base,
asrc_edma_handle_t handle 
)

Terminate In ASRC Convert.

This function will clear all transfer slots buffered in the asrc queue. If users only want to abort the current transfer slot, please call ASRC_TransferAbortPP2PEDMA.

Parameters
baseASRC base pointer.
handleASRC eDMA handle pointer.

brief Terminate In ASRC Convert.

This function will clear all transfer slots buffered in the asrc queue. If users only want to abort the current transfer slot, please call ASRC_TransferAbortPP2PEDMA.

param base ASRC base pointer. param handle ASRC eDMA handle pointer.

◆ ASRC_TransferOutAbortEDMA()

void ASRC_TransferOutAbortEDMA ( ASRC_Type base,
asrc_edma_handle_t handle 
)

Aborts a ASRC OUT transfer using eDMA.

This function only aborts the current transfer slots, the other transfer slots' information still kept in the handler. If users want to terminate all transfer slots, just call ASRC_TransferTerminalP2PEDMA.

Parameters
baseASRC base pointer.
handleASRC eDMA handle pointer.

brief Aborts a ASRC OUT transfer using eDMA.

This function only aborts the current transfer slots, the other transfer slots' information still kept in the handler. If users want to terminate all transfer slots, just call ASRC_TransferTerminalP2PEDMA.

param base ASRC base pointer. param handle ASRC eDMA handle pointer.

◆ ASRC_TransferOutCreateHandleEDMA()

void ASRC_TransferOutCreateHandleEDMA ( ASRC_Type base,
asrc_edma_handle_t handle,
asrc_channel_pair_t  channelPair,
asrc_edma_callback_t  callback,
edma_handle_t outDmaHandle,
const asrc_p2p_edma_config_t periphConfig,
void *  userData 
)

Initializes the ASRC OUT eDMA handle.

This function initializes the ASRC DMA handle, which can be used for other ASRC transactional APIs. Usually, for a specified ASRC channel pair, call this API once to get the initialized handle.

Parameters
baseASRC base pointer.
channelPairASRC channel pair
handleASRC eDMA handle pointer.
callbackPointer to user callback function.
outDmaHandleDMA handler for ASRC out.
periphConfigperipheral configuration.
userDataUser parameter passed to the callback function.

brief Initializes the ASRC OUT eDMA handle.

This function initializes the ASRC DMA handle, which can be used for other ASRC transactional APIs. Usually, for a specified ASRC channel pair, call this API once to get the initialized handle.

param base ASRC base pointer. param channelPair ASRC channel pair param handle ASRC eDMA handle pointer. param callback Pointer to user callback function. param txDmaHandle ASRC send edma handle pointer. param periphConfig peripheral configuration. param userData User parameter passed to the callback function.

◆ ASRC_TransferOutTerminalEDMA()

void ASRC_TransferOutTerminalEDMA ( ASRC_Type base,
asrc_edma_handle_t handle 
)

Terminate Out ASRC Convert.

This function will clear all transfer slots buffered in the asrc queue. If users only want to abort the current transfer slot, please call ASRC_TransferAbortPP2PEDMA.

Parameters
baseASRC base pointer.
handleASRC eDMA handle pointer.

brief Terminate Out ASRC Convert.

This function will clear all transfer slots buffered in the asrc queue. If users only want to abort the current transfer slot, please call ASRC_TransferAbortPP2PEDMA.

param base ASRC base pointer. param handle ASRC eDMA handle pointer.

◆ ASRC_TransferSetChannelPairConfigEDMA()

status_t ASRC_TransferSetChannelPairConfigEDMA ( ASRC_Type base,
asrc_edma_handle_t handle,
asrc_channel_pair_config_t asrcConfig,
uint32_t  inSampleRate,
uint32_t  outSampleRate 
)

Configures the ASRC P2P channel pair.

Parameters
baseASRC base pointer.
handleASRC eDMA handle pointer.
asrcConfigasrc configurations.
inSampleRateASRC input sample rate.
outSampleRateASRC output sample rate.

brief Configures the ASRC channel pair.

param base ASRC base pointer. param handle ASRC eDMA handle pointer. param asrcConfig asrc configurations. param periphConfig peripheral configuration. param inputSampleRate ASRC input sample rate. param outputSampleRate ASRC output sample rate.