XilinxProcessorIPLib/drivers/v_hdmirxss/src/xv_hdmirxss_hdcp.c
int XV_HdmiRxSs_HdcpTimerStart(void *InstancePtr, u16 TimeoutInMs)
{
  XHdcp1x *HdcpPtr = (XHdcp1x *)InstancePtr;
  XTmrCtr *TimerPtr = (XTmrCtr *)HdcpPtr->Hdcp1xRef;

  u8 TimerChannel = 0;
  u32 TimerOptions = 0;
  u32 NumTicks = 0;

  /* Verify argument. */
  Xil_AssertNonvoid(TimerPtr != NULL);

  /* Determine NumTicks */
  NumTicks = XV_HdmiRxSs_HdcpTimerConvUsToTicks((TimeoutInMs*1000ul),
        TimerPtr->Config.SysClockFreqHz);

  /* Stop it */
  XTmrCtr_Stop(TimerPtr, TimerChannel);

  /* Configure the callback */
  XTmrCtr_SetHandler(TimerPtr, &XV_HdmiRxSs_HdcpTimerCallback,
                                              (void*) InstancePtr);

  /* Configure the timer options */
  TimerOptions  = XTmrCtr_GetOptions(TimerPtr, TimerChannel);
  TimerOptions |=  XTC_DOWN_COUNT_OPTION;
  TimerOptions |=  XTC_INT_MODE_OPTION;
  TimerOptions &= ~XTC_AUTO_RELOAD_OPTION;
  XTmrCtr_SetOptions(TimerPtr, TimerChannel, TimerOptions);

  /* Set the timeout and start */
  XTmrCtr_SetResetValue(TimerPtr, TimerChannel, NumTicks);
  XTmrCtr_Start(TimerPtr, TimerChannel);

  return (XST_SUCCESS);
}
/******************************************************************************/
/**
*
* This function starts a timer on behalf of an hdcp interface
*
* @param InstancePtr  the hdcp interface
* @param TimeoutInMs  the timer duration in milliseconds
*
* @return
*   XST_SUCCESS if successful
*
* @note
*   None.
*
******************************************************************************/
This function starts a timer on behalf of an hdcp interface
This function starts a timer on behalf of an hdcp interface
int XV_HdmiRxSs_HdcpTimerStart(void *InstancePtr, u16 TimeoutInMs)
{
  XHdcp1x *HdcpPtr = (XHdcp1x *)InstancePtr;
  XTmrCtr *TimerPtr = (XTmrCtr *)HdcpPtr->Hdcp1xRef;
  u8 TimerChannel = 0;
  u32 TimerOptions = 0;
  u32 NumTicks = 0;
  Xil_AssertNonvoid(TimerPtr != NULL);
  NumTicks = XV_HdmiRxSs_HdcpTimerConvUsToTicks((TimeoutInMs*1000ul),
        TimerPtr->Config.SysClockFreqHz);
  XTmrCtr_Stop(TimerPtr, TimerChannel);
  XTmrCtr_SetHandler(TimerPtr, &XV_HdmiRxSs_HdcpTimerCallback,
                                              (void*) InstancePtr);
  TimerOptions  = XTmrCtr_GetOptions(TimerPtr, TimerChannel);
  TimerOptions |=  XTC_DOWN_COUNT_OPTION;
  TimerOptions |=  XTC_INT_MODE_OPTION;
  TimerOptions &= ~XTC_AUTO_RELOAD_OPTION;
  XTmrCtr_SetOptions(TimerPtr, TimerChannel, TimerOptions);
  XTmrCtr_SetResetValue(TimerPtr, TimerChannel, NumTicks);
  XTmrCtr_Start(TimerPtr, TimerChannel);
  return (XST_SUCCESS);
}
int XV_HdmiRxSs_HdcpTimerStart ( void * InstancePtr , u16 TimeoutInMs ) { XHdcp1x * HdcpPtr = ( XHdcp1x * ) InstancePtr ; XTmrCtr * TimerPtr = ( XTmrCtr * ) HdcpPtr -> Hdcp1xRef ; u8 TimerChannel = 0 ; u32 TimerOptions = 0 ; u32 NumTicks = 0 ; Xil_AssertNonvoid ( TimerPtr != NULL ) ; NumTicks = XV_HdmiRxSs_HdcpTimerConvUsToTicks ( ( TimeoutInMs * 1000ul ) , TimerPtr -> Config . SysClockFreqHz ) ; XTmrCtr_Stop ( TimerPtr , TimerChannel ) ; XTmrCtr_SetHandler ( TimerPtr , & XV_HdmiRxSs_HdcpTimerCallback , ( void * ) InstancePtr ) ; TimerOptions = XTmrCtr_GetOptions ( TimerPtr , TimerChannel ) ; TimerOptions |= XTC_DOWN_COUNT_OPTION ; TimerOptions |= XTC_INT_MODE_OPTION ; TimerOptions &= ~ XTC_AUTO_RELOAD_OPTION ; XTmrCtr_SetOptions ( TimerPtr , TimerChannel , TimerOptions ) ; XTmrCtr_SetResetValue ( TimerPtr , TimerChannel , NumTicks ) ; XTmrCtr_Start ( TimerPtr , TimerChannel ) ; return ( XST_SUCCESS ) ; }
This function starts a timer on behalf of an hdcp interface
This function starts a timer on behalf of an hdcp interface
/* Verify argument. */ /* Determine NumTicks */ /* Stop it */ /* Configure the callback */ /* Configure the timer options */ /* Set the timeout and start */