/* The function is used to enable the HFIRC auto trim, and select the Trim Calculation Loop.  */
void SysCtlHFIRCTrimEnable(xtBoolean bEnable, unsigned char ulTrimLoop)
/* The function is used to enable the HFIRC auto trim, and select the Trim Calculation Loop.  */
void SysCtlHFIRCTrimEnable(xtBoolean bEnable, unsigned char ulTrimLoop)
{
    xASSERT((ulTrimLoop == SYSCTL_TRIM_L00P_4) ||
            (ulTrimLoop == SYSCTL_TRIM_L00P_8) ||
            (ulTrimLoop == SYSCTL_TRIM_L00P_16) ||
            (ulTrimLoop == SYSCTL_TRIM_L00P_32));
    if(bEnable)
    {
        xHWREG(GCR_IRCTRIMCTL) |= GCR_IRCTRIMCTL_TRIM_SEL;
        xHWREG(GCR_IRCTRIMCTL) &= ~GCR_IRCTRIMCTL_TRIM_LOOP_M;
        xHWREG(GCR_IRCTRIMCTL) |= ulTrimLoop;
    }
    else
    {
        xHWREG(GCR_IRCTRIMCTL) &= ~GCR_IRCTRIMCTL_TRIM_SEL;    
    }
}