add wear_levelling component and example

This commit is contained in:
Ivan Grokhotkov
2017-04-10 22:06:35 +08:00
parent aeabbd305c
commit 52b51df859
40 changed files with 2386 additions and 8 deletions

View File

@@ -12,7 +12,7 @@ Using FatFs with VFS
Most applications will use the following flow when working with ``esp_vfs_fat_`` functions:
1. Call ``esp_vfs_fat_register``, specifying path prefix where the filesystem has to be mounted (e.g. ``"/sdcard"``), FatFs drive number, and a variable which will receive a pointer to ``FATFS`` structure.
1. Call ``esp_vfs_fat_register``, specifying path prefix where the filesystem has to be mounted (e.g. ``"/sdcard"``, ``"/spiflash"``), FatFs drive number, and a variable which will receive a pointer to ``FATFS`` structure.
2. Call ``ff_diskio_register`` function to register disk IO driver for the drive number used in step 1.
@@ -43,7 +43,7 @@ Using FatFs with VFS and SD cards
.. doxygenfunction:: esp_vfs_fat_sdmmc_mount
.. doxygenstruct:: esp_vfs_fat_sdmmc_mount_config_t
.. doxygenstruct:: esp_vfs_fat_mount_config_t
:members:
.. doxygenfunction:: esp_vfs_fat_sdmmc_unmount

View File

@@ -9,6 +9,7 @@ Storage API
Non-Volatile Storage <nvs_flash>
Virtual Filesystem <vfs>
FAT Filesystem <fatfs>
Wear Levelling <wear-levelling>
Example code for this API section is provided in :example:`storage` directory of ESP-IDF examples.

View File

@@ -0,0 +1,50 @@
.. include:: ../../../components/wear_levelling/README.rst
See also
--------
- :doc:`FAT Filesystem </partition-tables>`
- :doc:`Partition Table documentation </partition-tables>`
Application Example
-------------------
An example which combines wear levelling driver with FATFS library is provided in ``examples/storage/wear_levelling`` directory. This example initializes the
wear levelling driver, mounts FATFS partition, and writes and reads data from it using POSIX and C library APIs. See README.md file in the example directory for more information.
High level API Reference
-------------
Header Files
^^^^^^^^^^^^
* :component_file:`fatfs/src/esp_vfs_fat.h`
Functions
^^^^^^^^^
.. doxygenfunction:: esp_vfs_fat_spiflash_mount
.. doxygenstruct:: esp_vfs_fat_mount_config_t
:members:
.. doxygenfunction:: esp_vfs_fat_spiflash_unmount
Mid level API Reference
-------------
Header Files
^^^^^^^^^^^^
* :component_file:`wear_levelling/include/wear_levelling.h`
Functions
^^^^^^^^^
.. doxygenfunction:: wl_mount
.. doxygenfunction:: wl_unmount
.. doxygenfunction:: wl_erase_range
.. doxygenfunction:: wl_write
.. doxygenfunction:: wl_read
.. doxygenfunction:: wl_size
.. doxygenfunction:: wl_sector_size