Difference between revisions of "Component: MULTIUART (SPI2UART) (Comms: System)"

From Flowcode Help
Jump to navigationJump to search
 
(5 intermediate revisions by the same user 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
| 2.0 (Release)
+
| 2.0
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color:gray;" | Category
 
| Comms: System
 
| Comms: System
 
|}
 
|}
  
  
 +
==MULTIUART component==
 +
Uses a high speed SPI connection to enable up to four buffered external UARTs via the MULTIUART modules. 
  
==[[File:Component Icon 43861adb_8a59_492d_8f9f_a08775800bc1.png|Image]] MULTIUART (SPI2UART) component==
+
==Component Pack==
Uses a high speed SPI connection to enable up to four buffered external UARTs via the MULTIUART modules.
 
  
 +
FREE
  
 +
==Detailed description==
  
==Examples==
 
  
{{Fcfile|MULTIUART Test.fcfx|Simple test program}}
 
  
  
  
==Downloadable macro reference==
 
  
===<span style="font-weight: normal;"><u><tt>ReceiveByte</tt></u></span>===
 
Returns the first received byte held in queue for the selected channel.
 
  
Recommended to use the CheckRx macro first to collect number of bytes.
 
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''UART''
 
::UART Index Range: 0-3
 
  
  
'''Return value'''
+
''No detailed description exists yet for this component''
  
:[[Variable Types|BYTE]]
+
==Examples==
  
  
===<span style="font-weight: normal;"><u><tt>TransmitString</tt></u></span>===
 
Adds a byte to the transmit queue for the selected channel.
 
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''UART''
 
::UART Index Range: 0-3
 
  
:[[Variable Types|<- STRING]] ''Data''
 
::''This parameter may be returned back to the caller''
 
  
  
'''Return value'''
 
  
:''This call does not return a value''
 
  
  
===<span style="font-weight: normal;"><u><tt>SetBaud</tt></u></span>===
 
Adds a byte to the transmit queue for the selected channel.
 
  
'''Parameters'''
 
  
:[[Variable Types|BYTE]] ''UART''
 
::UART Index Range: 0-3
 
  
:[[Variable Types|BYTE]] ''Baud''
+
{{Fcfile|MULTIUART Test.fcfx|Simple test program}}
::0=1200, 1=2400, 2=4800, 3=9600, 4=19200, 5=38400, 6=57600, 7=115200
 
  
  
'''Return value'''
 
  
:''This call does not return a value''
+
==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;" | '''ReceiveByte'''
 +
|-
 +
| colspan="2" | Returns the first received byte held in queue for the selected channel. Recommended to use the CheckRx macro first to collect number of bytes.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | UART
 +
|-
 +
| colspan="2" | UART Index Range: 0-3&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><tt>TransmitByte</tt></u></span>===
 
Adds a byte to the transmit queue for the selected channel.
 
  
'''Parameters'''
+
{| 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;" | '''TransmitString'''
 +
|-
 +
| colspan="2" | Adds a byte to the transmit queue for the selected channel.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | UART
 +
|-
 +
| colspan="2" | UART Index Range: 0-3&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| 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''
 +
|}
  
:[[Variable Types|BYTE]] ''UART''
 
::UART Index Range: 0-3
 
  
:[[Variable Types|BYTE]] ''Data''
+
{| 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;" | '''SetBaud'''
 +
|-
 +
| colspan="2" | Adds a byte to the transmit queue for the selected channel.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | UART
 +
|-
 +
| colspan="2" | UART Index Range: 0-3&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Baud
 +
|-
 +
| colspan="2" | 0=1200, 1=2400, 2=4800, 3=9600, 4=19200, 5=38400, 6=57600, 7=115200&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''
 +
|}
  
  
'''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;" | '''TransmitByte'''
 +
|-
 +
| colspan="2" | Adds a byte to the transmit queue for the selected channel.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | UART
 +
|-
 +
| colspan="2" | UART Index Range: 0-3&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''
 +
|}
  
:''This call does not return a 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;" | '''CheckRx'''
 +
|-
 +
| colspan="2" | Returns the number of received bytes held in queue for the selected channel.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | UART
 +
|-
 +
| colspan="2" | UART Index Range: 0-3&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><tt>CheckRx</tt></u></span>===
 
Returns the number of received bytes held in queue for the selected channel.
 
  
'''Parameters'''
+
{| 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;" | '''CheckTx'''
 +
|-
 +
| colspan="2" | Returns the number of bytes held in the transmit queue for the selected channel.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | UART
 +
|-
 +
| colspan="2" | UART Index Range: 0-3&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''
 +
|}
  
:[[Variable Types|BYTE]] ''UART''
 
::UART Index Range: 0-3
 
  
 
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
'''Return value'''
+
|-
 
+
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
:[[Variable Types|BYTE]]
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveString'''
 
