AllJoyn/Samples/BACnetAdapter/bacnet-stack-0.8.2/ports/xplained/ASF/common/services/clock/xmega/sysclk.h
static inline void sysclk_rtcsrc_enable (uint8_t id)
  {
    Assert ((id & ~CLK_RTCSRC_gm) == 0);

    switch (id)
      {
      case SYSCLK_RTCSRC_RCOSC:
#if !XMEGA_A && !XMEGA_D
      case SYSCLK_RTCSRC_RCOSC32:
#endif
	osc_enable (OSC_ID_RC32KHZ);
	osc_wait_ready (OSC_ID_RC32KHZ);
	break;
      case SYSCLK_RTCSRC_TOSC:
      case SYSCLK_RTCSRC_TOSC32:
#if !XMEGA_A && !XMEGA_D
      case SYSCLK_RTCSRC_EXTCLK:
#endif
	osc_enable (OSC_ID_XOSC);
	osc_wait_ready (OSC_ID_XOSC);
	break;
      }

    CLK.RTCCTRL = id | CLK_RTCEN_bm;
  }
/**
 * \brief Enable RTC clock with specified clock source
 *
 * \param id RTC clock source ID. Select from SYSCLK_RTCSRC_ULP,
 *           SYSCLK_RTCSRC_RCOSC, SYSCLK_RTCSRC_TOSC, SYSCLK_RTCSRC_RCOSC32,
 *           SYSCLK_RTCSRC_TOSC32 or SYSCLK_RTCSRC_EXTCLK
 */
\brief Enable RTC clock with specified clock source
\param id RTC clock source ID.
\ brief Enable RTC clock with specified clock source \ param id RTC clock source ID .
static inline void sysclk_rtcsrc_enable (uint8_t id)
  {
    Assert ((id & ~CLK_RTCSRC_gm) == 0);
    switch (id)
      {
      case SYSCLK_RTCSRC_RCOSC:
#if !XMEGA_A && !XMEGA_D
      case SYSCLK_RTCSRC_RCOSC32:
#endif
	osc_enable (OSC_ID_RC32KHZ);
	osc_wait_ready (OSC_ID_RC32KHZ);
	break;
      case SYSCLK_RTCSRC_TOSC:
      case SYSCLK_RTCSRC_TOSC32:
#if !XMEGA_A && !XMEGA_D
      case SYSCLK_RTCSRC_EXTCLK:
#endif
	osc_enable (OSC_ID_XOSC);
	osc_wait_ready (OSC_ID_XOSC);
	break;
      }
    CLK.RTCCTRL = id | CLK_RTCEN_bm;
  }
static inline void sysclk_rtcsrc_enable ( uint8_t id ) { Assert ( ( id & ~ CLK_RTCSRC_gm ) == 0 ) ; switch ( id ) { case SYSCLK_RTCSRC_RCOSC : #if ! XMEGA_A && ! XMEGA_D case SYSCLK_RTCSRC_RCOSC32 : #endif osc_enable ( OSC_ID_RC32KHZ ) ; osc_wait_ready ( OSC_ID_RC32KHZ ) ; break ; case SYSCLK_RTCSRC_TOSC : case SYSCLK_RTCSRC_TOSC32 : #if ! XMEGA_A && ! XMEGA_D case SYSCLK_RTCSRC_EXTCLK : #endif osc_enable ( OSC_ID_XOSC ) ; osc_wait_ready ( OSC_ID_XOSC ) ; break ; } CLK . RTCCTRL = id | CLK_RTCEN_bm ; }
\brief Enable RTC clock with specified clock source
 \param id RTC clock source ID.
\ brief Enable RTC clock with specified clock source \ param id RTC clock source ID .