AllJoyn/Samples/BACnetAdapter/bacnet-stack-0.8.2/ports/xplained/ASF/xmega/drivers/rtc32/rtc32.c
static void vbat_init(void)
{
    // Enable access to VBAT
    VBAT.CTRL |= VBAT_ACCEN_bm;

    ccp_write_io((void *) &VBAT.CTRL, VBAT_RESET_bm);

    VBAT.CTRL |= VBAT_XOSCFDEN_bm;
    /* This delay is needed to give the voltage in the backup system some
       * time to stabilize before we turn on the oscillator. If we do not
       * have this delay we may get a failure detection.
     */
    delay_us(200);
    VBAT.CTRL |= VBAT_XOSCEN_bm | RTC32_CLOCK;
    while (!(VBAT.STATUS & VBAT_XOSCRDY_bm));
}
/**
 * \internal
 * \brief Initialize VBAT and start 32kHz oscillator
 *
 * Enables access to the VBAT system, performs a reset, enables the failure
 * detection, and starts the oscillator.
 *
 * The default clock rate to the RTC32 is 1Hz but this can be changed to 1024Hz
 * by the user in the module configuration by defining
 * \ref CONFIG_RTC32_CLOCK_1024HZ.
 */
\internal
\brief Initialize VBAT and start 32kHz oscillator

Enables access to the VBAT system, performs a reset, enables the failure
detection, and starts the oscillator.

The default clock rate to the RTC32 is 1Hz but this can be changed to 1024Hz
by the user in the module configuration by defining
\ref CONFIG_RTC32_CLOCK_1024HZ.
\ internal \ brief Initialize VBAT and start 32kHz oscillator Enables access to the VBAT system performs a reset enables the failure detection and starts the oscillator . The default clock rate to the RTC32 is 1Hz but this can be changed to 1024Hz by the user in the module configuration by defining \ ref CONFIG_RTC32_CLOCK_1024HZ .
static void vbat_init(void)
{
    VBAT.CTRL |= VBAT_ACCEN_bm;
    ccp_write_io((void *) &VBAT.CTRL, VBAT_RESET_bm);
    VBAT.CTRL |= VBAT_XOSCFDEN_bm;
    delay_us(200);
    VBAT.CTRL |= VBAT_XOSCEN_bm | RTC32_CLOCK;
    while (!(VBAT.STATUS & VBAT_XOSCRDY_bm));
}
static void vbat_init ( void ) { VBAT . CTRL |= VBAT_ACCEN_bm ; ccp_write_io ( ( void * ) & VBAT . CTRL , VBAT_RESET_bm ) ; VBAT . CTRL |= VBAT_XOSCFDEN_bm ; delay_us ( 200 ) ; VBAT . CTRL |= VBAT_XOSCEN_bm | RTC32_CLOCK ; while ( ! ( VBAT . STATUS & VBAT_XOSCRDY_bm ) ) ; }
\internal
 \brief Initialize VBAT and start 32kHz oscillator
\ internal \ brief Initialize VBAT and start 32kHz oscillator
// Enable access to VBAT /* This delay is needed to give the voltage in the backup system some
       * time to stabilize before we turn on the oscillator. If we do not
       * have this delay we may get a failure detection.
     */