XilinxProcessorIPLib/drivers/v_hdmitxss/src/xv_hdmitxss.c
void XV_HdmiTxSs_SendAuxInfoframe(XV_HdmiTxSs *InstancePtr, void *Aux)
{
  u8 Index;
  u8 Crc;
  XHdmiC_Aux *tx_aux = (XHdmiC_Aux *)Aux;

  if (Aux == (NULL)) {
      /* Header, Packet type */
      InstancePtr->HdmiTxPtr->Aux.Header.Byte[0] = 0x84;

      /* Version */
      InstancePtr->HdmiTxPtr->Aux.Header.Byte[1] = 0x01;

      /* Length */
      InstancePtr->HdmiTxPtr->Aux.Header.Byte[2] = 10;

      /* Checksum (this will be calculated by the HDMI TX IP) */
      InstancePtr->HdmiTxPtr->Aux.Header.Byte[3] = 0;

      /* 2 Channel count. Audio coding type refer to stream */
      InstancePtr->HdmiTxPtr->Aux.Data.Byte[1] = 0x1;

      for (Index = 2; Index < 32; Index++) {
        InstancePtr->HdmiTxPtr->Aux.Data.Byte[Index] = 0;
      }

      /* Calculate AVI infoframe checksum */
      Crc = 0;

      /* Header */
      for (Index = 0; Index < 3; Index++) {
        Crc += InstancePtr->HdmiTxPtr->Aux.Header.Byte[Index];
      }

      /* Data */
      for (Index = 1; Index < 5; Index++) {
        Crc += InstancePtr->HdmiTxPtr->Aux.Data.Byte[Index];
      }

      Crc = 256 - Crc;
      InstancePtr->HdmiTxPtr->Aux.Data.Byte[0] = Crc;

      XV_HdmiTx_AuxSend(InstancePtr->HdmiTxPtr);

  }

  else {
      // Copy Audio Infoframe
      if (tx_aux->Header.Byte[0] == 0x84) {
        // Header
        InstancePtr->HdmiTxPtr->Aux.Header.Data = tx_aux->Header.Data;

        // Data
        for (Index = 0; Index < 8; Index++) {
          InstancePtr->HdmiTxPtr->Aux.Data.Data[Index] =
            tx_aux->Data.Data[Index];
        }
      }
  }

  /* Send packet */
  XV_HdmiTx_AuxSend(InstancePtr->HdmiTxPtr);
}
/*****************************************************************************/
/**
*
* This function sends audio info frames.
*
* @param  None.
*
* @return None.
*
* @note   None.
*
******************************************************************************/
This function sends audio info frames.
This function sends audio info frames .
void XV_HdmiTxSs_SendAuxInfoframe(XV_HdmiTxSs *InstancePtr, void *Aux)
{
  u8 Index;
  u8 Crc;
  XHdmiC_Aux *tx_aux = (XHdmiC_Aux *)Aux;
  if (Aux == (NULL)) {
      InstancePtr->HdmiTxPtr->Aux.Header.Byte[0] = 0x84;
      InstancePtr->HdmiTxPtr->Aux.Header.Byte[1] = 0x01;
      InstancePtr->HdmiTxPtr->Aux.Header.Byte[2] = 10;
      InstancePtr->HdmiTxPtr->Aux.Header.Byte[3] = 0;
      InstancePtr->HdmiTxPtr->Aux.Data.Byte[1] = 0x1;
      for (Index = 2; Index < 32; Index++) {
        InstancePtr->HdmiTxPtr->Aux.Data.Byte[Index] = 0;
      }
      Crc = 0;
      for (Index = 0; Index < 3; Index++) {
        Crc += InstancePtr->HdmiTxPtr->Aux.Header.Byte[Index];
      }
      for (Index = 1; Index < 5; Index++) {
        Crc += InstancePtr->HdmiTxPtr->Aux.Data.Byte[Index];
      }
      Crc = 256 - Crc;
      InstancePtr->HdmiTxPtr->Aux.Data.Byte[0] = Crc;
      XV_HdmiTx_AuxSend(InstancePtr->HdmiTxPtr);
  }
  else {
      if (tx_aux->Header.Byte[0] == 0x84) {
        InstancePtr->HdmiTxPtr->Aux.Header.Data = tx_aux->Header.Data;
        for (Index = 0; Index < 8; Index++) {
          InstancePtr->HdmiTxPtr->Aux.Data.Data[Index] =
            tx_aux->Data.Data[Index];
        }
      }
  }
  XV_HdmiTx_AuxSend(InstancePtr->HdmiTxPtr);
}
void XV_HdmiTxSs_SendAuxInfoframe ( XV_HdmiTxSs * InstancePtr , void * Aux ) { u8 Index ; u8 Crc ; XHdmiC_Aux * tx_aux = ( XHdmiC_Aux * ) Aux ; if ( Aux == ( NULL ) ) { InstancePtr -> HdmiTxPtr -> Aux . Header . Byte [ 0 ] = 0x84 ; InstancePtr -> HdmiTxPtr -> Aux . Header . Byte [ 1 ] = 0x01 ; InstancePtr -> HdmiTxPtr -> Aux . Header . Byte [ 2 ] = 10 ; InstancePtr -> HdmiTxPtr -> Aux . Header . Byte [ 3 ] = 0 ; InstancePtr -> HdmiTxPtr -> Aux . Data . Byte [ 1 ] = 0x1 ; for ( Index = 2 ; Index < 32 ; Index ++ ) { InstancePtr -> HdmiTxPtr -> Aux . Data . Byte [ Index ] = 0 ; } Crc = 0 ; for ( Index = 0 ; Index < 3 ; Index ++ ) { Crc += InstancePtr -> HdmiTxPtr -> Aux . Header . Byte [ Index ] ; } for ( Index = 1 ; Index < 5 ; Index ++ ) { Crc += InstancePtr -> HdmiTxPtr -> Aux . Data . Byte [ Index ] ; } Crc = 256 - Crc ; InstancePtr -> HdmiTxPtr -> Aux . Data . Byte [ 0 ] = Crc ; XV_HdmiTx_AuxSend ( InstancePtr -> HdmiTxPtr ) ; } else { if ( tx_aux -> Header . Byte [ 0 ] == 0x84 ) { InstancePtr -> HdmiTxPtr -> Aux . Header . Data = tx_aux -> Header . Data ; for ( Index = 0 ; Index < 8 ; Index ++ ) { InstancePtr -> HdmiTxPtr -> Aux . Data . Data [ Index ] = tx_aux -> Data . Data [ Index ] ; } } } XV_HdmiTx_AuxSend ( InstancePtr -> HdmiTxPtr ) ; }
This function sends audio info frames.
This function sends audio info frames .
/* Header, Packet type */ /* Version */ /* Length */ /* Checksum (this will be calculated by the HDMI TX IP) */ /* 2 Channel count. Audio coding type refer to stream */ /* Calculate AVI infoframe checksum */ /* Header */ /* Data */ // Copy Audio Infoframe // Header // Data /* Send packet */