Skip to content

Commit 1e81863

Browse files
author
Amanda Butler
authored
Merge pull request #676 from maciejbocianski/update_qspi_docs
Update QSPI porting guide
2 parents 6319535 + 25ece26 commit 1e81863

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

docs/reference/contributing/target/QuadSPI.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ Implementing QSPI enables Mbed OS to communicate with external memories much fas
44

55
The most common use case is an external memory to use as additional data storage.
66

7-
<span class="warnings">**Warning:** We are changing the QSPI HAL API in an upcoming release of Mbed OS. This page documents code that exists on a feature branch of Mbed OS. You can find details on how it may affect you in the [Implementing the QSPI API](#implementing-quadspi) section.</span>
8-
97
### Assumptions
108

119
#### Defined behavior
@@ -29,6 +27,29 @@ To make sure your platform is ready for the upcoming changes, you need to implem
2927

3028
The target needs to define the `qspi_s` structure - target specific QSPI object.
3129

30+
The target needs to define the QSPI interface pin names:
31+
32+
- `QSPI_FLASHn_XXX` for pins connected to onboard flash memory.
33+
- `QSPIn_XXX` for pins routed out to external connector.
34+
35+
`n` is the interface index, typically `1` if single QSPI interface available.
36+
37+
```
38+
QSPIn_IO0
39+
QSPIn_IO1
40+
QSPIn_IO2
41+
QSPIn_IO3
42+
QSPIn_SCK
43+
QSPIn_CSN
44+
45+
QSPI_FLASHn_IO0
46+
QSPI_FLASHn_IO1
47+
QSPI_FLASHn_IO2
48+
QSPI_FLASHn_IO3
49+
QSPI_FLASHn_SCK
50+
QSPI_FLASHn_CSN
51+
```
52+
3253
Functions to implement:
3354

3455
```
@@ -41,7 +62,7 @@ qspi_status_t qspi_read(qspi_t *obj, const qspi_command_t *command, void *data,
4162
4263
```
4364

44-
Use `qspi_write` and `qspi_read` for data transfers. For communicating with a device, use `qspi_command_transfer`.
65+
Use `qspi_write` and `qspi_read` for data transfers. To communicate with a device, use `qspi_command_transfer`.
4566

4667
To enable the QSPI HAL, define `QSPI` in the targets.json file inside `device_has`:
4768

@@ -53,4 +74,12 @@ To enable the QSPI HAL, define `QSPI` in the targets.json file inside `device_ha
5374

5475
### Testing
5576

56-
To be implemented
77+
The Mbed OS HAL provides a set of conformance tests for the QSPI interface.
78+
79+
<span class="notes">**Note:** QSPI HAL tests require QSPI Flash pins to be defined.</span>
80+
81+
You can use these tests to validate the correctness of your implementation. To run the QSPI HAL tests, use the following command:
82+
83+
```
84+
mbed test -t <toolchain> -m <target> -n tests-mbed_hal-qspi
85+
```

0 commit comments

Comments
 (0)