Component: Embed File (File)

From Flowcode Help
Jump to navigationJump to search
Author Matrix TSL
Version 1.0
Category File


Embed File component

A component to simplify the process of embedding files into ROM. Stores the file inside a ROM look up table.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_EmbedFile.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_EmbedFile.fcfx

Detailed description

No detailed description exists yet for this component

Examples

Basic example program which embeds a text file into the microcontrollers ROM memory and then prints the file out to a LCD display. FC6 Icon.png EmbedFileExample Text file to go with the example, must be placed into the same directory as the Flowcode file.

File:TextFile.txt


Here is an archive which packages the example and text file together for you.

ZIP Icon.png Embed File Example Files


The file is selected using the File component property.

Clicking the small arrow to the right of the property and selecting Browse allows you to select a file using a Windows file explorer.

EmbedFile.jpg







Macro reference

GetFileArray

Fc9-comp-macro.png GetFileArray
Reads a number of bytes from the file from the specified start address. 
Fc9-u16-icon.png - UINT StartAddress
Address of the first byte to read 
Fc9-u16-icon.png - UINT NumBytes
Number of bytes to read from the file 
Fc9-u8-icon.png - BYTE Data
Variable to pass the data into 
Fc9-void-icon.png - VOID Return


GetFileByte

Fc9-comp-macro.png GetFileByte
Reads a single byte from the file at the specified address. 
Fc9-u16-icon.png - UINT Address
Address range 0 to NumBytesInFile - 1 
Fc9-u8-icon.png - BYTE Return


GetFileLength

Fc9-comp-macro.png GetFileLength
Returns the file size in bytes. 
Fc9-u16-icon.png - UINT Return


Property reference

Fc9-prop-icon.png Properties
Fc9-type-13-icon.png File
File you wish to embed into the program 
Fc9-type-21-icon.png File Length
File size in bytes. Max recommended file size = 65535 bytes 8-bit PICs may struggle with files larger than 256 bytes. 
Fc9-type-21-icon.png ROM Size
Number of bytes available in the target device ROM memory