Microchip® Advanced Software Framework

classb_rtc_common.h File Reference

Settings for the RTC driver.

Application note:
AVR1610: Guide to IEC60730 Class B compliance with XMEGA

Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.

#include <asf.h>
#include "classb_freq.h"
#include "classb_interrupt_monitor.h"

Macros

RTC Settings and Class B Interface.

These two constants give information about the RTC to the Class B tests.

Therefore, they need to be defined with correct values. As long as these are defined, any RTC driver can be used.

#define CLASSB_RTC_INT_PERIOD   2048UL
 RTC interrupt period. More...
 
#define CLASSB_RTC_FREQ   1024UL
 RTC frequency. More...
 
Test declarations.

These symbols set which Class B tests are included in the RTC interrupt, and can be defined at the compiler level or in this file.

#define CLASSB_FREQ_TEST
 Test for the CPU frequency. More...
 
#define CLASSB_INT_MON
 Interrupt monitor. More...
 
Compatibility macros for RTC and RTC32.

Depending on the XMEGA device there will be a 16- or 32-bits RTC.

To make this transparent we define the following constants.

#define RTC_TEST   RTC32
 Name of the RTC module. More...
 
#define RTC_TEST_START_bm   RTC32_ENABLE_bm
 Bit mask used to start RTC. More...
 
#define RTC_TEST_COMPINTLVL_LO_gc   RTC32_COMPINTLVL_LO_gc
 Compare interrupt level group configuration. More...
 
#define RTC_TEST_COMPINTLVL_OFF_gc   RTC32_COMPINTLVL_OFF_gc
 Compare interrupt disable group configuration. More...
 
#define RTC_TEST_COMPIF_bm   RTC32_COMPIF_bm
 Compare interrupt flag bit mask. More...
 
#define RTC_TEST_COMP_vect   RTC32_COMP_vect
 Compare interrupt vector. More...
 
#define RTC_TEST_OVFIF_bm   RTC32_OVFIF_bm
 Overflow Interrupt Flag bit mask. More...
 

Functions

void classb_rtc_callback (uint32_t time)
 This is the RTC compare interrupt. More...