XilinxProcessorIPLib/drivers/v_hdmirxss1/src/xv_hdmirxss1.c
void XV_HdmiRxSs1_ReportLinkQuality(XV_HdmiRxSs1 *InstancePtr)
{
	u8 Channel;
	u32 Errors;
	u16 Data = 0;

	if (InstancePtr->HdmiRx1Ptr->Stream.IsFrl != TRUE) {
		for (Channel = 0; Channel < 3; Channel++)
		{
			Errors = XV_HdmiRx1_GetLinkStatus(InstancePtr->HdmiRx1Ptr,
					Channel);

			xil_printf("Link quality channel %0d : ", Channel);

			if (Errors == 0) {
				xil_printf("excellent");
			}

			else if ((Errors > 0) && (Errors < 1024)) {
				xil_printf("good");
			}

			else if ((Errors > 1024) && (Errors < 16384)) {
				xil_printf("average");
			}

			else {
				xil_printf("bad");
			}

			xil_printf(" (%0d)\r\n", Errors);
		}
	} else {
		Data = XV_HdmiRx1_FrlDdcReadField(InstancePtr->HdmiRx1Ptr,
					(XV_HDMIRX1_SCDCFIELD_CH0_ERRCNT_MSB));
		xil_printf("Channel 0 CED: ");
		/* Valid only when the valid bit (0x80) is set */
		if (Data & 0x80) {
			Data &= 0x7F;
			Data = (Data << 8) |
					XV_HdmiRx1_FrlDdcReadField(InstancePtr->HdmiRx1Ptr,
					(XV_HDMIRX1_SCDCFIELD_CH0_ERRCNT_LSB));
			xil_printf("%d\r\n", Data);
		} else {
			xil_printf("Invalid\r\n", Data);
		}

		Data = XV_HdmiRx1_FrlDdcReadField(InstancePtr->HdmiRx1Ptr,
					(XV_HDMIRX1_SCDCFIELD_CH1_ERRCNT_MSB));
		xil_printf("Channel 1 CED: ");
		/* Valid only when the valid bit (0x80) is set */
		if (Data & 0x80) {
			Data &= 0x7F;
			Data = (Data << 8) |
					XV_HdmiRx1_FrlDdcReadField(InstancePtr->HdmiRx1Ptr,
					(XV_HDMIRX1_SCDCFIELD_CH1_ERRCNT_LSB));
			xil_printf("%d\r\n", Data);
		} else {
			xil_printf("Invalid\r\n", Data);
		}

		Data = XV_HdmiRx1_FrlDdcReadField(InstancePtr->HdmiRx1Ptr,
					(XV_HDMIRX1_SCDCFIELD_CH2_ERRCNT_MSB));
		xil_printf("Channel 2 CED: ");
		/* Valid only when the valid bit (0x80) is set */
		if (Data & 0x80) {
			Data &= 0x7F;
			Data = (Data << 8) |
					XV_HdmiRx1_FrlDdcReadField(InstancePtr->HdmiRx1Ptr,
					(XV_HDMIRX1_SCDCFIELD_CH2_ERRCNT_LSB));
			xil_printf("%d\r\n", Data);
		} else {
			xil_printf("Invalid\r\n", Data);
		}

		Data = XV_HdmiRx1_FrlDdcReadField(InstancePtr->HdmiRx1Ptr,
					(XV_HDMIRX1_SCDCFIELD_CH3_ERRCNT_MSB));
		xil_printf("Channel 3 CED: ");
		/* Valid only when the valid bit (0x80) is set */
		if (Data & 0x80) {
			Data &= 0x7F;
			Data = (Data << 8) |
					XV_HdmiRx1_FrlDdcReadField(InstancePtr->HdmiRx1Ptr,
					(XV_HDMIRX1_SCDCFIELD_CH3_ERRCNT_LSB));
			xil_printf("%d\r\n", Data);
		} else {
			xil_printf("Invalid\r\n", Data);
		}

		Data = XV_HdmiRx1_FrlDdcReadField(InstancePtr->HdmiRx1Ptr,
					(XV_HDMIRX1_SCDCFIELD_RSCCNT_MSB));
		xil_printf("RSED: ");
		/* Valid only when the valid bit (0x80) is set */
		if (Data & 0x80) {
			Data &= 0x7F;
			Data = (Data << 8) |
					XV_HdmiRx1_FrlDdcReadField(InstancePtr->HdmiRx1Ptr,
					(XV_HDMIRX1_SCDCFIELD_RSCCNT_LSB));
			xil_printf("%d\r\n", Data);
		} else {
			xil_printf("Invalid\r\n", Data);
		}
	}

	xil_printf("\r\n");

	/* Clear link error counters */
	XV_HdmiRx1_ClearLinkStatus(InstancePtr->HdmiRx1Ptr);
}
/*****************************************************************************/
/**
*
* This function reports the link quality based on the link error counter
*
* @param  None.
*
* @return None.
*
* @note   None.
*
******************************************************************************/
This function reports the link quality based on the link error counter
This function reports the link quality based on the link error counter
void XV_HdmiRxSs1_ReportLinkQuality(XV_HdmiRxSs1 *InstancePtr)
{
	u8 Channel;
	u32 Errors;
	u16 Data = 0;
	if (InstancePtr->HdmiRx1Ptr->Stream.IsFrl != TRUE) {
		for (Channel = 0; Channel < 3; Channel++)
		{
			Errors = XV_HdmiRx1_GetLinkStatus(InstancePtr->HdmiRx1Ptr,
					Channel);
			xil_printf("Link quality channel %0d : ", Channel);
			if (Errors == 0) {
				xil_printf("excellent");
			}
			else if ((Errors > 0) && (Errors < 1024)) {
				xil_printf("good");
			}
			else if ((Errors > 1024) && (Errors < 16384)) {
				xil_printf("average");
			}
			else {
				xil_printf("bad");
			}
			xil_printf(" (%0d)\r\n", Errors);
		}
	} else {
		Data = XV_HdmiRx1_FrlDdcReadField(InstancePtr->HdmiRx1Ptr,
					(XV_HDMIRX1_SCDCFIELD_CH0_ERRCNT_MSB));
		xil_printf("Channel 0 CED: ");
		if (Data & 0x80) {
			Data &= 0x7F;
			Data = (Data << 8) |
					XV_HdmiRx1_FrlDdcReadField(InstancePtr->HdmiRx1Ptr,
					(XV_HDMIRX1_SCDCFIELD_CH0_ERRCNT_LSB));
			xil_printf("%d\r\n", Data);
		} else {
			xil_printf("Invalid\r\n", Data);
		}
		Data = XV_HdmiRx1_FrlDdcReadField(InstancePtr->HdmiRx1Ptr,
					(XV_HDMIRX1_SCDCFIELD_CH1_ERRCNT_MSB));
		xil_printf("Channel 1 CED: ");
		if (Data & 0x80) {
			Data &= 0x7F;
			Data = (Data << 8) |
					XV_HdmiRx1_FrlDdcReadField(InstancePtr->HdmiRx1Ptr,
					(XV_HDMIRX1_SCDCFIELD_CH1_ERRCNT_LSB));
			xil_printf("%d\r\n", Data);
		} else {
			xil_printf("Invalid\r\n", Data);
		}
		Data = XV_HdmiRx1_FrlDdcReadField(InstancePtr->HdmiRx1Ptr,
					(XV_HDMIRX1_SCDCFIELD_CH2_ERRCNT_MSB));
		xil_printf("Channel 2 CED: ");
		if (Data & 0x80) {
			Data &= 0x7F;
			Data = (Data << 8) |
					XV_HdmiRx1_FrlDdcReadField(InstancePtr->HdmiRx1Ptr,
					(XV_HDMIRX1_SCDCFIELD_CH2_ERRCNT_LSB));
			xil_printf("%d\r\n", Data);
		} else {
			xil_printf("Invalid\r\n", Data);
		}
		Data = XV_HdmiRx1_FrlDdcReadField(InstancePtr->HdmiRx1Ptr,
					(XV_HDMIRX1_SCDCFIELD_CH3_ERRCNT_MSB));
		xil_printf("Channel 3 CED: ");
		if (Data & 0x80) {
			Data &= 0x7F;
			Data = (Data << 8) |
					XV_HdmiRx1_FrlDdcReadField(InstancePtr->HdmiRx1Ptr,
					(XV_HDMIRX1_SCDCFIELD_CH3_ERRCNT_LSB));
			xil_printf("%d\r\n", Data);
		} else {
			xil_printf("Invalid\r\n", Data);
		}
		Data = XV_HdmiRx1_FrlDdcReadField(InstancePtr->HdmiRx1Ptr,
					(XV_HDMIRX1_SCDCFIELD_RSCCNT_MSB));
		xil_printf("RSED: ");
		if (Data & 0x80) {
			Data &= 0x7F;
			Data = (Data << 8) |
					XV_HdmiRx1_FrlDdcReadField(InstancePtr->HdmiRx1Ptr,
					(XV_HDMIRX1_SCDCFIELD_RSCCNT_LSB));
			xil_printf("%d\r\n", Data);
		} else {
			xil_printf("Invalid\r\n", Data);
		}
	}
	xil_printf("\r\n");
	XV_HdmiRx1_ClearLinkStatus(InstancePtr->HdmiRx1Ptr);
}
void XV_HdmiRxSs1_ReportLinkQuality ( XV_HdmiRxSs1 * InstancePtr ) { u8 Channel ; u32 Errors ; u16 Data = 0 ; if ( InstancePtr -> HdmiRx1Ptr -> Stream . IsFrl != TRUE ) { for ( Channel = 0 ; Channel < 3 ; Channel ++ ) { Errors = XV_HdmiRx1_GetLinkStatus ( InstancePtr -> HdmiRx1Ptr , Channel ) ; xil_printf ( " " , Channel ) ; if ( Errors == 0 ) { xil_printf ( " " ) ; } else if ( ( Errors > 0 ) && ( Errors < 1024 ) ) { xil_printf ( " " ) ; } else if ( ( Errors > 1024 ) && ( Errors < 16384 ) ) { xil_printf ( " " ) ; } else { xil_printf ( " " ) ; } xil_printf ( " \r \n " , Errors ) ; } } else { Data = XV_HdmiRx1_FrlDdcReadField ( InstancePtr -> HdmiRx1Ptr , ( XV_HDMIRX1_SCDCFIELD_CH0_ERRCNT_MSB ) ) ; xil_printf ( " " ) ; if ( Data & 0x80 ) { Data &= 0x7F ; Data = ( Data << 8 ) | XV_HdmiRx1_FrlDdcReadField ( InstancePtr -> HdmiRx1Ptr , ( XV_HDMIRX1_SCDCFIELD_CH0_ERRCNT_LSB ) ) ; xil_printf ( " \r \n " , Data ) ; } else { xil_printf ( " \r \n " , Data ) ; } Data = XV_HdmiRx1_FrlDdcReadField ( InstancePtr -> HdmiRx1Ptr , ( XV_HDMIRX1_SCDCFIELD_CH1_ERRCNT_MSB ) ) ; xil_printf ( " " ) ; if ( Data & 0x80 ) { Data &= 0x7F ; Data = ( Data << 8 ) | XV_HdmiRx1_FrlDdcReadField ( InstancePtr -> HdmiRx1Ptr , ( XV_HDMIRX1_SCDCFIELD_CH1_ERRCNT_LSB ) ) ; xil_printf ( " \r \n " , Data ) ; } else { xil_printf ( " \r \n " , Data ) ; } Data = XV_HdmiRx1_FrlDdcReadField ( InstancePtr -> HdmiRx1Ptr , ( XV_HDMIRX1_SCDCFIELD_CH2_ERRCNT_MSB ) ) ; xil_printf ( " " ) ; if ( Data & 0x80 ) { Data &= 0x7F ; Data = ( Data << 8 ) | XV_HdmiRx1_FrlDdcReadField ( InstancePtr -> HdmiRx1Ptr , ( XV_HDMIRX1_SCDCFIELD_CH2_ERRCNT_LSB ) ) ; xil_printf ( " \r \n " , Data ) ; } else { xil_printf ( " \r \n " , Data ) ; } Data = XV_HdmiRx1_FrlDdcReadField ( InstancePtr -> HdmiRx1Ptr , ( XV_HDMIRX1_SCDCFIELD_CH3_ERRCNT_MSB ) ) ; xil_printf ( " " ) ; if ( Data & 0x80 ) { Data &= 0x7F ; Data = ( Data << 8 ) | XV_HdmiRx1_FrlDdcReadField ( InstancePtr -> HdmiRx1Ptr , ( XV_HDMIRX1_SCDCFIELD_CH3_ERRCNT_LSB ) ) ; xil_printf ( " \r \n " , Data ) ; } else { xil_printf ( " \r \n " , Data ) ; } Data = XV_HdmiRx1_FrlDdcReadField ( InstancePtr -> HdmiRx1Ptr , ( XV_HDMIRX1_SCDCFIELD_RSCCNT_MSB ) ) ; xil_printf ( " " ) ; if ( Data & 0x80 ) { Data &= 0x7F ; Data = ( Data << 8 ) | XV_HdmiRx1_FrlDdcReadField ( InstancePtr -> HdmiRx1Ptr , ( XV_HDMIRX1_SCDCFIELD_RSCCNT_LSB ) ) ; xil_printf ( " \r \n " , Data ) ; } else { xil_printf ( " \r \n " , Data ) ; } } xil_printf ( " \r \n " ) ; XV_HdmiRx1_ClearLinkStatus ( InstancePtr -> HdmiRx1Ptr ) ; }
This function reports the link quality based on the link error counter
This function reports the link quality based on the link error counter
/* Valid only when the valid bit (0x80) is set */ /* Valid only when the valid bit (0x80) is set */ /* Valid only when the valid bit (0x80) is set */ /* Valid only when the valid bit (0x80) is set */ /* Valid only when the valid bit (0x80) is set */ /* Clear link error counters */