Mbed library for ENC28J60 Ethernet modules. Full support for TCP/IP and UDP Server, Client and HTTP server (webserver). DHCP and DNS is included.

Dependents:   mBuino_ENC28_MQTT Nucleo_Web_ENC28J60 Nucleo_Web_ENC28J60_ADC Serial_over_Ethernet ... more

Library for ENC28J60 Ethernet modules.

/media/uploads/hudakz/enc28j60_module01.jpg

Ported to mbed from Norbert Truchsess's UIPEthernet library for Arduino. Thank you Norbert!

  • Full support for persistent (streaming) TCP/IP and UDP connections Client and Server each, ARP, ICMP, DHCP and DNS.
  • Works with both Mbed OS 2 and Mbed OS 5.

Usage:

  • Import the library into your project.
  • Add #include "UipEthernet.h" to main.cpp
  • Create one instance of the UipEthernet class initialized with the MAC address you'd like to use and SPI pins of the connected Mbed board.

Example programs:

Import programWebSwitch_ENC28J60

HTTP Server serving a simple webpage which enables to remotely turn a digital output on/off. Compile, download, run and type 'IP_address/secret/' (don't forget the last '/') into your web browser and hit ENTER.

Import programHTTPServer_Echo_ENC28J60

A simple HTTP server echoing received requests. Ethernet connection is over an ENC28J60 board. Usage: Type the server's IP address into you web browser and hit <ENTER>.

Import programTcpServer_ENC28J60

Simple TCP/IP Server using the UIPEthernet library for ENC28J60 Ethernet boards.

Import programTcpClient_ENC28J60

Simple TCP/IP Client using the UIPEthernet library for ENC28J60 Ethernet boards.

Import programUdpServer_ENC28J60

Simple UDP Server using the UIPEthernet library for ENC28J60 Ethernet boards.

Import programUdpClient_ENC28J60

Simple UDP Client using the UIPEthernet library for ENC28J60 Ethernet boards.

Import programMQTT_Hello_ENC28J60

MQTT Client example program. Ethernet connection is via an ENC28J60 module.

Committer:
hudakz
Date:
Thu Jul 23 15:30:54 2020 +0000
Revision:
18:8d5738a6646e
Parent:
8:4acb22344932
Mbed library for ENC28J60 Ethernet modules.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hudakz 3:5b17e4656dd0 1 /**
hudakz 3:5b17e4656dd0 2 * \defgroup clock Clock interface
hudakz 3:5b17e4656dd0 3 *
hudakz 3:5b17e4656dd0 4 * The clock interface is the interface between the \ref timer "timer library"
hudakz 3:5b17e4656dd0 5 * and the platform specific clock functionality. The clock
hudakz 3:5b17e4656dd0 6 * interface must be implemented for each platform that uses the \ref
hudakz 3:5b17e4656dd0 7 * timer "timer library".
hudakz 3:5b17e4656dd0 8 *
hudakz 3:5b17e4656dd0 9 * The clock interface does only one this: it measures time. The clock
hudakz 3:5b17e4656dd0 10 * interface provides a macro, CLOCK_SECOND, which corresponds to one
hudakz 3:5b17e4656dd0 11 * second of system time.
hudakz 3:5b17e4656dd0 12 *
hudakz 3:5b17e4656dd0 13 * \sa \ref timer "Timer library"
hudakz 3:5b17e4656dd0 14 *
hudakz 3:5b17e4656dd0 15 * @{
hudakz 3:5b17e4656dd0 16 */
hudakz 3:5b17e4656dd0 17 /*
hudakz 3:5b17e4656dd0 18 * Copyright (c) 2004, Swedish Institute of Computer Science.
hudakz 3:5b17e4656dd0 19 * All rights reserved.
hudakz 3:5b17e4656dd0 20 *
hudakz 3:5b17e4656dd0 21 * Redistribution and use in source and binary forms, with or without
hudakz 3:5b17e4656dd0 22 * modification, are permitted provided that the following conditions
hudakz 3:5b17e4656dd0 23 * are met:
hudakz 3:5b17e4656dd0 24 * 1. Redistributions of source code must retain the above copyright
hudakz 3:5b17e4656dd0 25 * notice, this list of conditions and the following disclaimer.
hudakz 3:5b17e4656dd0 26 * 2. Redistributions in binary form must reproduce the above copyright
hudakz 3:5b17e4656dd0 27 * notice, this list of conditions and the following disclaimer in the
hudakz 3:5b17e4656dd0 28 * documentation and/or other materials provided with the distribution.
hudakz 3:5b17e4656dd0 29 * 3. Neither the name of the Institute nor the names of its contributors
hudakz 3:5b17e4656dd0 30 * may be used to endorse or promote products derived from this software
hudakz 3:5b17e4656dd0 31 * without specific prior written permission.
hudakz 3:5b17e4656dd0 32 *
hudakz 3:5b17e4656dd0 33 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
hudakz 3:5b17e4656dd0 34 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
hudakz 3:5b17e4656dd0 35 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
hudakz 3:5b17e4656dd0 36 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
hudakz 3:5b17e4656dd0 37 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
hudakz 3:5b17e4656dd0 38 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
hudakz 3:5b17e4656dd0 39 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
hudakz 3:5b17e4656dd0 40 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
hudakz 3:5b17e4656dd0 41 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
hudakz 3:5b17e4656dd0 42 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
hudakz 3:5b17e4656dd0 43 * SUCH DAMAGE.
hudakz 3:5b17e4656dd0 44 *
hudakz 8:4acb22344932 45 * This file is part of the UIP TCP/IP stack
hudakz 3:5b17e4656dd0 46 *
hudakz 3:5b17e4656dd0 47 * Author: Adam Dunkels <adam@sics.se>
hudakz 3:5b17e4656dd0 48 *
hudakz 3:5b17e4656dd0 49 * $Id: clock.h,v 1.3 2006/06/11 21:46:39 adam Exp $
hudakz 3:5b17e4656dd0 50 */
hudakz 3:5b17e4656dd0 51 #ifndef __UIP_CLOCK_H__
hudakz 8:4acb22344932 52 #define __UIP_CLOCK_H__
hudakz 3:5b17e4656dd0 53
hudakz 8:4acb22344932 54 #include "clock-arch.h"
hudakz 3:5b17e4656dd0 55
hudakz 3:5b17e4656dd0 56 /**
hudakz 3:5b17e4656dd0 57 * Initialize the clock library.
hudakz 3:5b17e4656dd0 58 *
hudakz 3:5b17e4656dd0 59 * This function initializes the clock library and should be called
hudakz 3:5b17e4656dd0 60 * from the main() function of the system.
hudakz 3:5b17e4656dd0 61 *
hudakz 3:5b17e4656dd0 62 */
hudakz 3:5b17e4656dd0 63 void uip_clock_init(void);
hudakz 3:5b17e4656dd0 64
hudakz 3:5b17e4656dd0 65 /**
hudakz 3:5b17e4656dd0 66 * Get the current clock time.
hudakz 3:5b17e4656dd0 67 *
hudakz 3:5b17e4656dd0 68 * This function returns the current system clock time.
hudakz 3:5b17e4656dd0 69 *
hudakz 3:5b17e4656dd0 70 * \return The current clock time, measured in system ticks.
hudakz 3:5b17e4656dd0 71 */
hudakz 3:5b17e4656dd0 72 clock_time_t clock_time(void);
hudakz 3:5b17e4656dd0 73
hudakz 3:5b17e4656dd0 74 /**
hudakz 3:5b17e4656dd0 75 * A second, measured in system clock time.
hudakz 3:5b17e4656dd0 76 *
hudakz 3:5b17e4656dd0 77 * \hideinitializer
hudakz 3:5b17e4656dd0 78 */
hudakz 3:5b17e4656dd0 79
hudakz 8:4acb22344932 80 #ifdef CLOCK_CONF_SECOND
hudakz 8:4acb22344932 81 #define CLOCK_SECOND CLOCK_CONF_SECOND
hudakz 8:4acb22344932 82 #else
hudakz 8:4acb22344932 83 #define CLOCK_SECOND (clock_time_t) 32
hudakz 8:4acb22344932 84 #endif
hudakz 3:5b17e4656dd0 85 #endif /* __CLOCK_H__ */
hudakz 3:5b17e4656dd0 86
hudakz 3:5b17e4656dd0 87 /** @} */