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