emlib/src/em_cmu.c
void CMU_AUXHFRCOBandSet(CMU_AUXHFRCOFreq_TypeDef setFreq)
{
  uint32_t freqCal;

  /* Get DEVINFO index, set global auxHfrcoFreq */
  freqCal = CMU_AUXHFRCODevinfoGet(setFreq);
  EFM_ASSERT((freqCal != 0) && (freqCal != UINT_MAX));
  auxHfrcoFreq = setFreq;

  /* Wait for any previous sync to complete, and then set calibration data
     for the selected frequency.  */
  while (BUS_RegBitRead(&CMU->SYNCBUSY, _CMU_SYNCBUSY_AUXHFRCOBSY_SHIFT)) ;

  /* Set divider in AUXHFRCOCTRL for 1, 2 and 4MHz */
  switch (setFreq) {
    case cmuAUXHFRCOFreq_1M0Hz:
      freqCal = (freqCal & ~_CMU_AUXHFRCOCTRL_CLKDIV_MASK)
                | CMU_AUXHFRCOCTRL_CLKDIV_DIV4;
      break;

    case cmuAUXHFRCOFreq_2M0Hz:
      freqCal = (freqCal & ~_CMU_AUXHFRCOCTRL_CLKDIV_MASK)
                | CMU_AUXHFRCOCTRL_CLKDIV_DIV2;
      break;

    case cmuAUXHFRCOFreq_4M0Hz:
      freqCal = (freqCal & ~_CMU_AUXHFRCOCTRL_CLKDIV_MASK)
                | CMU_AUXHFRCOCTRL_CLKDIV_DIV1;
      break;

    default:
      break;
  }
  CMU->AUXHFRCOCTRL = freqCal;
}
/***************************************************************************/
/**
 * @brief
 *   Set AUXHFRCO calibration for the selected target frequency.
 *
 * @param[in] setFreq
 *   AUXHFRCO frequency to set
 ******************************************************************************/
@brief
Set AUXHFRCO calibration for the selected target frequency.

@param[in] setFreq
AUXHFRCO frequency to set
@brief Set AUXHFRCO calibration for the selected target frequency . @param [ in ] setFreq AUXHFRCO frequency to set
void CMU_AUXHFRCOBandSet(CMU_AUXHFRCOFreq_TypeDef setFreq)
{
  uint32_t freqCal;
  freqCal = CMU_AUXHFRCODevinfoGet(setFreq);
  EFM_ASSERT((freqCal != 0) && (freqCal != UINT_MAX));
  auxHfrcoFreq = setFreq;
  while (BUS_RegBitRead(&CMU->SYNCBUSY, _CMU_SYNCBUSY_AUXHFRCOBSY_SHIFT)) ;
  switch (setFreq) {
    case cmuAUXHFRCOFreq_1M0Hz:
      freqCal = (freqCal & ~_CMU_AUXHFRCOCTRL_CLKDIV_MASK)
                | CMU_AUXHFRCOCTRL_CLKDIV_DIV4;
      break;
    case cmuAUXHFRCOFreq_2M0Hz:
      freqCal = (freqCal & ~_CMU_AUXHFRCOCTRL_CLKDIV_MASK)
                | CMU_AUXHFRCOCTRL_CLKDIV_DIV2;
      break;
    case cmuAUXHFRCOFreq_4M0Hz:
      freqCal = (freqCal & ~_CMU_AUXHFRCOCTRL_CLKDIV_MASK)
                | CMU_AUXHFRCOCTRL_CLKDIV_DIV1;
      break;
    default:
      break;
  }
  CMU->AUXHFRCOCTRL = freqCal;
}
void CMU_AUXHFRCOBandSet ( CMU_AUXHFRCOFreq_TypeDef setFreq ) { uint32_t freqCal ; freqCal = CMU_AUXHFRCODevinfoGet ( setFreq ) ; EFM_ASSERT ( ( freqCal != 0 ) && ( freqCal != UINT_MAX ) ) ; auxHfrcoFreq = setFreq ; while ( BUS_RegBitRead ( & CMU -> SYNCBUSY , _CMU_SYNCBUSY_AUXHFRCOBSY_SHIFT ) ) ; switch ( setFreq ) { case cmuAUXHFRCOFreq_1M0Hz : freqCal = ( freqCal & ~ _CMU_AUXHFRCOCTRL_CLKDIV_MASK ) | CMU_AUXHFRCOCTRL_CLKDIV_DIV4 ; break ; case cmuAUXHFRCOFreq_2M0Hz : freqCal = ( freqCal & ~ _CMU_AUXHFRCOCTRL_CLKDIV_MASK ) | CMU_AUXHFRCOCTRL_CLKDIV_DIV2 ; break ; case cmuAUXHFRCOFreq_4M0Hz : freqCal = ( freqCal & ~ _CMU_AUXHFRCOCTRL_CLKDIV_MASK ) | CMU_AUXHFRCOCTRL_CLKDIV_DIV1 ; break ; default : break ; } CMU -> AUXHFRCOCTRL = freqCal ; }
@brief
   Set AUXHFRCO calibration for the selected target frequency.
@brief Set AUXHFRCO calibration for the selected target frequency .
/* Get DEVINFO index, set global auxHfrcoFreq */ /* Wait for any previous sync to complete, and then set calibration data
     for the selected frequency.  */ /* Set divider in AUXHFRCOCTRL for 1, 2 and 4MHz */