WL_Ext_Safe.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. // http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. // Unless required by applicable law or agreed to in writing, software
  9. // distributed under the License is distributed on an "AS IS" BASIS,
  10. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. // See the License for the specific language governing permissions and
  12. // limitations under the License.
  13. #ifndef _WL_Ext_Safe_H_
  14. #define _WL_Ext_Safe_H_
  15. #include "WL_Flash.h"
  16. #include "WL_Ext_Cfg.h"
  17. #include "WL_Ext_Perf.h"
  18. class WL_Ext_Safe : public WL_Ext_Perf
  19. {
  20. public:
  21. WL_Ext_Safe();
  22. ~WL_Ext_Safe() override;
  23. esp_err_t config(WL_Config_s *cfg, Flash_Access *flash_drv) override;
  24. esp_err_t init() override;
  25. size_t chip_size() override;
  26. protected:
  27. esp_err_t erase_sector_fit(uint32_t start_sector, uint32_t count) override;
  28. // Dump Sector
  29. uint32_t dump_addr; // dump buffer address
  30. uint32_t state_addr;// sectore where state of transaction will be stored
  31. esp_err_t recover();
  32. };
  33. #endif // _WL_Ext_Safe_H_