Unit tests for MegaRF IOPORT service.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
Functions | |
int | main (void) |
Run IOPORT unit tests. More... | |
static void | run_ioport_pin_test (const struct test_case *test) |
Test IOPORT pin level is getting changed. More... | |
static void | run_ioport_port_test (const struct test_case *test) |
Test IOPORT port level is getting changed. More... | |
int main | ( | void | ) |
Run IOPORT unit tests.
Initializes the clock system, board and serial output, then sets up the IOPORT Service unit test suite and runs it.
References usart_rs232_options::baudrate, board_init(), CONF_TEST_BAUDRATE, CONF_TEST_CHARLENGTH, CONF_TEST_PARITY, CONF_TEST_STOPBITS, CONF_TEST_USART, DEFINE_TEST_ARRAY, DEFINE_TEST_CASE, DEFINE_TEST_SUITE, run_ioport_pin_test(), run_ioport_port_test(), stdio_serial_init(), sysclk_init(), and test_suite_run().
|
static |
Test IOPORT pin level is getting changed.
This function set the direction of CONF_OUT_PIN to output mode with pull-up enabled and read the status of pin using CONF_IN_PIN which is configured in input mode.
The pin CONF_OUT_PIN and CONF_IN_PIN are shorted using a jumper.
test | Current test case. |
References CONF_IN_PIN, CONF_OUT_PIN, delay_ms, IOPORT_DIR_INPUT, IOPORT_DIR_OUTPUT, ioport_get_pin_level(), IOPORT_MODE_PULLUP, IOPORT_PIN_LEVEL_HIGH, IOPORT_PIN_LEVEL_LOW, ioport_set_pin_dir(), ioport_set_pin_level(), ioport_set_pin_mode(), ioport_toggle_pin_level(), and test_assert_true.
Referenced by main().
|
static |
Test IOPORT port level is getting changed.
This function set the direction of CONF_PORT_OUT_PIN_MASK to output mode with pull-up enabled and read the status of pin using CONF_PORT_IN_PIN_MASK which is configured in input mode. The pin CONF_PORT_OUT_PIN_MASK and CONF_PORT_IN_PIN_MASK are shorted using a jumper.
test | Current test case. |
References CONF_PORT, CONF_PORT_IN_PIN_MASK, CONF_PORT_OUT_PIN_MASK, delay_ms, IOPORT_DIR_INPUT, IOPORT_DIR_OUTPUT, ioport_get_port_level(), IOPORT_MODE_PULLUP, IOPORT_PIN_LEVEL_HIGH, IOPORT_PIN_LEVEL_LOW, ioport_set_port_dir(), ioport_set_port_level(), ioport_set_port_mode(), ioport_toggle_port_level(), and test_assert_true.
Referenced by main().