SAM RTC Calendar Unit test.
Copyright (c) 2015-2020 Microchip Technology Inc. and its subsidiaries.
Functions | |
static void | cdc_uart_init (void) |
Initialize the USART for unit test. More... | |
int | main (void) |
Run RTC unit tests. More... | |
static void | rtc_calendar_alarm_match_callback (void) |
static void | run_rtc_calendar_interrupt_test (const struct test_case *test) |
static void | run_rtc_calendar_test (const struct test_case *test) |
Test for RTC calendar polled mode test. More... | |
Variables | |
struct usart_module | cdc_uart_module |
volatile bool | interrupt_flag = false |
struct rtc_module | rtc_inst |
|
static |
Initialize the USART for unit test.
Initializes the SERCOM USART (SERCOM4) used for sending the unit test status to the computer via the EDBG CDC gateway.
References usart_config::baudrate, cdc_uart_module, usart_config::mux_setting, usart_config::pinmux_pad0, usart_config::pinmux_pad1, usart_config::pinmux_pad2, usart_config::pinmux_pad3, usart_enable(), and usart_get_config_defaults().
Referenced by main().
int main | ( | void | ) |
Run RTC unit tests.
Initializes the system and serial output, then sets up the RTC unit test suite and runs it.
References cdc_uart_init(), DEFINE_TEST_ARRAY, DEFINE_TEST_CASE, DEFINE_TEST_SUITE, delay_init(), NULL, run_rtc_calendar_interrupt_test(), run_rtc_calendar_test(), system_init(), and test_suite_run().
|
static |
References interrupt_flag.
Referenced by run_rtc_calendar_interrupt_test().
|
static |
References rtc_calendar_time::day, delay_s, rtc_calendar_time::hour, interrupt_flag, rtc_calendar_alarm_time::mask, rtc_calendar_time::minute, rtc_calendar_time::month, RTC_CALENDAR_ALARM_MASK_HOUR, rtc_calendar_alarm_match_callback(), RTC_CALENDAR_CALLBACK_ALARM_0, rtc_calendar_clear_alarm_match(), rtc_calendar_disable(), rtc_calendar_disable_callback(), rtc_calendar_enable(), rtc_calendar_enable_callback(), rtc_calendar_register_callback(), rtc_calendar_set_alarm(), rtc_calendar_set_time(), rtc_calendar_unregister_callback(), rtc_inst, rtc_calendar_time::second, STATUS_OK, test_assert_true, rtc_calendar_alarm_time::time, and rtc_calendar_time::year.
Referenced by main().
|
static |
Test for RTC calendar polled mode test.
This test initializes the RTC module and checks whether the initialization is successful or not.
Then this test executes alarm match test and overflow test.
test | Current test case. |
References rtc_calendar_config::clock_24h, rtc_calendar_time::day, delay_s, rtc_calendar_time::hour, rtc_calendar_alarm_time::mask, rtc_calendar_time::minute, rtc_calendar_time::month, result, RTC_CALENDAR_ALARM_MASK_YEAR, rtc_calendar_clear_alarm_match(), rtc_calendar_clear_overflow(), rtc_calendar_disable(), rtc_calendar_enable(), rtc_calendar_get_config_defaults(), rtc_calendar_get_time_defaults(), rtc_calendar_init(), rtc_calendar_is_alarm_match(), rtc_calendar_is_overflow(), rtc_calendar_set_alarm(), rtc_calendar_set_time(), rtc_inst, rtc_calendar_time::second, STATUS_OK, test_assert_true, rtc_calendar_alarm_time::time, and rtc_calendar_time::year.
Referenced by main().
struct usart_module cdc_uart_module |
Referenced by cdc_uart_init(), and configure_console().
Referenced by ac_user_callback(), adc_user_callback(), extint_user_callback(), freqm_complete_callback(), rtc_calendar_alarm_match_callback(), rtc_count_match_callback(), run_ac_callback_mode_test(), run_adc_callback_mode_test(), run_adc_window_mode_test(), run_extint_callback_mode_test(), run_freqm_callback_read_test(), run_rtc_calendar_interrupt_test(), run_rtc_count_interrupt_test(), setup_adc_callback_mode_test(), and setup_adc_window_mode_test().
struct rtc_module rtc_inst |
Referenced by cleanup_asynchronous_event_test(), cleanup_resynchronous_event_test(), cleanup_synchronous_event_test(), run_asynchronous_event_test(), run_resynchronous_event_test(), run_rtc_calendar_interrupt_test(), run_rtc_calendar_test(), run_rtc_count_interrupt_test(), run_rtc_count_test(), run_synchronous_event_test(), and test_event_gen_user_init().