Unit test for PARC driver.
Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
#include <asf.h>
#include "conf_test.h"
Macros | |
#define | DELAY_TIME 100 |
Functions | |
int | main (void) |
Run PARC driver unit tests. More... | |
static void | parc_complete_callback (struct parc_module *const module) |
callback handler for PARC data ready interrupt. More... | |
static void | parc_port_input_simulation (bool risingedge, uint32_t data) |
PARC input signal generating through GPIO port. More... | |
static void | run_parc_callback_test (const struct test_case *test) |
Test PARC functions in callback way. More... | |
static void | run_parc_ctrl_test (const struct test_case *test) |
Test PARC register write/read. More... | |
static void | run_parc_polled_test (const struct test_case *test) |
Test PARC functions in polling way. More... | |
Variables | |
static bool | callback_data_ready = false |
uint32_t | captured_data = 0 |
struct parc_config | config |
PARC configure stuct. More... | |
struct parc_module | module_inst |
#define DELAY_TIME 100 |
Referenced by run_parc_callback_test(), and run_parc_polled_test().
int main | ( | void | ) |
Run PARC driver unit tests.
References uart_rs232_options::baudrate, board_init(), DEFINE_TEST_ARRAY, DEFINE_TEST_CASE, DEFINE_TEST_SUITE, NULL, run_parc_callback_test(), run_parc_ctrl_test(), run_parc_polled_test(), stdio_serial_init(), sysclk_init(), test_suite_run(), and usart_serial_options.
|
static |
callback handler for PARC data ready interrupt.
module | The parc_module instance. |
References callback_data_ready, captured_data, and parc_read().
Referenced by run_parc_callback_test().
|
static |
PARC input signal generating through GPIO port.
risingedge | PARC sampling edge, rising edge(true),fall edge (false) |
data | Data to send |
References IOPORT_PIN_LEVEL_HIGH, IOPORT_PIN_LEVEL_LOW, and ioport_set_pin_level().
Referenced by run_parc_callback_test(), and run_parc_polled_test().
|
static |
Test PARC functions in callback way.
test | Current test case. |
References callback_data_ready, captured_data, config, delay_ms, DELAY_TIME, module_inst, PARC_CALLBACK_DATA_READY, parc_complete_callback(), parc_disable(), parc_disable_callback(), parc_disable_interrupts(), parc_enable(), parc_enable_callback(), parc_enable_interrupts(), parc_get_config_defaults(), parc_init(), PARC_INTERRUPT_DRDY, parc_port_input_simulation(), parc_register_callback(), parc_start_capture(), parc_stop_capture(), and test_assert_true.
Referenced by main().
|
static |
Test PARC register write/read.
test | Current test case. |
References config, module_inst, parc_disable(), parc_enable(), parc_get_config_defaults(), parc_get_status(), parc_init(), parc_start_capture(), PARC_STATUS_CS, PARC_STATUS_EN, parc_stop_capture(), and test_assert_true.
Referenced by main().
|
static |
Test PARC functions in polling way.
test | Current test case. |
References captured_data, config, delay_ms, DELAY_TIME, module_inst, parc_disable(), parc_enable(), parc_get_config_defaults(), parc_init(), parc_is_data_ready(), parc_port_input_simulation(), parc_read(), parc_start_capture(), parc_stop_capture(), and test_assert_true.
Referenced by main().
Referenced by parc_complete_callback(), and run_parc_callback_test().
uint32_t captured_data = 0 |
Referenced by parc_complete_callback(), run_parc_callback_test(), and run_parc_polled_test().
struct parc_config config |
PARC configure stuct.
Referenced by run_parc_callback_test(), run_parc_ctrl_test(), run_parc_polled_test(), trx_spi_init(), and uhd_ep_abort_pipe().
struct parc_module module_inst |
Referenced by parc_init(), run_parc_callback_test(), run_parc_ctrl_test(), and run_parc_polled_test().