Microchip® Advanced Software Framework

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages

Setup and test functions.

Functions

void classb_freq_callback (void)
 Callback function for the RTC interrupt. More...
 
void classb_freq_setup_timer (void)
 Set up the TC for use in the frequency test. More...
 
void classb_freq_tc_callback (void)
 TC overflow interrupt. More...
 

Variables

volatile uint16_t classb_tc_ovf_cnt = 0
 Counter variable for the number of TC overflows. More...
 

void classb_freq_callback ( void  )

Callback function for the RTC interrupt.

This function calculates the difference between the TC count and the predefined reference. The error handler CLASSB_ERROR_HANDLER_FREQ() is called if the relative difference is larger than the tolerance set with CLASSB_TC_MAX_DIFF.

References CLASSB_ERROR_HANDLER_FREQ, CLASSB_TC_COUNT_REF, CLASSB_TC_MAX_DIFF, classb_tc_ovf_cnt, and CLASSB_TEST_TC.

Referenced by classb_rtc_callback().

void classb_freq_setup_timer ( void  )

Set up the TC for use in the frequency test.

This configures the period, prescaler and overflow interrupt.

References CLASSB_TC_PER, CLASSB_TC_PRESCALER_gc, and CLASSB_TEST_TC.

Referenced by oven_classb_init_tests().

void classb_freq_tc_callback ( void  )

TC overflow interrupt.

This counts the number of TC overflows and the error handler is called if the configurable maximum is exceeded. The purpose of the latter is to detect RTC failure: the TC is reset in the RTC interrupt. If the RTC interrupt is too slow, the number of TC overflows will exceed the limit. Note that if the TC frequency increases abruptly, the error would probably be detected here.

References CLASSB_ERROR_HANDLER_FREQ, CLASSB_TC_MAX_OVF_COUNT, and classb_tc_ovf_cnt.

Referenced by oven_classb_init_tests().

volatile uint16_t classb_tc_ovf_cnt = 0

Counter variable for the number of TC overflows.

This variable is used to keep the MSW (bits 31 to 16) of the TC count.

Referenced by classb_freq_callback(), and classb_freq_tc_callback().