/** * \brief Run unit tests for MT48LC16m16a2tg7 SDRAM * \return 0 which should never occur. */ int main (void) { const usart_serial_options_t usart_serial_options = { .baudrate = CONF_TEST_BAUDRATE, .charlength = CONF_TEST_CHARLENGTH, .paritytype = CONF_TEST_PARITY, .stopbits = CONF_TEST_STOPBITS, }; sysclk_init(); board_init(); stdio_serial_init(CONF_TEST_USART, &usart_serial_options); sdramc_init(sysclk_get_cpu_hz()); // Define all the test cases DEFINE_TEST_CASE(data_integrity_test, NULL, run_data_integrity_test, NULL, "Data integrity test"); // Put test case addresses in an array DEFINE_TEST_ARRAY(ebi_sdram_tests) = { &data_integrity_test, }; // Define the test suite DEFINE_TEST_SUITE(ebi_sdram_suite, ebi_sdram_tests, "UC3 EBI driver w/ SDRAM test suite"); // Set up the test data pointer and run all tests in the suite test_set_data(¶ms); test_suite_run(&ebi_sdram_suite); while (true); return (0); }
/** * \brief Run EBI driver unit tests */ int main (void) { const usart_serial_options_t usart_serial_options = { .baudrate = CONF_TEST_BAUDRATE, .charlength = CONF_TEST_CHARLENGTH, .paritytype = CONF_TEST_PARITY, .stopbits = CONF_TEST_STOPBITS, }; sysclk_init(); board_init(); sleepmgr_init(); stdio_serial_init(CONF_TEST_USART, &usart_serial_options); ebi_sram_init(); // Define all the test cases DEFINE_TEST_CASE(data_bus_test, NULL, run_data_bus_test, NULL, "Data bus test"); DEFINE_TEST_CASE(address_bus_test, NULL, run_address_bus_test, NULL, "Address bus test"); DEFINE_TEST_CASE(data_integrity_test, NULL, run_data_integrity_test, NULL, "Data integrity test"); // Put test case addresses in an array DEFINE_TEST_ARRAY(ebi_sram_tests) = { &data_bus_test, &address_bus_test, &data_integrity_test, }; // Define the test suite DEFINE_TEST_SUITE(ebi_sram_suite, ebi_sram_tests, "XMEGA EBI driver w/ SRAM test suite"); // Set up the test data pointer and run all tests in the suite test_set_data(¶ms); test_suite_run(&ebi_sram_suite); while (1) { /* Intentionally left empty. */ } }