SD/MMC card unit tests.
Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.
#include <asf.h>
#include "conf_board.h"
#include "conf_clock.h"
#include "conf_test.h"
#include "sd_mmc_protocol.h"
Functions | |
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 | run_sd_mmc_sdio_rw_test (const struct test_case *test) |
SD/MMC/SDIO card read and write test. More... | |
static void | run_sdio_rw_test (const struct test_case *test) |
SDIO 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... | |
static COMPILER_WORD_ALIGNED uint8_t | buf_cia [TEST_CIA_SIZE] |
Buffer for test SDIO data. More... | |
#define NB_MULTI_BLOCKS (2) |
Referenced by run_sd_mmc_rw_test().
#define TEST_CIA_SIZE (0x16) |
Read and write test length of CIA in bytes.
Referenced by run_sdio_rw_test().
#define TEST_FILL_VALUE_U32 (0x5500AAFFU) |
The value used to generate test data.
Referenced by run_sd_mmc_rw_test().
int main | ( | void | ) |
Application entry point.
References uart_rs232_options::baudrate, board_init(), CONF_TEST_BAUDRATE, CONF_TEST_CHARLENGTH, CONF_TEST_PARITY, CONF_TEST_STOPBITS, CONF_TEST_USART, cpu_irq_enable, DEFINE_TEST_ARRAY, DEFINE_TEST_CASE, DEFINE_TEST_SUITE, irq_initialize_vectors, run_sd_mmc_init_test(), run_sd_mmc_sdio_rw_test(), stdio_serial_init(), sysclk_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 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_sdio_rw_test().
|
static |
SD/MMC/SDIO card read and write test.
test | Current test case. |
References CARD_TYPE_MMC, CARD_TYPE_SD, CARD_TYPE_SDIO, run_sd_mmc_rw_test(), run_sdio_rw_test(), sd_mmc_check(), sd_mmc_get_type(), SD_MMC_OK, and test_assert_true.
Referenced by main().
|
static |
SDIO card read and write test.
test | Current test case. |
References buf_cia, SD_MMC_OK, SDIO_CCCR_IEN, SDIO_CIA, sdio_read_direct(), sdio_read_extended(), sdio_write_direct(), sdio_write_extended(), test_assert_true, and TEST_CIA_SIZE.
Referenced by run_sd_mmc_sdio_rw_test().
|
static |
Buffer for test SDIO data.
Referenced by run_sdio_rw_test().
|
static |
Buffer used to save the sector area used by read/write tests.
Referenced by run_sd_mmc_rw_test().
|
static |
Buffer used by read/write tests.
Referenced by run_sd_mmc_rw_test().