Difference between revisions of "Component: IrDA (EB012, MCP1250, MCP2120) (Wireless)"

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
| 2.0 (Release)
+
| 2.0
 
|-
 
|-
| width="20%" style="color: gray;" | Category
+
| width="20%" style="color:gray;" | Category
 
| Wireless
 
| Wireless
 
|}
 
|}
  
  
 +
==IrDA (EB012, MCP1250, MCP2120) component==
 +
Low level routines for controlling a standard IrDA interface. Also available in the form of the EB012 IrDA E-block.
 +
 +
==Detailed description==
  
==[[File:Component Icon 2bfc8781_9817_4e0c_89f3_28dac37e9a62.png|Image]] IrDA (EB012, MCP1250, MCP2120) component==
+
''No detailed description exists yet for this component''
Low level routines for controlling a standard IrDA interface.
 
Also available in the form of the EB012 IrDA E-block.
 
  
 
==Examples==
 
==Examples==
 +
 +
 
===Transmit===
 
===Transmit===
  
Line 31: Line 33:
 
==Downloadable macro reference==
 
==Downloadable macro reference==
  
===<span style="font-weight: normal;"><u><tt>SendChar</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Sends a byte character to the IrDA connection.
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendChar'''
 +
|-
 +
| colspan="2" | Sends a byte character to the IrDA connection.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:]] -
 +
| width="90%" | Char
 +
|-
 +
| 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''
 +
|}
  
'''Parameters'''
 
  
:[[Variable Types|INT]] ''Char''
+
{| 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;" | '''ReceiveChar'''
 +
|-
 +
| colspan="2" | Receives byte character from the IrDA connection.&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:]] -
 +
| width="90%" | Timeout
 +
|-
 +
| colspan="2" | Max amount of time in milliseconds to wait for data.&nbsp;
 +
|-
 +
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 +
| 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;" | '''Initialise'''
 +
|-
 +
| colspan="2" | Initialises the UART ready for IrDA data to be sent or received,&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;" | '''Disconnect'''
 +
|-
 +
| colspan="2" | Disconnects from the MQTT server and the network&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>ReceiveChar</tt></u></span>===
 
Receives byte character from the IrDA connection.
 
  
'''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;" | '''Ping'''
 +
|-
 +
| colspan="2" | Ping packet is sent to the Server and checks for a reply. Returns non-zero value if successful &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|INT]] ''Timeout''
 
::Max amount of time in milliseconds to wait for 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;" | '''GetPayload'''
 +
|-
 +
| colspan="2" | Get the Payload of the last received (Read) packet. Returns the number of bytes for the Payload&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | Payload
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Size
 +
|-
 +
| colspan="2" | Byte count the Payload buffer&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'''
 
  
:[[Variable Types|INT]]
+
{| 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;" | '''Subscribe'''
 +
|-
 +
| colspan="2" | Subscribe to a Topic. Must be Connected first Returns non-zero if successful &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | Topic
 +
|-
 +
| colspan="2" | &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>Initialise</tt></u></span>===
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Initialises the UART ready for IrDA data to be sent or received,
+
|-
 +
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Unsubscribe'''
 +
|-
 +
| colspan="2" | Unsubscribe from a Topic. Must be Connected first Returns non-zero if successful &nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | Topic
 +
|-
 +
| colspan="2" | &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''
 +
|}
  
'''Parameters'''
 
  
:''This macro has no 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;" | '''Initialise'''
 +
|-
 +
| 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''
 +
