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, CONF_STDIO_BAUDRATE, CONF_STDIO_MUX_SETTING, CONF_STDIO_PINMUX_PAD0, CONF_STDIO_PINMUX_PAD1, CONF_STDIO_PINMUX_PAD2, CONF_STDIO_PINMUX_PAD3, CONF_STDIO_USART, 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(), 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, 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().
Referenced by rtc_calendar_alarm_match_callback(), and run_rtc_calendar_interrupt_test().
struct rtc_module rtc_inst |
Referenced by run_rtc_calendar_interrupt_test(), and run_rtc_calendar_test().