/* param base ENET peripheral base address. param srcClock_Hz This is the ENET module clock frequency. See clock distribution. param isPreambleDisabled The preamble disable flag. */
void ENET_SetSMI(ENET_Type *base, uint32_t srcClock_Hz, bool isPreambleDisabled)
/* param base ENET peripheral base address. param srcClock_Hz This is the ENET module clock frequency. See clock distribution. param isPreambleDisabled The preamble disable flag. */
void ENET_SetSMI(ENET_Type *base, uint32_t srcClock_Hz, bool isPreambleDisabled)
{
    assert((srcClock_Hz != 0U) && (srcClock_Hz <= 320000000U));
    uint32_t clkCycle = 0;
    uint32_t speed    = 0;
    uint32_t mscr     = 0;
    speed = (srcClock_Hz + 2U * ENET_MDC_FREQUENCY - 1U) / (2U * ENET_MDC_FREQUENCY) - 1U;
    clkCycle = (10U + ENET_NANOSECOND_ONE_SECOND / srcClock_Hz - 1U) / (ENET_NANOSECOND_ONE_SECOND / srcClock_Hz) - 1U;
    mscr =
        ENET_MSCR_MII_SPEED(speed) | ENET_MSCR_HOLDTIME(clkCycle) | (isPreambleDisabled ? ENET_MSCR_DIS_PRE_MASK : 0U);
    base->MSCR = mscr;
}