Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Internal settings

These constants should not be modified by user.

Macros

#define CLASSB_TC_COUNT_REF
 TC count reference. More...
 
#define CLASSB_TC_FREQ   (uint32_t)(F_CPU / CLASSB_TC_PRESCALER)
 TC frequency. More...
 
#define CLASSB_TC_MAX_DIFF
 Maximum absolute difference between reference and estimated frequency. More...
 
#define CLASSB_TC_MAX_OVF_COUNT
 TC maximum number of overflows. More...
 
#define CLASSB_TC_PER   0xFFFF
 TC period. More...
 
#define CLASSB_TC_PRESCALER_gc   LABEL(TC_CLKSEL_DIV, CLASSB_TC_PRESCALER, _gc)
 Label for the TC prescaler group configuration. More...
 
#define CLASSB_TEST_TC   LABEL(TC, CLASSB_TC_MOD,)
 Label for the TC module. More...
 
#define CLASSB_TEST_TC_OVF_vect   LABEL(TC, CLASSB_TC_MOD, _OVF_vect)
 Label for the overflow interrupt vector for the chosen TC. More...
 

#define CLASSB_TC_COUNT_REF
Value:
(uint32_t)(((1e0L * CLASSB_TC_FREQ) \
#define CLASSB_TC_FREQ
TC frequency.
Definition: classb_freq.h:174
#define CLASSB_RTC_FREQ
RTC frequency.
Definition: classb_rtc_common.h:94
#define CLASSB_RTC_INT_PERIOD
RTC interrupt period.
Definition: classb_rtc_common.h:85

TC count reference.

This is the reference value for TC count within one RTC interrupt period. Reference = F_tc * Interrupt_Period_rtc / F_rtc This can overflow if CLASSB_TC_FREQ and CLASSB_RTC_INT_PERIOD are too large.

Note
Multiplying by 1e0L forces the preprocessor to do operations with higher precision.

Referenced by classb_freq_callback().

#define CLASSB_TC_FREQ   (uint32_t)(F_CPU / CLASSB_TC_PRESCALER)

TC frequency.

The frequency of the TC is F_CPU divided by the prescaling factor.

#define CLASSB_TC_MAX_DIFF
Value:
(uint32_t)((1e0L * CLASSB_TC_COUNT_REF \
* CLASSB_TC_TOLERANCE) / 100UL)
#define CLASSB_TC_COUNT_REF
TC count reference.
Definition: classb_freq.h:187
#define CLASSB_TC_TOLERANCE
Tolerance for the CPU frequency deviation.
Definition: classb_freq.h:141

Maximum absolute difference between reference and estimated frequency.

Note
Multiplying by 1e0L forces the preprocessor to do operations with higher precision.

Referenced by classb_freq_callback().

#define CLASSB_TC_MAX_OVF_COUNT
Value:
(uint16_t)((CLASSB_TC_COUNT_REF \
#define CLASSB_TC_COUNT_REF
TC count reference.
Definition: classb_freq.h:187
#define CLASSB_TC_MAX_DIFF
Maximum absolute difference between reference and estimated frequency.
Definition: classb_freq.h:196

TC maximum number of overflows.

This is a limit for the number of TC overflows. If this is exceeded, the RTC is assumed to be faulty and the error handler called.

Referenced by classb_freq_tc_callback().

#define CLASSB_TC_PER   0xFFFF

TC period.

The 16-bit TC will generate an interrupt when the count reaches this value. The code is built counting that this is the largest possible value, i.e., 0xFFFF.

Referenced by classb_freq_setup_timer().

#define CLASSB_TC_PRESCALER_gc   LABEL(TC_CLKSEL_DIV, CLASSB_TC_PRESCALER, _gc)

Label for the TC prescaler group configuration.

Referenced by classb_freq_setup_timer().

#define CLASSB_TEST_TC   LABEL(TC, CLASSB_TC_MOD,)

Label for the TC module.

Referenced by classb_freq_callback(), and classb_freq_setup_timer().

#define CLASSB_TEST_TC_OVF_vect   LABEL(TC, CLASSB_TC_MOD, _OVF_vect)

Label for the overflow interrupt vector for the chosen TC.