emlib/src/em_cmu.c
uint32_t CMU_CalibrateCountGet(void)
{
  /* Wait until calibration completes, UNLESS continuous calibration mode is  */
  /* active */
#if defined(CMU_CALCTRL_CONT)
  if (!BUS_RegBitRead(&CMU->CALCTRL, _CMU_CALCTRL_CONT_SHIFT)) {
#if defined(CMU_STATUS_CALRDY)
    /* Wait until calibration completes */
    while (!BUS_RegBitRead(&CMU->STATUS, _CMU_STATUS_CALRDY_SHIFT)) {
    }
#else
    /* Wait until calibration completes */
    while (BUS_RegBitRead(&CMU->STATUS, _CMU_STATUS_CALBSY_SHIFT)) {
    }
#endif
  }
#else
  while (BUS_RegBitRead(&CMU->STATUS, _CMU_STATUS_CALBSY_SHIFT)) {
  }
#endif
  return CMU->CALCNT;
}
/***************************************************************************/
/**
 * @brief
 *    Get calibration count register
 * @note
 *    If continuous calibrartion mode is active, calibration busy will almost
 *    always be off, and we just need to read the value, where the normal case
 *    would be that this function call has been triggered by the CALRDY
 *    interrupt flag.
 * @return
 *    Calibration count, the number of UPSEL clocks (see CMU_CalibrateConfig)
 *    in the period of DOWNSEL oscillator clock cycles configured by a previous
 *    write operation to CMU->CALCNT
 ******************************************************************************/
@brief
Get calibration count register
@note
If continuous calibrartion mode is active, calibration busy will almost
always be off, and we just need to read the value, where the normal case
would be that this function call has been triggered by the CALRDY
interrupt flag.
@return
Calibration count, the number of UPSEL clocks
in the period of DOWNSEL oscillator clock cycles configured by a previous
write operation to CMU->CALCNT
@brief Get calibration count register @note If continuous calibrartion mode is active calibration busy will almost always be off and we just need to read the value where the normal case would be that this function call has been triggered by the CALRDY interrupt flag . @return Calibration count the number of UPSEL clocks in the period of DOWNSEL oscillator clock cycles configured by a previous write operation to CMU - > CALCNT
uint32_t CMU_CalibrateCountGet(void)
{
#if defined(CMU_CALCTRL_CONT)
  if (!BUS_RegBitRead(&CMU->CALCTRL, _CMU_CALCTRL_CONT_SHIFT)) {
#if defined(CMU_STATUS_CALRDY)
    while (!BUS_RegBitRead(&CMU->STATUS, _CMU_STATUS_CALRDY_SHIFT)) {
    }
#else
    while (BUS_RegBitRead(&CMU->STATUS, _CMU_STATUS_CALBSY_SHIFT)) {
    }
#endif
  }
#else
  while (BUS_RegBitRead(&CMU->STATUS, _CMU_STATUS_CALBSY_SHIFT)) {
  }
#endif
  return CMU->CALCNT;
}
uint32_t CMU_CalibrateCountGet ( void ) { #if defined ( CMU_CALCTRL_CONT ) if ( ! BUS_RegBitRead ( & CMU -> CALCTRL , _CMU_CALCTRL_CONT_SHIFT ) ) { #if defined ( CMU_STATUS_CALRDY ) while ( ! BUS_RegBitRead ( & CMU -> STATUS , _CMU_STATUS_CALRDY_SHIFT ) ) { } #else while ( BUS_RegBitRead ( & CMU -> STATUS , _CMU_STATUS_CALBSY_SHIFT ) ) { } #endif } #else while ( BUS_RegBitRead ( & CMU -> STATUS , _CMU_STATUS_CALBSY_SHIFT ) ) { } #endif return CMU -> CALCNT ; }
@brief
    Get calibration count register
 @note
    If continuous calibrartion mode is active, calibration busy will almost
    always be off, and we just need to read the value, where the normal case
    would be that this function call has been triggered by the CALRDY
    interrupt flag.
@brief Get calibration count register @note If continuous calibrartion mode is active calibration busy will almost always be off and we just need to read the value where the normal case would be that this function call has been triggered by the CALRDY interrupt flag .
/* Wait until calibration completes, UNLESS continuous calibration mode is  */ /* active */ /* Wait until calibration completes */ /* Wait until calibration completes */