Skip to main content

FlashDataReader

touchgfx/hal/FlashDataReader.hpp

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 booladdressIsAddressable(const void * address) =0
Compute if an address is directly addressable by the MCU.
virtual voidcopyData(const void src, void dst, uint32_t bytes) =0
Copy data from flash to a buffer.
virtual voidstartFlashLineRead(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.

Parameters:
addressThe address in the flash.
Returns:

True if the address is addressable by the MCU.

copyData

virtual void copyData(const void *src ,=0
void *dst ,=0
uint32_tbytes=0
)=0

Copy data from flash to a buffer.

This must be a synchrony method that does not return until the copy is done.

Parameters:
srcAddress of source data in the flash.
dstAddress of destination buffer in RAM.
bytesNumber of bytes to copy.

startFlashLineRead

virtual void startFlashLineRead(const void *src ,=0
uint32_tbytes=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.

Parameters:
srcAddress of source data in the flash.
bytesNumber 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.

Returns:

The address of a buffer containing the read data.

~FlashDataReader

virtual ~FlashDataReader()

Finalizes an instance of the FlashDataReader class.