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="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 | + | | 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== | ||
− | + | ''No detailed description exists yet for this component'' | |
− | |||
− | |||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
===Transmit=== | ===Transmit=== | ||
Line 31: | Line 33: | ||
==Downloadable macro reference== | ==Downloadable macro reference== | ||
− | === | + | {| 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. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:]] - | ||
+ | | width="90%" | Char | ||
+ | |- | ||
+ | | 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'' | ||
+ | |} | ||
− | |||
− | :[[ | + | {| 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. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:]] - | ||
+ | | width="90%" | Timeout | ||
+ | |- | ||
+ | | colspan="2" | Max amount of time in milliseconds to wait for data. | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] - | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | '''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" | Initialises the UART ready for IrDA data to be sent or received, | ||
+ | |- | ||
+ | |- | ||
+ | | 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;" | '''Disconnect''' | ||
+ | |- | ||
+ | | colspan="2" | Disconnects from the MQTT server and the network | ||
+ | |- | ||
+ | |- | ||
+ | | 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;" | '''Ping''' | ||
+ | |- | ||
+ | | colspan="2" | Ping packet is sent to the Server and checks for a reply. Returns non-zero value if successful | ||
+ | |- | ||
+ | |- | ||
+ | | 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;" | '''GetPayload''' | ||
+ | |- | ||
+ | | colspan="2" | Get the Payload of the last received (Read) packet. Returns the number of bytes for the Payload | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
+ | | width="90%" | Payload | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Size | ||
+ | |- | ||
+ | | colspan="2" | Byte count the Payload buffer | ||
+ | |- | ||
+ | | 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;" | '''Subscribe''' | ||
+ | |- | ||
+ | | colspan="2" | Subscribe to a Topic. Must be Connected first Returns non-zero if successful | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
+ | | width="90%" | Topic | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | 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;" | '''Unsubscribe''' | ||
+ | |- | ||
+ | | colspan="2" | Unsubscribe from a Topic. Must be Connected first Returns non-zero if successful | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
+ | | width="90%" | Topic | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | 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" | | ||
+ | |- | ||
+ | |- | ||
+ | | 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;" | '''GetPayloadString''' | ||
+ | |- | ||
+ | | colspan="2" | Get the Payload of the last received (Read) packet as a string value | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
+ | | width="90%" | Payload | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Size | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | 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. | ||
+ | |- | ||
+ | |- | ||
+ | | 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== | ==Property reference== | ||
− | |||
− | + | {| 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''' | |
− | + | |- | |
− | + | |- | |
− | + | | 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. | |
− | + | |- | |
− | + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | |
− | + | | width="90%" | Baud Options | |
− | + | |- | |
− | + | | colspan="2" | Baud rate option selector | |
− | + | |- | |
− | + | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | |
− | + | | width="90%" | Baud Rate | |
− | + | |- | |
− | + | | colspan="2" | | |
− | + | |- | |
− | + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | |
− | Number of data bits | + | | width="90%" | Data Bits |
− | + | |- | |
− | + | | colspan="2" | Number of data bits | |
− | + | |- | |
− | + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | |
− | + | | width="90%" | Echo | |
− | Echo selection | + | |- |
− | + | | colspan="2" | Echo selection | |
− | + | |- | |
− | + | | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]] | |
− | + | | 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. |
− | + | |- | |
− | + | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | |
− | + | | width="90%" | TX | |
− | + | |- | |
− | + | | colspan="2" | Pin to be used for Transmit data | |
− | Pin to be used for Transmit data | + | |- |
− | + | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | |
− | + | | width="90%" | RX | |
− | + | |- | |
− | + | | colspan="2" | Pin to be used for Receive data | |
− | + | |- | |
− | Pin to be used for Receive data | + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] |
− | + | | width="90%" | Use Flow Control | |
− | + | |- | |
− | + | | 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. | |
− | + | |- | |
− | + | | 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 |
− | + | |- | |
− | + | | colspan="2" | Label used to help identify the component on the panel. | |
− | + | |- | |
− | + | | 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. | |
− | + | |- | |
− | + | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | |
− | + | | 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 |
− | + | |- | |
− | 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. | |
− | + | |- | |
− | + | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | |
− | + | | 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. |
− | + | |} | |
− | |||
− | |||
− | |||
− | |||
− | Number of characters that can be displayed on a single line of the console. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | Simulation data source used to allow the component to connect to various remote devices | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 19:48, 16 November 2021
Author | Matrix Ltd. |
Version | 2.0 |
Category | Wireless |
Contents
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. IrDA Transmit
Receive
Basic example which waits for any incoming data and then displays the data on the LCD. IrDA Receive
Downloadable macro reference
SendChar | |
Sends a byte character to the IrDA connection. | |
[[File:]] - | Char |
- VOID | Return |
ReceiveChar | |
Receives byte character from the IrDA connection. | |
[[File:]] - | Timeout |
Max amount of time in milliseconds to wait for data. | |
[[File:]] - | Return |
Initialise | |
Initialises the UART ready for IrDA data to be sent or received, | |
- VOID | Return |
Disconnect | |
Disconnects from the MQTT server and the network | |
- BYTE | Return |
Ping | |
Ping packet is sent to the Server and checks for a reply. Returns non-zero value if successful | |
- BYTE | Return |
GetPayload | |
Get the Payload of the last received (Read) packet. Returns the number of bytes for the Payload | |
- STRING | Payload |
- BYTE | Size |
Byte count the Payload buffer | |
- BYTE | Return |
Subscribe | |
Subscribe to a Topic. Must be Connected first Returns non-zero if successful | |
- STRING | Topic |
- BYTE | Return |
Unsubscribe | |
Unsubscribe from a Topic. Must be Connected first Returns non-zero if successful | |
- STRING | Topic |
- BYTE | Return |
Initialise | |
- VOID | Return |
GetPayloadString | |
Get the Payload of the last received (Read) packet as a string value | |
- STRING | Payload |
- BYTE | Size |
- BYTE | Return |
Initialise | |
Starts up the MQTT component - call this after initialising the NetworkComms component. | |
- VOID | Return |