/* Covert the external timing nanosecond to internal clock cycle.  */
static uint8_t SEMC_ConvertTiming(uint32_t time_ns, uint32_t clkSrc_Hz)
/* Covert the external timing nanosecond to internal clock cycle.  */
static uint8_t SEMC_ConvertTiming(uint32_t time_ns, uint32_t clkSrc_Hz)
{
    assert(clkSrc_Hz > 0x00UL);
    uint8_t clockCycles = 0;
    uint32_t tClk_us;
    clkSrc_Hz /= 1000000UL;
    tClk_us = 1000000UL / clkSrc_Hz;
    while ((tClk_us * clockCycles) < (time_ns * 1000UL))
    {
        clockCycles++;
    }
    return (clockCycles - 1U);
}