⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 csl_dmaxaux.h

📁 Configuring External Interrupts on TMS320C672x Devices
💻 H
📖 第 1 页 / 共 3 页
字号:
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *    @n None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim

        CSL_dmaxGetFifoErrorCode (hDmax, &response);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_dmaxGetFifoErrorCode (
    CSL_DmaxHandle        hDmax,
    void                 *response
)
{
	Uint16 etype;
	Uint32 eventCtl;
	Uint32 *tmpPtr;
	CSL_DmaxFifoDesc *fifoObj;

	if (*(hDmax->hiTableEventEntryPtr) != 0) {
		eventCtl = *(hDmax->hiTableEventEntryPtr);
		tmpPtr = (Uint32 *)(hDmax->regs->HiMaxParam);
	} else {
		eventCtl = *(hDmax->loTableEventEntryPtr);
		tmpPtr = (Uint32 *)(hDmax->regs->LoMaxParam);            
	}
	etype = CSL_FEXT(eventCtl,DMAX_EVENT0_ETYPE);
	/* Make sure we have a valid FIFO event */          
	if ((etype == CSL_DMAX_EVENT0_ETYPE_FIFOREAD) 
		|| (etype == CSL_DMAX_EVENT0_ETYPE_FIFOWRITE)){
		tmpPtr += (hDmax->paramPtr) * CSL_DMAX_WORD_SIZE;
		fifoObj = (CSL_DmaxFifoDesc *)(((CSL_DmaxFifoParam *)tmpPtr)->pfd);
		*((Uint32 *)response) = CSL_FEXT(fifoObj->efield, DMAX_FIFODESC_EFIELD) \
													 & 0x000FFFFFu;
	}
}

/** ============================================================================
 *   @n@b CSL_dmaxGetEventEntry
 *
 *   @b Description
 *   @n Returns current contents of Event Entry for this event.
 *
 *   @b Arguments
 *   @verbatim

            hDmax           Handle to DMAX instance

            response        Placeholder to return status.

     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *    @n None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim

        CSL_dmaxGetEventEntry (hDmax, &response);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_dmaxGetEventEntry (
    CSL_DmaxHandle        hDmax,
    void                 *response
)
{
	if (*(hDmax->hiTableEventEntryPtr) != 0) {
		*((Uint32 *)response) = *(Uint32 *)(hDmax->hiTableEventEntryPtr);
	} else {
		*((Uint32 *)response) = *(Uint32 *)(hDmax->loTableEventEntryPtr);
	}          
}

/** ============================================================================
 *   @n@b CSL_dmaxGetParameterEntry
 *
 *   @b Description
 *   @n Clears parameter table entry for this event.
 *
 *   @b Arguments
 *   @verbatim

            hDmax           Handle to DMAX instance

            paramObj        Placeholder to return status.

     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *    @n None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim

        CSL_dmaxGetParameterEntry (hDmax, &response);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_dmaxGetParameterEntry (
    CSL_DmaxHandle        		hDmax,
    CSL_DmaxParameterEntry   *paramObj
)
{
	CSL_DmaxParameterEntry *tmpPtr;

	if (*(hDmax->hiTableEventEntryPtr) != 0) {
		tmpPtr = (CSL_DmaxParameterEntry*)
			(&(hDmax->regs->HiMaxParam));
	} else {
		tmpPtr = (CSL_DmaxParameterEntry*)
			(&(hDmax->regs->HiMaxParam));
	}
	/*
	* :KLUDGE: KSB Nov 13,2004
	* For dmax Event Entries the parameter table offset is expressed
	* as the number of dmax word offsets from the top of the Parameter
	* Table RAM. So address caluclation is done in bytes first and
	* then cast to entry type.
	*/
	tmpPtr = (CSL_DmaxParameterEntry *)(((Uint8 *)tmpPtr) 
		+ ((hDmax->paramPtr) * CSL_DMAX_WORD_SIZE));
	paramObj->word0 = tmpPtr->word0;
	paramObj->word1 = tmpPtr->word1;
	paramObj->word2 = tmpPtr->word2;
	paramObj->word3 = tmpPtr->word3;
	paramObj->word4 = tmpPtr->word4;
	paramObj->word5 = tmpPtr->word5;
	paramObj->word6 = tmpPtr->word6;
	paramObj->word7 = tmpPtr->word7;
	paramObj->word8 = tmpPtr->word8;
	paramObj->word9 = tmpPtr->word9;
	paramObj->word10 = tmpPtr->word10;
}

