mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-28 05:31:44 +01:00
Merge branch 'docs/add_CN_trans_for_esp_serial_slave_link_and_asio.rst' into 'master'
docs: Provide Chinese translation for api-reference/protocols/esp_serial_slave_link.rst Closes DOC-5998 See merge request espressif/esp-idf!25375
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
ASIO Port
|
||||
=========
|
||||
|
||||
Asio is a cross-platform C++ library, see https://think-async.com/Asio/. It provides a consistent asynchronous model using a modern C++ approach.
|
||||
:link_to_translation:`zh_CN:[中文]`
|
||||
|
||||
ASIO is a cross-platform C++ library, see https://think-async.com/Asio/. It provides a consistent asynchronous model using a modern C++ approach.
|
||||
|
||||
The ESP-IDF component ``ASIO`` has been moved from ESP-IDF since version v5.0 to a separate repository:
|
||||
|
||||
@@ -14,4 +16,4 @@ Hosted Documentation
|
||||
|
||||
The documentation can be found on the link below:
|
||||
|
||||
* `ASIO documentation (English) <https://docs.espressif.com/projects/esp-protocols/asio/docs/latest/index.html>`__
|
||||
* `ASIO documentation (English) <https://docs.espressif.com/projects/esp-protocols/asio/docs/latest/index.html>`__
|
||||
@@ -1,13 +1,23 @@
|
||||
ESP Serial Slave Link
|
||||
=====================
|
||||
|
||||
:link_to_translation:`zh_CN:[中文]`
|
||||
|
||||
Overview
|
||||
--------
|
||||
|
||||
Espressif provides several chips that can work as slaves. These slave devices rely on some common buses, and have their own communication protocols over those buses. The ``esp_serial_slave_link`` component is designed for the master to communicate with ESP slave devices through those protocols over the bus drivers.
|
||||
|
||||
After an ``esp_serial_slave_link`` device is initialized properly, the application can use it to communicate with the ESP
|
||||
slave devices conveniently.
|
||||
After an ``esp_serial_slave_link`` device is initialized properly, the application can use it to communicate with the ESP slave devices conveniently.
|
||||
|
||||
.. note::
|
||||
|
||||
The ESP-IDF component ``esp_serial_slave_link`` has been moved from ESP-IDF since version v5.0 to a separate repository:
|
||||
|
||||
* `ESSL component on GitHub <https://github.com/espressif/idf-extra-components/tree/master/esp_serial_slave_link>`__
|
||||
|
||||
To add ESSL component in your project, please run ``idf.py add-dependency espressif/esp_serial_slave_link``.
|
||||
|
||||
|
||||
Espressif Device Protocols
|
||||
--------------------------
|
||||
@@ -52,15 +62,15 @@ There are some common services provided by the Espressif slaves:
|
||||
|
||||
2. Frhost Interrupts: The master can inform the slave about certain events.
|
||||
|
||||
3. TX FIFO (master to slave): the slave can send data in stream to the master. The SDIO slave can also indicate it has new data to send to master by the interrupt line.
|
||||
3. TX FIFO (master to slave): The slave can receive data from the master in units of receiving buffers.
|
||||
|
||||
The slave updates the TX buffer num to inform the master how much data it can receive, and the master then read the TX buffer num, and take off the used buffer number to know how many buffers are remaining.
|
||||
|
||||
4. RX FIFO (slave to master): the slave can receive data from the master in units of receiving buffers.
|
||||
4. RX FIFO (slave to master): The slave can send data in stream to the master. The SDIO slave can also indicate it has new data to send to master by the interrupt line.
|
||||
|
||||
The slave updates the RX data size to inform the master how much data it has prepared to send, and then the master read the data size, and take off the data length it has already received to know how many data is remaining.
|
||||
|
||||
5. Shared registers: the master can read some part of the registers on the slave, and also write these registers to let the slave read.
|
||||
5. Shared registers: The master can read some part of the registers on the slave, and also write these registers to let the slave read.
|
||||
|
||||
.. only:: SOC_SDIO_SLAVE_SUPPORTED
|
||||
|
||||
@@ -79,9 +89,9 @@ Initialization of ESP Serial Slave Link
|
||||
ESP SDIO Slave
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
The ESP SDIO slave link (ESSL SDIO) devices relies on the sdmmc component. It includes the usage of communicating with ESP SDIO Slave device via SDSPI feature. The ESSL device should be initialized as below:
|
||||
The ESP SDIO slave link (ESSL SDIO) devices relies on the SDMMC component. It includes the usage of communicating with ESP SDIO Slave device via the SDMMC Host or SDSPI Host feature. The ESSL device should be initialized as below:
|
||||
|
||||
1. Initialize a sdmmc card (see :doc:` Document of SDMMC driver </api-reference/storage/sdmmc>`) structure.
|
||||
1. Initialize a SDMMC card (see :doc:` Document of SDMMC driver </api-reference/storage/sdmmc>`) structure.
|
||||
|
||||
2. Call :cpp:func:`sdmmc_card_init` to initialize the card.
|
||||
|
||||
@@ -124,14 +134,14 @@ Frhost Interrupts
|
||||
TX FIFO
|
||||
^^^^^^^
|
||||
|
||||
1. Call :cpp:func:`essl_get_tx_buffer_num` to know how many buffers the slave has prepared to receive data from the master. This is optional. The master will poll ``tx_buffer_num`` when it try to send packets to the slave, until the slave has enough buffer or timeout.
|
||||
1. Call :cpp:func:`essl_get_tx_buffer_num` to know how many buffers the slave has prepared to receive data from the master. This is optional. The master will poll ``tx_buffer_num`` when it tries to send packets to the slave, until the slave has enough buffer or timeout.
|
||||
|
||||
2. Call :cpp:func:`essl_send_packet` to send data to the slave.
|
||||
|
||||
RX FIFO
|
||||
^^^^^^^
|
||||
|
||||
1. Call :cpp:func:`essl_get_rx_data_size` to know how many data the slave has prepared to send to the master. This is optional. When the master tries to receive data from the slave, it will update the ``rx_data_size`` for once, if the current ``rx_data_size`` is shorter than the buffer size the master prepared to receive. And it may poll the ``rx_data_size`` if the ``rx_dat_size`` keeps 0, until timeout.
|
||||
1. Call :cpp:func:`essl_get_rx_data_size` to know how many data the slave has prepared to send to the master. This is optional. When the master tries to receive data from the slave, it updates the ``rx_data_size`` for once, if the current ``rx_data_size`` is shorter than the buffer size the master prepared to receive. And it may poll the ``rx_data_size`` if the ``rx_data_size`` keeps 0, until timeout.
|
||||
|
||||
2. Call :cpp:func:`essl_get_packet` to receive data from the slave.
|
||||
|
||||
@@ -144,9 +154,9 @@ Call :cpp:func:`essl_reset_cnt` to reset the internal counter if you find the sl
|
||||
Application Example
|
||||
-------------------
|
||||
|
||||
The example below shows how {IDF_TARGET_NAME} SDIO host and slave communicate with each other. The host use the ESSL SDIO.
|
||||
The example below shows how {IDF_TARGET_NAME} SDIO host and slave communicate with each other. The host uses the ESSL SDIO:
|
||||
|
||||
:example:`peripherals/sdio`.
|
||||
:example:`peripherals/sdio`
|
||||
|
||||
Please refer to the specific example README.md for details.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user