/* Get the MCI CLKDIV in the MCI_MR register. The max. for MCI clock is MCK/2 and corresponds to CLKDIV = 0  */
unsigned int MCI_GetSpeed(Mci *pMci, unsigned int *mciDiv)
/* Get the MCI CLKDIV in the MCI_MR register. The max. for MCI clock is MCK/2 and corresponds to CLKDIV = 0  */
unsigned int MCI_GetSpeed(Mci *pMci, unsigned int *mciDiv)
{
    AT91S_MCI *pMciHw = pMci->pMciHw;
    unsigned int mciMr;
    SANITY_CHECK(pMci);
    SANITY_CHECK(pMci->pMciHw);
    mciMr  = READ_MCI(pMciHw, MCI_MR);
    mciMr &= AT91C_MCI_CLKDIV;
    if (mciDiv) *mciDiv = mciMr;
    return (BOARD_MCK / 2 / (mciMr + 1));
}