Skip to content

Commit 83efce6

Browse files
committed
Merge branch 'doc/spi_hd' into 'feature/esp_as_mcu_host'
Fix(doc): Remove non-needed handshake pin from SPI half duplex documention See merge request app-frameworks/esp_hosted!527
2 parents f28b1b1 + 63cb7b5 commit 83efce6

File tree

2 files changed

+42
-37
lines changed

2 files changed

+42
-37
lines changed

docs/spi_half_duplex.md

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,21 @@ Using the pins already assigned to SPI signals (dedicated `IO_MUX` pins) is reco
106106
The following table shows the mapping between the SPI bus signals and
107107
their SPI HD Function:
108108

109-
| SPI Bus Signal | SPI HD Function |
110-
| :------------- | :-------------- |
111-
| SPID | Data Bit 0 |
112-
| SPIQ | Data Bit 1 |
113-
| SPIWP | Data Bit 2 |
114-
| SPIHD | Data Bit 3 |
115-
| SPICLK | Clk |
116-
117-
The SPI HD CS signal and `Data_Ready` can be assigned to any GPIO pin on the host and co-processor.
109+
| SPI Bus Signal | SPI HD Function | Applicable |
110+
| :-------------: | :--------------: | :--------------: |
111+
| SPI_CS | Chip Select | Dual, Quad SPI |
112+
| SPICLK | Clock | Dual, Quad SPI |
113+
| SPID | Data Bit 0 | Dual, Quad SPI |
114+
| SPIQ | Data Bit 1 | Dual, Quad SPI |
115+
| SPIWP | Data Bit 2 | Quad SPI |
116+
| SPIHD | Data Bit 3 | Quad SPI |
117+
| Data_Ready | Extra GPIO\* | Dual, Quad SPI |
118+
| Reset | Extra GPIO\* | Dual, Quad SPI |
119+
120+
- Extra GPIOs `Data_Ready`, `Reset` are explained above in [3.3 Extra GPIO Signals](#33-extra-gpio-signals)
121+
- The `SPI HD CS signal`, `Data_Ready` and `Reset` can be assigned to any GPIO pin on the host and co-processor.
122+
- By default, the SPI bus would idle (no CS, no clock, no data) when no transaction needed from either side, co-processor or host.
123+
- `Data_Ready` could be made optional with some code changes, but it would mean that the SPI bus would not be idled out when no transaction needed. This would be lower number of GPIOs used, but the power consumption would be higher. We are adding this feature soon.
118124

119125
## 4 SPI HD Protocol
120126

@@ -139,7 +145,7 @@ When communicating with the co-processor, the master uses the Command, Address,
139145
Hosted uses the following SPI HD commands when communicating with the co-processor:
140146

141147
| Command | OpCode | Purpose |
142-
| :--- | :--- | :--- |
148+
| :---: | :---: | :--- |
143149
| WRBUF | 0x01 | Write to a 32-bit buffer register on the co-processor |
144150
| RDBUF | 0x02 | Read from a 32-bit buffer register on the co-processor |
145151
| WRDMA | 0x03 | Write data to the co-processor using DMA |
@@ -153,7 +159,7 @@ Hosted uses the following SPI HD commands when communicating with the co-process
153159
The Commands are masked with a command mask to tell the co-processor the correct number of data lines to use during the transaction (2 or 4 data lines). Hosted uses the following masks, which are bit ORed with the command during a SPI transactions:
154160

155161
| Mode | Mask |
156-
| :--- | :--- |
162+
| :---: | :---: |
157163
| 2-bits | 0x50 |
158164
| 4-bits | 0xA0 |
159165

@@ -171,7 +177,7 @@ The Command Mask determines the number of data lines used for the transaction. E
171177
The ESP SPI Co-processor HD Mode Protocol defines a number of registers on the co-processor. These registers are used in Hosted as follows:
172178

173179
| Register | Name | Purpose |
174-
| :--- | :--- | :--- |
180+
| :---: | :---: | :--- |
175181
| 0x00 | COPROCESSOR\_READY | Indicates if co-processor is ready |
176182
| 0x04 | MAX\_TX\_BUF\_LEN | Maximum length of DMA data co-processor can transmit |
177183
| 0x08 | MAX\_RX\_BUF\_LEN | Maximum length of DMA data co-processor can receive |
@@ -389,18 +395,17 @@ Before flashing the co-processor and host, ensure that you have made the correct
389395

390396

391397
### Host connections
392-
| Signal | ESP32-S3 | ESP32-P4-Function-EV-Board |
393-
|------------|-------------|----------|
394-
| CLK | 19 | 18 |
395-
| D0 | 13 | 14 |
396-
| D1 | 35 | 15 |
397-
| D2 | 20 | 16 |
398-
| D3 | 9 | 17 |
399-
| CS | 47 | 19 |
400-
| Handshake | 17 | 16 |
401-
| Data Ready | 12 | 6 |
402-
| Reset Out | 42 | 54 |
403-
| GND | GND | GND |
398+
| Signal | ESP32-S3 | ESP32-P4-Function-EV-Board | Applicable |
399+
| :--------: | :------: | :------------------------: | :------------: |
400+
| CLK | 19 | 18 | Dual, Quad SPI |
401+
| D0 | 13 | 14 | Dual, Quad SPI |
402+
| D1 | 35 | 15 | Dual, Quad SPI |
403+
| CS | 47 | 19 | Dual, Quad SPI |
404+
| Data Ready | 12 | 6 | Dual, Quad SPI |
405+
| Reset Out | 42 | 54 | Dual, Quad SPI |
406+
| GND | GND | GND | Dual, Quad SPI |
407+
| D2 | 20 | 16 | Quad SPI only |
408+
| D3 | 9 | 17 | Quad SPI only |
404409

405410
- Host GPIOs can be re-configured to any other GPIOs, while co-processor configuration is done.
406411
- Make sure the configuration and hardware connections match.
@@ -415,17 +420,17 @@ Before flashing the co-processor and host, ensure that you have made the correct
415420

416421
### Co-processor connections
417422

418-
| Signal | ESP32-C6 on ESP32-P4-Function-EV-Board | ESP32-C2/C3/C6 | ESP32-C5 |
419-
|-------------|---------------------------------------|----------|----------|
420-
| CLK | 19 | 6 | 6 |
421-
| D0 | 20 | 7 | 7 |
422-
| D1 | 21 | 2 | 2 |
423-
| D2 | 22 | 5 | 5 |
424-
| D3 | 23 | 4 | 4 |
425-
| CS | 18 | 10 | 10 |
426-
| Data Ready | 2 | 0 | 13 |
427-
| Reset In | EN/RST | EN/RST | EN/RST |
428-
| GND | GND | GND | GND |
423+
| Signal | ESP32-C6 on ESP32-P4-Function-EV-Board | ESP32-C2/C3/C6 | ESP32-C5 | Applicable |
424+
| :---------: | :-----------------------------------: | :------------: | :------: | :------------: |
425+
| CLK | 19 | 6 | 6 | Dual, Quad SPI |
426+
| D0 | 20 | 7 | 7 | Dual, Quad SPI |
427+
| D1 | 21 | 2 | 2 | Dual, Quad SPI |
428+
| CS | 18 | 10 | 10 | Dual, Quad SPI |
429+
| Data Ready | 2 | 0 | 13 | Dual, Quad SPI |
430+
| Reset In | EN/RST | EN/RST | EN/RST | Dual, Quad SPI |
431+
| GND | GND | GND | GND | Dual, Quad SPI |
432+
| D2 | 22 | 5 | 5 | Quad SPI only |
433+
| D3 | 23 | 4 | 4 | Quad SPI only |
429434

430435
- Co-processor GPIOs can be re-configured to any other GPIOs, while co-processor configuration is done.
431436
- Make sure the configuration and hardware connections match.
@@ -782,7 +787,7 @@ After flashing both the co-processor and host devices, follow these steps to con
782787
Once connected, you can run iperf tests:
783788
784789
| Test Case | Host Command | External STA Command |
785-
|-----------|--------------|----------------------|
790+
| :-------: | :----------: | :------------------: |
786791
| UDP Host TX | `iperf -u -c <STA_IP> -t 60 -i 3` | `iperf -u -s -i 3` |
787792
| UDP Host RX | `iperf -u -s -i 3` | `iperf -u -c <HOST_IP> -t 60 -i 3` |
788793
| TCP Host TX | `iperf -c <STA_IP> -t 60 -i 3` | `iperf -s -i 3` |

idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "0.0.21"
1+
version: "0.0.22"
22
description: ESP-Hosted provides driver such that any host can re-use ESP chipset as Wi-Fi or Bluetooth co-processor.
33
url: https://github.com/espressif/esp-hosted/tree/feature/esp_as_mcu_host
44
examples:

0 commit comments

Comments
 (0)