|}
  
  
'''Return value'''
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
:''This call does not return a value''
+
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 +
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetPayloadString'''
 +
|-
 +
| colspan="2" | Get the Payload of the last received (Read) packet as a string value&nbsp;
 +
|-
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 +
| width="90%" | Payload
 +
|-
 +
| colspan="2" | &nbsp;
 +
|-
 +
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 +
| width="90%" | Size
 +
|-
 +
| colspan="2" | &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;" | '''Initialise'''
 +
|-
 +
| colspan="2" | Starts up the MQTT component - call this after initialising the NetworkComms component.&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>Interface</u></span>
 
  
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''INTERFACE''.
+
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
+
|-
Decides which IrDA interface IC we wish to communicate via.
+
| 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>Baud Options</u></span>
+
|-
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_uart::BAUD_LIST''.
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Interface
Baud rate option selector
+
|-
 
+
| colspan="2" | Decides which IrDA interface IC we wish to communicate via.&nbsp;
<span style="font-weight: normal;"><u>Baud Rate</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
This property is of type ''Signed integer'' and can be referenced with the variable name ''cal_uart::BAUD''.
+
| width="90%" | Baud Options
 
+
|-
''<span style="color:red;">No additional information</span>''
+
| colspan="2" | Baud rate option selector&nbsp;
 
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
+
| width="90%" | Baud Rate
<span style="font-weight: normal;"><u>Data Bits</u></span>
+
|-
 
+
| colspan="2" | &nbsp;
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_uart::DBITS''.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
Number of data bits
+
| width="90%" | Data Bits
 
+
|-
<span style="font-weight: normal;"><u>Echo</u></span>
+
| colspan="2" | Number of data bits&nbsp;
 
+
|-
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_uart::ECHO''.
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Echo
Echo selection
+
|-
 
+
| colspan="2" | Echo selection&nbsp;
<span style="font-weight: normal;"><u>Channel</u></span>
+
|-
 
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_uart::CHANNEL''.
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''  
 
+
|-
UART Channel selector
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
Software channels are bit banged using generic I/O pins but are not as reliable as hardware channels.
+
| width="90%" | Channel
 
+
|-
Hardware channels use the selected peripheral on-board the target microcontroller.
+
| colspan="2" | UART Channel selector Software channels are bit banged using generic I/O pins but are not as reliable as hardware channels. Hardware channels use the selected peripheral on-board the target microcontroller.&nbsp;
 
+
|-
<span style="font-weight: normal;"><u>TX</u></span>
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
 
+
| width="90%" | TX
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_uart::TX''.
+
|-
 
+
| colspan="2" | Pin to be used for Transmit data&nbsp;
Pin to be used for Transmit data
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
<span style="font-weight: normal;"><u>RX</u></span>
+
| width="90%" | RX
 
+
|-
This property is of type ''Single digital pin'' and can be referenced with the variable name ''cal_uart::RX''.
+
| colspan="2" | Pin to be used for Receive data&nbsp;
 
+
|-
Pin to be used for Receive data
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
 
+
| width="90%" | Use Flow Control
<span style="font-weight: normal;"><u>Use Flow Control</u></span>
+
|-
 
+
| colspan="2" | Flow Control (Handshake) enable or disable.    On: Two I/O pins are used to control the flow of data in and out of the device.    Off: Flow control is disabled.&nbsp;
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_uart::FLOWEN''.
+
|-
 
+
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
Flow Control (Handshake) enable or disable.
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''  
 
+
|-
     On: Two I/O pins are used to control the flow of data in and out of the device.
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
     Off: Flow control is disabled.
+
| width="90%" | Label
 
+
|-
<span style="font-weight: normal;"><u>Label</u></span>
+
| colspan="2" | Label used to help identify the component on the panel.&nbsp;
 
+
|-
This property is of type ''Line of text'' and can be referenced with the variable name ''label''.
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
+
| width="90%" | Scope Traces
Label used to help identify the component on the panel.
+
|-
 
+
| colspan="2" | Selects if the scope traces are automatically added to the data recorder window or not.    Simulation - draws an approximation of the UART data onto the scope trace.    ICT - sets up the scope trace for incoming data and adds UART packet decoding at the correct BAUD.&nbsp;
<span style="font-weight: normal;"><u>Scope Traces</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
This property is of type ''True or false'' and can be referenced with the variable name ''cal_uart::ScopeTraces''.
+
| width="90%" | Console Data
 
+
|-
Selects if the scope traces are automatically added to the data recorder window or not.
+
| colspan="2" | Selects if the console data is automatically generated or not&nbsp;
 
+
|-
     Simulation - draws an approximation of the UART data onto the scope trace.
+
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
 
+
| width="90%" | Console Columns
     ICT - sets up the scope trace for incoming data and adds UART packet decoding at the correct BAUD.
+
|-
 
+
| colspan="2" | Number of characters that can be displayed on a single line of the console.&nbsp;
<span style="font-weight: normal;"><u>Console Data</u></span>
+
|-
 
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
This property is of type ''True or false'' and can be referenced with the variable name ''cal_uart::ConsoleData''.
+
| width="90%" | Data Source
 
+
|-
Selects if the console data is automatically generated or not
+
| colspan="2" | Simulation data source used to allow the component to connect to various remote devices     Nothing - Simulation data is ignored       COM port - Routes the communication data to and from a physical or virtual COM port       API - Routes the communication data via a data API component on the Panel.&nbsp;
 
+
|}
<span style="font-weight: normal;"><u>Console Columns</u></span>
 
 
 
This property is of type ''Unsigned integer'' and can be referenced with the variable name ''cal_uart::ConsoleColumns''.
 
 
 
Number of characters that can be displayed on a single line of the console.
 
 
 
<span style="font-weight: normal;"><u>Data Source</u></span>
 
 
 
This property is of type ''Fixed list of ints'' and can be referenced with the variable name ''cal_uart::DataSource''.
 
 
 
Simulation data source used to allow the component to connect to various remote devices
 
 
 
    Nothing - Simulation data is ignored
 
 
 
    COM port - Routes the communication data to and from a physical or virtual COM port  
 
 
 
    Injector - Routes the communication data via a data injector component on the Panel.
 

Revision as of 19:48, 16 November 2021

Author Matrix Ltd.
Version 2.0
Category Wireless


IrDA (EB012, MCP1250, MCP2120) component

Low level routines for controlling a standard IrDA interface. Also available in the form of the EB012 IrDA E-block.

Detailed description

No detailed description exists yet for this component

Examples

Transmit

Basic example which repeatedly transmits a string of data via the IrDA interface. FC6 Icon.png IrDA Transmit

Receive

Basic example which waits for any incoming data and then displays the data on the LCD. FC6 Icon.png IrDA Receive

Downloadable macro reference

Fc9-comp-macro.png SendChar
Sends a byte character to the IrDA connection. 
[[File:]] - Char
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ReceiveChar
Receives byte character from the IrDA connection. 
[[File:]] - Timeout
Max amount of time in milliseconds to wait for data. 
[[File:]] - Return


Fc9-comp-macro.png Initialise
Initialises the UART ready for IrDA data to be sent or received, 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png Disconnect
Disconnects from the MQTT server and the network 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Ping
Ping packet is sent to the Server and checks for a reply. Returns non-zero value if successful  
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png GetPayload
Get the Payload of the last received (Read) packet. Returns the number of bytes for the Payload 
Fc9-string-icon.png - STRING Payload
 
Fc9-u8-icon.png - BYTE Size
Byte count the Payload buffer 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Subscribe
Subscribe to a Topic. Must be Connected first Returns non-zero if successful  
Fc9-string-icon.png - STRING Topic
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Unsubscribe
Unsubscribe from a Topic. Must be Connected first Returns non-zero if successful  
Fc9-string-icon.png - STRING Topic
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Initialise
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png GetPayloadString
Get the Payload of the last received (Read) packet as a string value 
Fc9-string-icon.png - STRING Payload
 
Fc9-u8-icon.png - BYTE Size
 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png Initialise
Starts up the MQTT component - call this after initialising the NetworkComms component. 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Interface
Decides which IrDA interface IC we wish to communicate via. 
Fc9-type-16-icon.png Baud Options
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
 
Fc9-type-16-icon.png Data Bits
Number of data bits 
Fc9-type-16-icon.png Echo
Echo selection 
Fc9-conn-icon.png Connections
Fc9-type-16-icon.png Channel
UART Channel selector Software channels are bit banged using generic I/O pins but are not as reliable as hardware channels. Hardware channels use the selected peripheral on-board the target microcontroller. 
Fc9-type-5-icon.png TX
Pin to be used for Transmit data 
Fc9-type-5-icon.png RX
Pin to be used for Receive data 
Fc9-type-16-icon.png Use Flow Control
Flow Control (Handshake) enable or disable. On: Two I/O pins are used to control the flow of data in and out of the device. Off: Flow control is disabled. 
Fc9-conn-icon.png Simulations
Fc9-type-10-icon.png Label
Label used to help identify the component on the panel. 
Fc9-type-7-icon.png Scope Traces
Selects if the scope traces are automatically added to the data recorder window or not. Simulation - draws an approximation of the UART data onto the scope trace. ICT - sets up the scope trace for incoming data and adds UART packet decoding at the correct BAUD. 
Fc9-type-7-icon.png Console Data
Selects if the console data is automatically generated or not 
Fc9-type-21-icon.png Console Columns
Number of characters that can be displayed on a single line of the console. 
Fc9-type-16-icon.png Data Source
Simulation data source used to allow the component to connect to various remote devices Nothing - Simulation data is ignored COM port - Routes the communication data to and from a physical or virtual COM port API - Routes the communication data via a data API component on the Panel.