Unit tests for AST driver.
Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.
#include <asf.h>
#include <conf_test.h>
Functions | |
static void | ast_alarm_callback (void) |
Callback handler for AST alarm interrupt. More... | |
static void | ast_per_callback (void) |
Callback handler for AST periodic interrupt. More... | |
int | main (void) |
Run AST driver unit tests. More... | |
static void | run_alarm_test (const struct test_case *test) |
Test alarm interrupt and wakeup functions in calendar/counter mode. More... | |
static void | run_periodic_test (const struct test_case *test) |
Test periodic interrupt and wakeup functions in counter mode. More... | |
Variables | |
volatile uint8_t | flag = 0 |
|
static |
Callback handler for AST alarm interrupt.
References ast_clear_interrupt_flag(), ast_disable_interrupt(), AST_INTERRUPT_ALARM, and flag.
Referenced by run_alarm_test().
|
static |
Callback handler for AST periodic interrupt.
References ast_clear_interrupt_flag(), ast_disable_interrupt(), AST_INTERRUPT_PER, and flag.
Referenced by run_periodic_test().
int main | ( | void | ) |
Run AST driver unit tests.
References uart_rs232_options::baudrate, board_init(), DEFINE_TEST_ARRAY, DEFINE_TEST_CASE, DEFINE_TEST_SUITE, NULL, osc_enable(), OSC_ID_OSC32, osc_is_ready(), osc_wait_ready(), run_alarm_test(), run_periodic_test(), stdio_serial_init(), sysclk_init(), test_suite_run(), and usart_serial_options.
|
static |
Test alarm interrupt and wakeup functions in calendar/counter mode.
test | Current test case. |
References ast_alarm_callback(), AST_CALENDAR_MODE, ast_clear_interrupt_flag(), AST_COUNTER_MODE, ast_disable(), ast_enable(), ast_enable_interrupt(), ast_enable_wakeup(), AST_INTERRUPT_ALARM, AST_OSC_32KHZ, AST_PSEL_32KHZ_1HZ, ast_read_counter_value(), ast_set_callback(), ast_set_config(), AST_WAKEUP_ALARM, ast_write_alarm0_value(), bpm_enable_wakeup_source(), bpm_sleep(), BPM_SM_WAIT, ast_config::calendar, ast_config::counter, ast_calv::day, delay_ms, ast_calendar::field, ast_calendar::FIELD, flag, ast_calv::hour, ast_calv::min, ast_config::mode, ast_calv::month, ast_config::osc_type, ast_config::psel, ast_calv::sec, test_assert_true, and ast_calv::year.
Referenced by main().
|
static |
Test periodic interrupt and wakeup functions in counter mode.
test | Current test case. |
References ast_clear_interrupt_flag(), AST_COUNTER_MODE, ast_disable(), ast_disable_interrupt(), ast_enable(), ast_enable_interrupt(), ast_enable_wakeup(), AST_INTERRUPT_PER, AST_OSC_32KHZ, ast_per_callback(), AST_PSEL_32KHZ_1HZ, ast_read_interrupt_mask(), ast_set_callback(), ast_set_config(), AST_WAKEUP_PER, ast_write_periodic0_value(), bpm_enable_wakeup_source(), bpm_sleep(), BPM_SM_WAIT, ast_config::counter, delay_ms, flag, ast_config::mode, ast_config::osc_type, ast_config::psel, and test_assert_true.
Referenced by main().
volatile uint8_t flag = 0 |