Skip to content

Commit 9b1ee45

Browse files
author
Amanda Butler
authored
Create QuadSPI.md
Add content from PR #454 to live site after reviewing on test site.
1 parent 8a056a4 commit 9b1ee45

File tree

1 file changed

+38
-7
lines changed

1 file changed

+38
-7
lines changed
Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,56 @@
11
<h2 id="quadspi-port">QuadSPI</h2>
22

3-
[Include a brief description here.]
3+
Implementing QSPI enables Mbed OS to communicate with external memories much faster than via SPI because the communication can be up to four lines between the host and a device.
4+
5+
The most common use case is an external memory to use as additional data storage.
6+
7+
<span class="warnings">**Warning:** We are changing the QSPI HAL API in an upcoming release of Mbed OS. You can find details on how it may affect you in the [Implementing QuadSPI](#implementing-quadspi) section.</span>
48

59
### Assumptions
610

711
#### Defined behavior
812

9-
[Include any defined behavior in bullet format here.]
13+
- A target implementation covers most of the QSPI frame format (some targets might not provide the flexibility for setting all frame parameters).
14+
- Command transfer - A target might provide additional functions for sending device-specific commands. If it does not, you can implement it using read and write functions. (This is target or driver dependent.)
1015

1116
#### Undefined behavior
1217

13-
[Include any undefined behavior in bullet format here.]
18+
- Calling any function other than `qspi_init` before the initialization of the QSPI.
1419

15-
#### Potential bugs
20+
#### Dependency
1621

17-
[Include any potential bugs in bullet format here.]
22+
QSPI peripheral
1823

1924
### Implementing QuadSPI
2025

21-
[Include implementation information here.]
26+
To make sure your platform is ready for the upcoming changes, you need to implement the future API and submit it in a separate pull request. You can find the API and specification for the new QuadSPI API in the following header file:
27+
28+
[![View code](https://www.mbed.com/embed/?type=library)](https://os.mbed.com/docs/v5.8/feature-hal-spec-qspi-doxy/classmbed_1_1_q_s_p_i.html)
29+
30+
The target needs to define the `qspi_s` structure - target specific QSPI object.
31+
32+
Functions to implement:
33+
34+
```
35+
qspi_status_t qspi_init(qspi_t *obj, PinName io0, PinName io1, PinName io2, PinName io3, PinName sclk, PinName ssel, uint32_t hz, uint8_t mode);
36+
qspi_status_t qspi_free(qspi_t *obj);
37+
qspi_status_t qspi_frequency(qspi_t *obj, int hz);
38+
qspi_status_t qspi_write(qspi_t *obj, const qspi_command_t *command, const void *data, size_t *length);
39+
qspi_status_t qspi_command_transfer(qspi_t *obj, const qspi_command_t *command, const void *tx_data, size_t tx_size, void *rx_data, size_t rx_size);
40+
qspi_status_t qspi_read(qspi_t *obj, const qspi_command_t *command, void *data, size_t *length);
41+
42+
```
43+
44+
Use `qspi_write` and `qspi_read` for data transfers. For communicating with a device, use `qspi_command_transfer`.
45+
46+
To enable the QSPI HAL, define `QSPI` in the targets.json file inside `device_has`:
47+
48+
```
49+
"TARGET_NAME": {
50+
"device_has": ["QSPI"]
51+
}
52+
```
2253

2354
### Testing
2455

25-
[Include testing information here.]
56+
To be implemented

0 commit comments

Comments
 (0)