Platform/ECM3532/M3/hw/csp/ecm3532/m3/csp/src/eta_csp_rtc.c
/***************************************************************************/
/**
 *
 *  EtaCspRtcClockOutCfgSet - Select a frequency to bring out on CLKOUT pin(s).
 *
 *  @param iFreq select from available frequencies.
 *
 *  @return Returns eEtaSuccess other returns eEtaFailure.
 *
 *  NOTE: the clock out will be enabled for any frequency selected. It will be
 *        disabled if eNone is selected.
 *
 ******************************************************************************/
Select a frequency to bring out on CLKOUT pin(s).
@param iFreq select from available frequencies.



the clock out will be enabled for any frequency selected. It will be
disabled if eNone is selected.
Select a frequency to bring out on CLKOUT pin ( s ) . @param iFreq select from available frequencies . the clock out will be enabled for any frequency selected . It will be disabled if eNone is selected .
tEtaStatus
EtaCspRtcClockOutCfgSet(tRtcClkOutFreqs iFreq)
{
    switch(iFreq)
    {
        case eNone:
        {
            REG_RTC_CLKOUT_CTRL.BF.SEL = BFV_RTC_CLKOUT_CTRL_SEL_NONE;
            break;
        }
        case eXtal32KHz:
        {
            REG_RTC_CLKOUT_CTRL.BF.SEL = BFV_RTC_CLKOUT_CTRL_SEL_32KHZ;
            break;
        }
        case eXtal16KHz:
        {
            REG_RTC_CLKOUT_CTRL.BF.SEL = BFV_RTC_CLKOUT_CTRL_SEL_16KHZ;
            break;
        }
        case eXtal8KHz:
        {
            REG_RTC_CLKOUT_CTRL.BF.SEL = BFV_RTC_CLKOUT_CTRL_SEL_8KHZ;
            break;
        }
        case eXtal4KHz:
        {
            REG_RTC_CLKOUT_CTRL.BF.SEL = BFV_RTC_CLKOUT_CTRL_SEL_4KHZ;
            break;
        }
        case eVHF2MHz:
        {
            REG_RTC_CLKOUT_CTRL.BF.SEL = BFV_RTC_CLKOUT_CTRL_SEL_2MHZ;
            break;
        }
        case eVHF1MHz:
        {
            REG_RTC_CLKOUT_CTRL.BF.SEL = BFV_RTC_CLKOUT_CTRL_SEL_1MHZ;
            break;
        }
        case eVHF512KHz:
        {
            REG_RTC_CLKOUT_CTRL.BF.SEL = BFV_RTC_CLKOUT_CTRL_SEL_512KHZ;
            break;
        }
        case eVHF256KHz:
        {
            REG_RTC_CLKOUT_CTRL.BF.SEL = BFV_RTC_CLKOUT_CTRL_SEL_256KHZ;
            break;
        }
        case eAdcToggle:
        {
            REG_RTC_CLKOUT_CTRL.BF.SEL = BFV_RTC_CLKOUT_CTRL_SEL_ADC_TOGGLE;
            break;
        }
        default:
        {
            return(eEtaFailure);
        }
    }
     If we get here, then enable it
    REG_RTC_CLKOUT_CFG.BF.EN = (iFreq != eNone) ? 1 : 0;
     Smile at the caller
    return(eEtaSuccess);
}
tEtaStatus EtaCspRtcClockOutCfgSet ( tRtcClkOutFreqs iFreq ) { switch ( iFreq ) { case eNone : { REG_RTC_CLKOUT_CTRL . BF . SEL = BFV_RTC_CLKOUT_CTRL_SEL_NONE ; break ; } case eXtal32KHz : { REG_RTC_CLKOUT_CTRL . BF . SEL = BFV_RTC_CLKOUT_CTRL_SEL_32KHZ ; break ; } case eXtal16KHz : { REG_RTC_CLKOUT_CTRL . BF . SEL = BFV_RTC_CLKOUT_CTRL_SEL_16KHZ ; break ; } case eXtal8KHz : { REG_RTC_CLKOUT_CTRL . BF . SEL = BFV_RTC_CLKOUT_CTRL_SEL_8KHZ ; break ; } case eXtal4KHz : { REG_RTC_CLKOUT_CTRL . BF . SEL = BFV_RTC_CLKOUT_CTRL_SEL_4KHZ ; break ; } case eVHF2MHz : { REG_RTC_CLKOUT_CTRL . BF . SEL = BFV_RTC_CLKOUT_CTRL_SEL_2MHZ ; break ; } case eVHF1MHz : { REG_RTC_CLKOUT_CTRL . BF . SEL = BFV_RTC_CLKOUT_CTRL_SEL_1MHZ ; break ; } case eVHF512KHz : { REG_RTC_CLKOUT_CTRL . BF . SEL = BFV_RTC_CLKOUT_CTRL_SEL_512KHZ ; break ; } case eVHF256KHz : { REG_RTC_CLKOUT_CTRL . BF . SEL = BFV_RTC_CLKOUT_CTRL_SEL_256KHZ ; break ; } case eAdcToggle : { REG_RTC_CLKOUT_CTRL . BF . SEL = BFV_RTC_CLKOUT_CTRL_SEL_ADC_TOGGLE ; break ; } default : { return ( eEtaFailure ) ; } } REG_RTC_CLKOUT_CFG . BF . EN = ( iFreq != eNone ) ? 1 : 0 ; return ( eEtaSuccess ) ; }
EtaCspRtcClockOutCfgSet - Select a frequency to bring out on CLKOUT pin(s).
EtaCspRtcClockOutCfgSet - Select a frequency to bring out on CLKOUT pin ( s ) .
// // If we get here, then enable it // // // Smile at the caller //