Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
Stm32SPIFFS.hxx
Go to the documentation of this file.
1
36#ifndef _FREERTOS_DRIVERS_SPIFFS_STM32F0_F3_STM32SPIFFS_HXX_
37#define _FREERTOS_DRIVERS_SPIFFS_STM32F0_F3_STM32SPIFFS_HXX_
38
39#include <cstdint>
40
43
45class Stm32SPIFFS : public SPIFFS
46{
47public:
49 Stm32SPIFFS(size_t physical_address, size_t size_on_disk,
50 size_t logical_block_size, size_t logical_page_size,
51 size_t max_num_open_descriptors = 16, size_t cache_pages = 8,
52 std::function<void()> post_format_hook = nullptr)
53 : SPIFFS(physical_address, size_on_disk, ERASE_PAGE_SIZE,
54 logical_block_size, logical_page_size,
55 max_num_open_descriptors, cache_pages, post_format_hook)
56 {
57 }
58
61 {
62 unmount();
63 }
64
65private:
67 static constexpr size_t ERASE_PAGE_SIZE = 256 * 1024;
68
70 Stm32Flash<FlashVariableSectors> flash_{STM32F7_SINGLE_BANK_2M_FLASH};
71
76 int32_t flash_read(uint32_t addr, uint32_t size, uint8_t *dst) override;
77
82 int32_t flash_write(uint32_t addr, uint32_t size, uint8_t *src) override;
83
87 int32_t flash_erase(uint32_t addr, uint32_t size) override;
88
90};
91
92#endif // _FREERTOS_DRIVERS_SPIFFS_STM32F0_F3_STM32SPIFFS_HXX_
Generic SPIFFS base class.
Definition SPIFFS.hxx:49
void unmount()
Flushes caches and unmounts the filesystem.
Definition SPIFFS.cxx:151
Specialization of Serial SPIFFS driver for CC32xx devices.
int32_t flash_read(uint32_t addr, uint32_t size, uint8_t *dst) override
SPIFFS callback to read flash, in context.
int32_t flash_erase(uint32_t addr, uint32_t size) override
SPIFFS callback to erase flash, in context.
Stm32SPIFFS(size_t physical_address, size_t size_on_disk, size_t logical_block_size, size_t logical_page_size, size_t max_num_open_descriptors=16, size_t cache_pages=8, std::function< void()> post_format_hook=nullptr)
Constructor.
static constexpr size_t ERASE_PAGE_SIZE
size of an erase page in FLASH
int32_t flash_write(uint32_t addr, uint32_t size, uint8_t *src) override
SPIFFS callback to write flash, in context.
Stm32Flash< FlashVariableSectors > flash_
Implementation of the flash read/write routines.
~Stm32SPIFFS()
Destructor.
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Removes default copy-constructor and assignment added by C++.
Definition macros.h:171