/* set SIM clock gating registers to enable or disable peripheral clocks.  */
void SIM_SetClockGating(uint32_t u32PeripheralMask, uint8_t u8GateOn)
/* set SIM clock gating registers to enable or disable peripheral clocks.  */
void SIM_SetClockGating(uint32_t u32PeripheralMask, uint8_t u8GateOn)
{
    uint32_t    u32Scgc;
    u32Scgc     = SIM->SCGC;
    if(u8GateOn)
    {
        u32Scgc |= u32PeripheralMask;
    }
    else
    {
        u32Scgc &= ~u32PeripheralMask;        
    }
    SIM->SCGC = u32Scgc;
}