Select one of the symbols to view example projects that use it.
 
Outline
#define _WL_Flash_H_
#include "esp_err.h"
#include "Flash_Access.h"
#include "Partition.h"
#include "WL_Config.h"
#include "WL_State.h"
WL_Flash
Files
loading (2/5)...
SourceVuESP-IDF Framework and ExamplesESP-IDFcomponents/wear_levelling/private_include/WL_Flash.h
 
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
69
70
71
72
73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 *//* ... */ #ifndef _WL_Flash_H_ #define _WL_Flash_H_ #include "esp_err.h" #include "Flash_Access.h" #include "Partition.h" #include "WL_Config.h" #include "WL_State.h"5 includes /** * @brief This class is used to make wear levelling for flash devices. Class implements Flash_Access interface * *//* ... */ class WL_Flash : public Flash_Access { public : WL_Flash(); ~WL_Flash() override; virtual esp_err_t config(wl_config_t *cfg, Partition *partition); virtual esp_err_t init(); size_t get_flash_size() override; size_t get_sector_size() override; esp_err_t erase_sector(size_t sector) override; esp_err_t erase_range(size_t start_address, size_t size) override; esp_err_t write(size_t dest_addr, const void *src, size_t size) override; esp_err_t read(size_t src_addr, void *dest, size_t size) override; esp_err_t flush() override; Partition *get_part(); wl_config_t *get_cfg(); ... protected: bool configured = false; bool initialized = false; wl_state_t state; wl_config_t cfg; Partition *partition = NULL; size_t addr_cfg; size_t addr_state1; size_t addr_state2; size_t index_state1; size_t index_state2; size_t flash_size; uint32_t state_size; uint32_t cfg_size; uint8_t *temp_buff = NULL; size_t dummy_addr; uint32_t pos_data[4]; esp_err_t initSections(); esp_err_t updateWL(); esp_err_t recoverPos(); size_t calcAddr(size_t addr); esp_err_t updateVersion(); esp_err_t updateV1_V2(); void fillOkBuff(int n); bool OkBuffSet(int n);... }{...}; /* ... */ #endif // _WL_Flash_H_
Details