XilinxProcessorIPLib/drivers/hdcp1x/src/xhdcp1x_port_hdmi_rx.c
static int XHdcp1x_PortHdmiRxRead(const XHdcp1x *InstancePtr, u8 Offset,
		void *Buf, u32 BufSize)
{
	u32 NumLeft = BufSize;
	u8 *ReadBuf = Buf;

	/* Verify arguments. */
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(Buf != NULL);

	/* Truncate if necessary */
	if ((BufSize + Offset) > 0x100u) {
		BufSize = (0x100u - Offset);
	}

	/* Write the offset */
	if (InstancePtr->Rx.IsDdcSetAddressCallbackSet) {
		InstancePtr->Rx.DdcSetAddressCallback(
		    InstancePtr->Rx.DdcSetAddressCallbackRef, Offset);
	}

	/* Read the buffer */
	while (NumLeft-- > 0) {
		if (InstancePtr->Rx.IsDdcGetDataCallbackSet) {
			*ReadBuf++ = InstancePtr->Rx.DdcGetDataCallback(
			    InstancePtr->Rx.DdcGetDataCallbackRef);
		}
	}

	return ((int)BufSize);
}
/*****************************************************************************/
/**
* This function reads a register from a HDCP port device.
*
* @param	InstancePtr is the device to read from.
* @param	Offset is the offset to start reading from.
* @param	Buf is the buffer to copy the data read.
* @param	BufSize is the size of the buffer.
*
* @return	The number of bytes read.
*
* @note		None.
*
******************************************************************************/
This function reads a register from a HDCP port device.
This function reads a register from a HDCP port device .
static int XHdcp1x_PortHdmiRxRead(const XHdcp1x *InstancePtr, u8 Offset,
		void *Buf, u32 BufSize)
{
	u32 NumLeft = BufSize;
	u8 *ReadBuf = Buf;
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(Buf != NULL);
	if ((BufSize + Offset) > 0x100u) {
		BufSize = (0x100u - Offset);
	}
	if (InstancePtr->Rx.IsDdcSetAddressCallbackSet) {
		InstancePtr->Rx.DdcSetAddressCallback(
		    InstancePtr->Rx.DdcSetAddressCallbackRef, Offset);
	}
	while (NumLeft-- > 0) {
		if (InstancePtr->Rx.IsDdcGetDataCallbackSet) {
			*ReadBuf++ = InstancePtr->Rx.DdcGetDataCallback(
			    InstancePtr->Rx.DdcGetDataCallbackRef);
		}
	}
	return ((int)BufSize);
}
static int XHdcp1x_PortHdmiRxRead ( const XHdcp1x * InstancePtr , u8 Offset , void * Buf , u32 BufSize ) { u32 NumLeft = BufSize ; u8 * ReadBuf = Buf ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( Buf != NULL ) ; if ( ( BufSize + Offset ) > 0x100u ) { BufSize = ( 0x100u - Offset ) ; } if ( InstancePtr -> Rx . IsDdcSetAddressCallbackSet ) { InstancePtr -> Rx . DdcSetAddressCallback ( InstancePtr -> Rx . DdcSetAddressCallbackRef , Offset ) ; } while ( NumLeft -- > 0 ) { if ( InstancePtr -> Rx . IsDdcGetDataCallbackSet ) { * ReadBuf ++ = InstancePtr -> Rx . DdcGetDataCallback ( InstancePtr -> Rx . DdcGetDataCallbackRef ) ; } } return ( ( int ) BufSize ) ; }
This function reads a register from a HDCP port device.
This function reads a register from a HDCP port device .
/* Verify arguments. */ /* Truncate if necessary */ /* Write the offset */ /* Read the buffer */