Difference between revisions of "Component: Embed File (Storage)"

From Flowcode Help
Jump to navigationJump to search
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
+
{| style="width:50%"
 
 
{| width="50%"
 
 
|-
 
|-
| width="20%" style="color: gray;" | Author
+
| width="20%" style="color:gray;" | Author
 
| Matrix TSL
 
| Matrix TSL
 
|-
 
|-
| width="20%" style="color: gray;" | Version
+
| width="20%" style="color:gray;" | Version
| 1.0 (Release)
+
| 1.0
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color:gray;" | Category
 
| Storage
 
| Storage
 
|}
 
|}
  
  
 +
==Embed File component==
 +
A component to simplify the process of embedding files into ROM. Stores the file inside a ROM look up table.
  
==[[File:Component Icon 42f3f8ef_ff5b_44e6_9be8_8c43d9ab5b08.png|Image]] Embed File component==
+
==Component Pack==
A component to simplify the process of embedding files into ROM.
 
Stores the file inside a ROM look up table.
 
  
==Examples==
+
STORAGE
  
Basic example program which embeds a text file into the microcontrollers ROM memory and then prints the file out to a LCD display.
+
==Detailed description==
  
{{Fcfile|EmbedFileExample.fcfx|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.
 
  
[[File:EmbedFile.zip]]
 
  
  
==Downloadable macro reference==
 
  
===<span style="font-weight: normal;"><u><tt>GetFileByte</tt></u></span>===
 
Reads a single byte from the file at the specified address.
 
  
'''Parameters'''
+
''No detailed description exists yet for this component''
  
:[[Variable Types|UINT]] ''Address''
+
==Examples==
::Address range 0 to NumBytesInFile - 1
 
  
  
'''Return value'''
 
  
:[[Variable Types|BYTE]]
 
  
  
===<span style="font-weight: normal;"><u><tt>GetFileLength</tt></u></span>===
 
Returns the file size in bytes.
 
  
'''Parameters'''
 
  
:''This macro has no parameters''
 
  
  
'''Return value'''
 
  
:[[Variable Types|UINT]]
 
  
  
 +
Basic example program which embeds a text file into the microcontrollers ROM memory and then prints the file out to a LCD display.
 +
{{Fcfile|EmbedFileExample.fcfx|EmbedFileExample}}
 +
Text file to go with the example, must be placed into the same directory as the Flowcode file.
  
==Simulation macro reference==
+
[[File:TextFile.txt]]
  
''This component does not contain any simulation macros''
 
  
 +
Here is an archive which packages the example and text file together for you.
  
==Property reference==
+
{{Zip|EmbedFile.zip|Embed File Example Files}}
<span style="font-weight: normal;"><u>File</u></span>
 
  
This property is of type ''Filename'' and can be referenced with the variable name ''file''.
 
  
File you wish to embed into the program
+
The file is selected using the File component property.
  
<span style="font-weight: normal;"><u>File Length</u></span>
+
Clicking the small arrow to the right of the property and selecting Browse allows you to select a file using a Windows file explorer.
  
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''file_Len''.
+
[[File:EmbedFile.jpg]]
  
File size in bytes.
 
  
Max recommended file size = 65535 bytes
+
==Downloadable macro reference==
 +
 
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetFileByte'''
 +
|-
 +
| colspan="2" | Reads a single byte from the file at the specified address.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | Address
 +
|-
 +
| colspan="2" | Address range 0 to NumBytesInFile - 1&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 
 +
 
 +
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetFileLength'''
 +
|-
 +
| colspan="2" | Returns the file size in bytes.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
 +
 
  
8-bit PICs may struggle with files larger than 256 bytes.
 
  
<span style="font-weight: normal;"><u>ROM Size</u></span>
 
  
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''RomSize''.
+
==Property reference==
  
Number of bytes available in the target device ROM memory
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-13-icon.png]]
 +
| width="90%" | File
 +
|-
 +
| colspan="2" | File you wish to embed into the program&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 +
| width="90%" | File Length
 +
|-
 +
| colspan="2" | File size in bytes.  Max recommended file size = 65535 bytes 8-bit PICs may struggle with files larger than 256 bytes.&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 +
| width="90%" | ROM Size
 +
|-
 +
| colspan="2" | Number of bytes available in the target device ROM memory&nbsp;
 +
|}

Latest revision as of 17:24, 9 November 2022

Author Matrix TSL
Version 1.0
Category Storage


Embed File component

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

Component Pack

STORAGE

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


Downloadable macro reference

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


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