/* * SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 *//* ... */#ifndefESP_PARTITION_HPP_#defineESP_PARTITION_HPP_#include"esp_partition.h"#include"intrusive_list.h"#include"partition.hpp"#include"nvs_memory_management.hpp"#defineESP_ENCRYPT_BLOCK_SIZE16#definePART_NAME_MAX_SIZE16/*!< maximum length of partition name (excluding null terminator) */namespacenvs{/** * Implementation of Partition for NVS. * * It is implemented as an intrusive_list_node to easily store instances of it. NVSStorage and NVSPage take pointer * references of this class to abstract their partition operations. *//* ... */classNVSPartition:publicPartition,publicintrusive_list_node<NVSPartition>,publicExceptionlessAllocatable{public:/** * Copy partition_name to mPartitionName and initialize mESPPartition. * * @param partition_name the name of the partition as in the partition table, must be non-NULL! * @param partition an already initialized partition structure *//* ... */NVSPartition(constesp_partition_t*partition);/** * No need to de-initialize mESPPartition here, if you used esp_partition_find_first. * Otherwise, the user is responsible for de-initializing it. *//* ... */virtual~NVSPartition(){}constchar*get_partition_name()override;/** * Look into \c esp_partition_read_raw for more details. * * @return * - ESP_OK on success * - other error codes from the esp_partition API *//* ... */esp_err_tread_raw(size_tsrc_offset,void*dst,size_tsize)override;/** * Look into \c esp_partition_read for more details. * * @return * - ESP_OK on success * - ESP_ERR_INVALID_ARG if size isn't a multiple of ESP_ENCRYPT_BLOCK_SIZE * - other error codes from the esp_partition API *//* ... */esp_err_tread(size_tsrc_offset,void*dst,size_tsize)override;/** * Look into \c esp_partition_write_raw for more details. * * @return * - ESP_OK on success * - error codes from the esp_partition API *//* ... */esp_err_twrite_raw(size_tdst_offset,constvoid*src,size_tsize)override;/** * Look into \c esp_partition_write for more details. * * @return * - ESP_OK on success * - ESP_ERR_INVALID_ARG if size isn't a multiple of ESP_ENCRYPT_BLOCK_SIZE * - other error codes from the esp_partition API *//* ... */esp_err_twrite(size_tdst_offset,constvoid*src,size_tsize)override;/** * Look into \c esp_partition_erase_range for more details. * * @return * - ESP_OK on success * - error codes from the esp_partition API *//* ... */esp_err_terase_range(size_tdst_offset,size_tsize)override;/** * @return the base address of the partition. *//* ... */uint32_tget_address()override;/** * @return the size of the partition in bytes. *//* ... */uint32_tget_size()override;/** * @return true if the partition is read-only. *//* ... */boolget_readonly()override;...protected:constesp_partition_t*mESPPartition;...}{...};}{...}// nvs/* ... */#endif// ESP_PARTITION_HPP_
Details
Show: from
Types: Columns:
All items filtered out
All items filtered out
This file uses the notable symbols shown below. Click anywhere in the file to view more details.