Difference between revisions of "Component: String Initialiser (Storage)"

From Flowcode Help
Jump to navigationJump to search
(XML import)
 
Line 1: Line 1:
 
+
{| style="width:50%"
 
 
{| width="50%"
 
 
|-
 
|-
| width="20%" style="color: gray;" | Author
+
| width="20%" style="color:gray;" | Author
 
| Matrix Ltd
 
| Matrix Ltd
 
|-
 
|-
| 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
 
|}
 
|}
  
  
 +
==String Initialiser component==
 +
A component allowing an easy way to initialise string variables using ROM memory. A simple and efficient way to populate string variables helping to save on RAM usage. Allows up to 16 strings to be stored. For additional strings simply use more String Initialiser components.
 +
 +
==Detailed description==
  
==[[File:Component Icon a8abdc98_224c_4c8a_8311_2921cb3dbe46.png|Image]] String Initialiser component==
+
''No detailed description exists yet for this component''
A component allowing an easy way to initialise string variables using ROM memory.
 
A simple and efficient way to populate string variables helping to save on RAM usage.
 
Allows up to 16 strings to be stored. For additional strings simply use more String Initialiser components.
 
  
 
==Examples==
 
==Examples==
 +
 +
 
''<span style="color:red;">No additional examples</span>''
 
''<span style="color:red;">No additional examples</span>''
  
Line 26: Line 27:
 
==Downloadable macro reference==
 
==Downloadable macro reference==
  
===<span style="font-weight: normal;"><u><tt>GetString</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Gets a string stored in ROM memory and loads into a RAM string variable
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetString'''
 +
|-
 +
| colspan="2" | Gets a string stored in ROM memory and loads into a RAM string variable&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Index
 +
|-
 +
| colspan="2" | Range: 0-15 Depending on number of strings&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''Index''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
::Range: 0-15 Depending on number of strings
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadDataByte'''
 +
|-
 +
| colspan="2" | Reads a single data byte from the specified address.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | PageAddress
 +
|-
 +
| colspan="2" | Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | ByteAddress
 +
|-
 +
| colspan="2" | A7-A0 : 8-bit Address within the page - Range 0x00 - 0xFF&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''
 +
|}
  
  
'''Return value'''
+
{| 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;" | '''ReadUniqueID'''
 +
|-
 +
| colspan="2" | Reads the 8-byte unique identifier from the IC. Useful if you need each board to have it's own guarenteed unique address or identifier.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | ID
 +
|-
 +
| colspan="2" | 8-Byte data array to store the unique ID read back from the IC.&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
:[[Variable Types|STRING]]
 
  
 +
{| 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;" | '''WriteDataArray'''
 +
|-
 +
| colspan="2" | Writes an array of data bytes atarting at the specified address. Writes must be enabled and memory locations must be erased for data writes to function correctly. Note that all bytes will be written to the same page.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | PageAddress
 +
|-
 +
| colspan="2" | Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | ByteAddress
 +
|-
 +
| colspan="2" | A7-A0 : 8-bit Address within the page - Range 0x00 - 0xFF&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Count
 +
|-
 +
| colspan="2" | Number of bytes to write.&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
==Simulation 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;" | '''EraseChip'''
 +
|-
 +
| colspan="2" | Erases all data stored on the chip. Chip erase takes between 20 seconds and 100 seconds to complete. Blocking mode is recommended to ensure write cycle is complete.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:]] -
 +
| width="90%" | Blocking
 +
|-
 +
