/* This function initializes clock module used for card clock generation.  */
static uint32_t smartcard_phy_emvsim_InterfaceClockInit(EMVSIM_Type *base, const smartcard_interface_config_t *config, uint32_t srcClock_Hz)
/* This function initializes clock module used for card clock generation.  */
static uint32_t smartcard_phy_emvsim_InterfaceClockInit(EMVSIM_Type *base, const smartcard_interface_config_t *config, uint32_t srcClock_Hz)
{
    assert((NULL != config) && (0u != srcClock_Hz));
    uint32_t emvsimClkMhz = 0u;
    uint8_t emvsimPRSCValue;
    emvsimClkMhz = srcClock_Hz / 1000000u;
    emvsimPRSCValue = (uint8_t)((emvsimClkMhz * 1000u) / (config->smartCardClock / 1000u));
    base->CLKCFG = (base->CLKCFG & ~EMVSIM_CLKCFG_CLK_PRSC_MASK) | EMVSIM_CLKCFG_CLK_PRSC(emvsimPRSCValue);
    return config->smartCardClock;
}