emlib/src/em_emu.c
void EMU_VScaleEM01ByClock(uint32_t clockFrequency, bool wait)
{
  uint32_t hfSrcClockFrequency;
  uint32_t hfPresc = 1U + ((CMU->HFPRESC & _CMU_HFPRESC_PRESC_MASK)
                           >> _CMU_HFPRESC_PRESC_SHIFT);

  /* VSCALE frequency is HFSRCCLK */
  if (clockFrequency == 0) {
    hfSrcClockFrequency = SystemHFClockGet() * hfPresc;
  } else {
    hfSrcClockFrequency = clockFrequency;
  }

  /* Apply EM0 and 1 voltage scaling command. */
  if (vScaleEM01Config.vScaleEM01LowPowerVoltageEnable
      && (hfSrcClockFrequency < CMU_VSCALEEM01_LOWPOWER_VOLTAGE_CLOCK_MAX)) {
    EMU_VScaleEM01(emuVScaleEM01_LowPower, wait);
  } else {
    EMU_VScaleEM01(emuVScaleEM01_HighPerformance, wait);
  }
}
/***************************************************************************/
/**
 * @brief
 *   Voltage scale in EM0 and 1 by clock frequency.
 *
 * @param[in] clockFrequency
 *   Use CMSIS HF clock if 0, or override to custom clock. Providing a
 *   custom clock frequency is required if using a non-standard HFXO
 *   frequency.
 * @param[in] wait
 *   Wait for scaling to complete.
 *
 * @note
 *   This function is primarily needed by the @ref CMU module.
 ******************************************************************************/
@brief
Voltage scale in EM0 and 1 by clock frequency.

@param[in] clockFrequency
Use CMSIS HF clock if 0, or override to custom clock. Providing a
custom clock frequency is required if using a non-standard HFXO
frequency.
@param[in] wait
Wait for scaling to complete.

@note
This function is primarily needed by the @ref CMU module.
@brief Voltage scale in EM0 and 1 by clock frequency . @param [ in ] clockFrequency Use CMSIS HF clock if 0 or override to custom clock . Providing a custom clock frequency is required if using a non - standard HFXO frequency . @param [ in ] wait Wait for scaling to complete . @note This function is primarily needed by the @ref CMU module .
void EMU_VScaleEM01ByClock(uint32_t clockFrequency, bool wait)
{
  uint32_t hfSrcClockFrequency;
  uint32_t hfPresc = 1U + ((CMU->HFPRESC & _CMU_HFPRESC_PRESC_MASK)
                           >> _CMU_HFPRESC_PRESC_SHIFT);
  if (clockFrequency == 0) {
    hfSrcClockFrequency = SystemHFClockGet() * hfPresc;
  } else {
    hfSrcClockFrequency = clockFrequency;
  }
  if (vScaleEM01Config.vScaleEM01LowPowerVoltageEnable
      && (hfSrcClockFrequency < CMU_VSCALEEM01_LOWPOWER_VOLTAGE_CLOCK_MAX)) {
    EMU_VScaleEM01(emuVScaleEM01_LowPower, wait);
  } else {
    EMU_VScaleEM01(emuVScaleEM01_HighPerformance, wait);
  }
}
void EMU_VScaleEM01ByClock ( uint32_t clockFrequency , bool wait ) { uint32_t hfSrcClockFrequency ; uint32_t hfPresc = 1U + ( ( CMU -> HFPRESC & _CMU_HFPRESC_PRESC_MASK ) >> _CMU_HFPRESC_PRESC_SHIFT ) ; if ( clockFrequency == 0 ) { hfSrcClockFrequency = SystemHFClockGet ( ) * hfPresc ; } else { hfSrcClockFrequency = clockFrequency ; } if ( vScaleEM01Config . vScaleEM01LowPowerVoltageEnable && ( hfSrcClockFrequency < CMU_VSCALEEM01_LOWPOWER_VOLTAGE_CLOCK_MAX ) ) { EMU_VScaleEM01 ( emuVScaleEM01_LowPower , wait ) ; } else { EMU_VScaleEM01 ( emuVScaleEM01_HighPerformance , wait ) ; } }
@brief
   Voltage scale in EM0 and 1 by clock frequency.
@brief Voltage scale in EM0 and 1 by clock frequency .
/* VSCALE frequency is HFSRCCLK */ /* Apply EM0 and 1 voltage scaling command. */