/** ============================================================================
 *   @n@b CSL_dmaxGetHbc
 *
 *   @b Description
 *   @n Returns the current status bits for Hi Priority dMax
 *
 *   @b Arguments
 *   @verbatim

            hDmax           Handle to Dmax instance

            response        Placeholder to return status.

     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *    @n None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim

        CSL_dmaxGetHbc (hDmax, &response);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_dmaxGetHbc (
    CSL_DmaxHandle        hDmax,
    void                 *response
)
{
	hDmax = hDmax;
	*((Uint32 *)response) = CSL_FEXT(CSL_dmaxGetDesr(), DMAX_DESR_HBC);	
}

/** ============================================================================
 *   @n@b CSL_dmaxGetLbc
 *
 *   @b Description
 *   @n Returns the current status bits for Lo Priority dmax.
 *
 *   @b Arguments
 *   @verbatim

            hDmax           Handle to DMAX instance

            response        Placeholder to return status.

     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *    @n None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim

        CSL_dmaxGetLbc (hDmax, &response);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_dmaxGetLbc (
    CSL_DmaxHandle        hDmax,
    void                 *response
)
{
	hDmax = hDmax;
	*((Uint32 *)response) = CSL_FEXT(CSL_dmaxGetDesr(), DMAX_DESR_LBC);	       
}

/** ============================================================================
 *   @n@b CSL_dmaxGetFifoAddr
 *
 *   @b Description
 *   @n Returns the address of the Fifo Descriptor associated with this event.
 *
 *   @b Arguments
 *   @verbatim

            hDmax           Handle to DMAX instance

            response        Placeholder to return status.

     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *    @n None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim

        CSL_dmaxGetFifoAddr (hDmax, &response);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_dmaxGetFifoAddr (
    CSL_DmaxHandle        hDmax,
    void                 *response
)
{
	Uint32 eventCtl;
	Uint16 etype;
	Uint32 *tmpPtr;
	CSL_DmaxFifoDesc *fifoObj;

	if (*(hDmax->hiTableEventEntryPtr) != 0) {
		eventCtl = *(hDmax->hiTableEventEntryPtr);
		tmpPtr = (Uint32 *)(hDmax->regs->HiMaxParam);
	} else {
		eventCtl = *(hDmax->loTableEventEntryPtr);
		tmpPtr = (Uint32 *)(hDmax->regs->LoMaxParam);            
	}
	etype = CSL_FEXT(eventCtl,DMAX_EVENT0_ETYPE);
	/* Make sure we have a valid FIFO event */          
	if ((etype == CSL_DMAX_EVENT0_ETYPE_FIFOREAD) 
		|| (etype == CSL_DMAX_EVENT0_ETYPE_FIFOWRITE)){
		tmpPtr += (hDmax->paramPtr) * CSL_DMAX_WORD_SIZE;
		fifoObj = (CSL_DmaxFifoDesc *)(((CSL_DmaxFifoParam *)tmpPtr)->pfd);
		*((Uint32 *)response) = (Int)fifoObj;
	}
}

