emlib/src/em_cmu.c
void CMU_FreezeEnable(bool enable)
{
  if (enable) {
    /* Wait for any ongoing LF synchronization to complete. This is just to */
    /* protect against the rare case when a user                            */
    /* - modifies a register requiring LF sync                              */
    /* - then enables freeze before LF sync completed                       */
    /* - then modifies the same register again                              */
    /* since modifying a register while it is in sync progress should be    */
    /* avoided.                                                             */
    while (CMU->SYNCBUSY) {
    }

    CMU->FREEZE = CMU_FREEZE_REGFREEZE;
  } else {
    CMU->FREEZE = 0;
  }
}
/**************************************************************************/
/**
 * @brief
 *   CMU low frequency register synchronization freeze control.
 *
 * @details
 *   Some CMU registers requires synchronization into the low frequency (LF)
 *   domain. The freeze feature allows for several such registers to be
 *   modified before passing them to the LF domain simultaneously (which
 *   takes place when the freeze mode is disabled).
 *
 *   Another usage scenario of this feature, is when using an API (such
 *   as the CMU API) for modifying several bit fields consecutively in the
 *   same register. If freeze mode is enabled during this sequence, stalling
 *   can be avoided.
 *
 * @note
 *   When enabling freeze mode, this function will wait for all current
 *   ongoing CMU synchronization to LF domain to complete (Normally
 *   synchronization will not be in progress.) However for this reason, when
 *   using freeze mode, modifications of registers requiring LF synchronization
 *   should be done within one freeze enable/disable block to avoid unecessary
 *   stalling.
 *
 * @param[in] enable
 *   @li true - enable freeze, modified registers are not propagated to the
 *       LF domain
 *   @li false - disable freeze, modified registers are propagated to LF
 *       domain
 *****************************************************************************/
@brief
CMU low frequency register synchronization freeze control.

@details
Some CMU registers requires synchronization into the low frequency (LF)
domain. The freeze feature allows for several such registers to be
modified before passing them to the LF domain simultaneously (which
takes place when the freeze mode is disabled).

Another usage scenario of this feature, is when using an API (such
as the CMU API) for modifying several bit fields consecutively in the
same register. If freeze mode is enabled during this sequence, stalling
can be avoided.

@note
When enabling freeze mode, this function will wait for all current
ongoing CMU synchronization to LF domain to complete (Normally
synchronization will not be in progress.) However for this reason, when
using freeze mode, modifications of registers requiring LF synchronization
should be done within one freeze enable/disable block to avoid unecessary
stalling.

@param[in] enable
@li true - enable freeze, modified registers are not propagated to the
LF domain
@li false - disable freeze, modified registers are propagated to LF
domain
@brief CMU low frequency register synchronization freeze control . @details Some CMU registers requires synchronization into the low frequency ( LF ) domain . The freeze feature allows for several such registers to be modified before passing them to the LF domain simultaneously ( which takes place when the freeze mode is disabled ) . Another usage scenario of this feature is when using an API ( such as the CMU API ) for modifying several bit fields consecutively in the same register . If freeze mode is enabled during this sequence stalling can be avoided . @note When enabling freeze mode this function will wait for all current ongoing CMU synchronization to LF domain to complete ( Normally synchronization will not be in progress . ) However for this reason when using freeze mode modifications of registers requiring LF synchronization should be done within one freeze enable / disable block to avoid unecessary stalling . @param [ in ] enable @li true - enable freeze modified registers are not propagated to the LF domain @li false - disable freeze modified registers are propagated to LF domain
void CMU_FreezeEnable(bool enable)
{
  if (enable) {
    while (CMU->SYNCBUSY) {
    }
    CMU->FREEZE = CMU_FREEZE_REGFREEZE;
  } else {
    CMU->FREEZE = 0;
  }
}
void CMU_FreezeEnable ( bool enable ) { if ( enable ) { while ( CMU -> SYNCBUSY ) { } CMU -> FREEZE = CMU_FREEZE_REGFREEZE ; } else { CMU -> FREEZE = 0 ; } }
@brief
   CMU low frequency register synchronization freeze control.
@brief CMU low frequency register synchronization freeze control .
/* Wait for any ongoing LF synchronization to complete. This is just to */ /* protect against the rare case when a user                            */ /* - modifies a register requiring LF sync                              */ /* - then enables freeze before LF sync completed                       */ /* - then modifies the same register again                              */ /* since modifying a register while it is in sync progress should be    */ /* avoided.                                                             */