FlashDataReader
This class is an abstract interface for a class reading data from a flash. The flash can be any type, but is mostly used for flashes that are not memory mapped. Applications must implement access to the flash through this interface.
Public Functions
virtual bool | addressIsAddressable(const void * address) =0 |
Compute if an address is directly addressable by the MCU. | |
virtual void | copyData(const void src, void dst, uint32_t bytes) =0 |
Copy data from flash to a buffer. | |
virtual void | startFlashLineRead(const void * src, uint32_t bytes) =0 |
Initiate a read operation from flash to a buffer. | |
virtual const uint8_t * | waitFlashReadComplete() =0 |
Waits until the previous startFlashLineRead operation is complete. | |
virtual | ~FlashDataReader() |
Finalizes an instance of the FlashDataReader class. | |
Public Functions Documentation
addressIsAddressable
virtual bool addressIsAddressable | ( | const void * | address | ) | |
Compute if an address is directly addressable by the MCU.
Compute if an address is directly addressable by the MCU. The data is addressable it should be read direct through a pointer and not through this interface.
address | The address in the flash. |
True if the address is addressable by the MCU.
copyData
virtual void copyData | ( | const void * | src , | =0 | |
void * | dst , | =0 | |||
uint32_t | bytes | =0 | |||
) | =0 |
Copy data from flash to a buffer.
This must be a synchrony method that does not return until the copy is done.
src | Address of source data in the flash. |
dst | Address of destination buffer in RAM. |
bytes | Number of bytes to copy. |
startFlashLineRead
virtual void startFlashLineRead | ( | const void * | src , | =0 | |
uint32_t | bytes | =0 | |||
) | =0 |
Initiate a read operation from flash to a buffer.
This can be an asynchrony operation that is still running after this function returns. Buffers must be handled by the subclass. LCD16bppSerialFlash will at most copy 4 bytes times the width of the display.
src | Address of source data in the flash. |
bytes | Number of bytes to copy. |
waitFlashReadComplete
virtual const uint8_t * waitFlashReadComplete | ( | ) | =0 |
Waits until the previous startFlashLineRead operation is complete.
Waits until the previous startFlashLineRead operation is complete. If the startFlashLineRead method is asynchrony, this method must wait until the previous operation has completed.
The address of a buffer containing the read data.
~FlashDataReader
virtual ~FlashDataReader | ( | ) |
Finalizes an instance of the FlashDataReader class.