Mistake on this page?
Report an issue in GitHub or email us
qspi_test.h
1 /* mbed Microcontroller Library
2  * Copyright (c) 2018-2018 ARM Limited
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 /** \addtogroup hal_qspi
19  * @{
20  * \defgroup hal_qspi_tests Tests
21  * QSPI tests of the HAL.
22  * @{
23  */
24 #ifndef MBED_QSPI_TEST_H
25 #define MBED_QSPI_TEST_H
26 
27 #include "qspi_api.h"
28 #include "qspi_test_utils.h"
29 
30 
31 #if DEVICE_QSPI
32 
33 /** Test that qspi_init/qspi_free can be called multiple times.
34  *
35  * Given board provides QSPI.
36  * When qspi_init/qspi_free is called multiple times.
37  * Then qspi_init/qspi_free are successfully performed (no exception is generated).
38  *
39  */
40 void qspi_init_free_test(void);
41 
42 /** Test qspi frequency setting.
43  *
44  * Given board provides QSPI, with QSPI already initialized.
45  * When set QSPI frequency.
46  * Then freguency setting is successfully performed (no exception is generated).
47  *
48  */
49 void qspi_frequency_test(void);
50 
51 /** Template for write/read tests
52  *
53  * Test single write/read operation of a block of data to/from the specific memory address
54  * Given board provides QSPI, with QSPI already initialized.
55  * When perform write and then read operations.
56  * Then data is successfully written and then read (no exception is generated) and the read data is valid.
57  *
58  * Test multiple write/read operation of a block of data to/from the same specific memory address
59  * Given board provides QSPI, with QSPI already initialized.
60  * When perform write and then read operations.
61  * Then data is successfully written and then read (no exception is generated) and the read data is valid.
62  *
63  * Test multiple adjacent write and single read operation of a block of data to/from the specific memory address
64  * Given board provides QSPI, with QSPI already initialized.
65  * When perform write and then read operations.
66  * Then data is successfully written and then read (no exception is generated) and the read data is valid.
67  *
68  * Test single write and multiple adjacent read operation of a block of data to/from the specific memory address
69  * Given board provides QSPI, with QSPI already initialized.
70  * When perform write and then read operations.
71  * Then data is successfully written and then read (no exception is generated) and the read data is valid.
72  *
73  */
74 template < qspi_bus_width_t write_inst_width,
75  qspi_bus_width_t write_addr_width,
76  qspi_bus_width_t write_data_width,
77  qspi_bus_width_t write_alt_width,
78  unsigned int write_cmd,
79  qspi_address_size_t write_addr_size,
80  qspi_alt_size_t write_alt_size,
81  uint32_t write_count,
82  qspi_bus_width_t read_inst_width,
83  qspi_bus_width_t read_addr_width,
84  qspi_bus_width_t read_data_width,
85  qspi_bus_width_t read_alt_width,
86  unsigned int read_cmd,
87  int read_dummy_cycles,
88  qspi_address_size_t read_addr_size,
89  qspi_alt_size_t read_alt_size,
90  int frequency,
91  uint32_t read_count,
92  uint32_t test_count,
93  uint32_t data_size,
94  uint32_t flash_addr>
95 void qspi_write_read_test(void);
96 
97 #endif
98 
99 #endif
100 
101 /** @}*/
102 /** @}*/
void qspi_init_free_test(void)
Test that qspi_init/qspi_free can be called multiple times.
enum qspi_address_size qspi_address_size_t
Address size in bits.
void qspi_write_read_test(void)
Template for write/read tests.
void qspi_frequency_test(void)
Test qspi frequency setting.
uint8_t qspi_alt_size_t
Alternative size in bits.
Definition: qspi_api.h:79
enum qspi_bus_width qspi_bus_width_t
QSPI Bus width.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.