XilinxProcessorIPLib/drivers/axidma/src/xaxidma_bd.c
int XAxiDma_BdSetAppWord(XAxiDma_Bd* BdPtr, int Offset, u32 Word)
{
	if (XAxiDma_BdRead(BdPtr, XAXIDMA_BD_HAS_STSCNTRL_OFFSET) == 0) {

		xdbg_printf(XDBG_DEBUG_ERROR, "BdRingSetAppWord: no sts cntrl"
			"stream in hardware build, cannot set app word\r\n");

		return XST_INVALID_PARAM;
	}

	if ((Offset < 0) || (Offset > XAXIDMA_LAST_APPWORD)) {

		xdbg_printf(XDBG_DEBUG_ERROR, "BdRingSetAppWord: invalid"
			"offset %d",Offset);

		return XST_INVALID_PARAM;
	}

	XAxiDma_BdWrite(BdPtr, XAXIDMA_BD_USR0_OFFSET + Offset * 4, Word);

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
 * Set the APP word at the specified APP word offset for a BD.
 *
 * @param	BdPtr is the BD to operate on.
 * @param	Offset is the offset inside the APP word, it is valid from
 *		0 to 4
 * @param	Word is the value to set
 *
 * @returns
 *		- XST_SUCCESS for success
 *		- XST_INVALID_PARAM under following error conditions:
 *		1) StsCntrlStrm is not built in hardware
 *		2) Offset is not in valid range
 *
 * @note
 *		If the hardware build has C_SG_USE_STSAPP_LENGTH set to 1,
 *		then the last APP word, XAXIDMA_LAST_APPWORD, must have
 *		non-zero value when AND with 0x7FFFFF. Not doing so will cause
 *		the hardware to stall.
 *		This function can be used only when DMA is in SG mode
 *
 *****************************************************************************/
Set the APP word at the specified APP word offset for a BD.
@param       BdPtr is the BD to operate on.
@param       Offset is the offset inside the APP word, it is valid from
0 to 4
@param       Word is the value to set

@returns
- XST_SUCCESS for success
- XST_INVALID_PARAM under following error conditions:
1) StsCntrlStrm is not built in hardware
2) Offset is not in valid range

@note
If the hardware build has C_SG_USE_STSAPP_LENGTH set to 1,
then the last APP word, XAXIDMA_LAST_APPWORD, must have
non-zero value when AND with 0x7FFFFF. Not doing so will cause
the hardware to stall.
This function can be used only when DMA is in SG mode
Set the APP word at the specified APP word offset for a BD . @param BdPtr is the BD to operate on . @param Offset is the offset inside the APP word it is valid from 0 to 4 @param Word is the value to set @returns - XST_SUCCESS for success - XST_INVALID_PARAM under following error conditions : 1 ) StsCntrlStrm is not built in hardware 2 ) Offset is not in valid range @note If the hardware build has C_SG_USE_STSAPP_LENGTH set to 1 then the last APP word XAXIDMA_LAST_APPWORD must have non - zero value when AND with 0x7FFFFF . Not doing so will cause the hardware to stall . This function can be used only when DMA is in SG mode
int XAxiDma_BdSetAppWord(XAxiDma_Bd* BdPtr, int Offset, u32 Word)
{
	if (XAxiDma_BdRead(BdPtr, XAXIDMA_BD_HAS_STSCNTRL_OFFSET) == 0) {
		xdbg_printf(XDBG_DEBUG_ERROR, "BdRingSetAppWord: no sts cntrl"
			"stream in hardware build, cannot set app word\r\n");
		return XST_INVALID_PARAM;
	}
	if ((Offset < 0) || (Offset > XAXIDMA_LAST_APPWORD)) {
		xdbg_printf(XDBG_DEBUG_ERROR, "BdRingSetAppWord: invalid"
			"offset %d",Offset);
		return XST_INVALID_PARAM;
	}
	XAxiDma_BdWrite(BdPtr, XAXIDMA_BD_USR0_OFFSET + Offset * 4, Word);
	return XST_SUCCESS;
}
int XAxiDma_BdSetAppWord ( XAxiDma_Bd * BdPtr , int Offset , u32 Word ) { if ( XAxiDma_BdRead ( BdPtr , XAXIDMA_BD_HAS_STSCNTRL_OFFSET ) == 0 ) { xdbg_printf ( XDBG_DEBUG_ERROR , " " " \r \n " ) ; return XST_INVALID_PARAM ; } if ( ( Offset < 0 ) || ( Offset > XAXIDMA_LAST_APPWORD ) ) { xdbg_printf ( XDBG_DEBUG_ERROR , " " " " , Offset ) ; return XST_INVALID_PARAM ; } XAxiDma_BdWrite ( BdPtr , XAXIDMA_BD_USR0_OFFSET + Offset * 4 , Word ) ; return XST_SUCCESS ; }
Set the APP word at the specified APP word offset for a BD.
Set the APP word at the specified APP word offset for a BD .