XilinxProcessorIPLib/drivers/v_hdmirx/src/xv_hdmirx_intr.c
static void HdmiRx_AudIntrHandler(XV_HdmiRx *InstancePtr)
{
    u32 Status;

    // Read Status register
    Status = XV_HdmiRx_ReadReg(InstancePtr->Config.BaseAddress, (XV_HDMIRX_AUD_STA_OFFSET));

    // Check for active stream event
    if ((Status) & (XV_HDMIRX_AUD_STA_ACT_EVT_MASK)) {

        // Clear event flag
        XV_HdmiRx_WriteReg(InstancePtr->Config.BaseAddress, (XV_HDMIRX_AUD_STA_OFFSET), (XV_HDMIRX_AUD_STA_ACT_EVT_MASK));

        InstancePtr->Stream.Audio.Active = (TRUE);
    }

    // Check for audio channel event
    if ((Status) & (XV_HDMIRX_AUD_STA_CH_EVT_MASK)) {

        // Clear event flag
        XV_HdmiRx_WriteReg(InstancePtr->Config.BaseAddress, (XV_HDMIRX_AUD_STA_OFFSET), (XV_HDMIRX_AUD_STA_CH_EVT_MASK));

        // Active channels
	switch ((Status >> XV_HDMIRX_AUD_STA_AUD_CH_SHIFT) &
			XV_HDMIRX_AUD_STA_AUD_CH_MASK) {
            // 32 channels
	case 6 :
		InstancePtr->Stream.Audio.Channels = 32;
		break;

	// 24 channels
	case 5 :
		InstancePtr->Stream.Audio.Channels = 24;
		break;

	// 12 channels
	case 4 :
		InstancePtr->Stream.Audio.Channels = 12;
		break;

	// 8 channels
	case 3 :
		InstancePtr->Stream.Audio.Channels = 8;
		break;

	// 6 channels
	case 2 :
		InstancePtr->Stream.Audio.Channels = 6;
		break;

	// 4 channels
	case 1 :
		InstancePtr->Stream.Audio.Channels = 4;
		break;

	// 2 channels
	default :
		InstancePtr->Stream.Audio.Channels = 2;
		break;
	}

        // Audio Format
        InstancePtr->AudFormat = (XV_HdmiRx_AudioFormatType)((Status >> XV_HDMIRX_AUD_STA_AUD_FMT_SHIFT) & XV_HDMIRX_AUD_STA_AUD_FMT_MASK);

        /* Callback */
        if (InstancePtr->IsAudCallbackSet) {
            InstancePtr->AudCallback(InstancePtr->AudRef);
        }
    }
}
/*****************************************************************************/
/**
*
* This function is the interrupt handler for the HDMI RX AUD peripheral.
*
* @param    InstancePtr is a pointer to the XV_HdmiRx core instance.
*
* @return   None.
*
* @note     None.
*
******************************************************************************/
This function is the interrupt handler for the HDMI RX AUD peripheral.
This function is the interrupt handler for the HDMI RX AUD peripheral .
static void HdmiRx_AudIntrHandler(XV_HdmiRx *InstancePtr)
{
    u32 Status;
    Status = XV_HdmiRx_ReadReg(InstancePtr->Config.BaseAddress, (XV_HDMIRX_AUD_STA_OFFSET));
    if ((Status) & (XV_HDMIRX_AUD_STA_ACT_EVT_MASK)) {
        XV_HdmiRx_WriteReg(InstancePtr->Config.BaseAddress, (XV_HDMIRX_AUD_STA_OFFSET), (XV_HDMIRX_AUD_STA_ACT_EVT_MASK));
        InstancePtr->Stream.Audio.Active = (TRUE);
    }
    if ((Status) & (XV_HDMIRX_AUD_STA_CH_EVT_MASK)) {
        XV_HdmiRx_WriteReg(InstancePtr->Config.BaseAddress, (XV_HDMIRX_AUD_STA_OFFSET), (XV_HDMIRX_AUD_STA_CH_EVT_MASK));
	switch ((Status >> XV_HDMIRX_AUD_STA_AUD_CH_SHIFT) &
			XV_HDMIRX_AUD_STA_AUD_CH_MASK) {
	case 6 :
		InstancePtr->Stream.Audio.Channels = 32;
		break;
	case 5 :
		InstancePtr->Stream.Audio.Channels = 24;
		break;
	case 4 :
		InstancePtr->Stream.Audio.Channels = 12;
		break;
	case 3 :
		InstancePtr->Stream.Audio.Channels = 8;
		break;
	case 2 :
		InstancePtr->Stream.Audio.Channels = 6;
		break;
	case 1 :
		InstancePtr->Stream.Audio.Channels = 4;
		break;
	default :
		InstancePtr->Stream.Audio.Channels = 2;
		break;
	}
        InstancePtr->AudFormat = (XV_HdmiRx_AudioFormatType)((Status >> XV_HDMIRX_AUD_STA_AUD_FMT_SHIFT) & XV_HDMIRX_AUD_STA_AUD_FMT_MASK);
        if (InstancePtr->IsAudCallbackSet) {
            InstancePtr->AudCallback(InstancePtr->AudRef);
        }
    }
}
static void HdmiRx_AudIntrHandler ( XV_HdmiRx * InstancePtr ) { u32 Status ; Status = XV_HdmiRx_ReadReg ( InstancePtr -> Config . BaseAddress , ( XV_HDMIRX_AUD_STA_OFFSET ) ) ; if ( ( Status ) & ( XV_HDMIRX_AUD_STA_ACT_EVT_MASK ) ) { XV_HdmiRx_WriteReg ( InstancePtr -> Config . BaseAddress , ( XV_HDMIRX_AUD_STA_OFFSET ) , ( XV_HDMIRX_AUD_STA_ACT_EVT_MASK ) ) ; InstancePtr -> Stream . Audio . Active = ( TRUE ) ; } if ( ( Status ) & ( XV_HDMIRX_AUD_STA_CH_EVT_MASK ) ) { XV_HdmiRx_WriteReg ( InstancePtr -> Config . BaseAddress , ( XV_HDMIRX_AUD_STA_OFFSET ) , ( XV_HDMIRX_AUD_STA_CH_EVT_MASK ) ) ; switch ( ( Status >> XV_HDMIRX_AUD_STA_AUD_CH_SHIFT ) & XV_HDMIRX_AUD_STA_AUD_CH_MASK ) { case 6 : InstancePtr -> Stream . Audio . Channels = 32 ; break ; case 5 : InstancePtr -> Stream . Audio . Channels = 24 ; break ; case 4 : InstancePtr -> Stream . Audio . Channels = 12 ; break ; case 3 : InstancePtr -> Stream . Audio . Channels = 8 ; break ; case 2 : InstancePtr -> Stream . Audio . Channels = 6 ; break ; case 1 : InstancePtr -> Stream . Audio . Channels = 4 ; break ; default : InstancePtr -> Stream . Audio . Channels = 2 ; break ; } InstancePtr -> AudFormat = ( XV_HdmiRx_AudioFormatType ) ( ( Status >> XV_HDMIRX_AUD_STA_AUD_FMT_SHIFT ) & XV_HDMIRX_AUD_STA_AUD_FMT_MASK ) ; if ( InstancePtr -> IsAudCallbackSet ) { InstancePtr -> AudCallback ( InstancePtr -> AudRef ) ; } } }
This function is the interrupt handler for the HDMI RX AUD peripheral.
This function is the interrupt handler for the HDMI RX AUD peripheral .
// Read Status register // Check for active stream event // Clear event flag // Check for audio channel event // Clear event flag // Active channels // 32 channels // 24 channels // 12 channels // 8 channels // 6 channels // 4 channels // 2 channels // Audio Format /* Callback */