emlib/src/em_cmu.c
bool CMU_PCNTClockExternalGet(unsigned int instance)
{
  uint32_t setting;

  switch (instance) {
#if defined(_CMU_PCNTCTRL_PCNT0CLKEN_MASK)
    case 0:
      setting = CMU->PCNTCTRL & CMU_PCNTCTRL_PCNT0CLKSEL_PCNT0S0;
      break;

#if defined(_CMU_PCNTCTRL_PCNT1CLKEN_MASK)
    case 1:
      setting = CMU->PCNTCTRL & CMU_PCNTCTRL_PCNT1CLKSEL_PCNT1S0;
      break;

#if defined(_CMU_PCNTCTRL_PCNT2CLKEN_MASK)
    case 2:
      setting = CMU->PCNTCTRL & CMU_PCNTCTRL_PCNT2CLKSEL_PCNT2S0;
      break;
#endif
#endif
#endif

    default:
      setting = 0;
      break;
  }
  return (setting ? true : false);
}
/**************************************************************************/
/**
 * @brief
 *   Determine if currently selected PCNTn clock used is external or LFBCLK.
 *
 * @param[in] instance
 *   PCNT instance number to get currently selected clock source for.
 *
 * @return
 *   @li true - selected clock is external clock.
 *   @li false - selected clock is LFBCLK.
 *****************************************************************************/
@brief
Determine if currently selected PCNTn clock used is external or LFBCLK.

@param[in] instance
PCNT instance number to get currently selected clock source for.

@return
@li true - selected clock is external clock.
@li false - selected clock is LFBCLK.
@brief Determine if currently selected PCNTn clock used is external or LFBCLK . @param [ in ] instance PCNT instance number to get currently selected clock source for . @return @li true - selected clock is external clock . @li false - selected clock is LFBCLK .
bool CMU_PCNTClockExternalGet(unsigned int instance)
{
  uint32_t setting;
  switch (instance) {
#if defined(_CMU_PCNTCTRL_PCNT0CLKEN_MASK)
    case 0:
      setting = CMU->PCNTCTRL & CMU_PCNTCTRL_PCNT0CLKSEL_PCNT0S0;
      break;
#if defined(_CMU_PCNTCTRL_PCNT1CLKEN_MASK)
    case 1:
      setting = CMU->PCNTCTRL & CMU_PCNTCTRL_PCNT1CLKSEL_PCNT1S0;
      break;
#if defined(_CMU_PCNTCTRL_PCNT2CLKEN_MASK)
    case 2:
      setting = CMU->PCNTCTRL & CMU_PCNTCTRL_PCNT2CLKSEL_PCNT2S0;
      break;
#endif
#endif
#endif
    default:
      setting = 0;
      break;
  }
  return (setting ? true : false);
}
bool CMU_PCNTClockExternalGet ( unsigned int instance ) { uint32_t setting ; switch ( instance ) { #if defined ( _CMU_PCNTCTRL_PCNT0CLKEN_MASK ) case 0 : setting = CMU -> PCNTCTRL & CMU_PCNTCTRL_PCNT0CLKSEL_PCNT0S0 ; break ; #if defined ( _CMU_PCNTCTRL_PCNT1CLKEN_MASK ) case 1 : setting = CMU -> PCNTCTRL & CMU_PCNTCTRL_PCNT1CLKSEL_PCNT1S0 ; break ; #if defined ( _CMU_PCNTCTRL_PCNT2CLKEN_MASK ) case 2 : setting = CMU -> PCNTCTRL & CMU_PCNTCTRL_PCNT2CLKSEL_PCNT2S0 ; break ; #endif #endif #endif default : setting = 0 ; break ; } return ( setting ? true : false ) ; }
@brief
   Determine if currently selected PCNTn clock used is external or LFBCLK.
@brief Determine if currently selected PCNTn clock used is external or LFBCLK .