Component: Embed File (Storage)

From Flowcode Help
Jump to navigationJump to search


Author Matrix TSL
Version 1.0 (Release)
Category Storage


Image Embed File component

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

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


Downloadable macro reference

GetFileByte

Reads a single byte from the file at the specified address.

Parameters

UINT Address
Address range 0 to NumBytesInFile - 1


Return value

BYTE


GetFileLength

Returns the file size in bytes.

Parameters

This macro has no parameters


Return value

UINT


Simulation macro reference

This component does not contain any simulation macros


Property reference

File

This property is of type Filename and can be referenced with the variable name file.

File you wish to embed into the program

File Length

This property is of type Unsigned integer and can be referenced with the variable name file_Len.

File size in bytes.

Max recommended file size = 65535 bytes

8-bit PICs may struggle with files larger than 256 bytes.

ROM Size

This property is of type Unsigned integer and can be referenced with the variable name RomSize.

Number of bytes available in the target device ROM memory