XilinxProcessorIPLib/drivers/v_hdmitxss1/src/xv_hdmitxss1_hdcp.c
static u32 XV_HdmiTxSs1_HdcpTimerConvUsToTicks(u32 TimeoutInUs,
                                                    u32 ClockFrequency)
{
    u32 TimeoutFreq = 0;
    u32 NumTicks = 0;

    /* Check for greater than one second */
    if (TimeoutInUs > 1000000ul) {
        u32 NumSeconds = 0;

        /* Determine theNumSeconds */
        NumSeconds = (TimeoutInUs/1000000ul);

        /* Update theNumTicks */
        NumTicks = (NumSeconds*ClockFrequency);

        /* Adjust theTimeoutInUs */
        TimeoutInUs -= (NumSeconds*1000000ul);
    }

    /* Convert TimeoutFreq to a frequency */
    TimeoutFreq  = 1000;
    TimeoutFreq *= 1000;
    TimeoutFreq /= TimeoutInUs;

    /* Update NumTicks */
    NumTicks += ((ClockFrequency / TimeoutFreq) + 1);

    return (NumTicks);
}
/******************************************************************************/
/**
*
* This function converts from microseconds to timer ticks
*
* @param TimeoutInUs  the timeout to convert
* @param ClockFrequency  the clock frequency to use in the conversion
*
* @return
*   The number of "ticks"
*
* @note
*   None.
*
******************************************************************************/
This function converts from microseconds to timer ticks
This function converts from microseconds to timer ticks
static u32 XV_HdmiTxSs1_HdcpTimerConvUsToTicks(u32 TimeoutInUs,
                                                    u32 ClockFrequency)
{
    u32 TimeoutFreq = 0;
    u32 NumTicks = 0;
    if (TimeoutInUs > 1000000ul) {
        u32 NumSeconds = 0;
        NumSeconds = (TimeoutInUs/1000000ul);
        NumTicks = (NumSeconds*ClockFrequency);
        TimeoutInUs -= (NumSeconds*1000000ul);
    }
    TimeoutFreq  = 1000;
    TimeoutFreq *= 1000;
    TimeoutFreq /= TimeoutInUs;
    NumTicks += ((ClockFrequency / TimeoutFreq) + 1);
    return (NumTicks);
}
static u32 XV_HdmiTxSs1_HdcpTimerConvUsToTicks ( u32 TimeoutInUs , u32 ClockFrequency ) { u32 TimeoutFreq = 0 ; u32 NumTicks = 0 ; if ( TimeoutInUs > 1000000ul ) { u32 NumSeconds = 0 ; NumSeconds = ( TimeoutInUs / 1000000ul ) ; NumTicks = ( NumSeconds * ClockFrequency ) ; TimeoutInUs -= ( NumSeconds * 1000000ul ) ; } TimeoutFreq = 1000 ; TimeoutFreq *= 1000 ; TimeoutFreq /= TimeoutInUs ; NumTicks += ( ( ClockFrequency / TimeoutFreq ) + 1 ) ; return ( NumTicks ) ; }
This function converts from microseconds to timer ticks
This function converts from microseconds to timer ticks
/* Check for greater than one second */ /* Determine theNumSeconds */ /* Update theNumTicks */ /* Adjust theTimeoutInUs */ /* Convert TimeoutFreq to a frequency */ /* Update NumTicks */