+
|-
 
+
| colspan="2" | Returns a string of received bytes held in queue for the selected channel. Recommended to use the CheckRx macro first to collect number of bytes.&nbsp;
===<span style="font-weight: normal;"><u><tt>ReceiveString</tt></u></span>===
+
|-
Returns a string of received bytes held in queue for the selected channel.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
Recommended to use the CheckRx macro first to collect number of bytes.
+
| width="90%" | UART
 
+
|-
'''Parameters'''
+
| colspan="2" | UART Index Range: 0-3&nbsp;
 
+
|-
:[[Variable Types|BYTE]] ''UART''
+
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
::UART Index Range: 0-3
+
| width="90%" | NumBytes
 
+
|-
:[[Variable Types|BYTE]] ''NumBytes''
+
| colspan="2" | &nbsp;
 
+
|-
 
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
'''Return value'''
+
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
+
|}
:[[Variable Types|STRING]]
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>CheckTx</tt></u></span>===
 
Returns the number of bytes held in the transmit queue for the selected channel.
 
 
 
'''Parameters'''
 
 
 
:[[Variable Types|BYTE]] ''UART''
 
::UART Index Range: 0-3
 
 
 
 
 
'''Return value'''
 
 
 
:[[Variable Types|BYTE]]
 
 
 
 
 
===<span style="font-weight: normal;"><u><tt>Initialise</tt></u></span>===
 
Activates the SPI peripheral and claims control over the I/O pins.
 
 
 
'''Parameters'''
 
 
 
:''This macro has no parameters''
 
 
 
 
 
'''Return value'''
 
 
 
:''This call does not return a 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;" | '''Initialise'''
 +
|-
 +
| colspan="2" | Activates the SPI peripheral and claims control over the I/O pins.&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==
 
  
''This component does not contain any simulation macros''
 
  
  
 
==Property reference==
 
==Property reference==
<span style="font-weight: normal;"><u>Channel</u></span>
 
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi::CHANNEL''.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
SPI Channel selector
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
<span style="font-weight: normal;"><u>Prescale</u></span>
+
|-
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi::PR_SCALE''.
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Bus Settings
Prescale option selector
+
|-
 
+
|-
<span style="font-weight: normal;"><u>MOSI</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Channel
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi::MOSI''.
+
|-
 
+
| colspan="2" | SPI Channel selector&nbsp;
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
<span style="font-weight: normal;"><u>MISO</u></span>
+
| width="90%" | Prescale
 
+
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi::MISO''.
+
| colspan="2" | Prescale option selector&nbsp;
 
+
|-
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode.
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections
<span style="font-weight: normal;"><u>CLK</u></span>
+
|-
 
+
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi::CLK''.
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
+
| width="90%" | MOSI
SPI Clock Pin CLK - The Clock signal is driven by the SPI master.
+
|-
 
+
| colspan="2" | SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.&nbsp;
<span style="font-weight: normal;"><u>CS / SS</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_spi::SS''.
+
| width="90%" | MOSI Remap Pin
 
+
|-
Chip Select / Slave Select Pin  
+
| colspan="2" | Select which the target pin to assign the MOSI hardware pin functionality.&nbsp;
 
+
|-
Master Mode: General purpose output pin used to select the remote SPI device.
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
+
| width="90%" | MISO
Slave Mode: Hardware chip select pin input used to select the SPI device.
+
|-
 
+
| colspan="2" | SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode.&nbsp;
<span style="font-weight: normal;"><u>Label</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
This property is of type ''Line of text'' and can be referenced with the variable name ''label''.
+
| width="90%" | MISO Remap Pin
 
+
|-
Label used to identify the component on the panel.
+
| colspan="2" | Select which the target pin to assign the MISO hardware pin functionality.&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>Scope Traces</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
+
| width="90%" | CLK
This property is of type ''True or false'' and can be referenced with the variable name ''cal_spi::ScopeTraces''.
+
|-
 
+
| colspan="2" | SPI Clock Pin CLK - The Clock signal is driven by the SPI master.&nbsp;
Selects if the scope traces are automatically generated or not
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
<span style="font-weight: normal;"><u>Console Data</u></span>
+
| width="90%" | CLK Remap Pin
 
