SD/MMC card unit tests.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
Functions | |
static void | cdc_uart_init (void) |
Initialize the USART for unit test. More... | |
int | main (void) |
Application entry point. More... | |
static void | run_sd_mmc_init_test (const struct test_case *test) |
SD/MMC stack initialization test. More... | |
static void | run_sd_mmc_rw_test (const struct test_case *test) |
SD/MMC card read and write test. More... | |
static void | rw_test (const struct test_case *test, uint16_t nb_block, bool split_tansfer) |
SD/MMC card read and write test. More... | |
Test configurations | |
#define | NB_MULTI_BLOCKS (2) |
#define | TEST_FILL_VALUE_U32 (0x5500AAFFU) |
The value used to generate test data. More... | |
#define | TEST_CIA_SIZE (0x16) |
Read and write test length of CIA in bytes. More... | |
static COMPILER_WORD_ALIGNED uint8_t | buf_save [SD_MMC_BLOCK_SIZE *NB_MULTI_BLOCKS] |
Buffer used to save the sector area used by read/write tests. More... | |
static COMPILER_WORD_ALIGNED uint8_t | buf_test [SD_MMC_BLOCK_SIZE *NB_MULTI_BLOCKS] |
Buffer used by read/write tests. More... | |
struct usart_module | cdc_uart_module |
Structure for UART module connected to EDBG (used for unit test output) More... | |
#define NB_MULTI_BLOCKS (2) |
Referenced by run_sd_mmc_rw_test(), and rw_test().
#define TEST_CIA_SIZE (0x16) |
Read and write test length of CIA in bytes.
#define TEST_FILL_VALUE_U32 (0x5500AAFFU) |
The value used to generate test data.
Referenced by rw_test().
|
static |
Initialize the USART for unit test.
Initializes the SERCOM USART used for sending the unit test status to the computer via the EDBG CDC gateway.
References usart_config::baudrate, cdc_uart_module, CONF_STDIO_BAUDRATE, CONF_STDIO_MUX_SETTING, CONF_STDIO_PINMUX_PAD0, CONF_STDIO_PINMUX_PAD1, CONF_STDIO_PINMUX_PAD2, CONF_STDIO_PINMUX_PAD3, CONF_STDIO_USART, usart_config::mux_setting, usart_config::pinmux_pad0, usart_config::pinmux_pad1, usart_config::pinmux_pad2, usart_config::pinmux_pad3, usart_enable(), and usart_get_config_defaults().
Referenced by main().
int main | ( | void | ) |
Application entry point.
References cdc_uart_init(), cpu_irq_enable, DEFINE_TEST_ARRAY, DEFINE_TEST_CASE, DEFINE_TEST_SUITE, delay_init(), delay_ms, irq_initialize_vectors, run_sd_mmc_init_test(), run_sd_mmc_rw_test(), system_init(), and test_suite_run().
|
static |
SD/MMC stack initialization test.
test | Current test case. |
References sd_mmc_check(), SD_MMC_ERR_NO_CARD, sd_mmc_init(), SD_MMC_INIT_ONGOING, SD_MMC_OK, and test_assert_true.
Referenced by main().
|
static |
SD/MMC card read and write test.
test | Current test case. |
References CARD_TYPE_MMC, CARD_TYPE_SD, NB_MULTI_BLOCKS, rw_test(), sd_mmc_check(), sd_mmc_get_type(), SD_MMC_OK, and test_assert_true.
Referenced by main().
SD/MMC card read and write test.
test | Current test case. |
nb_block | Test blocks. |
split_tansfer | Split transfer setting. |
References buf_save, buf_test, NB_MULTI_BLOCKS, SD_MMC_BLOCK_SIZE, sd_mmc_get_capacity(), sd_mmc_init_read_blocks(), sd_mmc_init_write_blocks(), sd_mmc_is_write_protected(), SD_MMC_OK, sd_mmc_start_read_blocks(), sd_mmc_start_write_blocks(), sd_mmc_wait_end_of_read_blocks(), sd_mmc_wait_end_of_write_blocks(), test_assert_true, and TEST_FILL_VALUE_U32.
Referenced by run_sd_mmc_rw_test().
|
static |
Buffer used to save the sector area used by read/write tests.
Referenced by rw_test().
|
static |
Buffer used by read/write tests.
Referenced by rw_test().
struct usart_module cdc_uart_module |
Structure for UART module connected to EDBG (used for unit test output)
Referenced by cdc_uart_init().