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

From Flowcode Help
Jump to navigationJump to search
(XML import)
 
 
(12 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.
 +
 +
==Component Pack==
 +
 +
STORAGE
  
==[[File:Component Icon 42f3f8ef_ff5b_44e6_9be8_8c43d9ab5b08.png|Image]] Embed File component==
+
==Detailed description==
A component to simplify the process of embedding files into ROM.
+
 
Stores the file inside a ROM look up table.
+
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
''No detailed description exists yet for this component''
  
 
==Examples==
 
==Examples==
''<span style="color:red;">No additional examples</span>''
 
  
  
==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'''
 
  
:[[Variable Types|UINT]] ''Address''
 
::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''
+
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.
  
 +
[[File:TextFile.txt]]
  
'''Return value'''
 
  
:[[Variable Types|UINT]]
+
Here is an archive which packages the example and text file together for you.
  
 +
{{Zip|EmbedFile.zip|Embed File Example Files}}
  
  
==Simulation macro reference==
+
The file is selected using the File component property.
  
''This component does not contain any simulation macros''
+
Clicking the small arrow to the right of the property and selecting Browse allows you to select a file using a Windows file explorer.
  
 +
[[File:EmbedFile.jpg]]
  
==Property reference==
 
<span style="font-weight: normal;"><u>File</u></span>
 
  
This property is of type ''Filename'' and can be referenced with the variable name ''file''.
+
==Downloadable macro reference==
  
File you wish to embed into the program
+
{| 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''
 +
|}
  
<span style="font-weight: normal;"><u>File Length</u></span>
 
  
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''file_Len''.
+
{| 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''
 +
|}
  
File size in bytes.
 
  
Max recommended file size = 65535 bytes
 
  
8-bit PICs may struggle with files larger than 256 bytes.
 
  
<span style="font-weight: normal;"><u>ROM Size</u></span>
+
==Property reference==
  
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''RomSize''.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
Number of bytes available in the target device ROM memory
+
| 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