Microchip® Advanced Software Framework

/components/memory/serial_flash/at25dfx/unit_tests/unit_tests.c File Reference

Unit tests for AT25DFx driver.

Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.

#include <asf.h>
#include <conf_test.h>
#include <conf_at25dfx.h>

Macros

#define TEST_BUFFER_SIZE   16
 
#define TEST_ERASE_VALUE   0xff
 
#define TEST_FLASH_SIZE   (1024 * 1024UL)
 
#define TEST_PAGE_SIZE   256
 

Functions

static void cdc_uart_init (void)
 
int main (void)
 
static void test_at25dfx_init (void)
 
Tests
static void run_check_presence_test (const struct test_case *test)
 
static void run_read_write_buffer_test (const struct test_case *test)
 
static void run_erase_test (const struct test_case *test)
 
static void run_erase_block_test (const struct test_case *test)
 
static void run_global_sector_protect_test (const struct test_case *test)
 
static void run_set_get_sector_protect_test (const struct test_case *test)
 
static void run_sleep_wake_test (const struct test_case *test)
 

Variables

static struct at25dfx_chip_module at25dfx_chip
 
static struct at25dfx_chip_module at25dfx_dummy
 
static at25dfx_spi_module_t at25dfx_spi
 
static struct usart_module cdc_uart_module
 
static uint8_t test_rx_buffer [TEST_BUFFER_SIZE]
 
static uint8_t test_tx_buffer [TEST_BUFFER_SIZE]
 

#define TEST_BUFFER_SIZE   16
#define TEST_PAGE_SIZE   256

static void run_check_presence_test ( const struct test_case test)
static

struct at25dfx_chip_module at25dfx_chip
static
struct at25dfx_chip_module at25dfx_dummy
static
at25dfx_spi_module_t at25dfx_spi
static
struct usart_module cdc_uart_module
static
uint8_t test_tx_buffer[TEST_BUFFER_SIZE]
static
Initial value:
= {
0x12, 0x34, 0x56, 0x78,
0x9a, 0xbc, 0xde, 0xf0,
0x21, 0x43, 0x65, 0x87,
0xa9, 0xcb, 0xed, 0x0f,
}

Referenced by run_erase_block_test(), run_erase_test(), run_global_sector_protect_test(), run_read_write_buffer_test(), and run_sleep_wake_test().