A stack which works with or without an Mbed os library. Provides IPv4 or IPv6 with a full 1500 byte buffer.

Dependents:   oldheating gps motorhome heating

Committer:
andrewboyson
Date:
Thu Jan 03 17:23:38 2019 +0000
Revision:
98:b977424ec7f7
Child:
132:db2174b36a6d
Added more fault positions and removed need for a net server module. Added need for the ethernet jack leds definition.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andrewboyson 98:b977424ec7f7 1 #include <stdbool.h>
andrewboyson 98:b977424ec7f7 2 #include "gpio.h"
andrewboyson 98:b977424ec7f7 3 #include "net-jack-leds.h"
andrewboyson 98:b977424ec7f7 4 #include "mstimer.h"
andrewboyson 98:b977424ec7f7 5
andrewboyson 98:b977424ec7f7 6 #define BLINK_DURATION_MS 50
andrewboyson 98:b977424ec7f7 7
andrewboyson 98:b977424ec7f7 8 void JackLeds(bool phyLink, bool phySpeed, bool activity)
andrewboyson 98:b977424ec7f7 9 {
andrewboyson 98:b977424ec7f7 10 static int blinkTimer = 0;
andrewboyson 98:b977424ec7f7 11
andrewboyson 98:b977424ec7f7 12 if (activity) blinkTimer = MsTimerCount;
andrewboyson 98:b977424ec7f7 13 if (MsTimerHasElapsed(blinkTimer, BLINK_DURATION_MS))
andrewboyson 98:b977424ec7f7 14 {
andrewboyson 98:b977424ec7f7 15 if (phyLink) LED_GR_L_SET; else LED_GR_L_CLR;
andrewboyson 98:b977424ec7f7 16 if (phySpeed) LED_YE_R_SET; else LED_YE_R_CLR;
andrewboyson 98:b977424ec7f7 17 }
andrewboyson 98:b977424ec7f7 18 else
andrewboyson 98:b977424ec7f7 19 {
andrewboyson 98:b977424ec7f7 20 LED_GR_L_CLR;
andrewboyson 98:b977424ec7f7 21 LED_YE_R_CLR;
andrewboyson 98:b977424ec7f7 22 }
andrewboyson 98:b977424ec7f7 23 }
andrewboyson 98:b977424ec7f7 24
andrewboyson 98:b977424ec7f7 25 void JackInit()
andrewboyson 98:b977424ec7f7 26 {
andrewboyson 98:b977424ec7f7 27 LED_GR_L_DIR = 1; //Set the direction to 1 == output
andrewboyson 98:b977424ec7f7 28 LED_YE_R_DIR = 1; //Set the direction to 1 == output
andrewboyson 98:b977424ec7f7 29 }