Difference between revisions of "Component: TCP/IP (ENC28J60) (Comms: Networking)"
From Flowcode Help
Jump to navigationJump to search| Line 44: | Line 44: | ||
''<span style="color:red;">No additional examples</span>'' | ''<span style="color:red;">No additional examples</span>'' | ||
| + | |||
| + | |||
| Line 49: | Line 51: | ||
==Macro reference== | ==Macro reference== | ||
| + | ===SetMyIPAddress=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 82: | Line 85: | ||
| + | ===PacketSend=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 100: | Line 104: | ||
| + | ===MakeTcpSynackFromSyn=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 118: | Line 123: | ||
| + | ===MakeArpRequest=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 136: | Line 142: | ||
| + | ===InitialiseDataLengthInfo=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 149: | Line 156: | ||
| + | ===MakeTcpAckFromAny=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 167: | Line 175: | ||
| + | ===PacketReceive=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 180: | Line 189: | ||
| + | ===CheckForTCPType=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 193: | Line 203: | ||
| + | ===CheckArpPacketIsMyreplyArp=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 206: | Line 217: | ||
| + | ===CheckForIp=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 224: | Line 236: | ||
| + | ===CheckForTCPPort=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 242: | Line 255: | ||
| + | ===CheckForPing=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 255: | Line 269: | ||
| + | ===GetModuleRevision=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 268: | Line 283: | ||
| + | ===MakeTcpAckWithData=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 286: | Line 302: | ||
| + | ===SetMyMACAddress=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 329: | Line 346: | ||
| + | ===MakeArpAnswerFromRequest=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 342: | Line 360: | ||
| + | ===ReadArrayFromBuffer=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 370: | Line 389: | ||
| + | ===ReadRegister=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 388: | Line 408: | ||
| + | ===CheckForARP=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 406: | Line 427: | ||
| + | ===ClientSendPacket=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 464: | Line 486: | ||
| + | ===MakeEchoReplyFromRequest=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 482: | Line 505: | ||
| + | ===ControlLEDs=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 500: | Line 524: | ||
| + | ===GetDataLength=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 513: | Line 538: | ||
| + | ===GetTcpDataPointer=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 526: | Line 552: | ||
| + | ===WriteRegister=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 549: | Line 576: | ||
| + | ===FillTcpData=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 572: | Line 600: | ||
| + | ===ReadStringFromBuffer=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 595: | Line 624: | ||
| + | ===GetSendersMAC=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 613: | Line 643: | ||
| + | ===FillTcpArray=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 641: | Line 672: | ||
| + | ===Initialise=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Revision as of 11:52, 3 February 2023
| Author | Matrix TSL |
| Version | 2.2 |
| Category | Comms: Networking |
Contents
- 1 TCP/IP (ENC28J60) component
- 2 Component Source Code
- 3 Detailed description
- 4 Examples
- 5 Macro reference
- 5.1 SetMyIPAddress
- 5.2 PacketSend
- 5.3 MakeTcpSynackFromSyn
- 5.4 MakeArpRequest
- 5.5 InitialiseDataLengthInfo
- 5.6 MakeTcpAckFromAny
- 5.7 PacketReceive
- 5.8 CheckForTCPType
- 5.9 CheckArpPacketIsMyreplyArp
- 5.10 CheckForIp
- 5.11 CheckForTCPPort
- 5.12 CheckForPing
- 5.13 GetModuleRevision
- 5.14 MakeTcpAckWithData
- 5.15 SetMyMACAddress
- 5.16 MakeArpAnswerFromRequest
- 5.17 ReadArrayFromBuffer
- 5.18 ReadRegister
- 5.19 CheckForARP
- 5.20 ClientSendPacket
- 5.21 MakeEchoReplyFromRequest
- 5.22 ControlLEDs
- 5.23 GetDataLength
- 5.24 GetTcpDataPointer
- 5.25 WriteRegister
- 5.26 FillTcpData
- 5.27 ReadStringFromBuffer
- 5.28 GetSendersMAC
- 5.29 FillTcpArray
- 5.30 Initialise
- 6 Property reference
TCP/IP (ENC28J60) component
A set of routines used to control a ENC28J60 TCP/IP Module. Required connections VCC, Reset, GND, SCK, MISO, MOSI, CS. Leave these pins disconnected CLKOUT, ENC_WOL, ENC_INT
Component Source Code
Please click here to download the component source project: FC_Comp_Source_TCPIP_ENC28J60.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_TCPIP_ENC28J60.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
SetMyIPAddress
PacketSend
| PacketSend | |
| Attempts to transmit a data packet to the ENC28J60 module. | |
| Length | |
| Return | |
MakeTcpSynackFromSyn
| MakeTcpSynackFromSyn | |
| Port | |
| Return | |
MakeArpRequest
| MakeArpRequest | |
| [[File:]] - | ServerIP |
| Return | |
InitialiseDataLengthInfo
| InitialiseDataLengthInfo | |
| Initialises the data pointers to allow us to craft a response containing data | |
| Return | |
MakeTcpAckFromAny
| MakeTcpAckFromAny | |
| Port | |
| Return | |
PacketReceive
| PacketReceive | |
| Attempts to receive a data packet from the ENC28J60 module. Returns the number of bytes received. | |
| Return | |
CheckForTCPType
| CheckForTCPType | |
| Checks to what kind of TCP type the received data is requesting. Returns a bit field specifying the type of request. 0x01 = Ack Requires, 0x02 = Synchronise 0x10 = Ack | |
| Return | |
CheckArpPacketIsMyreplyArp
| CheckArpPacketIsMyreplyArp | |
| Return | |
CheckForIp
| CheckForIp | |
| Checks to see if the received data is an IP request with my IP address. | |
| Length | |
| Return | |
CheckForTCPPort
| CheckForTCPPort | |
| Checks to see if the received data is requesting the server port | |
| Port | |
| Return | |
CheckForPing
| CheckForPing | |
| Checks to see if the received data is a Ping request | |
| Return | |
GetModuleRevision
| GetModuleRevision | |
| Requets the module revision number and returns the value supplied by the module's firmware. | |
| Return | |
MakeTcpAckWithData
| MakeTcpAckWithData | |
| DataLength | |
| Return | |
SetMyMACAddress
MakeArpAnswerFromRequest
| MakeArpAnswerFromRequest | |
| Return | |
ReadArrayFromBuffer
ReadRegister
| ReadRegister | |
| Reads the value from a single register onboard the ENC28J60 module. | |
| Address | |
| Return | |
CheckForARP
| CheckForARP | |
| Checks to see if the received data is an ARP request with my IP address. | |
| Length | |
| Return | |
ClientSendPacket
| ClientSendPacket | |
| DestPort | |
| SourcePort | |
| Flags | |
| MaxSegmentSize | |
| ClearSeqAck | |
| NextAckNum | |
| DataLength | |
| DestMac | |
| DestIp | |
| Return | |
MakeEchoReplyFromRequest
| MakeEchoReplyFromRequest | |
| Length | |
| Return | |
ControlLEDs
| ControlLEDs | |
| Allows both the LEDs on the Ethernet socket to be controlled. Useful for checking if the SPI communications are functioning correctly. | |
| Mode | |
| 0=Off, 1=On, 2=Auto | |
| Return | |
GetDataLength
| GetDataLength | |
| Returns the number of received data bytes after the headers | |
| Return | |
GetTcpDataPointer
| GetTcpDataPointer | |
| Return | |
WriteRegister
| WriteRegister | |
| Writes a value to a single register onboard the ENC28J60 module. | |
| Address | |
| Data | |
| Return | |
FillTcpData
| FillTcpData | |
| Position | |
| Data | |
| Return | |
ReadStringFromBuffer
GetSendersMAC
| GetSendersMAC | |
| Gets the MAC address from locations 6-11 of the IP Header | |
| MAC | |
| 6-byte Array to store the MAC address | |
| Return | |
FillTcpArray
| FillTcpArray | |
| Position | |
| Count | |
| Data | |
| Return | |
Initialise