WL_Ext_Perf.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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_Perf_H_
  14. #define _WL_Ext_Perf_H_
  15. #include "WL_Flash.h"
  16. #include "WL_Ext_Cfg.h"
  17. class WL_Ext_Perf : public WL_Flash
  18. {
  19. public:
  20. WL_Ext_Perf();
  21. ~WL_Ext_Perf() override;
  22. esp_err_t config(WL_Config_s *cfg, Flash_Access *flash_drv) override;
  23. esp_err_t init() override;
  24. size_t chip_size() override;
  25. size_t sector_size() override;
  26. esp_err_t erase_sector(size_t sector) override;
  27. esp_err_t erase_range(size_t start_address, size_t size) override;
  28. protected:
  29. uint32_t flash_sector_size;
  30. uint32_t fat_sector_size;
  31. uint32_t size_factor;
  32. uint32_t *sector_buffer;
  33. virtual esp_err_t erase_sector_fit(uint32_t start_sector, uint32_t count);
  34. };
  35. #endif // _WL_Ext_Perf_H_