Difference between revisions of "Component: TCP/IP (ENC28J60) (Comms: Networking)"
From Flowcode Help
Jump to navigationJump to searchLine 14: | Line 14: | ||
==TCP/IP component== | ==TCP/IP 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 | 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 Pack== | ||
+ | |||
+ | COMMSA | ||
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
Line 26: | Line 32: | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
Revision as of 16:25, 7 January 2022
Author | Matrix TSL |
Version | 2.2 |
Category | Comms: Networking |
Contents
TCP/IP 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 Pack
COMMSA
Detailed description
No detailed description exists yet for this component
Examples
Here is a simple example to help get started with the ENC28J60 module.
The example program creates a web page server on the network and will also respond to ping requests.
The HTML to drive the web pages is included in the flowchart near the bottom of the main program loop.
ENC28J60 Example
Downloadable macro reference
![]() |
PacketSend |
Attempts to transmit a data packet to the ENC28J60 module. | |
![]() |
Length |
![]() |
Return |
![]() |
MakeTcpSynackFromSyn |
![]() |
Port |
![]() |
Return |
![]() |
MakeArpRequest |
[[File:]] - | ServerIP |
![]() |
Return |
![]() |
InitialiseDataLengthInfo |
Initialises the data pointers to allow us to craft a response containing data | |
![]() |
Return |
![]() |
MakeTcpAckFromAny |
![]() |
Port |
![]() |
Return |
![]() |
PacketReceive |
Attempts to receive a data packet from the ENC28J60 module. Returns the number of bytes received. | |
![]() |
Return |
![]() |
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 |
![]() |
Return |
![]() |
CheckForIp |
Checks to see if the received data is an IP request with my IP address. | |
![]() |
Length |
![]() |
Return |
![]() |
CheckForTCPPort |
Checks to see if the received data is requesting the server port | |
![]() |
Port |
![]() |
Return |
![]() |
CheckForPing |
Checks to see if the received data is a Ping request | |
![]() |
Return |
![]() |
GetModuleRevision |
Requets the module revision number and returns the value supplied by the module's firmware. | |
![]() |
Return |
![]() |
MakeTcpAckWithData |
![]() |
DataLength |
![]() |
Return |
![]() |
MakeArpAnswerFromRequest |
![]() |
Return |
![]() |
ReadRegister |
Reads the value from a single register onboard the ENC28J60 module. | |
![]() |
Address |
![]() |
Return |
![]() |
CheckForARP |
Checks to see if the received data is an ARP request with my IP address. | |
![]() |
Length |
![]() |
Return |
![]() |
ClientSendPacket |
![]() |
DestPort |
![]() |
SourcePort |
![]() |
Flags |
![]() |
MaxSegmentSize |
![]() |
ClearSeqAck |
![]() |
NextAckNum |
![]() |
DataLength |
![]() |
DestMac |
![]() |
DestIp |
![]() |
Return |
![]() |
MakeEchoReplyFromRequest |
![]() |
Length |
![]() |
Return |
![]() |
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 |
Returns the number of received data bytes after the headers | |
![]() |
Return |
![]() |
GetTcpDataPointer |
![]() |
Return |
![]() |
WriteRegister |
Writes a value to a single register onboard the ENC28J60 module. | |
![]() |
Address |
![]() |
Data |
![]() |
Return |
![]() |
FillTcpData |
![]() |
Position |
![]() |
Data |
![]() |
Return |
![]() |
GetSendersMAC |
Gets the MAC address from locations 6-11 of the IP Header | |
![]() |
MAC |
6-byte Array to store the MAC address | |
![]() |
Return |
![]() |
FillTcpArray |
![]() |
Position |
![]() |
Count |
![]() |
Data |
![]() |
Return |