Unit tests for lcdca driver.
Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.
#include <string.h>
#include <asf.h>
#include "conf_test.h"
Macros | |
#define | LCDCA_AUTONOMOUS_CHECK_MASK (LCDCA_SR_CSRS) |
#define | LCDCA_BLINK_CHECK_MASK (LCDCA_SR_BLKS) |
#define | LCDCA_INIT_CHECK_MASK (LCDCA_SR_EN | LCDCA_SR_FC0S | LCDCA_SR_FC1S | LCDCA_SR_FC2S) |
Functions | |
int | main (void) |
Run LCDCA unit tests. More... | |
static void | run_lcdca_automated_scrolling_test (const struct test_case *test) |
Test LCDCA automated scrolling feature. More... | |
static void | run_lcdca_automated_sequential_test (const struct test_case *test) |
Test LCDCA automated sequential feature. More... | |
static void | run_lcdca_autonomous_test (const struct test_case *test) |
Test LCDCA autonomous feature. More... | |
static void | run_lcdca_blink_test (const struct test_case *test) |
Test LCDCA blink feature. More... | |
static void | run_lcdca_contrast_change_test (const struct test_case *test) |
Test LCDCA contrast change. More... | |
static void | run_lcdca_end_test (const struct test_case *test) |
Clean up LCDCA test. More... | |
static void | run_lcdca_init_test (const struct test_case *test) |
Test LCDCA initialization. More... | |
#define LCDCA_AUTONOMOUS_CHECK_MASK (LCDCA_SR_CSRS) |
Referenced by run_lcdca_autonomous_test().
#define LCDCA_BLINK_CHECK_MASK (LCDCA_SR_BLKS) |
Referenced by run_lcdca_blink_test().
#define LCDCA_INIT_CHECK_MASK (LCDCA_SR_EN | LCDCA_SR_FC0S | LCDCA_SR_FC1S | LCDCA_SR_FC2S) |
Referenced by run_lcdca_init_test().
int main | ( | void | ) |
Run LCDCA unit tests.
Initializes board, serial output, then sets up the LCDCA unit test suite and runs it.
References uart_rs232_options::baudrate, board_init(), DEFINE_TEST_ARRAY, DEFINE_TEST_CASE, DEFINE_TEST_SUITE, NULL, run_lcdca_automated_scrolling_test(), run_lcdca_automated_sequential_test(), run_lcdca_autonomous_test(), run_lcdca_blink_test(), run_lcdca_contrast_change_test(), run_lcdca_end_test(), run_lcdca_init_test(), sleepmgr_init(), stdio_serial_init(), sysclk_init(), test_suite_run(), and usart_serial_options.
|
static |
Test LCDCA automated scrolling feature.
test | Current test case. |
References lcdca_automated_char_config::automated_mode, lcdca_automated_char_config::automated_timer, delay_ms, lcdca_automated_char_config::dign, lcdca_automated_char_config::dir_reverse, lcdca_automated_char_config::lcd_tdg, lcdca_automated_char_set_config(), lcdca_automated_char_start(), lcdca_automated_char_stop(), LCDCA_AUTOMATED_DIR_REVERSE, LCDCA_AUTOMATED_MODE_SCROLLING, LCDCA_TDG_14SEG4COM, LCDCA_TIMER_FC1, status, lcdca_automated_char_config::steps, lcdca_automated_char_config::stseg, and test_assert_true.
Referenced by main().
|
static |
Test LCDCA automated sequential feature.
test | Current test case. |
References lcdca_automated_char_config::automated_mode, lcdca_automated_char_config::automated_timer, delay_ms, lcdca_automated_char_config::dign, lcdca_automated_char_config::dir_reverse, lcdca_automated_char_config::lcd_tdg, lcdca_automated_char_set_config(), lcdca_automated_char_start(), lcdca_automated_char_stop(), LCDCA_AUTOMATED_DIR_REVERSE, LCDCA_AUTOMATED_MODE_SEQUENTIAL, LCDCA_TDG_14SEG4COM, LCDCA_TIMER_FC1, status, lcdca_automated_char_config::steps, lcdca_automated_char_config::stseg, and test_assert_true.
Referenced by main().
|
static |
Test LCDCA autonomous feature.
test | Current test case. |
References lcdca_circular_shift_config::data, delay_ms, lcdca_circular_shift_config::lcd_csr_dir, lcdca_circular_shift_config::lcd_csr_timer, LCDCA_AUTONOMOUS_CHECK_MASK, lcdca_circular_shift_disable(), lcdca_circular_shift_enable(), lcdca_circular_shift_set_config(), LCDCA_CSR_RIGHT, lcdca_get_status(), LCDCA_TIMER_FC2, lcdca_circular_shift_config::size, status, and test_assert_true.
Referenced by main().
|
static |
Test LCDCA blink feature.
test | Current test case. |
References delay_ms, lcdca_blink_config::lcd_blink_mode, lcdca_blink_config::lcd_blink_timer, LCDCA_BLINK_CHECK_MASK, lcdca_blink_disable(), lcdca_blink_enable(), LCDCA_BLINK_SELECTED, lcdca_blink_set_config(), lcdca_clear_pixel(), lcdca_get_status(), lcdca_set_blink_pixel(), lcdca_set_pixel(), LCDCA_TIMER_FC2, status, and test_assert_true.
Referenced by main().
|
static |
Test LCDCA contrast change.
test | Current test case. |
References lcdca_set_contrast(), and test_assert_true.
Referenced by main().
|
static |
Clean up LCDCA test.
test | Current test case. |
References IOPORT_PIN_LEVEL_LOW, ioport_set_pin_level(), lcdca_disable(), and UNUSED.
Referenced by main().
|
static |
Test LCDCA initialization.
test | Current test case. |
References lcdca_config::contrast, lcdca_config::duty_type, lcdca_config::fc0, lcdca_config::fc1, lcdca_config::fc2, IOPORT_PIN_LEVEL_HIGH, ioport_set_pin_level(), lcdca_config::lcd_clkdiv, lcdca_config::lcd_pres, lcdca_clk_init(), lcdca_enable(), lcdca_enable_timer(), lcdca_get_status(), LCDCA_INIT_CHECK_MASK, lcdca_set_config(), LCDCA_TIMER_FC0, LCDCA_TIMER_FC1, LCDCA_TIMER_FC2, lcdca_config::lp_wave, lcdca_config::port_mask, status, test_assert_true, and lcdca_config::x_bias.
Referenced by main().