Select one of the symbols to view example projects that use it.
 
Outline
#include "esp_log.h"
#include "Partition.h"
#include <inttypes.h>
TAG
Partition::Partition(const esp_partition_t *)
Partition::get_flash_size()
Partition::erase_sector(size_t)
Partition::erase_range(size_t, size_t)
Partition::write(size_t, const void *, size_t)
Partition::read(size_t, void *, size_t)
Partition::get_sector_size()
Partition::is_readonly()
Partition::~Partition()
Files
loading...
SourceVuESP-IDF Framework and ExamplesESP-IDFcomponents/wear_levelling/Partition.cpp
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 *//* ... */ #include "esp_log.h" #include "Partition.h" #include <inttypes.h> static const char *TAG = "wl_partition"; Partition::Partition(const esp_partition_t *partition) { this->partition = partition; }{ ... } size_t Partition::get_flash_size() { return this->partition->size; }{ ... } esp_err_t Partition::erase_sector(size_t sector) { esp_err_t result = ESP_OK; result = erase_range(sector * this->partition->erase_size, this->partition->erase_size); return result; }{ ... } esp_err_t Partition::erase_range(size_t start_address, size_t size) { esp_err_t result = esp_partition_erase_range(this->partition, start_address, size); if (result == ESP_OK) { ESP_LOGV(TAG, "erase_range - start_address=0x%08" PRIx32 ", size=0x%08" PRIx32 ", result=0x%08x", (uint32_t) start_address, (uint32_t) size, result); }{...} else { ESP_LOGE(TAG, "erase_range - start_address=0x%08" PRIx32 ", size=0x%08" PRIx32 ", result=0x%08x", (uint32_t) start_address, (uint32_t) size, result); }{...} return result; }{ ... } esp_err_t Partition::write(size_t dest_addr, const void *src, size_t size) { esp_err_t result = ESP_OK; result = esp_partition_write(this->partition, dest_addr, src, size); return result; }{ ... } esp_err_t Partition::read(size_t src_addr, void *dest, size_t size) { esp_err_t result = ESP_OK; result = esp_partition_read(this->partition, src_addr, dest, size); return result; }{ ... } size_t Partition::get_sector_size() { return this->partition->erase_size; }{ ... } bool Partition::is_readonly() { return this->partition->readonly; }{ ... } Partition::~Partition() { }{ ... }
Details