partition.rst 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. Partitions API
  2. ==============
  3. :link_to_translation:`zh_CN:[中文]`
  4. Overview
  5. --------
  6. The ``esp_partition`` component has higher-level API functions which work with partitions defined in the :doc:`/api-guides/partition-tables`. These APIs are based on lower level API provided by :doc:`/api-reference/peripherals/spi_flash/index`.
  7. .. _flash-partition-apis:
  8. Partition Table API
  9. -------------------
  10. ESP-IDF projects use a partition table to maintain information about various regions of SPI flash memory (bootloader, various application binaries, data, filesystems). More information can be found in :doc:`/api-guides/partition-tables`.
  11. This component provides API functions to enumerate partitions found in the partition table and perform operations on them. These functions are declared in ``esp_partition.h``:
  12. - :cpp:func:`esp_partition_find` checks a partition table for entries with specific type, returns an opaque iterator.
  13. - :cpp:func:`esp_partition_get` returns a structure describing the partition for a given iterator.
  14. - :cpp:func:`esp_partition_next` shifts the iterator to the next found partition.
  15. - :cpp:func:`esp_partition_iterator_release` releases iterator returned by :cpp:func:`esp_partition_find`.
  16. - :cpp:func:`esp_partition_find_first` is a convenience function which returns the structure describing the first partition found by :cpp:func:`esp_partition_find`.
  17. - :cpp:func:`esp_partition_read`, :cpp:func:`esp_partition_write`, :cpp:func:`esp_partition_erase_range` are equivalent to :cpp:func:`esp_flash_read`, :cpp:func:`esp_flash_write`, :cpp:func:`esp_flash_erase_region`, but operate within partition boundaries.
  18. See Also
  19. --------
  20. - :doc:`../../api-guides/partition-tables`
  21. - :doc:`../system/ota` provides high-level API for updating applications stored in flash.
  22. - :doc:`nvs_flash` provides a structured API for storing small pieces of data in SPI flash.
  23. .. _api-reference-partition-table:
  24. API Reference - Partition Table
  25. -------------------------------
  26. .. include-build-file:: inc/esp_partition.inc