docs: sync up translation for api-reference

pull/10691/head
daiziyan 2023-01-29 19:29:58 +08:00
rodzic 25a56d13d7
commit 4667f1b3ef
10 zmienionych plików z 49 dodań i 25 usunięć

Wyświetl plik

@ -197,7 +197,7 @@ The callback functions above are called within the ISR context, so they should *
The parameter ``user_data`` of :cpp:func:`mcpwm_timer_register_event_callbacks` function is used to save user's own context, it will be passed to each callback function directly.
This function will lazy install interrupt service for the MCPWM timer without enabling it. It is only allowed to be called before before :cpp:func:`mcpwm_timer_enable`, otherwise the :c:macro:`ESP_ERR_INVALID_STATE` error will be returned. See also `Enable and Disable timer <#enable-and-disable-timer>`__ for more information.
This function will lazy install interrupt service for the MCPWM timer without enabling it. It is only allowed to be called before :cpp:func:`mcpwm_timer_enable`, otherwise the :c:macro:`ESP_ERR_INVALID_STATE` error will be returned. See also `Enable and Disable timer <#enable-and-disable-timer>`__ for more information.
Enable and Disable Timer
~~~~~~~~~~~~~~~~~~~~~~~~

Wyświetl plik

@ -5,6 +5,7 @@ SPI Flash API
Overview
--------
The spi_flash component contains API functions related to reading, writing, erasing, memory mapping for data in the external flash.
For higher-level API functions which work with partitions defined in the :doc:`partition table </api-guides/partition-tables>`, see :doc:`/api-reference/storage/partition`
@ -129,7 +130,6 @@ Concurrency Constraints for Flash on SPI1
The SPI0/1 bus is shared between the instruction & data cache (for firmware execution) and the SPI1 peripheral (controlled by the drivers including this SPI flash driver). Hence, calling SPI Flash API on SPI1 bus (including the main flash) will cause significant influence to the whole system. See :doc:`spi_flash_concurrency` for more details.
SPI Flash Encryption
--------------------
@ -258,4 +258,4 @@ API Reference - SPI Flash
API Reference - Flash Encrypt
-----------------------------
.. include-build-file:: inc/esp_flash_encrypt.inc
.. include-build-file:: inc/esp_flash_encrypt.inc

Wyświetl plik

@ -1,5 +1,6 @@
HTTP Server
===========
:link_to_translation:`zh_CN:[中文]`
Overview
@ -161,10 +162,12 @@ The HTTP server component provides websocket support. The websocket feature can
Event Handling
--------------
ESP HTTP Server has various events for which a handler can be triggered by :doc:`the Event Loop library <../system/esp_event>` when the particular event occurs. The handler has to be registered using :cpp:func:`esp_event_handler_register`. This helps in event handling for ESP HTTP Server.
:cpp:enum:`esp_http_server_event_id_t` has all the events which can happen for ESP HTTP Server.
ESP HTTP server has various events for which a handler can be triggered by :doc:`the Event Loop library <../system/esp_event>` when the particular event occurs. The handler has to be registered using :cpp:func:`esp_event_handler_register`. This helps in event handling for ESP HTTP server.
:cpp:enum:`esp_http_server_event_id_t` has all the events which can happen for ESP HTTP server.
Expected data type for different ESP HTTP server events in event loop:
Expected data type for different ESP HTTP Server events in event loop:
- HTTP_SERVER_EVENT_ERROR : ``httpd_err_code_t``
- HTTP_SERVER_EVENT_START : ``NULL``
- HTTP_SERVER_EVENT_ON_CONNECTED : ``int``

Wyświetl plik

@ -3,7 +3,6 @@ Storage API
:link_to_translation:`zh_CN:[中文]`
This section contains reference of the high-level storage APIs. They are based on low-level drivers such as SPI Flash, SD/MMC.
- :doc:`Partitions API <partition>` allow block based access to SPI Flash according to the :doc:`Partition Table </api-guides/partition-tables>`.
@ -33,4 +32,3 @@ This section contains reference of the high-level storage APIs. They are based o
wear-levelling
Code examples for this API section are provided in the :example:`storage` directory of ESP-IDF examples.

Wyświetl plik

@ -50,7 +50,7 @@ Usage example to set Ethernet configuration:
Usage example to get Ethernet configuration:
.. code-block:: c
eth_duplex_t duplex_mode;
esp_eth_ioctl(eth_handle, ETH_CMD_G_DUPLEX_MODE, &duplex_mode);
@ -141,13 +141,13 @@ This is the preferred way to print the address:
.. code-block:: c
ESP_LOGI(TAG, "got ip:" IPSTR "\n", IP2STR(&event->ip_info.ip));
ESP_LOGI(TAG, "got ip:" IPSTR "\n", IP2STR(&event->ip_info.ip));
Instead of
.. code-block:: c
ESP_LOGI(TAG, "got ip:%s\n", ip4addr_ntoa(&event->ip_info.ip));
ESP_LOGI(TAG, "got ip:%s\n", ip4addr_ntoa(&event->ip_info.ip));
Since ``ip4addr_ntoa()`` is a LwIP API, the esp-netif provides ``esp_ip4addr_ntoa()`` as a replacement. However, the above method using ``IP2STR()`` is generally preferred.

Wyświetl plik

@ -5,6 +5,7 @@ SPI Flash API
概述
--------
spi_flash 组件提供外部 flash 数据读取、写入、擦除和内存映射相关的 API 函数。
关于更多高层次的用于访问分区(分区表定义于 :doc:`分区表 </api-guides/partition-tables>`)的 API 函数,参见 :doc:`/api-reference/storage/partition`
@ -128,6 +129,7 @@ SPI1 Flash 并发约束
指令/数据 cache用以执行固件与 SPI1 外设(由像 SPI flash 驱动一样的驱动程序控制)共享 SPI0/1 总线。因此,在 SPI1 总线上调用 SPI flash API包括访问主 flash会对整个系统造成显著的影响。请参阅 :doc:`spi_flash_concurrency`,查看详细信息。
SPI Flash 加密
--------------------
@ -253,8 +255,6 @@ SPI Flash API 参考
.. include-build-file:: inc/spi_flash_types.inc
.. include-build-file:: inc/esp_flash_err.inc
.. _api-reference-partition-table:
Flash 加密 API 参考
-----------------------------

Wyświetl plik

@ -1,5 +1,6 @@
HTTP 服务器
===========
:link_to_translation:`en:[English]`
概述
@ -158,6 +159,25 @@ Websocket 服务器
HTTP 服务器组件提供 websocket 支持。可以在 menuconfig 中使用 :ref:`CONFIG_HTTPD_WS_SUPPORT` 选项启用 websocket 功能。有关如何使用 websocket 功能,请参阅 :example:`protocols/http_server/ws_echo_server` 目录下的示例代码。
事件处理
--------------
ESP HTTP 服务器有各种事件,当特定事件发生时,:doc:`事件循环库 <../system/esp_event>` 可以触发处理程序。 必须使用 :cpp:func:`esp_event_handler_register` 注册处理程序以便 ESP HTTP 服务器进行事件处理。
:cpp:enum:`esp_http_server_event_id_t` 包含 ESP HTTP 服务器可能发生的所有事件。
以下为事件循环中不同 ESP HTTP 服务器事件的预期数据类型:
- HTTP_SERVER_EVENT_ERROR : ``httpd_err_code_t``
- HTTP_SERVER_EVENT_START : ``NULL``
- HTTP_SERVER_EVENT_ON_CONNECTED : ``int``
- HTTP_SERVER_EVENT_ON_HEADER : ``int``
- HTTP_SERVER_EVENT_HEADERS_SENT : ``int``
- HTTP_SERVER_EVENT_ON_DATA : ``esp_http_server_event_data``
- HTTP_SERVER_EVENT_SENT_DATA : ``esp_http_server_event_data``
- HTTP_SERVER_EVENT_DISCONNECTED : ``int``
- HTTP_SERVER_EVENT_STOP : ``NULL``
API 参考
--------

Wyświetl plik

@ -7,15 +7,16 @@
- :doc:`分区表 API <partition>` 基于 :doc:`分区表 </api-guides/partition-tables>` ,允许以块为单位访问 SPI Flash 。
- :doc:`非易失性存储库 (NVS) <nvs_flash>` 在 SPI NOR Flash 上实现了一个有容错性,和磨损均衡功能的键值对存储。
- :doc:`虚拟文件系统 (VFS) <vfs>` 库提供了一个用于注册文件系统驱动的接口。 SPIFFS FAT 以及多种其他的文件系统库都基于 VFS
- :doc:`虚拟文件系统 (VFS) <vfs>` 库提供了一个用于注册文件系统驱动的接口。 SPIFFS、FAT 以及多种其他的文件系统库都基于 VFS。
- :doc:`SPIFFS <spiffs>` 是一个专为 SPI NOR Flash 优化的磨损均衡的文件系统,非常适用于小分区和低吞吐率的应用。
- :doc:`FAT <fatfs>` 是一个可用于 SPI Flash 或者 SD/MMC 存储卡的标准文件系统。
- :doc:`磨损均衡 <wear-levelling>` 库实现了一个适用于 SPI NOR Flash 的 Flash 翻译层 (FTL) 。它被用于 Flash 中的 FAT 分区的容器。
- :doc:`磨损均衡 <wear-levelling>` 库实现了一个适用于 SPI NOR Flash 的 Flash 翻译层 (FTL),用于 Flash 中 FAT 分区的容器。
.. note::
建议使用高层次的 API ``esp_partition`` 或者文件系统)而非低层次驱动 API 去访问 SPI NOR Flash 。
由于 NOR Flash 和乐鑫硬件的一些限制,访问主 Flash 会影响各个系统的性能。关于这些限制的更多信息,参见 :doc:`SPI Flash Documents </api-reference/peripherals/spi_flash/index>`
.. toctree::
:maxdepth: 1
@ -30,6 +31,4 @@
vfs
wear-levelling
此部分 API 代码示例存放在 ESP-IDF 示例项目的 :example:`storage` 目录下。

Wyświetl plik

@ -1,12 +1,13 @@
分区 API
========
:link_to_translation:`en:[English]`
概述
--------
``esp_partition`` 组件提供了高层次的 API 函数,用于访问定义在 :doc:`分区表 </api-guides/partition-tables>` 中的分区。这些 API 基于 :doc:`SPI Flash 驱动 </api-reference/peripherals/spi_flash/index>` 提供的低层次 API。
.. _flash-partition-apis:
分区表 API
@ -23,6 +24,7 @@ ESP-IDF 工程使用分区表保存 SPI flash 各区信息,包括引导程序
- :cpp:func:`esp_partition_find_first`:返回描述 :cpp:func:`esp_partition_find` 中找到的第一个分区的结构;
- :cpp:func:`esp_partition_read`:cpp:func:`esp_partition_write`:cpp:func:`esp_partition_erase_range` 等同于 :cpp:func:`esp_flash_read`:cpp:func:`esp_flash_write`:cpp:func:`esp_flash_erase_region`,但在分区边界内执行。
另请参考
------------
@ -30,6 +32,9 @@ ESP-IDF 工程使用分区表保存 SPI flash 各区信息,包括引导程序
- :doc:`OTA API <../system/ota>` 提供了高层 API 用于更新存储在 flash 中的 app 固件。
- :doc:`NVS API <nvs_flash>` 提供了结构化 API 用于存储 SPI flash 中的碎片数据。
.. _api-reference-partition-table:
分区表 API 参考
-------------------------------

Wyświetl plik

@ -6,19 +6,18 @@
Wi-Fi
*****
回调函数类型 esp_now_recv_cb_t
------------------------------
先前, ``esp_now_recv_cb_t`` 的第一个参数的类型是 ``const uint8_t *mac_addr``只包含对端 ESP-NOW 设备的地址。
此前 ``esp_now_recv_cb_t`` 的第一个参数的类型是 ``const uint8_t *mac_addr``该参数只包含对端 ESP-NOW 设备的地址。
类型定义已更新。 第一个参数的类型是 ``esp_now_recv_info_t`` 它包含三个成员变量 ``src_addr````des_addr````rx_ctrl`` 因此,以下更新是需要的:
现在该函数有所更新。第一个参数的类型变更为 ``esp_now_recv_info_t`` 它包含三个成员变量 ``src_addr````des_addr````rx_ctrl``因此,需要进行如下更新:
- 重新定义的 ESP-NOW 收包回调函数。
- ``src_addr`` 可以等价替换原来的 ``mac_addr`` 。
- ``src_addr`` 可以等价替换原来的 ``mac_addr``
- ``des_addr`` 是 ESP-NOW 包的目的 MAC 地址,它可以是单播地址或广播地址。有了 ``des_addr``,可以区分单播和广播的 ESP-NOW ,其中广播的 ESP-NOW 包在加密的 ESP-NOW 配置中也可以是非加密的。
- ``des_addr`` 是 ESP-NOW 包的目的 MAC 地址,可以是单播或广播地址。使用 ``des_addr`` 可以区分单播或广播的 ESP-NOW 包,其中,即使是在加密的 ESP-NOW 配置中,广播的 ESP-NOW 包也可以是非加密的。
- ``rx_ctrl`` 是 ESP-NOW 包的 Rx control info它包含此包的更多有用信息。
@ -51,7 +50,7 @@ esp_eth_ioctl() API
获取以太网配置的用例如下:
.. code-block:: c
eth_duplex_t duplex_mode;
esp_eth_ioctl(eth_handle, ETH_CMD_G_DUPLEX_MODE, &duplex_mode);