VitroIO SDK
Software development kit for Vitro Shard.
Loading...
Searching...
No Matches
flash_interface.h
Go to the documentation of this file.
1#ifndef VITROIO_SDK_FLASH_INTERFACE_H
2#define VITROIO_SDK_FLASH_INTERFACE_H
3
4#include <mbed.h>
5
6namespace vitroio
7{
8
9namespace sdk
10{
11
12namespace impl
13{
14
25class FlashInterface : private NonCopyable<FlashInterface>
26{
27public:
37 explicit FlashInterface();
38
43
52 bool isValid() const;
53
65 int read(void* buffer, uint32_t offset, uint32_t size);
66
78 int write(void* buffer, uint32_t offset, uint32_t size);
79
89 uint32_t getMaxSectorSize() const;
90
99 uint32_t getSectorSize(uint32_t offset) const;
100
104 uint32_t getFlashStartAddress() const;
105
109 uint32_t getFlashSize() const;
110
111private:
112 bool valid_;
113
114 FlashIAP iap_;
115 uint32_t maxSectorSize_;
116 uint32_t flashStartAddr_;
117};
118
123} // namespace impl
124
125} // namespace sdk
126
127} // namespace vitroio
128
129#endif // VITROIO_SDK_FLASH_INTERFACE_H
Class is a wrapper for mbed::FlashIAP module.
Definition: flash_interface.h:26
uint32_t getFlashSize() const
Function allows to obtain flash memory size in bytes.
uint32_t getMaxSectorSize() const
Function allows to obtain maximum size of sector in flash memory.
uint32_t getFlashStartAddress() const
Function allows to obtain flash memory start address.
int read(void *buffer, uint32_t offset, uint32_t size)
Function reads data from flash memory.
uint32_t getSectorSize(uint32_t offset) const
Function allows to obtain sector size of flash memory for specified address.
FlashInterface()
Constructor initializes the interface.
int write(void *buffer, uint32_t offset, uint32_t size)
Function writes data to flash memory.
bool isValid() const
Function allows to check whether the interface is in valid state.
The namespace contains all of components of vitro-shard-sdk and components based on the sdk....
Definition: can_layer.h:9