![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Color Oled(SSD1331) connect to STMicroelectronics Nucleo-F466
mbed-os/TESTS/mbed_hal/qspi/qspi_test.h@0:8fdf9a60065b, 2018-10-10 (annotated)
- Committer:
- kadonotakashi
- Date:
- Wed Oct 10 00:33:53 2018 +0000
- Revision:
- 0:8fdf9a60065b
how to make mbed librry
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kadonotakashi | 0:8fdf9a60065b | 1 | /* mbed Microcontroller Library |
kadonotakashi | 0:8fdf9a60065b | 2 | * Copyright (c) 2018-2018 ARM Limited |
kadonotakashi | 0:8fdf9a60065b | 3 | * |
kadonotakashi | 0:8fdf9a60065b | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
kadonotakashi | 0:8fdf9a60065b | 5 | * you may not use this file except in compliance with the License. |
kadonotakashi | 0:8fdf9a60065b | 6 | * You may obtain a copy of the License at |
kadonotakashi | 0:8fdf9a60065b | 7 | * |
kadonotakashi | 0:8fdf9a60065b | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
kadonotakashi | 0:8fdf9a60065b | 9 | * |
kadonotakashi | 0:8fdf9a60065b | 10 | * Unless required by applicable law or agreed to in writing, software |
kadonotakashi | 0:8fdf9a60065b | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
kadonotakashi | 0:8fdf9a60065b | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
kadonotakashi | 0:8fdf9a60065b | 13 | * See the License for the specific language governing permissions and |
kadonotakashi | 0:8fdf9a60065b | 14 | * limitations under the License. |
kadonotakashi | 0:8fdf9a60065b | 15 | */ |
kadonotakashi | 0:8fdf9a60065b | 16 | |
kadonotakashi | 0:8fdf9a60065b | 17 | /** \addtogroup hal_qspi_tests |
kadonotakashi | 0:8fdf9a60065b | 18 | * @{ |
kadonotakashi | 0:8fdf9a60065b | 19 | */ |
kadonotakashi | 0:8fdf9a60065b | 20 | #ifndef MBED_QSPI_TEST_H |
kadonotakashi | 0:8fdf9a60065b | 21 | #define MBED_QSPI_TEST_H |
kadonotakashi | 0:8fdf9a60065b | 22 | |
kadonotakashi | 0:8fdf9a60065b | 23 | #include "qspi_api.h" |
kadonotakashi | 0:8fdf9a60065b | 24 | #include "qspi_test_utils.h" |
kadonotakashi | 0:8fdf9a60065b | 25 | |
kadonotakashi | 0:8fdf9a60065b | 26 | |
kadonotakashi | 0:8fdf9a60065b | 27 | #if DEVICE_QSPI |
kadonotakashi | 0:8fdf9a60065b | 28 | |
kadonotakashi | 0:8fdf9a60065b | 29 | /** Test that qspi_init/qspi_free can be called multiple times. |
kadonotakashi | 0:8fdf9a60065b | 30 | * |
kadonotakashi | 0:8fdf9a60065b | 31 | * Given board provides QSPI. |
kadonotakashi | 0:8fdf9a60065b | 32 | * When qspi_init/qspi_free is called multiple times. |
kadonotakashi | 0:8fdf9a60065b | 33 | * Then qspi_init/qspi_free are successfully performed (no exception is generated). |
kadonotakashi | 0:8fdf9a60065b | 34 | * |
kadonotakashi | 0:8fdf9a60065b | 35 | */ |
kadonotakashi | 0:8fdf9a60065b | 36 | void qspi_init_free_test(void); |
kadonotakashi | 0:8fdf9a60065b | 37 | |
kadonotakashi | 0:8fdf9a60065b | 38 | /** Test qspi frequency setting. |
kadonotakashi | 0:8fdf9a60065b | 39 | * |
kadonotakashi | 0:8fdf9a60065b | 40 | * Given board provides QSPI, with QSPI already initialized. |
kadonotakashi | 0:8fdf9a60065b | 41 | * When set QSPI frequency. |
kadonotakashi | 0:8fdf9a60065b | 42 | * Then freguency setting is successfully performed (no exception is generated). |
kadonotakashi | 0:8fdf9a60065b | 43 | * |
kadonotakashi | 0:8fdf9a60065b | 44 | */ |
kadonotakashi | 0:8fdf9a60065b | 45 | void qspi_frequency_test(void); |
kadonotakashi | 0:8fdf9a60065b | 46 | |
kadonotakashi | 0:8fdf9a60065b | 47 | /** Template for write/read tests |
kadonotakashi | 0:8fdf9a60065b | 48 | * |
kadonotakashi | 0:8fdf9a60065b | 49 | * Test single write/read operation of a block of data to/from the specific memory address |
kadonotakashi | 0:8fdf9a60065b | 50 | * Given board provides QSPI, with QSPI already initialized. |
kadonotakashi | 0:8fdf9a60065b | 51 | * When perform write and then read operations. |
kadonotakashi | 0:8fdf9a60065b | 52 | * Then data is successfully written and then read (no exception is generated) and the read data is valid. |
kadonotakashi | 0:8fdf9a60065b | 53 | * |
kadonotakashi | 0:8fdf9a60065b | 54 | * Test multiple write/read operation of a block of data to/from the same specific memory address |
kadonotakashi | 0:8fdf9a60065b | 55 | * Given board provides QSPI, with QSPI already initialized. |
kadonotakashi | 0:8fdf9a60065b | 56 | * When perform write and then read operations. |
kadonotakashi | 0:8fdf9a60065b | 57 | * Then data is successfully written and then read (no exception is generated) and the read data is valid. |
kadonotakashi | 0:8fdf9a60065b | 58 | * |
kadonotakashi | 0:8fdf9a60065b | 59 | * Test multiple adjacent write and single read operation of a block of data to/from the specific memory address |
kadonotakashi | 0:8fdf9a60065b | 60 | * Given board provides QSPI, with QSPI already initialized. |
kadonotakashi | 0:8fdf9a60065b | 61 | * When perform write and then read operations. |
kadonotakashi | 0:8fdf9a60065b | 62 | * Then data is successfully written and then read (no exception is generated) and the read data is valid. |
kadonotakashi | 0:8fdf9a60065b | 63 | * |
kadonotakashi | 0:8fdf9a60065b | 64 | * Test single write and multiple adjacent read operation of a block of data to/from the specific memory address |
kadonotakashi | 0:8fdf9a60065b | 65 | * Given board provides QSPI, with QSPI already initialized. |
kadonotakashi | 0:8fdf9a60065b | 66 | * When perform write and then read operations. |
kadonotakashi | 0:8fdf9a60065b | 67 | * Then data is successfully written and then read (no exception is generated) and the read data is valid. |
kadonotakashi | 0:8fdf9a60065b | 68 | * |
kadonotakashi | 0:8fdf9a60065b | 69 | */ |
kadonotakashi | 0:8fdf9a60065b | 70 | template < qspi_bus_width_t write_inst_width, |
kadonotakashi | 0:8fdf9a60065b | 71 | qspi_bus_width_t write_addr_width, |
kadonotakashi | 0:8fdf9a60065b | 72 | qspi_bus_width_t write_data_width, |
kadonotakashi | 0:8fdf9a60065b | 73 | qspi_bus_width_t write_alt_width, |
kadonotakashi | 0:8fdf9a60065b | 74 | unsigned int write_cmd, |
kadonotakashi | 0:8fdf9a60065b | 75 | qspi_address_size_t write_addr_size, |
kadonotakashi | 0:8fdf9a60065b | 76 | qspi_alt_size_t write_alt_size, |
kadonotakashi | 0:8fdf9a60065b | 77 | int write_frequency, |
kadonotakashi | 0:8fdf9a60065b | 78 | uint32_t write_count, |
kadonotakashi | 0:8fdf9a60065b | 79 | qspi_bus_width_t read_inst_width, |
kadonotakashi | 0:8fdf9a60065b | 80 | qspi_bus_width_t read_addr_width, |
kadonotakashi | 0:8fdf9a60065b | 81 | qspi_bus_width_t read_data_width, |
kadonotakashi | 0:8fdf9a60065b | 82 | qspi_bus_width_t read_alt_width, |
kadonotakashi | 0:8fdf9a60065b | 83 | unsigned int read_cmd, |
kadonotakashi | 0:8fdf9a60065b | 84 | int read_dummy_cycles, |
kadonotakashi | 0:8fdf9a60065b | 85 | qspi_address_size_t read_addr_size, |
kadonotakashi | 0:8fdf9a60065b | 86 | qspi_alt_size_t read_alt_size, |
kadonotakashi | 0:8fdf9a60065b | 87 | int read_frequency, |
kadonotakashi | 0:8fdf9a60065b | 88 | uint32_t read_count, |
kadonotakashi | 0:8fdf9a60065b | 89 | uint32_t test_count, |
kadonotakashi | 0:8fdf9a60065b | 90 | uint32_t data_size, |
kadonotakashi | 0:8fdf9a60065b | 91 | uint32_t flash_addr> |
kadonotakashi | 0:8fdf9a60065b | 92 | void qspi_write_read_test(void); |
kadonotakashi | 0:8fdf9a60065b | 93 | |
kadonotakashi | 0:8fdf9a60065b | 94 | #endif |
kadonotakashi | 0:8fdf9a60065b | 95 | |
kadonotakashi | 0:8fdf9a60065b | 96 | #endif |
kadonotakashi | 0:8fdf9a60065b | 97 | |
kadonotakashi | 0:8fdf9a60065b | 98 | /** @}*/ |