+
|-
This property is of type ''True or false'' and can be referenced with the variable name ''cal_spi::ConsoleData''.
+
| colspan="2" | Select which the target pin to assign the CLK hardware pin functionality.&nbsp;
 
+
|-
Selects if the console data is automatically generated or not
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
+
| width="90%" | CS / SS
<span style="font-weight: normal;"><u>Injector</u></span>
+
|-
 
+
| colspan="2" | Chip Select / Slave Select Pin Master Mode: General purpose output pin used to select the remote SPI device. Slave Mode: Hardware chip select pin input used to select the SPI device. &nbsp;
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_spi::Injector''.
+
|-
 
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
''<span style="color:red;">No additional information</span>''
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 +
| width="90%" | Label
 +
|-
 +
| colspan="2" | Label used to identify the component on the panel.&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 +
| width="90%" | Scope Traces
 +
|-
 +
| colspan="2" | Selects if the scope traces are automatically generated or not&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 +
| width="90%" | Console Data
 +
|-
 +
| colspan="2" | Selects if the console data is automatically generated or not&nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 +
| width="90%" | API
 +
|-
 +
| colspan="2" | &nbsp;
 +
|}

Latest revision as of 17:22, 9 November 2022

Author Matrix TSL
Version 2.0
Category Comms: System


MULTIUART component

Uses a high speed SPI connection to enable up to four buffered external UARTs via the MULTIUART modules.

Component Pack

FREE

Detailed description

No detailed description exists yet for this component

Examples

FC6 Icon.png Simple test program


Downloadable macro reference

Fc9-comp-macro.png ReceiveByte
Returns the first received byte held in queue for the selected channel. Recommended to use the CheckRx macro first to collect number of bytes. 
Fc9-u8-icon.png - BYTE UART
UART Index Range: 0-3 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png TransmitString
Adds a byte to the transmit queue for the selected channel. 
Fc9-u8-icon.png - BYTE UART
UART Index Range: 0-3 
Fc9-string-icon.png - STRING Data
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png SetBaud
Adds a byte to the transmit queue for the selected channel. 
Fc9-u8-icon.png - BYTE UART
UART Index Range: 0-3 
Fc9-u8-icon.png - BYTE Baud
0=1200, 1=2400, 2=4800, 3=9600, 4=19200, 5=38400, 6=57600, 7=115200 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png TransmitByte
Adds a byte to the transmit queue for the selected channel. 
Fc9-u8-icon.png - BYTE UART
UART Index Range: 0-3 
Fc9-u8-icon.png - BYTE Data
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png CheckRx
Returns the number of received bytes held in queue for the selected channel. 
Fc9-u8-icon.png - BYTE UART
UART Index Range: 0-3 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png CheckTx
Returns the number of bytes held in the transmit queue for the selected channel. 
Fc9-u8-icon.png - BYTE UART
UART Index Range: 0-3 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png ReceiveString
Returns a string of received bytes held in queue for the selected channel. Recommended to use the CheckRx macro first to collect number of bytes. 
Fc9-u8-icon.png - BYTE UART
UART Index Range: 0-3 
Fc9-u8-icon.png - BYTE NumBytes
 
Fc9-string-icon.png - STRING Return


Fc9-comp-macro.png Initialise
Activates the SPI peripheral and claims control over the I/O pins. 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Bus Settings
Fc9-type-16-icon.png Channel
SPI Channel selector 
Fc9-type-16-icon.png Prescale
Prescale option selector 
Fc9-conn-icon.png Connections
Fc9-type-5-icon.png MOSI
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode. 
Fc9-type-16-icon.png MOSI Remap Pin
Select which the target pin to assign the MOSI hardware pin functionality. 
Fc9-type-5-icon.png MISO
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode. 
Fc9-type-16-icon.png MISO Remap Pin
Select which the target pin to assign the MISO hardware pin functionality. 
Fc9-type-5-icon.png CLK
SPI Clock Pin CLK - The Clock signal is driven by the SPI master. 
Fc9-type-16-icon.png CLK Remap Pin
Select which the target pin to assign the CLK hardware pin functionality. 
Fc9-type-5-icon.png CS / SS
Chip Select / Slave Select Pin Master Mode: General purpose output pin used to select the remote SPI device. Slave Mode: Hardware chip select pin input used to select the SPI device.  
Fc9-conn-icon.png Simulation
Fc9-type-10-icon.png Label
Label used to identify the component on the panel. 
Fc9-type-7-icon.png Scope Traces
Selects if the scope traces are automatically generated or not 
Fc9-type-7-icon.png Console Data
Selects if the console data is automatically generated or not 
Fc9-type-16-icon.png API