XilinxProcessorIPLib/drivers/audio_formatter/src/xaudioformatter.c
void XSdiAud_GetChStat(XAudioFormatter *InstancePtr, u8 *ChStatBuf)
{
	u32 offset;
	u32 RegOffset;
	u32 *pBuf32 = (u32 *) ChStatBuf;
	u8 NumBytes = XAUD_CHSTAT_NUMBER_OF_BYTES;

	Xil_AssertVoid(InstancePtr != NULL);
	Xil_AssertVoid(ChStatBuf != NULL);

	if (InstancePtr->ChannelId == XAudioFormatter_S2MM) {
		offset = XAUD_FORMATTER_S2MM_OFFSET;
	}
	if (InstancePtr->ChannelId == XAudioFormatter_MM2S) {
		offset = XAUD_FORMATTER_MM2S_OFFSET;
	}
	RegOffset = XAUD_FORMATTER_CH_STS_START + offset;
	for (int i = 0; i < NumBytes; i += 4) {
		*pBuf32 = XAudioFormatter_ReadReg(
			InstancePtr->Config.BaseAddress, RegOffset);
		pBuf32++;
		RegOffset += 4;
	}
}
/*****************************************************************************/
/**
 ** This function reads all the Channel Status registers and writes to a buffer
 **
 ** @param  InstancePtr is a pointer to the Audio Formatter instance.
 ** @param  ChStatBuf is a pointer to a buffer.
 **
 ** @return None.
 **
 *******************************************************************************/
This function reads all the Channel Status registers and writes to a buffer
@param  InstancePtr is a pointer to the Audio Formatter instance.
@param  ChStatBuf is a pointer to a buffer.

@return None.
This function reads all the Channel Status registers and writes to a buffer @param InstancePtr is a pointer to the Audio Formatter instance . @param ChStatBuf is a pointer to a buffer . @return None .
void XSdiAud_GetChStat(XAudioFormatter *InstancePtr, u8 *ChStatBuf)
{
	u32 offset;
	u32 RegOffset;
	u32 *pBuf32 = (u32 *) ChStatBuf;
	u8 NumBytes = XAUD_CHSTAT_NUMBER_OF_BYTES;
	Xil_AssertVoid(InstancePtr != NULL);
	Xil_AssertVoid(ChStatBuf != NULL);
	if (InstancePtr->ChannelId == XAudioFormatter_S2MM) {
		offset = XAUD_FORMATTER_S2MM_OFFSET;
	}
	if (InstancePtr->ChannelId == XAudioFormatter_MM2S) {
		offset = XAUD_FORMATTER_MM2S_OFFSET;
	}
	RegOffset = XAUD_FORMATTER_CH_STS_START + offset;
	for (int i = 0; i < NumBytes; i += 4) {
		*pBuf32 = XAudioFormatter_ReadReg(
			InstancePtr->Config.BaseAddress, RegOffset);
		pBuf32++;
		RegOffset += 4;
	}
}
void XSdiAud_GetChStat ( XAudioFormatter * InstancePtr , u8 * ChStatBuf ) { u32 offset ; u32 RegOffset ; u32 * pBuf32 = ( u32 * ) ChStatBuf ; u8 NumBytes = XAUD_CHSTAT_NUMBER_OF_BYTES ; Xil_AssertVoid ( InstancePtr != NULL ) ; Xil_AssertVoid ( ChStatBuf != NULL ) ; if ( InstancePtr -> ChannelId == XAudioFormatter_S2MM ) { offset = XAUD_FORMATTER_S2MM_OFFSET ; } if ( InstancePtr -> ChannelId == XAudioFormatter_MM2S ) { offset = XAUD_FORMATTER_MM2S_OFFSET ; } RegOffset = XAUD_FORMATTER_CH_STS_START + offset ; for ( int i = 0 ; i < NumBytes ; i += 4 ) { * pBuf32 = XAudioFormatter_ReadReg ( InstancePtr -> Config . BaseAddress , RegOffset ) ; pBuf32 ++ ; RegOffset += 4 ; } }
This function reads all the Channel Status registers and writes to a buffer
 @param  InstancePtr is a pointer to the Audio Formatter instance.
This function reads all the Channel Status registers and writes to a buffer @param InstancePtr is a pointer to the Audio Formatter instance .