Skip to content

Commit 45fa5d3

Browse files
committed
Merge branch 'feat/esp32c6_spi_sdio' into 'master'
feat: add SPI and sdio for esp32c6 See merge request application/esp-at!1456
2 parents 9126d96 + 829cfba commit 45fa5d3

20 files changed

+168
-86
lines changed

docs/conf_common.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
'AT_Command_Examples/classic_bluetooth_at_examples.rst',
2525
'AT_Command_Set/BT_AT_Commands.rst',
2626
'AT_Command_Set/Ethernet_AT_Commands.rst',
27-
'Compile_and_Develop/esp32-sdio-at-guide.rst',
27+
'Compile_and_Develop/How_to_implement_SDIO_AT.rst',
2828
'Compile_and_Develop/how_to_enable_at_classic_bluetooth.rst',
2929
'Compile_and_Develop/How_to_enable_ESP_AT_Ethernet.rst',
3030
'Customized_AT_Commands_and_Firmware/*'
@@ -45,7 +45,8 @@
4545
]
4646

4747
ESP32C6_DOCS = ['AT_Binary_Lists/ESP32-C6_AT_binaries.rst',
48-
'Compile_and_Develop/How_to_implement_SPI_AT.rst'
48+
'Compile_and_Develop/How_to_implement_SPI_AT.rst',
49+
'Compile_and_Develop/How_to_implement_SDIO_AT.rst'
4950
]
5051

5152
# format: {tag needed to include: documents to included}, tags are parsed from sdkconfig and peripheral_caps.h headers

docs/en/Compile_and_Develop/esp32-sdio-at-guide.rst renamed to docs/en/Compile_and_Develop/How_to_implement_SDIO_AT.rst

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,23 @@ SDIO can use either 1-bit or 4-bit data transfer mode.
1515

1616
The SDIO slave pins are as below:
1717

18-
- CLK is GPIO14
19-
- CMD is GPIO15
20-
- DAT0 is GPIO2
21-
- DAT1 is GPIO4
22-
- DAT2 is GPIO12 (for 4-bit mode only)
23-
- DAT3 is GPIO13 (for 4-bit mode only)
18+
.. only:: esp32
19+
20+
- CLK is GPIO14
21+
- CMD is GPIO15
22+
- DAT0 is GPIO2
23+
- DAT1 is GPIO4
24+
- DAT2 is GPIO12 (for 4-bit mode only)
25+
- DAT3 is GPIO13 (for 4-bit mode only)
26+
27+
.. only:: esp32c6
28+
29+
- CLK is GPIO19
30+
- CMD is GPIO18
31+
- DAT0 is GPIO20
32+
- DAT1 is GPIO21
33+
- DAT2 is GPIO22 (for 4-bit mode only)
34+
- DAT3 is GPIO23 (for 4-bit mode only)
2435

2536
Implement SDIO AT
2637
-----------------

docs/en/Compile_and_Develop/How_to_implement_SPI_AT.rst

Lines changed: 51 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ How to enable SPI AT?
2222

2323
You can configure and enable SPI AT through the following steps:
2424

25-
1. ``./build.py menuconfig`` -> ``Component config`` -> ``AT`` -> ``communicate method for AT command`` -> ``AT through HSPI`` to enable SPI AT.
25+
1. ``./build.py menuconfig`` -> ``Component config`` -> ``AT`` -> ``communicate method for AT command`` -> ``AT through SPI`` to enable SPI AT.
2626
2. ``./build.py menuconfig`` -> ``Component config`` -> ``AT`` -> ``communicate method for AT command`` -> ``AT SPI Data Transmission Mode`` to choose the SPI data transmission mode.
2727
3. ``./build.py menuconfig`` -> ``Component config`` -> ``AT`` -> ``communicate method for AT command`` -> ``AT SPI GPIO settings`` to change the default pin assignments for SPI AT.
2828
4. ``./build.py menuconfig`` -> ``Component config`` -> ``AT`` -> ``communicate method for AT command`` -> ``AT SPI driver settings`` to choose the SPI slave mode, and config the buffer size for data transmission.
@@ -33,32 +33,59 @@ The Default Pin Assignment
3333

3434
The following pin assignments are used by default:
3535

36-
.. list-table:: The Default Pins for SPI AT
37-
:widths: 10 25
38-
:header-rows: 1
39-
40-
* - Signal
41-
- GPIO Number
42-
* - SCLK
43-
- 6
44-
* - MISO
45-
- 2
46-
* - MOSI
47-
- 7
48-
* - CS
49-
- 10
50-
* - HANDSHAKE
51-
- 3
52-
* - GND
53-
- GND
54-
* - QUADWP (qio/qout) :sup:`1`
55-
- 8
56-
* - QUADHD (qio/qout) :sup:`1`
57-
- 9
36+
.. only:: esp32c2 or esp32c3
37+
38+
.. list-table:: The Default Pins for SPI AT
39+
:widths: 10 25
40+
:header-rows: 1
41+
42+
* - Signal
43+
- GPIO Number
44+
* - SCLK
45+
- 6
46+
* - MISO
47+
- 2
48+
* - MOSI
49+
- 7
50+
* - CS
51+
- 10
52+
* - HANDSHAKE
53+
- 3
54+
* - GND
55+
- GND
56+
* - QUADWP (qio/qout) :sup:`1`
57+
- 8
58+
* - QUADHD (qio/qout) :sup:`1`
59+
- 9
60+
61+
.. only:: esp32c6
62+
63+
.. list-table:: The Default Pins for SPI AT
64+
:widths: 10 25
65+
:header-rows: 1
66+
67+
* - Signal
68+
- GPIO Number
69+
* - SCLK
70+
- 19
71+
* - MISO
72+
- 20
73+
* - MOSI
74+
- 18
75+
* - CS
76+
- 23
77+
* - HANDSHAKE
78+
- 21
79+
* - GND
80+
- GND
81+
* - QUADWP (qio/qout) :sup:`1`
82+
- 22
83+
* - QUADHD (qio/qout) :sup:`1`
84+
- 2
5885

5986
**Note** 1: QUADWP and QUADHD signals are only used for 4-bit (qio/qout) transactions.
6087

61-
You can change the default pin assignments by ``./build.py menuconfig`` > ``Component config`` > ``AT`` > ``communicate method for AT command`` > ``AT through HSPI`` > ``AT SPI GPIO settings`` and compile the project (see :doc:`../Compile_and_Develop/How_to_clone_project_and_compile_it`).
88+
You can change the default pin assignments by ``./build.py menuconfig`` > ``Component config`` > ``AT`` > ``communicate method for AT command`` > ``AT through SPI`` > ``AT SPI GPIO settings`` and compile the project (see :doc:`../Compile_and_Develop/How_to_clone_project_and_compile_it`).
6289

6390
How to Use SPI AT?
6491
-----------------------

docs/en/Compile_and_Develop/How_to_optimize_throughput.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,9 @@ The data stream of throughput is similar to water flow. In order to improve thro
277277

278278
If the user expects the throughput rate to be greater than or close to 5 Mbps, then SPI, SDIO, Socket or other methods can be considered. Please refer to:
279279

280-
.. only:: esp32
280+
.. only:: esp32 or esp32c6
281281

282-
- SDIO: :doc:`SDIO AT Guide </Compile_and_Develop/esp32-sdio-at-guide>`
282+
- SDIO: :doc:`SDIO AT Guide </Compile_and_Develop/How_to_implement_SDIO_AT>`
283283
- Socket: :project_file:`Socket AT Guide <main/interface/socket/README.md>`
284284

285285
.. only:: esp32c2 or esp32c3 or esp32c6

docs/en/Compile_and_Develop/How_to_set_AT_port_pin.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ To modify the AT port pins of your {IDF_TARGET_NAME}, you should:
1717
This document focuses on modifying the pins. Click the links above for details of other steps.
1818

1919
.. note::
20-
To use other interfaces as the AT command port, please refer to :project_file:`AT through SDIO <main/interface/sdio/README.md>`, :project_file:`AT through SPI <main/interface/hspi/README.md>`, or :project_file:`AT through socket <main/interface/socket/README.md>` for more details.
20+
To use other interfaces as the AT command port, please refer to :project_file:`AT through SDIO <main/interface/sdio/README.md>`, :project_file:`AT through SPI <main/interface/spi/README.md>`, or :project_file:`AT through socket <main/interface/socket/README.md>` for more details.
2121

2222
{IDF_TARGET_NAME} Series
2323
------------------------

docs/en/Compile_and_Develop/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ How to Compile and Develop Your Own AT Project
1919
How to Customize Partitions <How_to_customize_partitions>
2020
:esp32: How to Enable {IDF_TARGET_NAME} AT Ethernet <How_to_enable_ESP_AT_Ethernet>
2121
How to Add Support for a Module <How_to_add_support_for_a_module>
22-
:esp32: {IDF_TARGET_NAME} SDIO AT Guide <{IDF_TARGET_PATH_NAME}-sdio-at-guide.rst>
22+
:esp32 or esp32c6: How to Implement SDIO AT <How_to_implement_SDIO_AT>
2323
:esp32c2 or esp32c3 or esp32c6: How to Implement SPI AT <How_to_implement_SPI_AT>
2424
How to Implement OTA Update <How_to_implement_OTA_update>
2525
How to Update IDF <How_to_update_IDF>

docs/en/faq.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ What interfaces of {IDF_TARGET_NAME} chips can be used to transmit AT commands?
245245
:esp32: - {IDF_TARGET_NAME} can transmit AT commands through UART and SDIO.
246246
:esp32c2 or esp32c3 or esp32c6: - {IDF_TARGET_NAME} can transmit AT commands through UART and SPI.
247247
- The default firmware uses UART for transmission. If you need SDIO or SPI interface to transmit AT commands, you can configure it through ``./build.py menuconfig`` > ``Component config`` > ``AT`` when compiling the ESP-AT project by yourself.
248-
- See :project_file:`AT through SDIO <main/interface/sdio/README.md>`, :project_file:`AT through SPI <main/interface/hspi/README.md>`, or :project_file:`AT through socket <main/interface/socket/README.md>` for more details.
248+
- See :project_file:`AT through SDIO <main/interface/sdio/README.md>`, :project_file:`AT through SPI <main/interface/spi/README.md>`, or :project_file:`AT through socket <main/interface/socket/README.md>` for more details.
249249

250250
.. only:: esp32
251251

docs/zh_CN/Compile_and_Develop/esp32-sdio-at-guide.rst renamed to docs/zh_CN/Compile_and_Develop/How_to_implement_SDIO_AT.rst

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,23 @@ SDIO 可使用 一线或四线模式。至少需要 4 根线:CMD、CLK、DAT0
1515

1616
SDIO slave 管脚如下所示:
1717

18-
- CLK:GPIO14
19-
- CMD:GPIO15
20-
- DAT0:GPIO2
21-
- DAT1:GPIO4
22-
- DAT2:GPIO12(四线)
23-
- DAT3:GPIO13(四线)
18+
.. only:: esp32
19+
20+
- CLK is GPIO14
21+
- CMD is GPIO15
22+
- DAT0 is GPIO2
23+
- DAT1 is GPIO4
24+
- DAT2 is GPIO12(四线)
25+
- DAT3 is GPIO13(四线)
26+
27+
.. only:: esp32c6
28+
29+
- CLK is GPIO19
30+
- CMD is GPIO18
31+
- DAT0 is GPIO20
32+
- DAT1 is GPIO21
33+
- DAT2 is GPIO22(四线)
34+
- DAT3 is GPIO23(四线)
2435

2536
如何使用 SDIO AT
2637
----------------

docs/zh_CN/Compile_and_Develop/How_to_implement_SPI_AT.rst

Lines changed: 51 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ AT 工程默认使用 UART 协议进行数据通信,但是 UART 协议在一
2222

2323
您可以通过下述步骤配置并启用 SPI AT:
2424

25-
1. 通过 ``./build.py menuconfig`` -> ``Component config`` -> ``AT`` -> ``communicate method for AT command`` -> ``AT through HSPI`` 使能 SPI AT。
25+
1. 通过 ``./build.py menuconfig`` -> ``Component config`` -> ``AT`` -> ``communicate method for AT command`` -> ``AT through SPI`` 使能 SPI AT。
2626
2. 通过 ``./build.py menuconfig`` -> ``Component config`` -> ``AT`` -> ``communicate method for AT command`` -> ``AT SPI Data Transmission Mode`` 选择 SPI 数据传输模式。
2727
3. 通过 ``./build.py menuconfig`` -> ``Component config`` -> ``AT`` -> ``communicate method for AT command`` -> ``AT SPI GPIO settings`` 配置 SPI 使用的 GPIO 管脚。
2828
4. 通过 ``./build.py menuconfig`` -> ``Component config`` -> ``AT`` -> ``communicate method for AT command`` -> ``AT SPI driver settings`` 选择 SPI 从机的工作模式,并配置相关缓存区的大小。
@@ -33,32 +33,59 @@ SPI AT 默认管脚
3333

3434
下表给出了不同系列的 {IDF_TARGET_NAME} 设备使用 SPI AT 时默认的硬件管脚:
3535

36-
.. list-table:: SPI AT 默认管脚
37-
:widths: 10 25
38-
:header-rows: 1
39-
40-
* - 信号
41-
- GPIO 编号
42-
* - SCLK
43-
- 6
44-
* - MISO
45-
- 2
46-
* - MOSI
47-
- 7
48-
* - CS
49-
- 10
50-
* - HANDSHAKE
51-
- 3
52-
* - GND
53-
- GND
54-
* - QUADWP (qio/qout) :sup:`1`
55-
- 8
56-
* - QUADHD (qio/qout) :sup:`1`
57-
- 9
36+
.. only:: esp32c2 or esp32c3
37+
38+
.. list-table:: SPI AT 默认管脚
39+
:widths: 10 25
40+
:header-rows: 1
41+
42+
* - 信号
43+
- GPIO 编号
44+
* - SCLK
45+
- 6
46+
* - MISO
47+
- 2
48+
* - MOSI
49+
- 7
50+
* - CS
51+
- 10
52+
* - HANDSHAKE
53+
- 3
54+
* - GND
55+
- GND
56+
* - QUADWP (qio/qout) :sup:`1`
57+
- 8
58+
* - QUADHD (qio/qout) :sup:`1`
59+
- 9
60+
61+
.. only:: esp32c6
62+
63+
.. list-table:: SPI AT 默认管脚
64+
:widths: 10 25
65+
:header-rows: 1
66+
67+
* - 信号
68+
- GPIO 编号
69+
* - SCLK
70+
- 19
71+
* - MISO
72+
- 20
73+
* - MOSI
74+
- 18
75+
* - CS
76+
- 23
77+
* - HANDSHAKE
78+
- 21
79+
* - GND
80+
- GND
81+
* - QUADWP (qio/qout) :sup:`1`
82+
- 22
83+
* - QUADHD (qio/qout) :sup:`1`
84+
- 2
5885

5986
**说明** 1:QUADWP 引脚和 QUADHD 引脚仅在使用 4 线 SPI 工作时使用。
6087

61-
您可以通过 ``./build.py menuconfig`` > ``Component config`` > ``AT`` > ``communicate method for AT command`` > ``AT through HSPI`` > ``AT SPI GPIO settings``,然后编译工程来配置 SPI AT 对应的管脚(参考 :doc:`../Compile_and_Develop/How_to_clone_project_and_compile_it`)。
88+
您可以通过 ``./build.py menuconfig`` > ``Component config`` > ``AT`` > ``communicate method for AT command`` > ``AT through SPI`` > ``AT SPI GPIO settings``,然后编译工程来配置 SPI AT 对应的管脚(参考 :doc:`../Compile_and_Develop/How_to_clone_project_and_compile_it`)。
6289

6390
使用 SPI AT
6491
--------------

docs/zh_CN/Compile_and_Develop/How_to_optimize_throughput.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,9 @@
277277

278278
如果用户期望吞吐速率大于或接近于 5 Mbps,可以考虑使用 SPI、SDIO、Socket 等方式。具体请参考:
279279

280-
.. only:: esp32
280+
.. only:: esp32 or esp32c6
281281

282-
- SDIO: :doc:`SDIO AT 指南 </Compile_and_Develop/esp32-sdio-at-guide>`
282+
- SDIO: :doc:`SDIO AT 指南 </Compile_and_Develop/How_to_implement_SDIO_AT>`
283283
- Socket: :project_file:`Socket AT 指南 <main/interface/socket/README.md>`
284284

285285
.. only:: esp32c2 or esp32c3 or esp32c6

docs/zh_CN/Compile_and_Develop/How_to_set_AT_port_pin.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
本文档重点介绍如何修改管脚,点击上面的链接了解其它步骤的详细信息。
1818

1919
.. note::
20-
使用其它接口作为 AT 命令接口请参考 :project_file:`使用 AT SPI 接口 <main/interface/sdio/README.md>`, :project_file:`AT through SPI <main/interface/hspi/README.md>` 和 :project_file:`使用 AT 套接字接口 <main/interface/socket/README.md>`。
20+
使用其它接口作为 AT 命令接口请参考 :project_file:`使用 AT SPI 接口 <main/interface/sdio/README.md>`, :project_file:`AT through SPI <main/interface/spi/README.md>` 和 :project_file:`使用 AT 套接字接口 <main/interface/socket/README.md>`。
2121

2222
{IDF_TARGET_NAME} 系列
2323
------------------------

docs/zh_CN/Compile_and_Develop/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
如何自定义分区 <How_to_customize_partitions>
2020
:esp32: 如何使能 {IDF_TARGET_NAME}-AT 以太网 <How_to_enable_ESP_AT_Ethernet>
2121
如何增加一个新的模组支持 <How_to_add_support_for_a_module>
22-
:esp32: {IDF_TARGET_NAME} SDIO AT 指南 <{IDF_TARGET_PATH_NAME}-sdio-at-guide.rst>
22+
:esp32 or esp32c6: 如何实现 SDIO AT <How_to_implement_SDIO_AT>
2323
:esp32c2 or esp32c3 or esp32c6: 如何实现 SPI AT <How_to_implement_SPI_AT>
2424
如何基于乐鑫服务器实现自己的 OTA 管理 <How_to_implement_OTA_update>
2525
如何更新 ESP-IDF 版本 <How_to_update_IDF>

docs/zh_CN/faq.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ ESP-AT 固件中 TCP 发送窗口大小是否可以修改?
245245
:esp32: - {IDF_TARGET_NAME} 支持 UART、SDIO 接口通信。
246246
:esp32c2 or esp32c3 or esp32c6: - {IDF_TARGET_NAME} 支持 UART、SPI 接口通信。
247247
- AT 默认固件是使用 UART 接口来传输。用户如果需要使用 SDIO 或者 SPI 接口进行通信,可以基于 ESP-AT 配置编译,详情请见 :doc:`编译和开发 <Compile_and_Develop/index>`。
248-
- 更多资料请参考 :project_file:`使用 AT SDIO 接口 <main/interface/sdio/README.md>`,:project_file:`使用 AT SPI 接口 <main/interface/hspi/README.md>`,或 :project_file:`使用 AT 套接字接口 <main/interface/socket/README.md>`。
248+
- 更多资料请参考 :project_file:`使用 AT SDIO 接口 <main/interface/sdio/README.md>`,:project_file:`使用 AT SPI 接口 <main/interface/spi/README.md>`,或 :project_file:`使用 AT 套接字接口 <main/interface/socket/README.md>`。
249249

250250
.. only:: esp32
251251

main/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ choice AT_COMMUNICATION_METHOD
99
depends on AT_ENABLE
1010

1111
rsource "interface/uart/Kconfig"
12-
rsource "interface/hspi/Kconfig"
12+
rsource "interface/spi/Kconfig"
1313
rsource "interface/socket/Kconfig"
1414
rsource "interface/sdio/Kconfig"
1515

main/interface/sdio/Kconfig

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11

22
config AT_BASE_ON_SDIO
33
bool "AT through SDIO"
4-
depends on IDF_TARGET_ESP32
4+
depends on IDF_TARGET_ESP32 || IDF_TARGET_ESP32C6
55
help
66
This demo is AT through SDIO. The MCU can send AT command through SDIO bus.
7-
Note: GPIO14 is SDIO CLK pin, GPIO15 is SDIO CMD pin, GPIO2 is SDIO DAT0 pin,
8-
GPIO4 is SDIO DAT1 pin, GPIO12 is SDIO DAT2 pin, GPIO13 is SDIO DAT3 pin.
97

108
if AT_BASE_ON_SDIO
119
menu "AT SDIO settings"

0 commit comments

Comments
 (0)