docs: update the description for general purpose spi

This commit is contained in:
Wang Fang 2023-05-25 17:14:18 +08:00
parent 307cdd6697
commit ed63cbe9cd
4 changed files with 15 additions and 85 deletions

View File

@ -2,38 +2,15 @@ SPI Master Driver
=================
:link_to_translation:`zh_CN:[中文]`
SPI Master driver is a program that controls {IDF_TARGET_NAME}'s SPI peripherals while they function as masters.
Overview of {IDF_TARGET_NAME}'s SPI Peripherals
-----------------------------------------------
{IDF_TARGET_SPI2_CS_NUM:default="6", esp32="3"}
{IDF_TARGET_SPI3_CS_NUM:default="3"}
{IDF_TARGET_NAME} integrates {IDF_TARGET_SOC_SPI_PERIPH_NUM} SPI peripherals.
- SPI0 and SPI1 are used internally to access the {IDF_TARGET_NAME}'s attached flash memory. Both controllers share the same SPI bus signals, and there is an arbiter to determine which can access the bus.
.. only:: esp32
There are quite a few limitations when using SPI Master driver on the SPI1 bus, see :ref:`spi_master_on_spi1_bus`.
.. only:: not esp32
Currently, SPI Master driver does not support SPI1 bus.
SPI Master driver is a program that controls {IDF_TARGET_NAME}'s General Purpose SPI (GP-SPI) peripheral(s) when it functions as a master.
.. only:: esp32
- SPI2 and SPI3 are general-purpose SPI controllers, sometimes referred to as HSPI and VSPI. They are open to users. SPI2 and SPI3 have independent bus signals with the same respective names. Each bus has three CS lines to drive up to a same number of SPI slaves.
.. note::
SPI1 is not a GP-SPI. SPI Master driver also supports SPI1 but with quite a few limitations, see :ref:`spi_master_on_spi1_bus`.
.. only:: esp32s2 or esp32s3
- SPI2 and SPI3 are general-purpose SPI controllers. They are open to users. SPI2 and SPI3 have independent signal buses with the same respective names. SPI2 has {IDF_TARGET_SPI2_CS_NUM} CS lines. SPI3 has {IDF_TARGET_SPI3_CS_NUM} CS lines. Each CS line can be used to drive one SPI slave.
.. only:: esp32c3 or esp32c2 or esp32c6 or esp32h2
- SPI2 is a general-purpose SPI controller. It has an independent signal bus with the same name. The bus has {IDF_TARGET_SPI2_CS_NUM} CS lines to drive up to {IDF_TARGET_SPI2_CS_NUM} SPI slaves.
For more hardware information about the GP-SPI peripheral(s), see *{IDF_TARGET_NAME} Technical Reference Manual* > *SPI Controller* [`PDF <{IDF_TARGET_TRM_EN_URL}#spi>`__].
Terminology
-----------

View File

@ -3,21 +3,9 @@ SPI Slave Driver
:link_to_translation:`zh_CN:[中文]`
SPI Slave driver is a program that controls {IDF_TARGET_NAME}'s SPI peripherals while they function as slaves.
SPI Slave driver is a program that controls {IDF_TARGET_NAME}'s General Purpose SPI (GP-SPI) peripheral(s) when it functions as a slave.
Overview of {IDF_TARGET_NAME}'s SPI peripherals
-----------------------------------------------
{IDF_TARGET_MAX_SLAVE_PERIPH_NUM:default="2", esp32c3="1", esp32c2="1", esp32c6="1", esp32h2="1"}
On {IDF_TARGET_NAME}, {IDF_TARGET_MAX_SLAVE_PERIPH_NUM} SPI controllers are available for general purpose usage. A certain SPI controller has an independent signal bus with the same name.
.. only:: esp32
.. note::
On ESP32, HSPI refers to SPI2, VSPI refers to SPI3.
For more hardware information about the GP-SPI peripheral(s), see *{IDF_TARGET_NAME} Technical Reference Manual* > *SPI Controller* [`PDF <{IDF_TARGET_TRM_EN_URL}#spi>`__].
Terminology
-----------

View File

@ -2,38 +2,15 @@ SPI 主机驱动程序
===================
:link_to_translation:`en:[English]`
SPI 主机驱动程序是用于控制 {IDF_TARGET_NAME} 的 SPI 外设作为 SPI 主机的软件程序。
{IDF_TARGET_NAME} 的 SPI 外设概述
-------------------------------------------
{IDF_TARGET_SPI2_CS_NUM:default="6", esp32="3"}
{IDF_TARGET_SPI3_CS_NUM:default="3"}
{IDF_TARGET_NAME} 集成了 {IDF_TARGET_SOC_SPI_PERIPH_NUM} 个 SPI 外设。
- SPI0 与 SPI1 用于内部访问 {IDF_TARGET_NAME} 所连接的 flash。两个控制器共享同一 SPI 总线信号,并由仲裁器裁定控制器访问权。
.. only:: esp32
在 SPI1 总线上使用 SPI 主机驱动程序存在诸多限制,请参阅 :ref:`spi_master_on_spi1_bus`
.. only:: not esp32
当前SPI 主机驱动程序不支持 SPI1 总线。
SPI 主机驱动程序是用于控制 {IDF_TARGET_NAME} 的通用 SPI (GP-SPI) 外设作为 SPI 主机的软件程序。
.. only:: esp32
- SPI2 和 SPI3 为通用 SPI 控制器,也被称作 HSPI 和 VSPI使用权对用户开放。SPI2 和 SPI3 具有独立的总线信号,各自的信号线名称相同。每条总线具有三条 CS 线,可驱动多达相同数量的 SPI 从机设备。
.. note::
SPI1 不属于 GP-SPI。SPI 主机驱动程序也支持 SPI1。但在 SPI1 总线上使用 SPI 主机驱动程序存在诸多限制,请参阅 :ref:`spi_master_on_spi1_bus`
.. only:: esp32s2 or esp32s3
- SPI2 和 SPI3 为通用 SPI 控制器使用权对用户开放。SPI2 和 SPI3 具有独立的信号总线名称分别相同。SPI2 具有 {IDF_TARGET_SPI2_CS_NUM} 条 CS 线SPI3 具有 {IDF_TARGET_SPI3_CS_NUM} 条 CS 线。每条 CS 线可用于驱动一个 SPI 从机设备。
.. only:: esp32c3 or esp32c2 or esp32c6 or esp32h2
- SPI2 为通用 SPI 控制器具有独立的信号总线且名称相同。SPI2 具有 {IDF_TARGET_SPI2_CS_NUM} 条 CS 线,可驱动多达 {IDF_TARGET_SPI2_CS_NUM} 个 SPI 从机设备.
有关 GP-SPI 硬件相关信息,请参考 *{IDF_TARGET_NAME} 技术参考手册* > *SPI 控制器* [`PDF <{IDF_TARGET_TRM_CN_URL}#spi>`__]。
术语
--------

View File

@ -3,26 +3,14 @@ SPI 从机驱动程序
:link_to_translation:`en:[English]`
SPI 从机驱动程序控制在 {IDF_TARGET_NAME} 中作为从机的 SPI 外设。
SPI 从机驱动程序控制在 {IDF_TARGET_NAME} 中作为从机的 GP-SPI 外设。
{IDF_TARGET_NAME} 中 SPI 外设概述
-----------------------------------------------
{IDF_TARGET_MAX_SLAVE_PERIPH_NUM:default="2", esp32c3="1", esp32c2="1", esp32c6="1", esp32h2="1"}
{IDF_TARGET_NAME} 集成了 {IDF_TARGET_MAX_SLAVE_PERIPH_NUM} 个通用的 SPI 控制器。该控制器具有与之同名的独立总线信号。
.. only:: esp32
.. note::
在 ESP32 中HSPI 为 SPI2VSPI 为 SPI3。
有关 GP-SPI 硬件相关信息,请参考 *{IDF_TARGET_NAME} 技术参考手册* > *SPI 控制器* [`PDF <{IDF_TARGET_TRM_CN_URL}#spi>`__]。
术语
-----------
下表为 SPI 机驱动的相关术语。
下表为 SPI 从机驱动的相关术语。
.. list-table::
:widths: 30 70