emlib/src/em_emu.c
void EMU_DCDCConductionModeSet(EMU_DcdcConductionMode_TypeDef conductionMode, bool rcoDefaultSet)
{
  EMU_DcdcMode_TypeDef currentDcdcMode
    = (EMU_DcdcMode_TypeDef)(EMU->DCDCCTRL & _EMU_DCDCCTRL_DCDCMODE_MASK);
  EMU_DcdcLnRcoBand_TypeDef rcoBand
    = (EMU_DcdcLnRcoBand_TypeDef)((EMU->DCDCLNFREQCTRL & _EMU_DCDCLNFREQCTRL_RCOBAND_MASK)
                                  >> _EMU_DCDCLNFREQCTRL_RCOBAND_SHIFT);

  /* Set bypass mode and wait for bypass mode to settle before
     EMU_DCDCMISCCTRL_LNFORCECCM is set. Restore current DCDC mode. */
  EMU_IntClear(EMU_IFC_DCDCINBYPASS);
  EMU_DCDCModeSet(emuDcdcMode_Bypass);
  while (EMU->DCDCSYNC & EMU_DCDCSYNC_DCDCCTRLBUSY) ;
  while (!(EMU_IntGet() & EMU_IF_DCDCINBYPASS)) ;
  if (conductionMode == emuDcdcConductionMode_DiscontinuousLN) {
    EMU->DCDCMISCCTRL &= ~EMU_DCDCMISCCTRL_LNFORCECCM;
    if (rcoDefaultSet) {
      EMU_DCDCLnRcoBandSet(emuDcdcLnRcoBand_3MHz);
    } else {
      /* emuDcdcConductionMode_DiscontinuousLN supports up to 4MHz LN RCO. */
      EFM_ASSERT(rcoBand <= emuDcdcLnRcoBand_4MHz);
    }
  } else {
    EMU->DCDCMISCCTRL |= EMU_DCDCMISCCTRL_LNFORCECCM;
    if (rcoDefaultSet) {
      EMU_DCDCLnRcoBandSet(emuDcdcLnRcoBand_7MHz);
    }
  }
  EMU_DCDCModeSet(currentDcdcMode);
  /* Update slice configuration as it depends on conduction mode and RCO band. */
  EMU_DCDCOptimizeSlice(dcdcEm01LoadCurrent_mA);
}
/***************************************************************************/
/**
 * @brief
 *   Set DCDC LN regulator conduction mode
 *
 * @param[in] conductionMode
 *   DCDC LN conduction mode.
 * @param[in] rcoDefaultSet
 *   The default DCDC RCO band for the conductionMode will be used if true.
 *   Otherwise the current RCO configuration is used.
 ******************************************************************************/
@brief
Set DCDC LN regulator conduction mode

@param[in] conductionMode
DCDC LN conduction mode.
@param[in] rcoDefaultSet
The default DCDC RCO band for the conductionMode will be used if true.
Otherwise the current RCO configuration is used.
@brief Set DCDC LN regulator conduction mode @param [ in ] conductionMode DCDC LN conduction mode . @param [ in ] rcoDefaultSet The default DCDC RCO band for the conductionMode will be used if true . Otherwise the current RCO configuration is used .
void EMU_DCDCConductionModeSet(EMU_DcdcConductionMode_TypeDef conductionMode, bool rcoDefaultSet)
{
  EMU_DcdcMode_TypeDef currentDcdcMode
    = (EMU_DcdcMode_TypeDef)(EMU->DCDCCTRL & _EMU_DCDCCTRL_DCDCMODE_MASK);
  EMU_DcdcLnRcoBand_TypeDef rcoBand
    = (EMU_DcdcLnRcoBand_TypeDef)((EMU->DCDCLNFREQCTRL & _EMU_DCDCLNFREQCTRL_RCOBAND_MASK)
                                  >> _EMU_DCDCLNFREQCTRL_RCOBAND_SHIFT);
  EMU_IntClear(EMU_IFC_DCDCINBYPASS);
  EMU_DCDCModeSet(emuDcdcMode_Bypass);
  while (EMU->DCDCSYNC & EMU_DCDCSYNC_DCDCCTRLBUSY) ;
  while (!(EMU_IntGet() & EMU_IF_DCDCINBYPASS)) ;
  if (conductionMode == emuDcdcConductionMode_DiscontinuousLN) {
    EMU->DCDCMISCCTRL &= ~EMU_DCDCMISCCTRL_LNFORCECCM;
    if (rcoDefaultSet) {
      EMU_DCDCLnRcoBandSet(emuDcdcLnRcoBand_3MHz);
    } else {
      EFM_ASSERT(rcoBand <= emuDcdcLnRcoBand_4MHz);
    }
  } else {
    EMU->DCDCMISCCTRL |= EMU_DCDCMISCCTRL_LNFORCECCM;
    if (rcoDefaultSet) {
      EMU_DCDCLnRcoBandSet(emuDcdcLnRcoBand_7MHz);
    }
  }
  EMU_DCDCModeSet(currentDcdcMode);
  EMU_DCDCOptimizeSlice(dcdcEm01LoadCurrent_mA);
}
void EMU_DCDCConductionModeSet ( EMU_DcdcConductionMode_TypeDef conductionMode , bool rcoDefaultSet ) { EMU_DcdcMode_TypeDef currentDcdcMode = ( EMU_DcdcMode_TypeDef ) ( EMU -> DCDCCTRL & _EMU_DCDCCTRL_DCDCMODE_MASK ) ; EMU_DcdcLnRcoBand_TypeDef rcoBand = ( EMU_DcdcLnRcoBand_TypeDef ) ( ( EMU -> DCDCLNFREQCTRL & _EMU_DCDCLNFREQCTRL_RCOBAND_MASK ) >> _EMU_DCDCLNFREQCTRL_RCOBAND_SHIFT ) ; EMU_IntClear ( EMU_IFC_DCDCINBYPASS ) ; EMU_DCDCModeSet ( emuDcdcMode_Bypass ) ; while ( EMU -> DCDCSYNC & EMU_DCDCSYNC_DCDCCTRLBUSY ) ; while ( ! ( EMU_IntGet ( ) & EMU_IF_DCDCINBYPASS ) ) ; if ( conductionMode == emuDcdcConductionMode_DiscontinuousLN ) { EMU -> DCDCMISCCTRL &= ~ EMU_DCDCMISCCTRL_LNFORCECCM ; if ( rcoDefaultSet ) { EMU_DCDCLnRcoBandSet ( emuDcdcLnRcoBand_3MHz ) ; } else { EFM_ASSERT ( rcoBand <= emuDcdcLnRcoBand_4MHz ) ; } } else { EMU -> DCDCMISCCTRL |= EMU_DCDCMISCCTRL_LNFORCECCM ; if ( rcoDefaultSet ) { EMU_DCDCLnRcoBandSet ( emuDcdcLnRcoBand_7MHz ) ; } } EMU_DCDCModeSet ( currentDcdcMode ) ; EMU_DCDCOptimizeSlice ( dcdcEm01LoadCurrent_mA ) ; }
@brief
   Set DCDC LN regulator conduction mode
@brief Set DCDC LN regulator conduction mode
/* Set bypass mode and wait for bypass mode to settle before
     EMU_DCDCMISCCTRL_LNFORCECCM is set. Restore current DCDC mode. */ /* emuDcdcConductionMode_DiscontinuousLN supports up to 4MHz LN RCO. */ /* Update slice configuration as it depends on conduction mode and RCO band. */