/** ============================================================================
 *   @n@b CSL_dmaxGetEventEntryAddr
 *
 *   @b Description
 *   @n Returns address of the Event entry for this event.
 *
 *   @b Arguments
 *   @verbatim

            hDmax           Handle to DMAX instance

            response        Placeholder to return status.

     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *    @n None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim

        CSL_dmaxGetEventEntryAddr (hDmax, &response);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_dmaxGetEventEntryAddr (
    CSL_DmaxHandle        hDmax,
    void                 *response
)
{
	Uint32 *tmpPtr;

	if (*(hDmax->hiTableEventEntryPtr) != 0) {
		tmpPtr = hDmax->hiTableEventEntryPtr;
	} else {
		tmpPtr = hDmax->loTableEventEntryPtr;
	}
	*((Uint32 *)response) = (Uint32)tmpPtr;
}

/** ============================================================================
 *   @n@b CSL_dmaxGetParameterEntryAddr
 *
 *   @b Description
 *   @n This function gets the interrupt code of the DMAX module.
 *
 *   @b Arguments
 *   @verbatim

            hDmax           Handle to Dmax instance

            response        Placeholder to return status.

     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *    @n None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim

        CSL_dmaxGetParameterEntryAddr (hDmax, &response);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_dmaxGetParameterEntryAddr (
    CSL_DmaxHandle        hDmax,
    void                 *response
)
{
	CSL_DmaxParameterEntry *tmpPtr;

	if (*(hDmax->hiTableEventEntryPtr) != 0) {
		tmpPtr = (CSL_DmaxParameterEntry*)
			(&(hDmax->regs->HiMaxParam));
	} else {
		tmpPtr = (CSL_DmaxParameterEntry*)
			(&(hDmax->regs->HiMaxParam));
	}
	/*
	* :KLUDGE: KSB Nov 13,2004
	* For dmax Event Entries the parameter table offset is expressed
	* as the number of dmax word offsets from the top of the Parameter
	* Table RAM. So address caluclation is done in bytes first and
	* then cast to entry type.
	*/
	tmpPtr = (CSL_DmaxParameterEntry *)(((Uint8 *)tmpPtr) 
		+ ((hDmax->paramPtr) * CSL_DMAX_WORD_SIZE));
	*((Uint32 *)response) = (Uint32)tmpPtr;
}

/** ============================================================================
 *   @n@b CSL_dmaxGetFifoFull
 *
 *   @b Description
 *   @n Returns the value of the FIFO Full bit in EFIELD of fifo descriptor.
 *
 *   @b Arguments
 *   @verbatim

            hDmax           Handle to DMAX instance

            response        Placeholder to return status.

     @endverbatim
 *
 *   <b> Return Value </b>  None
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *    @n None
 *
 *   @b Modifies
 *   @n  None
 *
 *   @b Example
 *   @verbatim

        CSL_dmaxGetFifoFull (hDmax, &response);

     @endverbatim
 * ===========================================================================
 */
static inline
void CSL_dmaxGetFifoFull (
    CSL_DmaxHandle        hDmax,
    void                 *response
)
{
	Uint16 				etype;
	Uint32 				eventCtl;	
	Uint32 				*tmpPtr;
	CSL_DmaxFifoDesc 	*fifoObj;

	if (*(hDmax->hiTableEventEntryPtr) != 0) {
		eventCtl = *(hDmax->hiTableEventEntryPtr);
		tmpPtr = (Uint32 *)(hDmax->regs->HiMaxParam);
	} else {
		eventCtl = *(hDmax->loTableEventEntryPtr);
		tmpPtr = (Uint32 *)(hDmax->regs->LoMaxParam);            
	}
	etype = CSL_FEXT(eventCtl,DMAX_EVENT0_ETYPE);
	/* Make sure we have a valid FIFO event */          
	if ((etype == CSL_DMAX_EVENT0_ETYPE_FIFOREAD) 
		|| (etype == CSL_DMAX_EVENT0_ETYPE_FIFOWRITE)){
		tmpPtr += (hDmax->paramPtr) * CSL_DMAX_WORD_SIZE;
		fifoObj = (CSL_DmaxFifoDesc *)(((CSL_DmaxFifoParam *)tmpPtr)->pfd);
		*((Uint32 *)response) = CSL_FEXT(fifoObj->efield,DMAX_FIFO_FULL);
	}
}

#ifdef __cplusplus
}
#endif

#endif /* CSL_DMAXAUX_H_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -