📄 edma3_drv.h
字号:
/**
* Application data to be passed back to the global error callback
* function
*/
void *gblerrData;
} EDMA3_DRV_InitConfig;
/**\struct EDMA3_DRV_MiscParam
* \brief Used to specify the miscellaneous options during EDMA3 Driver
* Initialization.
*
* This configuration structure is used to specify some misc options
* while creating the Driver object. New options may also be added into this
* structure in future.
*/
typedef struct {
/**
* In a multi-master system (for e.g. ARM + DSP), this option is used to
* distinguish between Master and Slave. Only the Master is allowed to
* program the global EDMA3 registers (like Queue priority, Queue water-
* mark level, error registers etc).
*/
unsigned short isSlave;
/** For future use **/
unsigned short param;
}EDMA3_DRV_MiscParam;
/**
* \brief Create EDMA3 Driver Object
*
* This API is used to create the EDMA3 Driver Object. It should be
* called only ONCE for each EDMA3 hardware instance.
*
* Init-time Configuration structure for EDMA3 hardware is provided to pass the
* SoC specific information. This configuration information could be provided
* by the user at init-time. In case user doesn't provide it, this information
* could be taken from the SoC specific configuration file
* edma3_<SOC_NAME>_cfg.c, in case it is available.
*
* This API clears the error specific registers (EMCR/EMCRh, QEMCR, CCERRCLR)
* and sets the TCs priorities and Event Queues' watermark levels, if the 'miscParam'
* argument is NULL. User can avoid these registers' programming (in some specific
* use cases) by SETTING the 'isSlave' field of 'EDMA3_RM_MiscParam' configuration
* structure and passing this structure as the third argument (miscParam).
*
* After successful completion of this API, Driver Object's state
* changes to EDMA3_DRV_CREATED from EDMA3_DRV_DELETED.
*
* \param phyCtrllerInstId [IN] EDMA3 Controller Instance Id
* (Hardware instance id, starting from 0).
* \param gblCfgParams [IN] SoC specific configuration structure for the
* EDMA3 Hardware.
* \param miscParam [IN] Misc configuration options provided in the
* structure 'EDMA3_DRV_MiscParam'.
* For default options, user can pass NULL
* in this argument.
*
* \return EDMA3_DRV_SOK or EDMA3_DRV Error code
*/
EDMA3_DRV_Result EDMA3_DRV_create (unsigned int phyCtrllerInstId,
const EDMA3_DRV_GblConfigParams *gblCfgParams,
const void *miscParam);
/**
* \brief Delete EDMA3 Driver Object
*
* Use this API to delete the EDMA3 Driver Object. It should be called only
* ONCE for each EDMA3 hardware instance. It should be called ONLY after
* closing all the EDMA3 Driver Instances.
*
* This API is used to delete the EDMA3 Driver Object. It should be called
* once for each EDMA3 hardware instance, ONLY after closing all the
* previously opened EDMA3 Driver Instances.
*
* After successful completion of this API, Driver Object's state
* changes to EDMA3_DRV_DELETED.
*
* \param phyCtrllerInstId [IN] EDMA3 Phy Controller Instance Id (Hardware
* instance id, starting from 0).
* \param param [IN] For possible future use.
*
* \return EDMA3_DRV_SOK or EDMA3_DRV Error code
*/
EDMA3_DRV_Result EDMA3_DRV_delete (unsigned int phyCtrllerInstId,
const void *param);
/**
* \brief Open EDMA3 Driver Instance
*
* This API is used to open an EDMA3 Driver Instance. It could be
* called multiple times, for each possible EDMA3 shadow region. Maximum
* EDMA3_MAX_REGIONS instances are allowed for each EDMA3 hardware
* instance. Multiple instances on the same shadow region are NOT allowed.
*
* Also, only ONE Master Driver Instance is permitted. This master
* instance (and hence the region to which it belongs) will only receive the
* EDMA3 interrupts, if enabled.
*
* User could pass the instance specific configuration structure
* (initCfg.drvInstInitConfig) as a part of the 'initCfg' structure,
* during init-time. In case user doesn't provide it, this information could
* be taken from the SoC specific configuration file edma3_<SOC_NAME>_cfg.c,
* in case it is available.
*
* By default, this EDMA3 Driver instance will clear the PaRAM Sets while
* allocating them. To change the default behavior, user should use the IOCTL
* interface appropriately.
*
* \param phyCtrllerInstId [IN] EDMA3 Controller Instance Id (Hardware
* instance id, starting from 0).
* \param initCfg [IN] Used to Initialize the EDMA3 Driver
* Instance (Master or Slave).
* \param errorCode [OUT] Error code while opening DRV instance.
*
* \return EDMA3_DRV_Handle : If successfully opened, the API will return the
* associated driver's instance handle.
*
* \note This function disables the global interrupts (by calling API
* edma3OsProtectEntry with protection level
* EDMA3_OS_PROTECT_INTERRUPT) while modifying the global data
* structures, to make it re-entrant.
*/
EDMA3_DRV_Handle EDMA3_DRV_open (unsigned int phyCtrllerInstId,
const EDMA3_DRV_InitConfig *initCfg,
EDMA3_DRV_Result *errorCode);
/**
* \brief Close the EDMA3 Driver Instance.
*
* This API is used to close a previously opened EDMA3 Driver Instance.
*
* \param hEdma [IN] Handle to the previously opened EDMA3
* Driver Instance.
* \param param [IN] For possible future use
*
* \return EDMA3_DRV_SOK or EDMA3_DRV Error code
*
* \note This function disables the global interrupts (by calling API
* edma3OsProtectEntry with protection level
* EDMA3_OS_PROTECT_INTERRUPT) while modifying the global data
* structures, to make it re-entrant.
*/
EDMA3_DRV_Result EDMA3_DRV_close (EDMA3_DRV_Handle hEdma,
const void *param);
/**
* \defgroup Edma3DrvChannelSetup EDMA3 Driver Channel Setup
*
* Channel related Interface of the EDMA3 Driver
*
* @{
*/
/* Defines for Logical Channel Values */
/*---------------------------------------------------------------------------*/
/**
* Used to specify any available DMA Channel while requesting
* one. Used in the API EDMA3_DRV_requestChannel().
* DMA channel from the pool of (owned && non_reserved && available_right_now)
* DMA channels will be chosen and returned.
*/
#define EDMA3_DRV_DMA_CHANNEL_ANY 1002u
/**
* Used to specify any available QDMA Channel while requesting
* one. Used in the API EDMA3_DRV_requestChannel().
* QDMA channel from the pool of (owned && non_reserved && available_right_now)
* QDMA channels will be chosen and returned.
*/
#define EDMA3_DRV_QDMA_CHANNEL_ANY 1003u
/**
* Used to specify any available TCC while requesting
* one. Used in the API EDMA3_DRV_requestChannel(), for
* both DMA and QDMA channels.
* TCC from the pool of (owned && non_reserved && available_right_now)
* TCCs will be chosen and returned.
*/
#define EDMA3_DRV_TCC_ANY 1004u
/**
* Used to specify any available PaRAM Set while requesting
* one. Used in the API EDMA3_DRV_requestChannel(), for Link channels.
* PaRAM Set from the pool of (owned && non_reserved && available_right_now)
* PaRAM Sets will be chosen and returned.
*/
#define EDMA3_DRV_LINK_CHANNEL 1005u
/*---------------------------------------------------------------------------*/
/**
* \brief DMA Channels assigned to different Hardware Events.
* They should be used while requesting a specific DMA channel.
* One possible usage is to maintain a SoC specific file, which will
* contain the mapping of these hardware events to the respective
* peripherals for better understanding and lesser probability of
* errors. Also, if any event associated with a particular peripheral
* gets changed, only that SoC specific file needs to be changed.
*
* for eg, the sample SoC specific file "soc.h" can have these defines:
*
* #define EDMA3_DRV_HW_CHANNEL_MCBSP_TX EDMA3_DRV_HW_CHANNEL_EVENT_2
* #define EDMA3_DRV_HW_CHANNEL_MCBSP_RX EDMA3_DRV_HW_CHANNEL_EVENT_3
*
* These defines will be used by the MCBSP driver. The same event
* EDMA3_DRV_HW_CHANNEL_EVENT_2/3 could be mapped to some other
* peripheral also.
*/
typedef enum
{
/** Channel assigned to EDMA3 Event 0 */
EDMA3_DRV_HW_CHANNEL_EVENT_0 = 0,
/** Channel assigned to EDMA3 Event 1 */
EDMA3_DRV_HW_CHANNEL_EVENT_1,
/** Channel assigned to EDMA3 Event 2 */
EDMA3_DRV_HW_CHANNEL_EVENT_2,
/** Channel assigned to EDMA3 Event 3 */
EDMA3_DRV_HW_CHANNEL_EVENT_3,
/** Channel assigned to EDMA3 Event 4 */
EDMA3_DRV_HW_CHANNEL_EVENT_4,
/** Channel assigned to EDMA3 Event 5 */
EDMA3_DRV_HW_CHANNEL_EVENT_5,
/** Channel assigned to EDMA3 Event 6 */
EDMA3_DRV_HW_CHANNEL_EVENT_6,
/** Channel assigned to EDMA3 Event 7 */
EDMA3_DRV_HW_CHANNEL_EVENT_7,
/** Channel assigned to EDMA3 Event 8 */
EDMA3_DRV_HW_CHANNEL_EVENT_8,
/** Channel assigned to EDMA3 Event 9 */
EDMA3_DRV_HW_CHANNEL_EVENT_9,
/** Channel assigned to EDMA3 Event 10 */
EDMA3_DRV_HW_CHANNEL_EVENT_10,
/** Channel assigned to EDMA3 Event 11 */
EDMA3_DRV_HW_CHANNEL_EVENT_11,
/** Channel assigned to EDMA3 Event 12 */
EDMA3_DRV_HW_CHANNEL_EVENT_12,
/** Channel assigned to EDMA3 Event 13 */
EDMA3_DRV_HW_CHANNEL_EVENT_13,
/** Channel assigned to EDMA3 Event 14 */
EDMA3_DRV_HW_CHANNEL_EVENT_14,
/** Channel assigned to EDMA3 Event 15 */
EDMA3_DRV_HW_CHANNEL_EVENT_15,
/** Channel assigned to EDMA3 Event 16 */
EDMA3_DRV_HW_CHANNEL_EVENT_16,
/** Channel assigned to EDMA3 Event 17 */
EDMA3_DRV_HW_CHANNEL_EVENT_17,
/** Channel assigned to EDMA3 Event 18 */
EDMA3_DRV_HW_CHANNEL_EVENT_18,
/** Channel assigned to EDMA3 Event 19 */
EDMA3_DRV_HW_CHANNEL_EVENT_19,
/** Channel assigned to EDMA3 Event 20 */
EDMA3_DRV_HW_CHANNEL_EVENT_20,
/** Channel assigned to EDMA3 Event 21 */
EDMA3_DRV_HW_CHANNEL_EVENT_21,
/** Channel assigned to EDMA3 Event 22 */
EDMA3_DRV_HW_CHANNEL_EVENT_22,
/** Channel assigned to EDMA3 Event 23 */
EDMA3_DRV_HW_CHANNEL_EVENT_23,
/** Channel assigned to EDMA3 Event 24 */
EDMA3_DRV_HW_CHANNEL_EVENT_24,
/** Channel assigned to EDMA3 Event 25 */
EDMA3_DRV_HW_CHANNEL_EVENT_25,
/** Channel assigned to EDMA3 Event 26 */
EDMA3_DRV_HW_CHANNEL_EVENT_26,
/** Channel assigned to EDMA3 Event 27 */
EDMA3_DRV_HW_CHANNEL_EVENT_27,
/** Channel assigned to EDMA3 Event 28 */
EDMA3_DRV_HW_CHANNEL_EVENT_28,
/** Channel assigned to EDMA3 Event 29 */
EDMA3_DRV_HW_CHANNEL_EVENT_29,
/** Channel assigned to EDMA3 Event 30 */
EDMA3_DRV_HW_CHANNEL_EVENT_30,
/** Channel assigned to EDMA3 Event 31 */
EDMA3_DRV_HW_CHANNEL_EVENT_31,
/** Channel assigned to EDMA3 Event 32 */
EDMA3_DRV_HW_CHANNEL_EVENT_32,
/** Channel assigned to EDMA3 Event 33 */
EDMA3_DRV_HW_CHANNEL_EVENT_33,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -