]> granicus.if.org Git - esp-idf/commitdiff
Merge branch 'bugfix/docs_cleanup' into 'master'
authorIvan Grokhotkov <ivan@espressif.com>
Wed, 18 Jan 2017 16:33:31 +0000 (00:33 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Wed, 18 Jan 2017 16:33:31 +0000 (00:33 +0800)
Organize examples and API documentation - supplement to !430

This supplement to !430, both intended to replace bulky  !421.

1. Fixed broken links
2. Added links to available examples in API documentation, where missing
3. Updated links to point directly to example folder (to show README.md with example description)
4. Added README.md in docs folder info to point reader to ReadTheDocs instead of doc sources, ref. https://github.com/espressif/esp-idf/issues/243
5. Fixed some typo errors / Sphinx warnings
6. Fixed memory leak in example, ref. https://github.com/espressif/esp-idf/issues/209

See merge request !440

22 files changed:
docs/README.md [new file with mode: 0644]
docs/api/bluetooth/controller_vhci.rst
docs/api/bluetooth/esp_blufi.rst
docs/api/bluetooth/esp_gap_ble.rst
docs/api/bluetooth/esp_gattc.rst
docs/api/bluetooth/esp_gatts.rst
docs/api/peripherals/sigmadelta.rst
docs/api/peripherals/spi_master.rst
docs/api/peripherals/uart.rst
docs/api/protocols/mdns.rst
docs/api/storage/nvs_flash.rst
docs/api/system/deep_sleep.rst
docs/api/system/log.rst
docs/api/system/ota.rst
docs/api/wifi/esp_smartconfig.rst
docs/api/wifi/esp_wifi.rst
docs/build-system.rst [moved from docs/build_system.rst with 98% similarity]
docs/conf.py
docs/index.rst
docs/security/flash-encryption.rst
examples/storage/nvs_rw_blob/main/nvs_rw_blob.c
examples/storage/sd_card/README.md

diff --git a/docs/README.md b/docs/README.md
new file mode 100644 (file)
index 0000000..475ce09
--- /dev/null
@@ -0,0 +1,11 @@
+# Documentation Source Folder\r
+\r
+This folder contains source files of [ESP-IDF documentation](http://esp-idf.readthedocs.io/).\r
+\r
+The sources do not render well in GitHub and some information is not visible at all.\r
+\r
+Use actual documentation generated instantly on each commit:\r
+\r
+* Main server: http://esp-idf.readthedocs.io/ or http://esp-idf.rtfd.io/\r
+* Mirror: https://dl.espressif.com/doc/esp-idf/latest/\r
+\r
index 3868d9cec7bafcb0259012ec5635637f4788ff9f..dfad1af25e8b52df4f404976316a0bf390eea8fd 100644 (file)
@@ -6,19 +6,17 @@ Overview
 
 `Instructions`_
 
+.. _Instructions: ../template.html
+
 Application Example
 -------------------
 
-Check `/examples <https://github.com/espressif/esp-idf/tree/master/examples>`_ folder of `espressif/esp-idf <https://github.com/espressif/esp-idf/>`_ repository, that contains the following example:
+Check `/examples/bluetooth <https://github.com/espressif/esp-idf/tree/master/examples/bluetooth>`_ folder of `espressif/esp-idf <https://github.com/espressif/esp-idf/>`_ repository, that contains the following example:
 
-`bluetooth/ble_adv <https://github.com/espressif/esp-idf/blob/master/examples/bluetooth/ble_adv/main/app_bt.c>`_ 
+`ble_adv <https://github.com/espressif/esp-idf/blob/master/examples/bluetooth/ble_adv>`_ 
 
   This is a BLE advertising demo with virtual HCI interface. Send Reset/ADV_PARAM/ADV_DATA/ADV_ENABLE HCI command for BLE advertising.
 
-`Instructions`_
-
-.. _Instructions: ../template.html
-
 API Reference
 -------------
 
index a281c3d3d61d07b71e4ec3844febf8137ccbcd91..442e54f5cac531eca7ef6074ef8a0a5da1a280be 100644 (file)
@@ -11,11 +11,11 @@ Use should concern these things:
 Application Example
 -------------------
 
-Check `/examples <https://github.com/espressif/esp-idf/tree/master/examples>`_ folder of `espressif/esp-idf <https://github.com/espressif/esp-idf/>`_ repository, that contains the following example:
+Check `/examples/bluetooth <https://github.com/espressif/esp-idf/tree/master/examples/bluetooth>`_ folder of `espressif/esp-idf <https://github.com/espressif/esp-idf>`_ repository, that contains the following example:
 
-`bluetooth/blufi <https://github.com/espressif/esp-idf/blob/master/examples/bluetooth/blufi/main/>`_ 
+`blufi <https://github.com/espressif/esp-idf/blob/master/examples/bluetooth/blufi>`_ 
 
-This is a BLUFI demo. This demo can set ESP32's wifi to softap/station/softap&station mode and config wifi connections.
+  This is a BLUFI demo. This demo can set ESP32's wifi to softap/station/softap&station mode and config wifi connections.
 
 
 API Reference
index 088ab27dbaed3cf23ddfd98f4c76c870e47e11b6..f53b8d56ad76fd7a3b96bb842e6685c288125335 100644 (file)
@@ -1,25 +1,21 @@
 GAP API
-========
+=======
 
 Overview
 --------
 
 `Instructions`_
 
+.. _Instructions: ../template.html
+
 Application Example
 -------------------
 
-Check `/examples <https://github.com/espressif/esp-idf/tree/master/examples>`_ folder of `espressif/esp-idf <https://github.com/espressif/esp-idf/>`_ repository, that contains the following example:
-
-`14_gatts_demo <https://github.com/espressif/esp-idf/blob/master/examples/bluetooth/gatt_server/main/gatts_demo.c>`_ 
-`15_gattc_demo <https://github.com/espressif/esp-idf/blob/master/examples/bluetooth/gatt_client/main/gattc_demo.c>`_ 
-
-The two demos use different gap api, such like advertising, scan, set device name and others.
+Check `/examples/bluetooth <https://github.com/espressif/esp-idf/tree/master/examples/bluetooth>`_ folder of `espressif/esp-idf <https://github.com/espressif/esp-idf>`_ repository, that contains the following examples:
 
-`Instructions`_
-
-.. _Instructions: ../template.html
+`gatt_server <https://github.com/espressif/esp-idf/blob/master/examples/bluetooth/gatt_server>`_, `gatt_client <https://github.com/espressif/esp-idf/blob/master/examples/bluetooth/gatt_client>`_ 
 
+  The two demos use different gap api, such like advertising, scan, set device name and others.
 
 API Reference
 -------------
@@ -27,7 +23,7 @@ API Reference
 Header Files
 ^^^^^^^^^^^^
 
-  * `bt/bluedroid/api/include/esp_gap_ble_api.h <https://github.com/espressif/esp-idf/blob/master/components/bt/bluedroid/api/include/esp_gap_ble.h>`_
+  * `bt/bluedroid/api/include/esp_gap_ble_api.h <https://github.com/espressif/esp-idf/blob/master/components/bt/bluedroid/api/include/esp_gap_ble_api.h>`_
 
 
 Macros
index eada883fd7093d24e96b8b2442b776acb0648a57..adfc225dfab0ec05284101c8cc1b10bd0e58c6c3 100644 (file)
@@ -6,18 +6,16 @@ Overview
 
 `Instructions`_
 
+.. _Instructions: ../template.html
+
 Application Example
 -------------------
 
-Check `/examples <https://github.com/espressif/esp-idf/tree/master/examples>`_ folder of `espressif/esp-idf <https://github.com/espressif/esp-idf/>`_ repository, that contains the following example:
-
-`15_gattc_demo <https://github.com/espressif/esp-idf/blob/master/examples/bluetooth/gatt_client/main/gattc_demo.c>`_ 
+Check `/examples/bluetooth <https://github.com/espressif/esp-idf/tree/master/examples/bluetooth>`_ folder of `espressif/esp-idf <https://github.com/espressif/esp-idf>`_ repository, that contains the following example:
 
-This is a gatt client demo. This demo can scan devices, connect to the gatt server and discover the service.
+`gatt_client <https://github.com/espressif/esp-idf/blob/master/examples/bluetooth/gatt_client>`_ 
 
-`Instructions`_
-
-.. _Instructions: ../template.html
+  This is a gatt client demo. This demo can scan devices, connect to the gatt server and discover the service.
 
 
 API Reference
index 877840402c0df65c8fc44fea250f86befd04fb55..4753490d4d927e39aae4ab15540e659f802cbf0a 100644 (file)
@@ -6,19 +6,16 @@ Overview
 
 `Instructions`_
 
+.. _Instructions: ../template.html
+
 Application Example
 -------------------
 
-Check `/examples <https://github.com/espressif/esp-idf/tree/master/examples>`_ folder of `espressif/esp-idf <https://github.com/espressif/esp-idf/>`_ repository, that contains the following example:
-
-`14_gatts_demo <https://github.com/espressif/esp-idf/blob/master/examples/bluetooth/gatt_server/main/gatts_demo.c>`_ 
-
-This is a gatt server demo. Use gatt api to create a gatt server with send advertising. This gatt server can be connected and the service can be discovery.
+Check `/examples/bluetooth <https://github.com/espressif/esp-idf/tree/master/examples/bluetooth>`_ folder of `espressif/esp-idf <https://github.com/espressif/esp-idf>`_ repository, that contains the following example:
 
-`Instructions`_
-
-.. _Instructions: ../template.html
+`gatt_server <https://github.com/espressif/esp-idf/blob/master/examples/bluetooth/gatt_server>`_ 
 
+  This is a gatt server demo. Use gatt api to create a gatt server with send advertising. This gatt server can be connected and the service can be discovery.
 
 API Reference
 -------------
index b03f0494211405455be4cebad1605f75c15d3a74..56e4d77e72829a8bf6c56cfa59df3fb41615b01c 100644 (file)
@@ -10,7 +10,7 @@ This driver configures the channels of the sigma-delta module.
 Application Example
 -------------------
 
-Sigma-delta Modulation example: `examples/14_sigmadelta <https://github.com/espressif/esp-idf/tree/master/examples/14_sigmadelta>`_.
+Sigma-delta Modulation example: `examples/peripherals/sigmadelta <https://github.com/espressif/esp-idf/tree/master/examples/peripherals/sigmadelta>`_.
 
 API Reference
 -------------
index 5b57d85f4262daeee6eb5f7e358e44fd1a585f67..9e5c0eb6369f575ef36d5b9ce41c00f7c434627f 100644 (file)
@@ -105,13 +105,18 @@ on the transmission. For received data, use ``rx_data`` and set ``SPI_USE_RXDATA
 not touch the ``tx_buffer`` or ``rx_buffer`` members, because they use the same memory locations
 as ``tx_data`` and ``rx_data``.
 
+Application Example
+-------------------
+Display graphics on the ILI9341-based 320x240 LCD: `examples/peripherals/spi_master <https://github.com/espressif/esp-idf/tree/master/examples/peripherals/spi_master>`_.
+
 API Reference
 -------------
 
 Header Files
 ^^^^^^^^^^^^
 
-  * `drivers/include/drivers/spi_master.h <https://github.com/espressif/esp-idf/blob/master/components/drivers/include/drivers/spi_master.h>`_
+  * `driver/include/driver/spi_master.h <https://github.com/espressif/esp-idf/blob/master/components/driver/include/driver/spi_master.h>`_
 
 Macros
 ^^^^^^
index 8684b2afa370d1e52972a7100140fc494cfe59b4..b00b4e064865ed2721676e5741eeffc0a63efcb2 100644 (file)
@@ -6,18 +6,16 @@ Overview
 
 `Instructions`_
 
+.. _Instructions: ../template.html
+
 Application Example
 -------------------
 
-`Instructions`_
+Configure uart settings and install uart driver to read/write using UART0 and UART1 interfaces: `examples/peripherals/uart <https://github.com/espressif/esp-idf/tree/master/examples/peripherals/uart>`_.
 
 API Reference
 -------------
 
-`Instructions`_
-
-.. _Instructions: ../template.html
-
 Header Files
 ^^^^^^^^^^^^
 
index d674e25a08b42800aafc7ec2b7af24e23bc8a211..621488396551000d52e013cc07e4b9be5a87dc89 100644 (file)
@@ -163,7 +163,7 @@ Example of using the methods above:
 Application Example
 -------------------
 
-mDNS server/scanner example: `examples/protocols/mdsn <https://github.com/espressif/esp-idf/tree/master/examples/protocols/mdsn>`_.
+mDNS server/scanner example: `examples/protocols/mdns <https://github.com/espressif/esp-idf/tree/master/examples/protocols/mdns>`_.
 
 API Reference
 -------------
index 00094d8697d11b2cf8889027bb1deb8ea02dfa42..9e97c3a8118d26dfb2eebb521a07ffeefc708e1b 100644 (file)
@@ -3,9 +3,9 @@
 Application Example
 -------------------
 
-Two examples are provided in ESP-IDF examples directory:
+Two examples are provided in ESP-IDF `examples/storage <https://github.com/espressif/esp-idf/tree/master/examples/storage>`_ directory:
 
-`storage/nvs_rw_value <https://github.com/espressif/esp-idf/blob/master/examples/storage/nvs_rw_value/main/nvs_rw_value.c>`_
+`nvs_rw_value <https://github.com/espressif/esp-idf/blob/master/examples/storage/nvs_rw_value>`_
 
   Demonstrates how to read and write a single integer value using NVS.
 
@@ -13,7 +13,7 @@ Two examples are provided in ESP-IDF examples directory:
 
   Example also shows how to check if read / write operation was successful, or certain value is not initialized in NVS. Diagnostic is provided in plain text to help track program flow and capture any issues on the way.
 
-`storage/nvs_rw_blob <https://github.com/espressif/esp-idf/blob/master/examples/storage/nvs_rw_blob/main/nvs_rw_blob.c>`_
+`nvs_rw_blob <https://github.com/espressif/esp-idf/blob/master/examples/storage/nvs_rw_blob>`_
 
   Demonstrates how to read and write a single integer value and a blob (binary large object) using NVS to preserve them between ESP32 module restarts.
 
index 9e6642fd907c7f7bc8187dbd6f0c35fd5be3195b..393d5f025ed6b0e27c8c1231d9ca70ee75285182 100644 (file)
@@ -87,3 +87,8 @@ The following function can be used to enter deep sleep once wakeup sources are c
 
 .. doxygenfunction:: esp_deep_sleep_start
 
+Application Example
+-------------------
+Implementation of basic functionality of deep sleep is shown in `protocols/sntp <https://github.com/espressif/esp-idf/tree/master/examples/protocols/sntp>`_ example, where ESP module is periodically waken up to retrive time from NTP server.
+
index d812740bb2e260e8b12ba4f92fd7d1327e05f0fb..24d3bef80a08a5d9939a0de521bfc6ad99a41f62 100644 (file)
@@ -3,9 +3,11 @@
 Application Example
 -------------------
 
-`Instructions`_
-
-.. _Instructions: ../template.html
+Log library is commonly used by most of esp-idf components and examples. For demonstration of log functionality check `examples <https://github.com/espressif/esp-idf/tree/master/examples>`_ folder of `espressif/esp-idf <https://github.com/espressif/esp-idf>`_ repository, that among others, contains the following examples:
+* `system/ota <https://github.com/espressif/esp-idf/tree/master/examples/system/ota>`_ 
+* `storage/sd_card <https://github.com/espressif/esp-idf/tree/master/examples/storage/sd_card>`_ 
+* `protocols/https_request <https://github.com/espressif/esp-idf/tree/master/examples/protocols/https_request>`_ 
 
 API Reference
 -------------
index a4984620f6e5883ada2da0c1b8d9bb22b44d5775..ce2fdba63555ba5464f86b60461283cd909938ca 100644 (file)
@@ -1,6 +1,11 @@
 OTA
 ===
 
+Application Example
+-------------------
+Demonstration of OTA (over the air) firmware update workflow: `examples/system/ota <https://github.com/espressif/esp-idf/tree/master/examples/system/ota>`_.
+
 API Reference
 -------------
 
index 262218aa8b2853bca3cd18b0856e945ac200e701..11a6bccbfa37b795bfb6c631a9752d6511e0afe9 100644 (file)
@@ -1,5 +1,5 @@
 Smart Config
-===
+============
 
 API Reference
 -------------
index 1fe832a2c5dbac07fbbb11b3d596c0896e427800..247ddf7522a9f6f8c3067862ba3a000324e9f1ac 100644 (file)
@@ -6,18 +6,16 @@ Overview
 
 `Instructions`_
 
+.. _Instructions: ../template.html
+
 Application Example
 -------------------
 
-`Instructions`_
+Simple code showing how to connect ESP32 module to an Access Point: `esp-idf-template <https://github.com/espressif/esp-idf-template>`_.
 
 API Reference
 -------------
 
-`Instructions`_
-
-.. _Instructions: ../template.html
-
 Header Files
 ^^^^^^^^^^^^
 
similarity index 98%
rename from docs/build_system.rst
rename to docs/build-system.rst
index d4353287b941bd723aa399f7bbfafcd3ed336533..8f43b211768257f9ec7000f73078a2a6fab81863 100644 (file)
@@ -131,7 +131,7 @@ Component Makefiles
 
 Each project contains one or more components, which can either be part of esp-idf or added from other component directories.
 
-A component is any sub-directory that contains a `component.mk` file.[#f1]_.
+A component is any sub-directory that contains a `component.mk` file [#f1]_.
 
 Minimal Component Makefile
 ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -464,7 +464,7 @@ The file's contents will be added to the .rodata section in flash, and are avail
 
 The names are generated from the full name of the file, as given in COMPONENT_EMBED_FILES. Characters /, ., etc. are replaced with underscores. The _binary prefix in the symbol name is added by objcopy and is the same for both text and binary files.
 
-For an example of using this technique, see examples/protocols/https_request - the certificate file contents are loaded from the text .pem file at compile time.
+For an example of using this technique, see `examples/protocols/https_request <https://github.com/espressif/esp-idf/tree/master/examples/protocols/https_request>`_ - the certificate file contents are loaded from the text .pem file at compile time.
 
 
 Fully Overriding The Component Makefile
@@ -485,7 +485,7 @@ is set then the component can instruct the linker to link other binaries instead
 
 .. _esp-idf-template: https://github.com/espressif/esp-idf-template
 .. _GNU Make Manual: https://www.gnu.org/software/make/manual/make.html
-.. _[_f1]: Actually, some components in esp-idf are "pure configuration" components that don't have a component.mk file, only a Makefile.projbuild and/or Kconfig.projbuild file. However, these components are unusual and most components have a component.mk file.
+.. [#f1] Actually, some components in esp-idf are "pure configuration" components that don't have a component.mk file, only a Makefile.projbuild and/or Kconfig.projbuild file. However, these components are unusual and most components have a component.mk file.
 
 
 Custom sdkconfig defaults
index 551cd86dd02a93e47021a3f711adf575d935c18a..d38d3dee9d3aaa6e1bdbc4686ec9783e400f7fee 100644 (file)
@@ -65,8 +65,8 @@ source_suffix = '.rst'
 master_doc = 'index'
 
 # General information about the project.
-project = u'ESP32 Programming Guide'
-copyright = u'2016, Espressif'
+project = u'ESP-IDF Programming Guide'
+copyright = u'2016 - 2017, Espressif'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
index b8d24d690c35aaa6f592764d3e5d702c26125661..488471dfe1b8d897983c8dc404e0f1fab8176e3c 100644 (file)
@@ -28,7 +28,7 @@ Contents:
    :maxdepth: 1
 
    General Notes <general-notes>
-   Build System <build_system>
+   Build System <build-system>
    Debugging <openocd>
    ESP32 Core Dump <core_dump>
    Partition Tables <partition-tables>
index 298a0a75bf67cd2fe7d05b29e68f96a0a09f2f42..8c6bd4c857eeb9fd8f853c223fd72a334df9d656 100644 (file)
@@ -291,11 +291,13 @@ Flash Encryption Algorithm
 - Each 32 byte block is encrypted with a unique key which is derived from this main flash encryption key XORed with the offset of this block in the flash (a "key tweak").
 
 - The specific tweak depends on the setting of ``FLASH_CRYPT_CONFIG`` efuse. This is a 4 bit efuse, where each bit enables XORing of a particular range of the key bits:
+
   - Bit 1, bits 0-66 of the key are XORed.
   - Bit 2, bits 67-131 of the key are XORed.
   - Bit 3, bits 132-194 of the key are XORed.
   - Bit 4, bits 195-256 of the key are XORed.
-It is recommended that ``FLASH_CRYPT_CONFIG`` is always left to set the default value `0xF`, so that all key bits are XORed with the block offset. See `Setting FLASH_CRYPT_CONFIG` for details.
+
+  It is recommended that ``FLASH_CRYPT_CONFIG`` is always left to set the default value `0xF`, so that all key bits are XORed with the block offset. See `Setting FLASH_CRYPT_CONFIG` for details.
 
 - The high 19 bits of the block offset (bit 5 to bit 23) are XORed with the main flash encryption key. This range is chosen for two reasons: the maximum flash size is 16MB (24 bits), and each block is 32 bytes so the least significant 5 bits are always zero.
 
index 0d4b7db4ee4fdc437c1cda32d9c30c98287fcb33..c0a865eb6ad5f6a924e96a60bd63bb1ad635772e 100644 (file)
@@ -87,10 +87,10 @@ esp_err_t save_run_time(void)
     required_size += sizeof(uint32_t);
     run_time[required_size / sizeof(uint32_t) - 1] = xTaskGetTickCount() * portTICK_PERIOD_MS;
     err = nvs_set_blob(my_handle, "run_time", run_time, required_size);
-    if (err != ESP_OK) return err;
-
     free(run_time);
 
+    if (err != ESP_OK) return err;
+
     // Commit
     err = nvs_commit(my_handle);
     if (err != ESP_OK) return err;
index bfc6a39fe9730ebd500640f75bfe4562adb73b8b..b125716eaeb0e8039d6e0c0baad47d5a23ea136f 100644 (file)
@@ -32,7 +32,8 @@ N/C           | WP          |
 This example doesn't utilize card detect (CD) and write protect (WP) signals from SD card slot.
 
 ### Note about GPIO2
-GPIO2 pin is used as a bootstrapping pin, and should be low to enter UART download mode. One way to do this is to connect GPIO0 and GPIO2 using a jumper, and then the auto-reset circuit on most development boards will pull GPIO2 low along with GPIO2, when entering download mode.
+
+GPIO2 pin is used as a bootstrapping pin, and should be low to enter UART download mode. One way to do this is to connect GPIO0 and GPIO2 using a jumper, and then the auto-reset circuit on most development boards will pull GPIO2 low along with GPIO0, when entering download mode.
 
 ### Note about GPIO12