emlib/src/em_emu.c
bool EMU_DCDCPowerOff(void)
{
  bool dcdcModeSet;

#if defined(_EMU_PWRCFG_MASK)
  /* Set DCDCTODVDD only to enable write access to EMU->DCDCCTRL */
  EMU->PWRCFG = EMU_PWRCFG_PWRCFG_DCDCTODVDD;
#endif

  /* Select DVDD as input to the digital regulator */
#if defined(EMU_PWRCTRL_IMMEDIATEPWRSWITCH)
  EMU->PWRCTRL |= EMU_PWRCTRL_REGPWRSEL_DVDD | EMU_PWRCTRL_IMMEDIATEPWRSWITCH;
#elif defined(EMU_PWRCTRL_REGPWRSEL_DVDD)
  EMU->PWRCTRL |= EMU_PWRCTRL_REGPWRSEL_DVDD;
#endif

  /* Set DCDC to OFF and disable LP in EM2/3/4. Verify that the required
     mode could be set. */
  while (EMU->DCDCSYNC & EMU_DCDCSYNC_DCDCCTRLBUSY) ;
  EMU->DCDCCTRL = EMU_DCDCCTRL_DCDCMODE_OFF;

  dcdcModeSet = (EMU->DCDCCTRL == EMU_DCDCCTRL_DCDCMODE_OFF);
  EFM_ASSERT(dcdcModeSet);

  return dcdcModeSet;
}
/***************************************************************************/
/**
 * @brief
 *   Power off the DCDC regulator.
 *
 * @details
 *   This function powers off the DCDC controller. This function should only be
 *   used if the external power circuit is wired for no DCDC. If the external power
 *   circuit is wired for DCDC usage, then use EMU_DCDCInit() and set the
 *   DCDC in bypass mode to disable DCDC.
 *
 * @return
 *   Return false if the DCDC could not be disabled.
 ******************************************************************************/
@brief
Power off the DCDC regulator.

@details
This function powers off the DCDC controller. This function should only be
used if the external power circuit is wired for no DCDC. If the external power
circuit is wired for DCDC usage, then use EMU_DCDCInit() and set the
DCDC in bypass mode to disable DCDC.

@return
Return false if the DCDC could not be disabled.
@brief Power off the DCDC regulator . @details This function powers off the DCDC controller . This function should only be used if the external power circuit is wired for no DCDC . If the external power circuit is wired for DCDC usage then use EMU_DCDCInit () and set the DCDC in bypass mode to disable DCDC . @return Return false if the DCDC could not be disabled .
bool EMU_DCDCPowerOff(void)
{
  bool dcdcModeSet;
#if defined(_EMU_PWRCFG_MASK)
  EMU->PWRCFG = EMU_PWRCFG_PWRCFG_DCDCTODVDD;
#endif
#if defined(EMU_PWRCTRL_IMMEDIATEPWRSWITCH)
  EMU->PWRCTRL |= EMU_PWRCTRL_REGPWRSEL_DVDD | EMU_PWRCTRL_IMMEDIATEPWRSWITCH;
#elif defined(EMU_PWRCTRL_REGPWRSEL_DVDD)
  EMU->PWRCTRL |= EMU_PWRCTRL_REGPWRSEL_DVDD;
#endif
  while (EMU->DCDCSYNC & EMU_DCDCSYNC_DCDCCTRLBUSY) ;
  EMU->DCDCCTRL = EMU_DCDCCTRL_DCDCMODE_OFF;
  dcdcModeSet = (EMU->DCDCCTRL == EMU_DCDCCTRL_DCDCMODE_OFF);
  EFM_ASSERT(dcdcModeSet);
  return dcdcModeSet;
}
bool EMU_DCDCPowerOff ( void ) { bool dcdcModeSet ; #if defined ( _EMU_PWRCFG_MASK ) EMU -> PWRCFG = EMU_PWRCFG_PWRCFG_DCDCTODVDD ; #endif #if defined ( EMU_PWRCTRL_IMMEDIATEPWRSWITCH ) EMU -> PWRCTRL |= EMU_PWRCTRL_REGPWRSEL_DVDD | EMU_PWRCTRL_IMMEDIATEPWRSWITCH ; #elif defined ( EMU_PWRCTRL_REGPWRSEL_DVDD ) EMU -> PWRCTRL |= EMU_PWRCTRL_REGPWRSEL_DVDD ; #endif while ( EMU -> DCDCSYNC & EMU_DCDCSYNC_DCDCCTRLBUSY ) ; EMU -> DCDCCTRL = EMU_DCDCCTRL_DCDCMODE_OFF ; dcdcModeSet = ( EMU -> DCDCCTRL == EMU_DCDCCTRL_DCDCMODE_OFF ) ; EFM_ASSERT ( dcdcModeSet ) ; return dcdcModeSet ; }
@brief
   Power off the DCDC regulator.
@brief Power off the DCDC regulator .
/* Set DCDCTODVDD only to enable write access to EMU->DCDCCTRL */ /* Select DVDD as input to the digital regulator */ /* Set DCDC to OFF and disable LP in EM2/3/4. Verify that the required
     mode could be set. */