| colspan="2" | Controls if the macro blocks until the erase cycle is complete. 0 = Don't Wait, 1 = Wait&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| 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;" | '''WriteDataByte'''
 +
|-
 +
| colspan="2" | Writes a single data byte to the specified address. Writes must be enabled and memory locations must be erased for data writes to function correctly.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | PageAddress
 +
|-
 +
| colspan="2" | Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | ByteAddress
 +
|-
 +
| colspan="2" | A7-A0 : 8-bit Address within the page - Range 0x00 - 0xFF&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | Data byte to write&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
''This component does not contain any simulation macros''
 
  
 +
{| 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;" | '''EraseBlock'''
 +
|-
 +
| colspan="2" | Erases a block of data stored on the chip. Erase takes between 45 milliseconds and 2000 milliseconds to complete. Blocking mode is recommended to ensure write cycle is complete.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | EraseMode
 +
|-
 +
| colspan="2" | 0=4KB / 1=32KB / 2=64KB&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | PageAddress
 +
|-
 +
| colspan="2" | Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:]] -
 +
| width="90%" | Blocking
 +
|-
 +
| colspan="2" | Controls if the macro blocks until the erase cycle is complete. 0 = Don't Wait, 1 = Wait&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
==Property reference==
 
<span style="font-weight: normal;"><u>Number of Strings</u></span>
 
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''NumStrings''.
+
{| 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;" | '''ReadDataArray'''
 +
|-
 +
| colspan="2" | Reads up to 256 data bytes starting from the specified address. Note that all bytes will be read from the same page.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 +
| width="90%" | PageAddress
 +
|-
 +
| colspan="2" | Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | ByteAddress
 +
|-
 +
| colspan="2" | A7-A0 : 8-bit Address within the page - Range 0x00 - 0xFF&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Count
 +
|-
 +
| colspan="2" | Number of bytes to read.&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Data
 +
|-
 +
| colspan="2" | Byta array to store the incoming read data.&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
''<span style="color:red;">No additional information</span>''
 
  
 +
{| 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;" | '''Initialise'''
 +
|-
 +
| colspan="2" | Initialises the SPI bus ready for communications.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
  
<span style="font-weight: normal;"><u>String 0</u></span>
+
{| 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;" | '''Initialise'''
 +
|-
 +
| colspan="2" | Configures each matching sensor on the bus with the specified conversion bits.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 +
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 +
|}
  
This property is of type ''Line of text'' and can be referenced with the variable name ''Str0''.
 
  
String data index 0
 
  
<span style="font-weight: normal;"><u>String 1</u></span>
 
  
This property is of type ''Line of text'' and can be referenced with the variable name ''Str1''.
+
==Property reference==
  
String data index 1
+
{| 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-16-icon.png]]
 +
| width="90%" | Number of Strings
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 +
| width="90%" | String 0
 +
|-
 +
| colspan="2" | String data index 0&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 +
| width="90%" | String 1
 +
|-
 +
| colspan="2" | String data index 1&nbsp;
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
 +
|-
 +
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
 +
|-
 +
|}

Revision as of 20:58, 16 November 2021

Author Matrix Ltd
Version 1.0
Category Storage


String Initialiser component

A component allowing an easy way to initialise string variables using ROM memory. A simple and efficient way to populate string variables helping to save on RAM usage. Allows up to 16 strings to be stored. For additional strings simply use more String Initialiser components.

Detailed description

No detailed description exists yet for this component

Examples

No additional examples


Downloadable macro reference

Fc9-comp-macro.png GetString
Gets a string stored in ROM memory and loads into a RAM string variable 
Fc9-u8-icon.png - BYTE Index
Range: 0-15 Depending on number of strings 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png ReadDataByte
Reads a single data byte from the specified address. 
Fc9-u16-icon.png - UINT PageAddress
Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF 
Fc9-u8-icon.png - BYTE ByteAddress
A7-A0 : 8-bit Address within the page - Range 0x00 - 0xFF 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png ReadUniqueID
Reads the 8-byte unique identifier from the IC. Useful if you need each board to have it's own guarenteed unique address or identifier. 
Fc9-u8-icon.png - BYTE ID
8-Byte data array to store the unique ID read back from the IC. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png WriteDataArray
Writes an array of data bytes atarting at the specified address. Writes must be enabled and memory locations must be erased for data writes to function correctly. Note that all bytes will be written to the same page. 
Fc9-u16-icon.png - UINT PageAddress
Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF 
Fc9-u8-icon.png - BYTE ByteAddress
A7-A0 : 8-bit Address within the page - Range 0x00 - 0xFF 
Fc9-u8-icon.png - BYTE Count
Number of bytes to write. 
Fc9-u8-icon.png - BYTE Data
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png EraseChip
Erases all data stored on the chip. Chip erase takes between 20 seconds and 100 seconds to complete. Blocking mode is recommended to ensure write cycle is complete. 
[[File:]] - Blocking
Controls if the macro blocks until the erase cycle is complete. 0 = Don't Wait, 1 = Wait 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png WriteDataByte
Writes a single data byte to the specified address. Writes must be enabled and memory locations must be erased for data writes to function correctly. 
Fc9-u16-icon.png - UINT PageAddress
Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF 
Fc9-u8-icon.png - BYTE ByteAddress
A7-A0 : 8-bit Address within the page - Range 0x00 - 0xFF 
Fc9-u8-icon.png - BYTE Data
Data byte to write 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png EraseBlock
Erases a block of data stored on the chip. Erase takes between 45 milliseconds and 2000 milliseconds to complete. Blocking mode is recommended to ensure write cycle is complete. 
Fc9-u8-icon.png - BYTE EraseMode
0=4KB / 1=32KB / 2=64KB 
Fc9-u16-icon.png - UINT PageAddress
Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF 
[[File:]] - Blocking
Controls if the macro blocks until the erase cycle is complete. 0 = Don't Wait, 1 = Wait 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ReadDataArray
Reads up to 256 data bytes starting from the specified address. Note that all bytes will be read from the same page. 
Fc9-u16-icon.png - UINT PageAddress
Address bits A23-A8 : 16-bit Address - Range 0x0000 - 0xFFFF 
Fc9-u8-icon.png - BYTE ByteAddress
A7-A0 : 8-bit Address within the page - Range 0x00 - 0xFF 
Fc9-u8-icon.png - BYTE Count
Number of bytes to read. 
Fc9-u8-icon.png - BYTE Data
Byta array to store the incoming read data. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
Initialises the SPI bus ready for communications. 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Initialise
Configures each matching sensor on the bus with the specified conversion bits. 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Number of Strings
 
Fc9-type-10-icon.png String 0
String data index 0 
Fc9-type-10-icon.png String 1
String data index 1 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png Simulations