/* config the pmc mode among run, wait and stop modes.  */
void PMC_SetMode(PMC_Type *pPMC, uint8_t u8PmcMode)
/* config the pmc mode among run, wait and stop modes.  */
void PMC_SetMode(PMC_Type *pPMC, uint8_t u8PmcMode)
{
    switch(u8PmcMode & 0x3) 
    {
        case PmcModeRun:    
            break;
        case PmcModeWait:
            wait();
            break;
        case PmcModeStop4:
            pPMC->SPMSC1 |= (PMC_SPMSC1_LVDE_MASK | PMC_SPMSC1_LVDSE_MASK);            stop();   
            break;
        case PmcModeStop3:
            pPMC->SPMSC1 &= ~(PMC_SPMSC1_LVDE_MASK | PMC_SPMSC1_LVDRE_MASK | PMC_SPMSC1_LVDSE_MASK);            stop();  
            break;
        default: 
            break;
    }
}