Difference between revisions of "Component: MULTIUART (SPI2UART) (Comms: Interface)"
From Flowcode Help
Jump to navigationJump to search(2 intermediate revisions by the same user not shown) | |||
Line 74: | Line 74: | ||
{{Fcfile|MULTIUART Test.fcfx|Simple test program}} | {{Fcfile|MULTIUART Test.fcfx|Simple test program}} | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
Line 83: | Line 89: | ||
==Macro reference== | ==Macro reference== | ||
− | === | + | ===CheckRx=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckRx''' |
|- | |- | ||
− | | colspan="2" | Returns the | + | | colspan="2" | Returns the number of received bytes held in queue for the selected channel. |
|- | |- | ||
|- | |- | ||
Line 102: | Line 108: | ||
− | === | + | ===CheckTx=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckTx''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Returns the number of bytes held in the transmit queue for the selected channel. |
|- | |- | ||
|- | |- | ||
Line 116: | Line 122: | ||
| colspan="2" | UART Index Range: 0-3 | | colspan="2" | UART Index Range: 0-3 | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE |
− | | width="90%" | | + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |
+ | |} | ||
+ | |||
+ | |||
+ | ===Initialise=== | ||
+ | {| 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. | ||
|- | |- | ||
− | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
Line 126: | Line 141: | ||
− | === | + | ===ReceiveByte=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveByte''' |
|- | |- | ||
− | | colspan="2" | | + | | 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. |
|- | |- | ||
|- | |- | ||
Line 140: | Line 155: | ||
| colspan="2" | UART Index Range: 0-3 | | colspan="2" | UART Index Range: 0-3 | ||
|- | |- | ||
− | + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | |
− | |||
− | |||
− | |||
− | |||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
− | === | + | ===ReceiveString=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveString''' |
|- | |- | ||
− | | colspan="2" | | + | | 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. |
|- | |- | ||
|- | |- | ||
Line 165: | Line 175: | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
− | | width="90%" | | + | | width="90%" | NumBytes |
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | 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'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
− | === | + | ===SetBaud=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetBaud''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Adds a byte to the transmit queue for the selected channel. |
|- | |- | ||
|- | |- | ||
Line 188: | Line 198: | ||
| colspan="2" | UART Index Range: 0-3 | | colspan="2" | UART Index Range: 0-3 | ||
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | 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 | ||
+ | |- | ||
+ | | 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'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
− | === | + | ===TransmitByte=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''TransmitByte''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Adds a byte to the transmit queue for the selected channel. |
|- | |- | ||
|- | |- | ||
Line 207: | Line 222: | ||
| colspan="2" | UART Index Range: 0-3 | | colspan="2" | UART Index Range: 0-3 | ||
|- | |- | ||
− | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | 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'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
− | === | + | ===TransmitString=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
− | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''TransmitString''' |
|- | |- | ||
− | | colspan="2" | | + | | colspan="2" | Adds a byte to the transmit queue for the selected channel. |
|- | |- | ||
|- | |- | ||
Line 226: | Line 246: | ||
| colspan="2" | UART Index Range: 0-3 | | colspan="2" | UART Index Range: 0-3 | ||
|- | |- | ||
− | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING |
− | | width="90%" | | + | | width="90%" | Data |
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | 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'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
− | |||
− | |||
Latest revision as of 13:12, 7 February 2023
Author | Matrix TSL |
Version | 2.0 |
Category | Comms: Interface |
Contents
MULTIUART component
Uses a high speed SPI connection to enable up to four buffered external UARTs via the MULTIUART modules.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_MULTIUART.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_MULTIUART.fcfx
Detailed description
No detailed description exists yet for this component
Examples
Macro reference
CheckRx
![]() |
CheckRx |
Returns the number of received bytes held in queue for the selected channel. | |
![]() |
UART |
UART Index Range: 0-3 | |
![]() |
Return |
CheckTx
![]() |
CheckTx |
Returns the number of bytes held in the transmit queue for the selected channel. | |
![]() |
UART |
UART Index Range: 0-3 | |
![]() |
Return |
Initialise
![]() |
Initialise |
Activates the SPI peripheral and claims control over the I/O pins. | |
![]() |
Return |
ReceiveByte
ReceiveString
SetBaud
![]() |
SetBaud |
Adds a byte to the transmit queue for the selected channel. | |
![]() |
UART |
UART Index Range: 0-3 | |
![]() |
Baud |
0=1200, 1=2400, 2=4800, 3=9600, 4=19200, 5=38400, 6=57600, 7=115200 | |
![]() |
Return |
TransmitByte
![]() |
TransmitByte |
Adds a byte to the transmit queue for the selected channel. | |
![]() |
UART |
UART Index Range: 0-3 | |
![]() |
Data |
![]() |
Return |
TransmitString
![]() |
TransmitString |
Adds a byte to the transmit queue for the selected channel. | |
![]() |
UART |
UART Index Range: 0-3 | |
![]() |
Data |
![]() |
Return |