takashi kadono / Mbed OS Nucleo_446

Dependencies:   ssd1331

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers qspi_test.h Source File

qspi_test.h

00001 /* mbed Microcontroller Library
00002  * Copyright (c) 2018-2018 ARM Limited
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 /** \addtogroup hal_qspi_tests
00018  *  @{
00019  */
00020 #ifndef MBED_QSPI_TEST_H
00021 #define MBED_QSPI_TEST_H
00022 
00023 #include "qspi_api.h"
00024 #include "qspi_test_utils.h"
00025 
00026 
00027 #if DEVICE_QSPI
00028 
00029 /** Test that qspi_init/qspi_free can be called multiple times.
00030  *
00031  *  Given board provides QSPI.
00032  *  When qspi_init/qspi_free is called multiple times.
00033  *  Then qspi_init/qspi_free are successfully performed (no exception is generated).
00034  *
00035  */
00036 void qspi_init_free_test(void);
00037 
00038 /** Test qspi frequency setting.
00039  *
00040  *  Given board provides QSPI, with QSPI already initialized.
00041  *  When set QSPI frequency.
00042  *  Then freguency setting is successfully performed (no exception is generated).
00043  *
00044  */
00045 void qspi_frequency_test(void);
00046 
00047 /** Template for write/read tests
00048  *
00049  *  Test single write/read operation of a block of data to/from the specific memory address
00050  *  Given board provides QSPI, with QSPI already initialized.
00051  *  When perform write and then read operations.
00052  *  Then data is successfully written and then read (no exception is generated) and the read data is valid.
00053  *
00054  *  Test multiple write/read operation of a block of data to/from the same specific memory address
00055  *  Given board provides QSPI, with QSPI already initialized.
00056  *  When perform write and then read operations.
00057  *  Then data is successfully written and then read (no exception is generated) and the read data is valid.
00058  *
00059  *  Test multiple adjacent write and single read operation of a block of data to/from the specific memory address
00060  *  Given board provides QSPI, with QSPI already initialized.
00061  *  When perform write and then read operations.
00062  *  Then data is successfully written and then read (no exception is generated) and the read data is valid.
00063  *
00064  *  Test single write and multiple adjacent read operation of a block of data to/from the specific memory address
00065  *  Given board provides QSPI, with QSPI already initialized.
00066  *  When perform write and then read operations.
00067  *  Then data is successfully written and then read (no exception is generated) and the read data is valid.
00068  *
00069  */
00070 template <  qspi_bus_width_t write_inst_width,
00071             qspi_bus_width_t write_addr_width,
00072             qspi_bus_width_t write_data_width,
00073             qspi_bus_width_t write_alt_width,
00074             unsigned int write_cmd,
00075             qspi_address_size_t write_addr_size,
00076             qspi_alt_size_t write_alt_size,
00077             int write_frequency,
00078             uint32_t write_count,
00079             qspi_bus_width_t read_inst_width,
00080             qspi_bus_width_t read_addr_width,
00081             qspi_bus_width_t read_data_width,
00082             qspi_bus_width_t read_alt_width,
00083             unsigned int read_cmd,
00084             int read_dummy_cycles,
00085             qspi_address_size_t read_addr_size,
00086             qspi_alt_size_t read_alt_size,
00087             int read_frequency,
00088             uint32_t read_count,
00089             uint32_t test_count,
00090             uint32_t data_size,
00091             uint32_t flash_addr>
00092 void qspi_write_read_test(void);
00093 
00094 #endif
00095 
00096 #endif
00097 
00098 /** @}*/