Microchip® Advanced Software Framework

drivers/rtc/unit_test_calendar/unit_test.c File Reference

SAM RTC Calendar Unit test.

Copyright (c) 2015-2020 Microchip Technology Inc. and its subsidiaries.

#include <asf.h>
#include <stdio_serial.h>
#include <string.h>
#include "conf_test.h"

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 void cdc_uart_init ( void  )
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 void rtc_calendar_alarm_match_callback ( void  )
static

struct usart_module cdc_uart_module

Referenced by cdc_uart_init(), and configure_console().