Unit tests for QTouch component driver with I2C interface.
Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
Functions | |
static void | init_interface (void) |
Initialize TWI communication interface. More... | |
int | main (void) |
Run QTouch component driver with I2C interface unit tests. More... | |
static void | run_qt_test_comm_ready (const struct test_case *test) |
Test if communication is ready with QT device. More... | |
static void | run_qt_test_get_status (const struct test_case *test) |
Test if key status correctly. More... | |
static void | run_qt_test_setup_block (const struct test_case *test) |
Test if set QT device setup block correctly. More... | |
Variables | |
struct qt_setup_block | setup_block_0 |
Storage for QT setup block 0. More... | |
struct qt_setup_block | setup_block_1 |
Storage for QT setup block 1. More... | |
struct qt_status | status |
Storage for QT status. More... | |
|
static |
Initialize TWI communication interface.
References BOARD_QT_TWI_INSTANCE, twi_options::speed, and twi_master_setup().
Referenced by run_qt_test_comm_ready().
int main | ( | void | ) |
Run QTouch component driver with I2C interface unit tests.
References uart_rs232_options::baudrate, board_init(), CONF_TEST_BAUDRATE, CONF_TEST_PARITY, CONF_TEST_USART, DEFINE_TEST_ARRAY, DEFINE_TEST_CASE, DEFINE_TEST_SUITE, run_qt_test_comm_ready(), run_qt_test_get_status(), run_qt_test_setup_block(), stdio_serial_init(), sysclk_init(), and test_suite_run().
|
static |
Test if communication is ready with QT device.
test | Current test case. |
References ERR_IO_ERROR, ERR_UNSUPPORTED_DEV, init_interface(), qt_get_comm_ready(), qt_hardware_reset(), and test_assert_true.
Referenced by main().
|
static |
Test if key status correctly.
For unit test board, it assume there is no key been pressed in the test.
test | Current test case. |
References delay_ms, qt_get_status(), qt_is_change_line_low(), status, STATUS_OK, test_assert_false, test_assert_true, and ut_is_any_key_pressed().
Referenced by main().
|
static |
Test if set QT device setup block correctly.
test | Current test case. |
References qt_read_setup_block(), qt_write_setup_block(), setup_block_0, setup_block_1, STATUS_OK, test_assert_true, and ut_set_qt_param().
Referenced by main().
struct qt_setup_block setup_block_0 |
Storage for QT setup block 0.
Referenced by run_qt_test_setup_block().
struct qt_setup_block setup_block_1 |
Storage for QT setup block 1.
Referenced by run_qt_test_setup_block().
struct qt_status status |
Storage for QT status.
Referenced by run_qt_test_get_status(), twi_master_init(), twi_master_read(), twi_master_write(), twi_slave_read(), and twi_slave_write().