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_ospi
19 * @{
20 * \defgroup hal_ospi_tests Tests
21 * OSPI tests of the HAL.
22 * @{
23 */
24#ifndef MBED_OSPI_TEST_H
25#define MBED_OSPI_TEST_H
26
27#include "ospi_test_utils.h"
28#include "ospi_api.h"
29
30
31#if DEVICE_OSPI
32
33/** Test that ospi_init/ospi_free can be called multiple times.
34 *
35 * Given board provides OSPI.
36 * When ospi_init/ospi_free is called multiple times.
37 * Then ospi_init/ospi_free are successfully performed (no exception is generated).
38 *
39 */
40void ospi_init_free_test(void);
41
42/** Test ospi frequency setting.
43 *
44 * Given board provides OSPI, with OSPI already initialized.
45 * When set OSPI frequency.
46 * Then freguency setting is successfully performed (no exception is generated).
47 *
48 */
49void ospi_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 OSPI, with OSPI 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 OSPI, with OSPI 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 OSPI, with OSPI 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 OSPI, with OSPI 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 */
74template < ospi_bus_width_t write_inst_width,
75 ospi_bus_width_t write_addr_width,
76 ospi_bus_width_t write_data_width,
77 ospi_bus_width_t write_alt_width,
78unsignedint write_cmd,
79 ospi_address_size_t write_addr_size,
80 ospi_alt_size_t write_alt_size,
81 uint32_t write_count,
82 ospi_bus_width_t read_inst_width,
83 ospi_bus_width_t read_addr_width,
84 ospi_bus_width_t read_data_width,
85 ospi_bus_width_t read_alt_width,
86unsignedint read_cmd,
87int read_dummy_cycles,
88 ospi_address_size_t read_addr_size,
89 ospi_alt_size_t read_alt_size,
90int frequency,
91 uint32_t read_count,
92 uint32_t test_count,
93 uint32_t data_size,
94 uint32_t flash_addr>
95void ospi_write_read_test(void);
96
97#endif
98
99#endif
100
101/** @}*/
102/** @}*/
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.