Unit tests for Events driver (PEVC).
Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
#include <asf.h>
#include <conf_test.h>
Functions | |
static void | init_ast (void) |
Initialize the AST as event generator. More... | |
static void | init_dacc (void) |
Initialize the DAC as event user. More... | |
int | main (void) |
Run Event driver unit tests. More... | |
static void | run_events_ast_test (const struct test_case *test) |
Test events driver with AST trigger. More... | |
static void | run_events_software_test (const struct test_case *test) |
Test events driver with Software trigger. More... | |
|
static |
Initialize the AST as event generator.
References AST_COUNTER_MODE, ast_enable(), ast_enable_event(), AST_EVENT_PER, AST_OSC_32KHZ, AST_PSEL_32KHZ_1HZ, ast_set_config(), ast_write_periodic0_value(), ast_config::counter, ast_config::mode, osc_enable(), OSC_ID_OSC32, osc_is_ready(), ast_config::osc_type, osc_wait_ready(), and ast_config::psel.
Referenced by run_events_ast_test().
|
static |
Initialize the DAC as event user.
References dacc_enable(), dacc_reset(), dacc_set_timing(), dacc_set_transfer_mode(), dacc_set_trigger(), and sysclk_enable_peripheral_clock().
Referenced by run_events_ast_test().
int main | ( | void | ) |
Run Event driver unit tests.
References uart_rs232_options::baudrate, board_init(), DEFINE_TEST_ARRAY, DEFINE_TEST_CASE, DEFINE_TEST_SUITE, NULL, run_events_ast_test(), run_events_software_test(), stdio_serial_init(), sysclk_init(), test_suite_run(), and usart_serial_options.
|
static |
Test events driver with AST trigger.
test | Current test case. |
References ast_disable(), events_ch_conf::channel_id, DACC_MAX_DATA, dacc_write_conversion_data(), delay_ms, EVENT_IGF_EDGE_NONE, events_ch_clear_trigger_status(), events_ch_configure(), events_ch_enable(), events_ch_get_config_defaults(), events_ch_is_triggered(), events_enable(), events_get_config_defaults(), events_init(), events_ch_conf::generator_id, events_ch_conf::igf_edge, init_ast(), init_dacc(), events_ch_conf::shaper_enable, and test_assert_true.
Referenced by main().
|
static |
Test events driver with Software trigger.
test | Current test case. |
References DACC_MAX_DATA, dacc_write_conversion_data(), delay_ms, events_ch_clear_trigger_status(), events_ch_enable_software_trigger(), events_ch_is_triggered(), events_ch_software_trigger(), and test_assert_true.
Referenced by main().