Sfoglia il codice sorgente

add modules folder

balbekova 8 anni fa
parent
commit
30ee2e708f
44 ha cambiato i file con 15128 aggiunte e 0 eliminazioni
  1. 256 0
      modules/Ethernet/lwipopts.h
  2. 377 0
      modules/Ethernet/netconf.c
  3. 79 0
      modules/Ethernet/netconf.h
  4. 940 0
      modules/Ethernet/private_mib.c
  5. 37 0
      modules/Ethernet/private_mib.h
  6. 264 0
      modules/Ethernet/snmp_api.c
  7. 121 0
      modules/Ethernet/snmp_api.h
  8. 208 0
      modules/Ethernet/trap_api.c
  9. 82 0
      modules/Ethernet/trap_api.h
  10. 178 0
      modules/HTTP_Server/fs.c
  11. 101 0
      modules/HTTP_Server/fs.h
  12. BIN
      modules/HTTP_Server/fs/favicon.ico
  13. BIN
      modules/HTTP_Server/fs/index.html
  14. BIN
      modules/HTTP_Server/fs/info.html
  15. BIN
      modules/HTTP_Server/fs/main.css
  16. BIN
      modules/HTTP_Server/fs/main.js
  17. BIN
      modules/HTTP_Server/fs/rotek.png
  18. BIN
      modules/HTTP_Server/fs/settings.html
  19. 1894 0
      modules/HTTP_Server/fsdata.c
  20. 56 0
      modules/HTTP_Server/fsdata.h
  21. 769 0
      modules/HTTP_Server/http_server.c
  22. 98 0
      modules/HTTP_Server/http_server.h
  23. BIN
      modules/HTTP_Server/makefsdata.exe
  24. 7 0
      modules/HTTP_Server/readme.txt
  25. 40 0
      modules/HTTP_Server/trap_params.c
  26. 185 0
      modules/HTTP_Server/trap_params.h
  27. 351 0
      modules/HTTP_Server/web_params_api.c
  28. 66 0
      modules/HTTP_Server/web_params_api.h
  29. 101 0
      modules/Makefile
  30. 952 0
      modules/STM32F4x7_ETH_Driver/Release_Notes.html
  31. 2719 0
      modules/STM32F4x7_ETH_Driver/stm32f4x7_eth.c
  32. 1902 0
      modules/STM32F4x7_ETH_Driver/stm32f4x7_eth.h
  33. 261 0
      modules/STM32F4x7_ETH_Driver/stm32f4x7_eth_bsp.c
  34. 70 0
      modules/STM32F4x7_ETH_Driver/stm32f4x7_eth_bsp.h
  35. 113 0
      modules/STM32F4x7_ETH_Driver/stm32f4x7_eth_conf.h
  36. 92 0
      modules/STM32F4x7_ETH_Driver/stm32f4x7_eth_conf_template.h
  37. 156 0
      modules/leds/led.c
  38. 90 0
      modules/leds/led.h
  39. 615 0
      modules/parameters.c
  40. 711 0
      modules/parameters.h
  41. 330 0
      modules/settings_api.c
  42. 204 0
      modules/settings_api.h
  43. 512 0
      modules/startup/startup_stm32f4xx.s
  44. 191 0
      modules/startup/stm32_flash.ld

+ 256 - 0
modules/Ethernet/lwipopts.h

@@ -0,0 +1,256 @@
+/**
+  ******************************************************************************
+  * @file    lwipopts.h
+  * @author  MCD Application Team
+  * @version V1.0.0
+  * @date    31-October-2011
+  * @brief   lwIP Options Configuration.
+  *          This file is based on Utilities\lwip_v1.3.2\src\include\lwip\opt.h 
+  *          and contains the lwIP configuration for the STM32F4x7 demonstration.
+  ******************************************************************************
+  * @attention
+  *
+  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
+  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
+  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
+  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
+  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+  *
+  * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
+  ******************************************************************************
+  */
+
+#ifndef __LWIPOPTS_H__
+#define __LWIPOPTS_H__
+
+/**
+ * SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain
+ * critical regions during buffer allocation, deallocation and memory
+ * allocation and deallocation.
+ */
+#define SYS_LIGHTWEIGHT_PROT    1
+
+#define ETHARP_TRUST_IP_MAC     0
+#define IP_REASSEMBLY           0
+#define IP_FRAG                 0
+#define ARP_QUEUEING            0
+
+/**
+ * NO_SYS==1: Provides VERY minimal functionality. Otherwise,
+ * use lwIP facilities.
+ */
+
+#define NO_SYS                  0
+
+/* ---------- Memory options ---------- */
+/* MEM_ALIGNMENT: should be set to the alignment of the CPU for which
+   lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2
+   byte alignment -> define MEM_ALIGNMENT to 2. */
+#define MEM_ALIGNMENT           4
+
+/* MEM_SIZE: the size of the heap memory. If the application will send
+a lot of data that needs to be copied, this should be set high. */
+#define MEM_SIZE                (5*1024)
+//#define MEM_SIZE                (10*1024)
+
+/* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
+   sends a lot of data out of ROM (or other static memory), this
+   should be set high. */
+//#define MEMP_NUM_PBUF           100
+///#define MEMP_NUM_PBUF           40
+#define MEMP_NUM_PBUF           50
+/* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
+   per active UDP "connection". */
+#define MEMP_NUM_UDP_PCB        6
+/* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP
+   connections. */
+#define MEMP_NUM_TCP_PCB        12
+//#define MEMP_NUM_TCP_PCB        5
+/* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP
+   connections. */
+#define MEMP_NUM_TCP_PCB_LISTEN 5
+//#define MEMP_NUM_TCP_PCB_LISTEN 15
+/* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
+   segments. */
+#define MEMP_NUM_TCP_SEG        25
+//#define MEMP_NUM_TCP_SEG        100	 
+/* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active
+   timeouts. */
+#define MEMP_NUM_SYS_TIMEOUT    10
+//#define MEMP_NUM_SYS_TIMEOUT    100
+
+/* ---------- Pbuf options ---------- */
+/* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
+//#define PBUF_POOL_SIZE          15
+#define PBUF_POOL_SIZE          25
+//#define PBUF_POOL_SIZE          18
+
+/* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
+//#define PBUF_POOL_BUFSIZE       1500
+//#define PBUF_POOL_BUFSIZE       3024
+#define PBUF_POOL_BUFSIZE         1540
+
+
+
+/* ---------- TCP options ---------- */
+#define LWIP_TCP                1
+#define TCP_TTL                 255
+
+/* Controls if TCP should queue segments that arrive out of
+   order. Define to 0 if your device is low on memory. */
+#define TCP_QUEUE_OOSEQ         0
+
+/* TCP Maximum segment size. */
+#define TCP_MSS                 (1500 - 40)	  /* TCP_MSS = (Ethernet MTU - IP header size - TCP header size) */
+
+/* TCP sender buffer space (bytes). */
+//#define TCP_SND_BUF             (5*TCP_MSS)
+//#define TCP_SND_BUF             (18*TCP_MSS)
+#define TCP_SND_BUF             (18*TCP_MSS)
+
+/*  TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least
+  as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work. */
+//20 
+#define TCP_SND_QUEUELEN        (4* TCP_SND_BUF/TCP_MSS)
+//#define TCP_SND_QUEUELEN        (4* TCP_SND_BUF/TCP_MSS)
+
+/* TCP receive window. */
+#define TCP_WND                 (4*TCP_MSS)
+
+
+/* ---------- ICMP options ---------- */
+#define LWIP_ICMP                       1
+//#define ICMP_TTL			128
+
+/* ---------- DHCP options ---------- */
+/* Define LWIP_DHCP to 1 if you want DHCP configuration of
+   interfaces. DHCP is not implemented in lwIP 0.5.1, however, so
+   turning this on does currently not work. */
+#define LWIP_DHCP               1
+
+
+// ---------- SNMP options ----------
+#define LWIP_SNMP                       1
+#define SNMP_CONCURRENT_REQUESTS        1
+#define SNMP_TRAP_DESTINATIONS          1
+#define SNMP_PRIVATE_MIB                1
+#define SNMP_SAFE_REQUESTS              1
+     
+
+/* ---------- UDP options ---------- */
+#define LWIP_UDP                1
+#define UDP_TTL                 255
+
+
+/* ---------- Statistics options ---------- */
+#define LWIP_STATS 0
+#define LWIP_PROVIDE_ERRNO 1
+
+
+/*
+   --------------------------------------
+   ---------- Checksum options ----------
+   --------------------------------------
+*/
+
+/* 
+The STM32F4x7 allows computing and verifying the IP, UDP, TCP and ICMP checksums by hardware:
+ - To use this feature let the following define uncommented.
+ - To disable it and process by CPU comment the  the checksum.
+*/
+#define CHECKSUM_BY_HARDWARE 
+
+
+#ifdef CHECKSUM_BY_HARDWARE
+  /* CHECKSUM_GEN_IP==0: Generate checksums by hardware for outgoing IP packets.*/
+  #define CHECKSUM_GEN_IP                 0
+  /* CHECKSUM_GEN_UDP==0: Generate checksums by hardware for outgoing UDP packets.*/
+  #define CHECKSUM_GEN_UDP                0
+  /* CHECKSUM_GEN_TCP==0: Generate checksums by hardware for outgoing TCP packets.*/
+  #define CHECKSUM_GEN_TCP                0 
+  /* CHECKSUM_CHECK_IP==0: Check checksums by hardware for incoming IP packets.*/
+  #define CHECKSUM_CHECK_IP               0
+  /* CHECKSUM_CHECK_UDP==0: Check checksums by hardware for incoming UDP packets.*/
+  #define CHECKSUM_CHECK_UDP              0
+  /* CHECKSUM_CHECK_TCP==0: Check checksums by hardware for incoming TCP packets.*/
+  #define CHECKSUM_CHECK_TCP              0
+#else
+  /* CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets.*/
+  #define CHECKSUM_GEN_IP                 1
+  /* CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets.*/
+  #define CHECKSUM_GEN_UDP                1
+  /* CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets.*/
+  #define CHECKSUM_GEN_TCP                1
+  /* CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets.*/
+  #define CHECKSUM_CHECK_IP               1
+  /* CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets.*/
+  #define CHECKSUM_CHECK_UDP              1
+  /* CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets.*/
+  #define CHECKSUM_CHECK_TCP              1
+#endif
+
+
+/*
+   ----------------------------------------------
+   ---------- Sequential layer options ----------
+   ----------------------------------------------
+*/
+/**
+ * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c)
+ */
+#define LWIP_NETCONN                    1
+
+/*
+   ------------------------------------
+   ---------- Socket options ----------
+   ------------------------------------
+*/
+/**
+ * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c)
+ */
+#define LWIP_SOCKET                     0
+
+/*
+   -----------------------------------
+   ---------- DEBUG options ----------
+   -----------------------------------
+*/
+
+//#define LWIP_DEBUG
+
+#define TCP_DEBUG                       LWIP_DBG_OFF
+#define ETHARP_DEBUG                    LWIP_DBG_OFF
+#define PBUF_DEBUG                      LWIP_DBG_ON
+#define IP_DEBUG                        LWIP_DBG_OFF
+#define TCPIP_DEBUG                     LWIP_DBG_OFF
+#define DHCP_DEBUG                      LWIP_DBG_OFF
+#define UDP_DEBUG                       LWIP_DBG_OFF
+#define SOCKETS_DEBUG                   LWIP_DBG_OFF
+#define MEMP_DEBUG                      LWIP_DBG_ON
+#define PING_DEBUG                      LWIP_DBG_OFF
+#define SNMP_MSG_DEBUG                  LWIP_DBG_ON
+#define SNMP_MIB_DEBUG                  LWIP_DBG_ON
+
+
+/*
+   ---------------------------------
+   ---------- OS options ----------
+   ---------------------------------
+*/
+
+#define TCPIP_THREAD_STACKSIZE          400
+#define TCPIP_MBOX_SIZE                 50
+#define DEFAULT_UDP_RECVMBOX_SIZE       20
+#define DEFAULT_TCP_RECVMBOX_SIZE       70
+#define DEFAULT_RAW_RECVMBOX_SIZE       10
+#define DEFAULT_ACCEPTMBOX_SIZE         20
+#define DEFAULT_THREAD_STACKSIZE        500
+#define TCPIP_THREAD_PRIO               (configMAX_PRIORITIES - 2)
+
+#define MEMP_NUM_TCPIP_MSG_INPKT        20
+
+
+#endif /* __LWIPOPTS_H__ */
+
+/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/

+ 377 - 0
modules/Ethernet/netconf.c

@@ -0,0 +1,377 @@
+
+#include "lwip/mem.h"
+#include "lwip/memp.h"
+#include "lwip/dhcp.h"
+#include "ethernetif.h"
+#include "common_config.h"
+#include "netconf.h"
+#include "tcpip.h"
+#include "main.h"
+#include "settings_api.h"
+#include "parameters.h"
+#include "web_params_api.h"
+#include "snmp_api.h"
+#include "trap_api.h"
+
+#ifdef PRINTF_STDLIB
+#include <stdio.h>
+#endif
+#ifdef PRINTF_CUSTOM
+#include "tinystdio.h"
+#endif
+#include <string.h>
+
+
+#define MAX_DHCP_TRIES 3
+
+#define TIME_COUNTER_10_MIN   600
+#define TIME_COUNTER_1_MIN    60
+
+/**
+  * @brief  Общая структура настроек
+  */
+extern SETTINGS_t sSettings;
+
+/**
+  * @brief  Флаг подтверждения новых сетевых параметров пользователем
+  */  
+extern bool fConfirmWebParams;
+
+/**
+  * @brief  Network interface structure
+  */
+struct netif xnetif; 
+
+/**
+  * @brief  Задача получения сетевый параметров по DHCP протоколу
+  */
+TaskHandle_t xHandleDHCP = NULL;
+
+/**
+  * @brief  Задача переинициализации сети
+  */
+TaskHandle_t xHandleWebReinit = NULL;
+
+bool dhcp = false;	
+
+void LwIP_Init(void)
+{
+  struct ip_addr ipaddr;
+  struct ip_addr netmask;
+  struct ip_addr gw;
+  char str[20];
+
+  tcpip_init( NULL, NULL );	
+  sSettings.sFlags.netsettingsChanged = false;
+  /* Если настройки изменили, то используем временные параметры */
+  if (sSettings.sFlags.netsettingsChanged == true)
+  {
+    if (sSettings.sWebTempParams.dhcpEnable)
+    {	
+      ipaddr.addr = 0;
+      netmask.addr = 0;
+      gw.addr = 0;
+	
+	  netif_add(&xnetif, &ipaddr, &netmask, &gw, NULL, &ethernetif_init, &tcpip_input);
+      netif_set_default(&xnetif);
+      netif_set_up(&xnetif); 
+    }	
+    else
+    {	
+	  ipaddr.addr = ipaddr_addr(sSettings.sWebTempParams.ip);
+	  netmask.addr = ipaddr_addr(sSettings.sWebTempParams.mask);
+	  gw.addr = ipaddr_addr(sSettings.sWebTempParams.gate);
+  
+      sprintf(str, " %s\n\r", sSettings.sWebTempParams.ip);
+      PRINT_USART("\n\rStatic IP address   \n\r");
+      PRINT_USART(str);
+
+      netif_add(&xnetif, &ipaddr, &netmask, &gw, NULL, &ethernetif_init, &tcpip_input);
+      netif_set_default(&xnetif);
+      netif_set_up(&xnetif); 
+    }
+  
+	if (sSettings.sWebTempParams.dhcpEnable) {
+      xTaskCreate(LwIP_DHCP_task, "DHCPClient", configMINIMAL_STACK_SIZE * 2, NULL,
+                  tskIDLE_PRIORITY + 2, &xHandleDHCP);
+	  dhcp = true;
+	}  
+  }
+  /* Настройки не менялись, используем обычне настройки из флеш памяти */
+  else
+  {
+    if (sSettings.sWebParams.dhcpEnable)
+    {	
+      ipaddr.addr = 0;
+      netmask.addr = 0;
+      gw.addr = 0;
+	
+	  netif_add(&xnetif, &ipaddr, &netmask, &gw, NULL, &ethernetif_init, &tcpip_input);
+      netif_set_default(&xnetif);
+      netif_set_up(&xnetif); 
+    }	
+    else
+    {	
+	  ipaddr.addr = ipaddr_addr(sSettings.sWebParams.ip);
+	  netmask.addr = ipaddr_addr(sSettings.sWebParams.mask);
+	  gw.addr = ipaddr_addr(sSettings.sWebParams.gate);
+  	  
+	  /* Обновляем временные настройки */
+	  sSettings.sWebTempParams.dhcpEnable = sSettings.sWebParams.dhcpEnable;
+	  strcpy(sSettings.sWebTempParams.ip, sSettings.sWebParams.ip);
+	  strcpy(sSettings.sWebTempParams.mask, sSettings.sWebParams.mask);
+	  strcpy(sSettings.sWebTempParams.gate, sSettings.sWebParams.gate);
+	  
+      sprintf(str, " %s\n\r", sSettings.sWebParams.ip);
+      PRINT_USART("\n\rStatic IP address   \n\r");
+      PRINT_USART(str);
+
+      netif_add(&xnetif, &ipaddr, &netmask, &gw, NULL, &ethernetif_init, &tcpip_input);
+      netif_set_default(&xnetif);
+      netif_set_up(&xnetif); 
+    }
+  
+	if (sSettings.sWebParams.dhcpEnable) {
+      xTaskCreate(LwIP_DHCP_task, "DHCPClient", configMINIMAL_STACK_SIZE * 2, NULL,
+                  tskIDLE_PRIORITY + 2, &xHandleDHCP);
+	  dhcp = true;
+	}  
+  }
+  
+  /* Если настройки изменились, запускаем задачу по отсчету времени реакции пользователя*/
+  if (sSettings.sFlags.netsettingsChanged == true)
+    xTaskCreate(vTaskWebReinit, "webReinit", configMINIMAL_STACK_SIZE, NULL,
+              tskIDLE_PRIORITY, &xHandleWebReinit);
+}
+
+/**
+  * @brief  LwIP_DHCP_Process_Handle
+  * @param  None
+  * @retval None
+  */
+void LwIP_DHCP_task(void * pvParameters)
+{
+  struct ip_addr ipaddr;
+  struct ip_addr netmask;
+  struct ip_addr gw;
+  uint8_t DHCP_state;  
+  DHCP_state = DHCP_START;
+
+  for (;;)
+  {
+    switch (DHCP_state)
+    {
+      case DHCP_START:
+      {
+        dhcp_start(&xnetif);
+        DHCP_state = DHCP_WAIT_ADDRESS;
+        //PRINT_USART("\n\rLooking for DHCP server please wait...\n\r");
+      }
+      break;
+
+      case DHCP_WAIT_ADDRESS:
+      {
+        /* Read the new IP address */
+        ipaddr = xnetif.ip_addr;
+        netmask = xnetif.netmask;
+        gw = xnetif.gw;
+        	
+        if (ipaddr.addr != 0) 
+        {
+          DHCP_state = DHCP_ADDRESS_ASSIGNED;	
+          dhcp_stop(&xnetif);
+          
+		  /* Сохранение полученных сетевый параметров */
+		  /* Если настройки изменили, то сохраняем во временные настройки */
+          if (sSettings.sFlags.netsettingsChanged == true)
+		  {
+		    sprintf(sSettings.sWebTempParams.ip,   "%s", ipaddr_ntoa(&ipaddr));
+		    sprintf(sSettings.sWebTempParams.mask, "%s", ipaddr_ntoa(&netmask));
+		    sprintf(sSettings.sWebTempParams.gate, "%s", ipaddr_ntoa(&gw));
+		  }
+		  else
+		  {
+		    sprintf(sSettings.sWebParams.ip,   "%s", ipaddr_ntoa(&ipaddr));
+		    sprintf(sSettings.sWebParams.mask, "%s", ipaddr_ntoa(&netmask));
+		    sprintf(sSettings.sWebParams.gate, "%s", ipaddr_ntoa(&gw));
+			
+			/* Обновляем временные настройки */
+			sSettings.sWebTempParams.dhcpEnable = sSettings.sWebParams.dhcpEnable;
+			sprintf(sSettings.sWebTempParams.ip,   "%s", ipaddr_ntoa(&ipaddr));
+		    sprintf(sSettings.sWebTempParams.mask, "%s", ipaddr_ntoa(&netmask));
+		    sprintf(sSettings.sWebTempParams.gate, "%s", ipaddr_ntoa(&gw));
+			
+		  }
+		  
+		  PRINT_USART("Parameters assigned by a DHCP server:\n\r     IP:   ");
+          PRINT_USART(ipaddr_ntoa(&ipaddr));
+		  PRINT_USART("\n\r");
+          
+		  PRINT_USART("Netmask:   ");
+		  PRINT_USART(ipaddr_ntoa(&netmask));
+		  PRINT_USART("\n\r");
+		  
+		  PRINT_USART("Gateway:   ");
+		  PRINT_USART(ipaddr_ntoa(&gw));
+		  PRINT_USART("\n\r");
+          
+		  vTaskDelay(50);
+		  /* Установлен динамический IP, можно отправить трап о перезагрузке устройства */
+		  SNMP_SendUserTrap(DEVICE_REBOOTED);
+		  
+          vTaskDelete(xHandleDHCP);
+        }
+        else
+        {
+          /* DHCP timeout */
+          if (xnetif.dhcp->tries > MAX_DHCP_TRIES)
+          {
+            DHCP_state = DHCP_TIMEOUT;
+
+            /* Stop DHCP */
+            dhcp_stop(&xnetif);
+			
+			if (sSettings.sFlags.netsettingsChanged == true)
+		    {
+			  ipaddr.addr = ipaddr_addr(sSettings.sWebTempParams.ip);
+	          netmask.addr = ipaddr_addr(sSettings.sWebTempParams.mask);
+	          gw.addr = ipaddr_addr(sSettings.sWebTempParams.gate);
+			}  
+			else
+			{  
+			  ipaddr.addr = ipaddr_addr(sSettings.sWebParams.ip);
+	          netmask.addr = ipaddr_addr(sSettings.sWebParams.mask);
+	          gw.addr = ipaddr_addr(sSettings.sWebParams.gate);
+			}
+			  
+            /* Static address used */
+            netif_set_addr(&xnetif, &ipaddr , &netmask, &gw);
+ 
+            PRINT_USART("DHCP timeout\n\r");
+            PRINT_USART("\n\rStatic IP address\n\r");
+			PRINT_USART(ipaddr_ntoa(&ipaddr));
+		    PRINT_USART("\n\r");
+
+			vTaskDelay(50);
+			/* Установлен статический IP, можно отправить трап о перезагрузке устройства */
+		    SNMP_SendUserTrap(DEVICE_REBOOTED);
+			
+			vTaskDelete(xHandleDHCP);
+          }
+        }
+      }
+      break;
+
+      default: break;
+    }
+
+    vTaskDelay(250);
+  }   
+}
+
+/**
+  * @brief  Запуск задачи переинициализации WEB
+  */
+void WEB_StartReinitTask(void)
+{
+  xTaskCreate(vTaskWebReinit, "ReinitWeb", 2*configMINIMAL_STACK_SIZE, NULL,
+              tskIDLE_PRIORITY, &xHandleWebReinit);
+}
+
+/**
+  * @brief  Переинициализация WEB. Задача положенное время отслеживает флаг
+  *         fConfirmWebParams. 
+  *           Если флаг устанавливается в положенное время,
+  *         временные настройки web перезаписываются в постоянные, сбрасывается 
+  *         флаг sSettings.sFlags.netsettingsChanged и вся структура настроек 
+  *         сохраняется в памяти. 
+  *           Если флаг не устанавливается в положенное время, то сбрасывается
+  *         флаг sSettings.sFlags.netsettingsChanged, сохраняется вся структура
+  *         настроек в памяти и контроллер перезагружается.
+  */
+void vTaskWebReinit(void * pvParameters)
+{
+  static uint16_t timeCounter = 0;
+  
+  for (;;)
+  {
+	/* Контроль времени работы задачи */
+	if (timeCounter++ > TIME_COUNTER_10_MIN)
+	{
+	  SetWebReinitFlag(false);
+	  HTTP_SaveSettings();
+      vTaskDelay(1010);
+ 	  NVIC_SystemReset();
+	}
+	
+	if (fConfirmWebParams)
+	{
+	  fConfirmWebParams = false;
+		
+	  /* Сохраняем временные сетевые настройки в постоянные */
+	  sSettings.sWebParams.dhcpEnable = sSettings.sWebTempParams.dhcpEnable;
+	  strcpy(sSettings.sWebParams.ip,   sSettings.sWebTempParams.ip);
+	  strcpy(sSettings.sWebParams.gate, sSettings.sWebTempParams.gate);
+	  strcpy(sSettings.sWebParams.mask, sSettings.sWebTempParams.mask);
+	  
+	  HTTP_SaveSettings();
+	  
+	  vTaskDelete(xHandleWebReinit);
+	}	
+	  
+	vTaskDelay(1000);
+  }	
+}	
+
+/**
+  * @brief  Возвращает true если сетевые параметры изменились
+  */
+bool GetStateWebReinit(void)
+{
+  /* Статус dhcp изменился? */
+  if (sSettings.sWebParams.dhcpEnable != sSettings.sWebTempParams.dhcpEnable)
+  {
+	/* Включили dhcp */
+    if (sSettings.sWebTempParams.dhcpEnable == 1)
+	{
+	  /* Устанавилваем флаг */
+	  SetWebReinitFlag(true);
+	  return true;
+	}
+	/* Выключили dhcp */
+	else
+	{
+	  /* Устанавилваем флаг */
+      SetWebReinitFlag(true);
+	  return true;
+	}  
+  }
+  
+  /* Изменился IP? */
+  if (strstr(sSettings.sWebParams.ip, sSettings.sWebTempParams.ip) == 0)
+  {
+    /* Устанавилваем флаг */
+	SetWebReinitFlag(true);
+	return true;
+  }
+ 
+  /* Изменился шлюз? */
+  if (strstr(sSettings.sWebParams.gate, sSettings.sWebTempParams.gate) == 0)
+  {
+    /* Устанавилваем флаг */
+	SetWebReinitFlag(true);
+	return true;
+  }
+  
+  /* Изменилась маска? */
+  if (strstr(sSettings.sWebParams.mask, sSettings.sWebTempParams.mask) == 0)
+  {
+    /* Устанавилваем флаг */
+	SetWebReinitFlag(true);
+	return true;
+  }
+  
+  return false;
+}
+
+/*********** Portions COPYRIGHT 2012 Embest Tech. Co., Ltd.*****END OF FILE****/

+ 79 - 0
modules/Ethernet/netconf.h

@@ -0,0 +1,79 @@
+/**
+  ******************************************************************************
+  * @file    netconf.h
+  * @author  MCD Application Team
+  * @version V1.0.0
+  * @date    31-October-2011 
+  * @brief   This file contains all the functions prototypes for the netconf.c 
+  *          file.
+  ******************************************************************************
+  * @attention
+  *
+  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
+  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
+  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
+  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
+  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+  *
+  * <h2><center>&copy; Portions COPYRIGHT 2011 STMicroelectronics</center></h2>
+  ******************************************************************************
+  */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __NETCONF_H
+#define __NETCONF_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+   
+#include "stm32f4xx.h"    
+#include <stdbool.h>
+   
+typedef enum 
+{ 
+  DHCP_START=0,
+  DHCP_WAIT_ADDRESS,
+  DHCP_ADDRESS_ASSIGNED,
+  DHCP_TIMEOUT
+} 
+DHCP_State_TypeDef;
+
+void LwIP_Init(void);
+
+void LwIP_DHCP_task(void * pvParameters);
+
+/**
+  * @brief  Запуск задачи переинициализации WEB
+  */
+void WEB_StartReinitTask(void);
+
+/**
+  * @brief  Переинициализация WEB. Задача положенное время отслеживает флаг
+  *         fConfirmWebParams. 
+  *           Если флаг устанавливается в положенное время,
+  *         временные настройки web перезаписываются в посоянные, сбрасывается 
+  *         флаг sSettings.sFlags.netsettingsChanged и вся структура настроек 
+  *         сохраняется в памяти. Далее контроллер перезагружается.
+  *           Если флаг не устанавливается в положенное время, то сбрасывается
+  *         флаг sSettings.sFlags.netsettingsChanged, сохраняется вся структура
+  *         настроек в памяти и контроллер перезагружается.
+  */
+void vTaskWebReinit(void * pvParameters);
+
+/**
+  * @brief  Возвращает true если сетевые параметры изменились
+  */
+bool GetStateWebReinit(void);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __NETCONF_H */
+
+
+/*********** Portions COPYRIGHT 2012 Embest Tech. Co., Ltd.*****END OF FILE****/

+ 940 - 0
modules/Ethernet/private_mib.c

@@ -0,0 +1,940 @@
+#include "stm32f4xx.h"  
+
+#include "private_mib.h"
+#include "lwip/snmp.h"
+#include "lwip/snmp_msg.h"
+#include "lwip/snmp_asn1.h"
+#include "lwip/snmp_structs.h"
+
+#include "parameters.h"
+#include "web_params_api.h"
+#include "snmp_api.h"
+#include "trap_api.h"
+#include "common_config.h"
+
+#include "FreeRTOS.h"
+
+#ifdef PRINTF_STDLIB
+#include <stdio.h>
+#endif
+#ifdef PRINTF_CUSTOM
+#include "tinystdio.h"
+#endif
+
+extern void ocstrncpy(u8_t *dst, u8_t *src, u16_t n);
+
+char paramStr[255];
+uint8_t paramLength = 0;
+uint32_t paramInt = 0;
+
+static void system_get_object_def_ee( u8_t ident_len, s32_t *ident, struct obj_def *od );
+static void system_get_value_ee(struct obj_def *od, u16_t len, void *value);
+static u8_t system_set_test_ee(struct obj_def *od, u16_t len, void *value);
+static void system_set_value_ee(struct obj_def *od, u16_t len, void *value);
+
+/* Функции для узла Signals */
+static void signals_get_object_def (u8_t ident_len, s32_t *ident, struct obj_def *od);
+static void signals_get_value (struct obj_def *od, u16_t len, void *value);
+static u8_t signals_set_test (struct obj_def *od, u16_t len, void *value);
+static void signals_set_value (struct obj_def *od, u16_t len, void *value);
+
+/*------------------------------------------------------------------------------
+ Описание узлов 
+------------------------------------------------------------------------------*/
+/* узел SYSTEM (операции с EEPROM) */
+/*             0 1 2 3 4 5 6 */
+/* system .1.3.6.1.2.1.1 */
+const mib_scalar_node system_scalar_ee = {
+  &system_get_object_def_ee,
+  &system_get_value_ee,
+  &system_set_test_ee,
+  &system_set_value_ee,
+  MIB_NODE_SC,
+  0
+};
+
+// переменные узла SIGNALS ------------------------------------------
+
+const mib_scalar_node signals_var = 
+{
+  &signals_get_object_def,
+  &signals_get_value,
+  &signals_set_test,
+  &signals_set_value,
+  MIB_NODE_SC,
+  0
+};
+
+// узел SIGNALS -----------------------------------------------------
+
+const s32_t signals_ids[27] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 };
+
+struct mib_node* const signals_nodes[13] = 
+{
+  (struct mib_node* const)&signals_var,
+  (struct mib_node* const)&signals_var,
+  (struct mib_node* const)&signals_var,
+  (struct mib_node* const)&signals_var,
+  (struct mib_node* const)&signals_var,
+  (struct mib_node* const)&signals_var,
+  (struct mib_node* const)&signals_var,
+  (struct mib_node* const)&signals_var,
+  (struct mib_node* const)&signals_var,
+  (struct mib_node* const)&signals_var,
+  (struct mib_node* const)&signals_var,
+  (struct mib_node* const)&signals_var,
+  (struct mib_node* const)&signals_var
+};
+
+const struct mib_array_node signals = 
+{
+  &noleafs_get_object_def,
+  &noleafs_get_value,
+  &noleafs_set_test,
+  &noleafs_set_value,
+  MIB_NODE_AR,
+  13,
+  signals_ids,
+  signals_nodes
+};
+
+
+// узел BT-6701 ------------------------------------------------------------
+
+const s32_t bt6701_ids[1] = { 1 };
+
+struct mib_node* const bt6701_nodes[1] = 
+{
+  (struct mib_node* const)&signals,
+};
+
+const struct mib_array_node bt6701 = 
+{
+  &noleafs_get_object_def,
+  &noleafs_get_value,
+  &noleafs_set_test,
+  &noleafs_set_value,
+  MIB_NODE_AR,
+  1,
+  bt6701_ids,
+  bt6701_nodes
+};
+
+// узел swt ------------------------------------------------------------
+const s32_t swt_ids[1] = { 
+1
+};
+
+struct mib_node* const swt_nodes[1] = 
+{
+  (struct mib_node* const)&bt6701,
+};
+
+const struct mib_array_node swt = 
+{
+  &noleafs_get_object_def,
+  &noleafs_get_value,
+  &noleafs_set_test,
+  &noleafs_set_value,
+  MIB_NODE_AR,
+  1,
+  swt_ids,
+  swt_nodes
+};
+
+// узел ROTEK ------------------------------------------------------------
+
+const s32_t rotek_ids[1] = { 911 };
+
+struct mib_node* const rotek_nodes[1] = 
+{
+  (struct mib_node* const)&swt,
+};
+
+const struct mib_array_node rotek = 
+{
+  &noleafs_get_object_def,
+  &noleafs_get_value,
+  &noleafs_set_test,
+  &noleafs_set_value,
+  MIB_NODE_AR,
+  1,
+  rotek_ids,
+  rotek_nodes
+};
+
+// узел ENTERPRISES -------------------------------------------------------
+
+const s32_t enterprises_ids[1] = { 41752 };
+
+struct mib_node* const enterprises_nodes[1] = 
+{
+  (struct mib_node* const)&rotek
+};
+
+const struct mib_array_node enterprises = 
+{
+  &noleafs_get_object_def,
+  &noleafs_get_value,
+  &noleafs_set_test,
+  &noleafs_set_value,
+  MIB_NODE_AR,
+  1,
+  enterprises_ids,
+  enterprises_nodes
+};
+
+// узел PRIVATE -----------------------------------------------------------
+
+const s32_t mib_private_ids[1] = { 1 };
+
+struct mib_node* const mib_pivate_nodes[1] = 
+{
+  (struct mib_node* const)&enterprises
+};
+
+const struct mib_array_node mib_private = 
+{
+  &noleafs_get_object_def,
+  &noleafs_get_value,
+  &noleafs_set_test,
+  &noleafs_set_value,
+  MIB_NODE_AR,
+  1,
+  mib_private_ids,
+  mib_pivate_nodes
+};
+
+
+/*------------------------------------------------------------------------------
+ Функции
+------------------------------------------------------------------------------*/
+
+// Функции для узла SIGNALS
+
+/**-----------------------------------------------------------------------------
+ \fn     static void signals_get_object_def (u8_t ident_len, s32_t *ident, struct obj_def *od)
+ \brief  функция получения свойств переменных узла Identification
+ \param  ident_len - the address length. длина адреса
+ \param  ident - points to objectname.0 (object id trailer) 
+ \param  od - points to object definition. указатель на описание переменной
+ \return нет
+------------------------------------------------------------------------------*/
+static void signals_get_object_def (u8_t ident_len, s32_t *ident, struct obj_def *od)
+{
+  u8_t id;
+  
+  /* return to object name, adding index depth (1) */
+  ident_len += 1;
+  ident -= 1;
+  if (ident_len == 2)
+  {
+    od->id_inst_len = ident_len;
+    od->id_inst_ptr = ident;
+
+    id = ident[0];
+    
+    switch (id)
+    {
+      case 1: /* FWVersion */
+		GetVersionStr(paramStr, &paramLength);
+        od->instance = MIB_OBJECT_SCALAR;
+        od->access = MIB_OBJECT_READ_ONLY;
+        od->asn_type = SNMP_ASN1_OC_STR;
+        od->v_len = paramLength;
+        break;
+	 case 2: /* RestoreSignal */
+		GetRestore(paramStr, &paramLength);
+        od->instance = MIB_OBJECT_SCALAR;
+        od->access = MIB_OBJECT_READ_WRITE;
+        od->asn_type = SNMP_ASN1_INTEG;
+        od->v_len = sizeof(s32_t);
+        break;
+	  case 3: /* RebootSignal */
+		GetReboot(paramStr, &paramLength);
+		od->instance = MIB_OBJECT_SCALAR;
+        od->access = MIB_OBJECT_READ_WRITE;
+        od->asn_type = SNMP_ASN1_INTEG;
+        od->v_len = sizeof(s32_t);
+        break;
+	  case 4: /* IntTemp */
+		GetInternalTempStr(paramStr, &paramLength);
+        od->instance = MIB_OBJECT_SCALAR;
+        od->access = MIB_OBJECT_READ_ONLY;
+        od->asn_type = SNMP_ASN1_OC_STR;
+        od->v_len = paramLength;
+        break;
+      case 5: /* LineFailBit */
+		GetLineFailBitStr(paramStr, &paramLength);
+        od->instance = MIB_OBJECT_SCALAR;
+        od->access = MIB_OBJECT_READ_ONLY;
+        od->asn_type = SNMP_ASN1_OC_STR;
+        od->v_len = paramLength;
+        break;
+      case 6: /* LowBatBit */
+		GetLowBatteryBitStr(paramStr, &paramLength);
+        od->instance = MIB_OBJECT_SCALAR;
+        od->access = MIB_OBJECT_READ_ONLY;
+        od->asn_type = SNMP_ASN1_OC_STR;
+        od->v_len = paramLength;
+        break;
+	  case 7: /* InFreq */
+		GetInputFreqStr(paramStr, &paramLength);
+		od->instance = MIB_OBJECT_SCALAR;
+        od->access = MIB_OBJECT_READ_ONLY;
+        od->asn_type = SNMP_ASN1_OC_STR;
+        od->v_len = paramLength;
+		break;
+	  case 8: /* OutFreq */
+		GetOutputFreqStr(paramStr, &paramLength);
+        od->instance = MIB_OBJECT_SCALAR;
+        od->access = MIB_OBJECT_READ_ONLY;
+        od->asn_type = SNMP_ASN1_OC_STR;
+        od->v_len = paramLength;
+		break;
+	  case 9: /* InVoltVAC */
+		GetInputVoltageStr(paramStr, &paramLength);
+		od->instance = MIB_OBJECT_SCALAR;
+        od->access = MIB_OBJECT_READ_ONLY;
+        od->asn_type = SNMP_ASN1_OC_STR;
+        od->v_len = paramLength;
+		break;
+	  case 10: /* OutVoltVAC */
+		GetOutputVoltageStr(paramStr, &paramLength);
+        od->instance = MIB_OBJECT_SCALAR;
+        od->access = MIB_OBJECT_READ_ONLY;
+        od->asn_type = SNMP_ASN1_OC_STR;
+        od->v_len = paramLength;
+        break;
+	  case 11: /* Power */
+		GetPowerStr(paramStr, &paramLength);
+		od->instance = MIB_OBJECT_SCALAR;
+        od->access = MIB_OBJECT_READ_ONLY;
+        od->asn_type = SNMP_ASN1_OC_STR;
+        od->v_len = paramLength;
+		break;
+	  case 12: /* BatCap */
+		GetBatCapacityStr(paramStr, &paramLength);
+        od->instance = MIB_OBJECT_SCALAR;
+        od->access = MIB_OBJECT_READ_ONLY;
+        od->asn_type = SNMP_ASN1_OC_STR;
+        od->v_len = paramLength;
+        break;	
+      case 13: /* ConnectMonitor */
+		GetConnectMonitorStr(paramStr, &paramLength);
+        od->instance = MIB_OBJECT_SCALAR;
+        od->access = MIB_OBJECT_READ_ONLY;
+        od->asn_type = SNMP_ASN1_OC_STR;
+        od->v_len = paramLength;
+        break;	
+      default:
+        //LWIP_DEBUGF(SNMP_MIB_DEBUG,("planar_get_object_def: no such object\n"));
+        od->instance = MIB_OBJECT_NONE;
+        break;
+    };
+  }
+  else
+  {
+    LWIP_DEBUGF(SNMP_MIB_DEBUG,("planar_get_object_def: no scalar\n"));
+    od->instance = MIB_OBJECT_NONE;
+  }
+}
+
+/**-----------------------------------------------------------------------------
+ \fn     static void Identification_get_value(struct obj_def *od, u16_t len, void *value)
+ \brief  функция получения значения переменных узла Identification
+ \param  obj_def - указатель на описание переменной
+ \param  len - длина переменной в байтах 
+ \param  value - указатель на значение переменной
+ \return нет
+------------------------------------------------------------------------------*/
+static void signals_get_value (struct obj_def *od, u16_t len, void *value)
+{
+  u8_t id;
+  
+  id = od->id_inst_ptr[0];
+  
+  switch (id)
+  {
+    case 1: /* FWVersion */
+	  ocstrncpy((u8_t*)value, (u8_t*)paramStr, len);
+      break;
+	case 2: /* RestoreSignal */
+	  *((s32_t*)value) = 0;
+      break;
+	case 3: /* RebootSignal */
+	  *((s32_t*)value) = 0;
+      break;
+	case 4: /* IntTemp */
+	  ocstrncpy((u8_t*)value, (u8_t*)paramStr, len);
+      break;  
+	case 5: /* LineFailBit */
+	  ocstrncpy((u8_t*)value, (u8_t*)paramStr, len);
+      break;  
+    case 6: /* LowBatBit */
+	  ocstrncpy((u8_t*)value, (u8_t*)paramStr, len);
+      break;
+	case 7: /* InFreq */
+	  ocstrncpy((u8_t*)value, (u8_t*)paramStr, len);
+      break;  
+	case 8: /* OutFreq */
+	  ocstrncpy((u8_t*)value, (u8_t*)paramStr, len);
+      break;  
+	case 9: /* InVoltVAC */
+	  ocstrncpy((u8_t*)value, (u8_t*)paramStr, len);
+      break;
+	case 10: /* OutVoltVAC */
+	  ocstrncpy((u8_t*)value, (u8_t*)paramStr, len);
+      break;
+	case 11: /* Power */
+      ocstrncpy((u8_t*)value, (u8_t*)paramStr, len);
+      break;
+	case 12: /* BatCap */
+	  ocstrncpy((u8_t*)value, (u8_t*)paramStr, len);
+      break;
+    case 13: /* ConnectMonitor */
+	  ocstrncpy((u8_t*)value, (u8_t*)paramStr, len);
+      break;  
+    default :
+	  break;
+  };
+}
+
+/**-----------------------------------------------------------------------------
+ \fn     static void Identification_set_value (struct obj_def *od, u16_t len, void *value)
+ \brief  функция записи значений переменных узла Identification
+ \param  obj_def - указатель на описание переменной
+ \param  len - длина переменной в байтах 
+ \param  value - указатель на значение переменной
+ \return нет
+------------------------------------------------------------------------------*/
+static void signals_set_value (struct obj_def *od, u16_t len, void *value)
+{
+  u8_t id;
+  uint32_t val;
+  
+  id = od->id_inst_ptr[0];
+
+  val = *((s32_t*)value);
+  
+  switch (id)
+  {
+    case 2: /* RestoreSignal */
+      if (val == 1) {
+        SNMP_SendUserTrap(DEVICE_RESTORED);
+        HTTP_ResetSettings();
+      }
+    break;
+    case 3: /* RebootSignal */
+      if (val == 1)
+        HTTP_StartResetTask(false);
+    break;
+    default :
+    break;
+  };
+  
+}
+
+/**-----------------------------------------------------------------------------
+ \fn     static u8_t Identification_set_test (struct obj_def *od, u16_t len, void *value)
+ \brief  функция проверки записываемых значений переменных узла Identification
+ \param  obj_def - указатель на описание переменной
+ \param  len - длина переменной в байтах 
+ \param  value - указатель на значение переменной
+ \return 0 - некорректное значение
+         1 - корректное значение
+------------------------------------------------------------------------------*/
+static u8_t signals_set_test (struct obj_def *od, u16_t len, void *value)
+{
+  u8_t id, set_ok;
+
+  LWIP_UNUSED_ARG(value);
+  set_ok = 0;
+  id = od->id_inst_ptr[0];
+  
+  switch (id)
+  {
+    case 2: 
+      if ( len == sizeof(s32_t) )
+      {
+        set_ok = 1;
+      }
+      break;  
+	  
+    case 3: 
+      if ( len == sizeof(s32_t) )
+      {
+        set_ok = 1;
+      }
+      break; 
+  };
+  
+  return set_ok;
+}
+
+/**
+ * Returns systems object definitions (eeprom).
+ *
+ * @param ident_len the address length (2)
+ * @param ident points to objectname.0 (object id trailer)
+ * @param od points to object definition.
+ */
+static void
+system_get_object_def_ee(u8_t ident_len, s32_t *ident, struct obj_def *od)
+{
+  u8_t id;
+
+  /* return to object name, adding index depth (1) */
+  ident_len += 1;
+  ident -= 1;
+  if (ident_len == 2)
+  {
+    od->id_inst_len = ident_len;
+    od->id_inst_ptr = ident;
+
+    id = ident[0];
+    //LWIP_DEBUGF(SNMP_MIB_DEBUG,("get_object_def_ee system.%"U16_F".0\n",(u16_t)id));
+    switch (id)
+    {
+      case 4: /* sysContact */
+        od->instance = MIB_OBJECT_SCALAR;
+        od->access = MIB_OBJECT_READ_WRITE;
+        od->asn_type = (SNMP_ASN1_UNIV | SNMP_ASN1_PRIMIT | SNMP_ASN1_OC_STR);
+        od->v_len = 1 /*GetSnmpStringLen(SNMP_SYSCONTACT_TYPE)*/;
+        break;
+      case 5: /* sysName */
+        od->instance = MIB_OBJECT_SCALAR;
+        od->access = MIB_OBJECT_READ_WRITE;
+        od->asn_type = (SNMP_ASN1_UNIV | SNMP_ASN1_PRIMIT | SNMP_ASN1_OC_STR);
+        od->v_len = 1 /*GetSnmpStringLen(SNMP_SYSNAME_TYPE)*/;
+        break;
+      case 6: /* sysLocation */
+        od->instance = MIB_OBJECT_SCALAR;
+        od->access = MIB_OBJECT_READ_WRITE;
+        od->asn_type = (SNMP_ASN1_UNIV | SNMP_ASN1_PRIMIT | SNMP_ASN1_OC_STR);
+        od->v_len = 1 /*GetSnmpStringLen(SNMP_SYSLOCATION_TYPE)*/;
+        break;
+      default:
+        //LWIP_DEBUGF(SNMP_MIB_DEBUG,("system_get_object_def_ee: no such object\n"));
+        od->instance = MIB_OBJECT_NONE;
+        break;
+    };
+  }
+  else
+  {
+    LWIP_DEBUGF(SNMP_MIB_DEBUG,("system_get_object_def_ee: no scalar\n"));
+    od->instance = MIB_OBJECT_NONE;
+  }
+}
+// ----------------------------------------------------------------------------
+
+
+/**
+ * Returns system object value.
+ *
+ * @param ident_len the address length (2)
+ * @param ident points to objectname.0 (object id trailer)
+ * @param len return value space (in bytes)
+ * @param value points to (varbind) space to copy value into.
+ */
+static void
+system_get_value_ee(struct obj_def *od, u16_t len, void *value)
+{
+  u8_t id;
+
+  id = od->id_inst_ptr[0];
+  switch (id)
+  {
+    case 4: /* sysContact */
+      //GetSnmpString(SNMP_SYSCONTACT_TYPE, value, len );
+      break;
+    case 5: /* sysName */
+      //GetSnmpString(SNMP_SYSNAME_TYPE, value, len );
+      break;
+    case 6: /* sysLocation */
+      //GetSnmpString(SNMP_SYSLOCATION_TYPE, value, len );
+      break;
+  };
+}
+// ----------------------------------------------------------------------------
+
+
+static u8_t
+system_set_test_ee(struct obj_def *od, u16_t len, void *value)
+{
+  u8_t id, set_ok;
+
+  LWIP_UNUSED_ARG(value);
+  set_ok = 0;
+  id = od->id_inst_ptr[0];
+  switch (id)
+  {
+    case 4: /* sysContact */
+      if ( len <= 255 )
+      {
+        set_ok = 1;
+      }
+      break;
+    case 5: /* sysName */
+      if ( len <= 255 )
+      {
+        set_ok = 1;
+      }
+      break;
+    case 6: /* sysLocation */
+      if ( len <= 255 )
+      {
+        set_ok = 1;
+      }
+      break;
+  };
+  return set_ok;
+}
+// ----------------------------------------------------------------------------
+
+
+static void
+system_set_value_ee(struct obj_def *od, u16_t len, void *value)
+{
+  u8_t id;
+
+  id = od->id_inst_ptr[0];
+  switch (id)
+  {
+    case 4: /* sysContact */
+      //SetSnmpString(SNMP_SYSCONTACT_TYPE, value, len );
+      //*syscontact_len_ptr = len;
+    break;
+    case 5: /* sysName */
+      //SetSnmpString(SNMP_SYSNAME_TYPE, value, len );
+      //*sysname_len_ptr = len;
+    break;
+    case 6: /* sysLocation */
+      //SetSnmpString(SNMP_SYSLOCATION_TYPE, value, len );
+      //*syslocation_len_ptr = len;
+    break;
+  };
+}
+// ----------------------------------------------------------------------------
+
+/**-----------------------------------------------------------------------------
+ \fn     err_t snmp_send_trap_ex (s8_t generic_trap, 
+                         struct snmp_obj_id *eoid, 
+                         s32_t specific_trap, 
+                         struct snmp_obj_id* varbinds, 
+                         u8_t varbinds_num)
+ \brief  функция посылки трапа с возможностью пристыковывать переменные
+ \param  generic_trap  - код трапа
+ \param  eoid          - указатель на enterprise object identifier
+ \param  specific_trap - used for enterprise traps when generic_trap == 6
+ \param  varbinds      - указатель на переменные
+ \param  varbinds_num  - число переменных
+ \return код ошибки
+------------------------------------------------------------------------------*/
+err_t snmp_send_trap_ex (s8_t generic_trap, 
+                         struct snmp_obj_id *eoid, 
+                         s32_t specific_trap, 
+                         struct snmp_obj_id* varbinds, 
+                         u8_t varbinds_num)
+{
+	uint8_t bSnmpActive = 1;
+	
+	struct snmp_varbind** vb_list;
+	struct mib_node* node;
+	struct obj_def obj;
+	err_t tResult;
+	s32_t* VarNum;
+    struct snmp_name_ptr np;
+	
+
+	/* SNMP не готово - ничего не отправляем */
+	if( !bSnmpActive )
+	{
+		return ERR_MEM;
+	}
+	
+	/* создаем таблицу указателей переменных */
+	pvPortMalloc( varbinds_num * sizeof(struct snmp_varbind*) );
+	/*
+	if(vb_list == NULL)
+	{
+		return ERR_MEM;
+	}
+	*/
+	/* создаем сами переменные */
+	for(u8_t i = 0; i < varbinds_num; i++)
+	{
+		/* ищем узел в дереве*/
+		node = snmp_search_tree( (struct mib_node*)&internet, varbinds[i].len - 3, 
+										 &varbinds[i].id[4], &np );
+		
+		//node = snmp_search_tree( (struct mib_node*)&internet, varbinds[i].len, 
+		//								 &varbinds[i].id[0], &np );
+		
+		if(node != NULL)
+		{
+			/* получаем информацию о переменной узла */
+			VarNum = &varbinds[i].id[ varbinds[i].len - 1 ];
+			
+			if( node->node_type == MIB_NODE_EX)
+			{
+				struct mib_external_node* node_ex;
+				node_ex = (struct mib_external_node*)node;
+				/* TODO: подставить правильный rid вместо 0 */
+				node_ex->get_object_def_a(0, 1, VarNum, &obj);
+			}
+			else
+			{
+				node->get_object_def(1, VarNum, &obj);
+			}
+			
+			/* создаем переменную */
+			vb_list[i] = snmp_varbind_alloc(&varbinds[i], obj.asn_type, obj.v_len);
+			if( vb_list[i] != NULL )
+			{
+				{
+					/* получаем значение переменной */
+					if( node->node_type == MIB_NODE_EX)
+					{
+						struct mib_external_node* node_ex;
+						node_ex = (struct mib_external_node*)node;
+						/* TODO: подставить правильный rid вместо 0 */
+						node_ex->get_value_a(0, &obj, obj.v_len, vb_list[i]->value);
+					}
+					else
+					{
+						node->get_value(&obj, obj.v_len, vb_list[i]->value);
+					}
+					/* добавляем переменную в ловушку */
+					snmp_varbind_tail_add(&trap_msg.outvb, vb_list[i]);
+				}
+			}
+		}
+	}
+
+	/* посылаем ловушку */
+	tResult = snmp_send_trap(generic_trap, eoid, specific_trap);
+	
+	/* удаляем переменные из списка */
+	snmp_varbind_list_free(&trap_msg.outvb);
+	
+	/* удаляем указатели переменных */
+	vPortFree(vb_list);
+	
+	return tResult;
+}
+
+void SNMP_SendTestTrap(void)
+{
+/*  
+  struct snmp_varbind *vb;
+  struct snmp_obj_id objid = {11, {1, 3, 6, 1, 4, 1, 41752, 5, 16, 2, 1}};
+  unsigned char msg[] = "Sex, drugs and LwIP";
+  unsigned char msglen = 19;
+  
+  vb = snmp_varbind_alloc(&objid, SNMP_ASN1_OPAQUE, msglen);
+  
+  vb->value = &msg;
+           
+  trap_msg.outvb.head = vb;
+  trap_msg.outvb.tail = vb;
+  trap_msg.outvb.count = 1;
+  
+  snmp_send_trap(SNMP_GENTRAP_ENTERPRISESPC, &objid, 0);
+     
+  trap_msg.outvb.head = NULL;
+  trap_msg.outvb.tail = NULL;
+  trap_msg.outvb.count = 0;
+  //vb->value = NULL;
+     
+  snmp_varbind_free(vb);
+*/  
+  static struct snmp_obj_id trapObjId = {11, {1, 3, 6, 1, 4, 1, 41752, 5, 16, 2, 1}};
+  static struct snmp_obj_id varObjId  = {11, {1, 3, 6, 1, 4, 1, 41752, 5, 16, 1, 1}};
+  
+  struct snmp_varbind* vb;
+  u32_t *u32ptr;
+  
+  vb = snmp_varbind_alloc(&varObjId, MIB_NODE_SC, 4);
+  
+  vb->value_len = 4;
+  vb->value_type = 0x02;
+  u32ptr = vb->value; 	
+  *u32ptr = 23;
+  
+  if( vb != NULL )
+	snmp_varbind_tail_add(&trap_msg.outvb, vb);
+			
+  snmp_send_trap(SNMP_GENTRAP_ENTERPRISESPC, &trapObjId, 0);
+	
+  /* удаляем переменные из списка */
+  snmp_varbind_list_free(&trap_msg.outvb);
+  
+  //snmp_send_trap_ex(SNMP_GENTRAP_ENTERPRISESPC, &trapObjId, 0, &varObjId, 1);
+  
+  
+#if 0	
+	struct snmp_varbind** vb_list;
+	struct mib_node* node;
+	struct obj_def obj;
+	err_t tResult;
+	s32_t* VarNum;
+    struct snmp_name_ptr np;
+	
+
+	/* создаем указатель на переменную */
+	pvPortMalloc(sizeof(struct snmp_varbind*) );
+
+	/* создаем сами переменные */
+	for(u8_t i = 0; i < varbinds_num; i++)
+	{
+		/* ищем узел в дереве*/
+		node = snmp_search_tree( (struct mib_node*)&internet, varbinds[i].len - 4, 
+										 &varbinds[i].id[4], &np );
+		
+		//node = snmp_search_tree( (struct mib_node*)&internet, varbinds[i].len, 
+		//								 &varbinds[i].id[0], &np );
+		
+		if(node != NULL)
+		{
+			/* получаем информацию о переменной узла */
+			VarNum = &varbinds[i].id[ varbinds[i].len - 1 ];
+			
+			if( node->node_type == MIB_NODE_EX)
+			{
+				struct mib_external_node* node_ex;
+				node_ex = (struct mib_external_node*)node;
+				/* TODO: подставить правильный rid вместо 0 */
+				node_ex->get_object_def_a(0, 1, VarNum, &obj);
+			}
+			else
+			{
+				node->get_object_def(1, VarNum, &obj);
+			}
+			
+			/* создаем переменную */
+			vb_list[i] = snmp_varbind_alloc(&varbinds[i], obj.asn_type, obj.v_len);
+			if( vb_list[i] != NULL )
+			{
+				{
+					/* получаем значение переменной */
+					if( node->node_type == MIB_NODE_EX)
+					{
+						struct mib_external_node* node_ex;
+						node_ex = (struct mib_external_node*)node;
+						/* TODO: подставить правильный rid вместо 0 */
+						node_ex->get_value_a(0, &obj, obj.v_len, vb_list[i]->value);
+					}
+					else
+					{
+						node->get_value(&obj, obj.v_len, vb_list[i]->value);
+					}
+					/* добавляем переменную в ловушку */
+					snmp_varbind_tail_add(&trap_msg.outvb, vb_list[i]);
+				}
+			}
+		}
+	}
+
+	/* посылаем ловушку */
+	tResult = snmp_send_trap(generic_trap, eoid, specific_trap);
+	
+	/* удаляем переменные из списка */
+	snmp_varbind_list_free(&trap_msg.outvb);
+	
+	/* удаляем указатели переменных */
+	vPortFree(vb_list);
+	
+	return tResult;
+#endif	
+}
+
+#define NUM_PRIVATE_TRAP 10
+ 
+//static unsigned char SNMP_TRAP_0_FLAG = 1;
+//static struct ip_addr SNMP_TRAP_0_ADDR;
+ 
+extern struct snmp_msg_trap trap_msg;
+ 
+struct private_trap
+{
+  /* source enterprise ID (sysObjectID) */
+  struct snmp_obj_id *enterprise; 
+  /* trap ID */
+  struct snmp_obj_id *trap_oid;
+ 
+  /* specific trap code */
+  u32_t spc_trap;
+ 
+  /* object value ASN1 type */
+  u8_t value_type;
+  /* object value length (in u8_t) */
+  u8_t value_len;
+  /* object value */
+  void *value;
+  /* indicate that the trap is sent */
+  u8_t in_use;
+};
+ 
+struct private_trap trap_bank[NUM_PRIVATE_TRAP];
+ 
+struct private_trap * getNextFreePrivateTrap()
+{
+   u8_t index;
+   void * result = NULL;
+  
+   for(index = 0; index < NUM_PRIVATE_TRAP; index++)
+   {
+      if(!trap_bank[index].in_use)
+      {
+         trap_bank[index].in_use = 1;
+         result = &trap_bank[index];        
+         break;
+      }
+   }
+  
+   return result; 
+}
+ 
+void freePrivateTrap(struct private_trap * trap)
+{
+   trap->enterprise = NULL;
+   trap->trap_oid = NULL;
+   trap->value = NULL;
+   trap->in_use = 0;  
+}
+ 
+void vSendTrapCallback( void * parameters )
+{
+   struct private_trap * trapToSend;
+   struct snmp_varbind * vb;
+  
+   if( parameters != NULL )
+   {
+      trapToSend = (struct private_trap *) parameters;
+     
+      vb = snmp_varbind_alloc(trapToSend->enterprise,
+                              trapToSend->value_type,
+                              trapToSend->value_len);
+                             
+      vb->value = trapToSend->value;
+           
+      trap_msg.outvb.head = vb;
+      trap_msg.outvb.tail = vb;
+      trap_msg.outvb.count = 1;
+     
+      snmp_send_trap(SNMP_GENTRAP_ENTERPRISESPC, trapToSend->trap_oid, trapToSend->spc_trap);
+     
+      trap_msg.outvb.head = NULL;
+      trap_msg.outvb.tail = NULL;
+      trap_msg.outvb.count = 0;
+     
+      vb->value = NULL;
+     
+      snmp_varbind_free(vb);
+     
+      freePrivateTrap(trapToSend);
+   }  
+}
+ 
+ 

+ 37 - 0
modules/Ethernet/private_mib.h

@@ -0,0 +1,37 @@
+/********************************* (C) РОТЕК ***********************************
+ * @module  template
+ * @file    template.h
+ * @version 1.0.0
+ * @date    XX.XX.XXXX
+ * $brief   template
+ *******************************************************************************
+ * @history     Version  Author         Comment
+ * XX.XX.XXXX   1.0.0    Telenkov D.A.  First release.
+ *******************************************************************************
+ */
+
+/* Define to prevent recursive  ----------------------------------------------*/
+#ifndef PRIVATE_MIB_H
+#define PRIVATE_MIB_H
+
+//#include "arch\cc.h"
+
+/**
+  * @brief  
+  */
+extern const struct mib_array_node mib_private;
+
+void lwip_privmib_init(void);
+/*  
+err_t snmp_send_trap_ex (s8_t generic_trap, 
+                         struct snmp_obj_id *eoid, 
+                         s32_t specific_trap, 
+                         struct snmp_obj_id* varbinds, 
+                         u8_t varbinds_num);
+*/
+
+void SNMP_SendTestTrap(void);
+
+#endif /* #ifndef PRIVATE_MIB_H */
+
+/********************************* (C) РОТЕК **********************************/

+ 264 - 0
modules/Ethernet/snmp_api.c

@@ -0,0 +1,264 @@
+/********************************* (C) ROTEK ***********************************
+ * @module  template
+ * @file    template.c
+ * @version 1.0.0
+ * @date    XX.XX.XXXX
+ * $brief   Template
+ *******************************************************************************
+ * @history     Version  Author         Comment
+ * XX.XX.XXXX   1.0.0    Telenkov D.A.  First release.
+ *******************************************************************************
+ */
+
+#include "stm32f4xx.h"  
+#include "snmp_api.h"
+#include "trap_api.h"
+#include "settings_api.h"
+#include "common_config.h"
+#include "rtc.h"
+
+#ifdef PRINTF_STDLIB
+#include <stdio.h>
+#endif
+#ifdef PRINTF_CUSTOM
+#include "tinystdio.h"
+#endif
+#include <stdbool.h>
+#include <string.h>
+
+#include "lwip/opt.h"
+#include "lwip/api.h"
+#include "lwip/sys.h"
+#include "lwip/udp.h"
+
+#include "snmp.h"
+#include "snmp_msg.h"
+#include "private_mib.h"
+
+#include "FreeRTOS.h"
+#include "task.h"
+#include "queue.h"
+
+/**
+  * @brief  Пул всех возможных трапов устройства
+  */
+extern TRAP_t traps[];
+
+/**
+  * @brief  Общая структура настроек
+  */
+extern SETTINGS_t sSettings;
+
+/**
+  * @brief  Очередь для отправки трапов
+  */
+QueueHandle_t    SNMP_TrapQueue;
+
+/**
+  * @brief  Инициализация параметров SNMP
+  * @retval 
+  */
+void SNMP_Init(void)
+{
+  //SETTINGS_SetSnmpDef();
+  SNMP_AgentInit();
+}
+
+
+/**
+  * @brief  Системный тик SNMP. Таск должен вызываться с частотой 100Гц.
+  * @retval 
+  */
+void SNMP_SysUpTimeTask(void *arg)
+{
+  TickType_t xLastWakeTime;
+  const TickType_t xFrequency = 10;
+  
+  xLastWakeTime = xTaskGetTickCount();
+  
+  while(1)
+  {
+	vTaskDelayUntil( &xLastWakeTime, xFrequency );
+    snmp_inc_sysuptime();
+  }
+}
+
+/**
+  * @brief  Тестовый таск для проверки отправки трапов
+  * @retval 
+  */
+void snmp_trap_tread(void *arg)
+{
+  uint8_t trapName;
+	
+  while(1)
+  {
+    if (xQueueReceive(SNMP_TrapQueue, &trapName, 0) == pdTRUE)
+	{
+      SNMP_SetManagerIP(sSettings.sSnmp.managerIP);
+	  SNMP_SendVarbindTrap(&traps[trapName]);
+      
+      SNMP_SetManagerIP(sSettings.sSnmp.managerIP2);
+	  SNMP_SendVarbindTrap(&traps[trapName]);
+      
+      SNMP_SetManagerIP(sSettings.sSnmp.managerIP3);
+	  SNMP_SendVarbindTrap(&traps[trapName]);
+	}
+  }  
+
+}
+
+/**
+  * @brief  Инициализация SNMP агента
+  * @retval 
+  */
+void SNMP_AgentInit(void)
+{
+  SNMP_SetObjDescr();
+  SNMP_SetReadCommunity(sSettings.sSnmp.readCommunity);
+  SNMP_SetWriteCommunity(sSettings.sSnmp.writeCommunity);
+  SNMP_SetSysContact(sSettings.sSnmp.sysContact);
+  SNMP_SetSysName(sSettings.sSnmp.sysName);
+  SNMP_SetSysLocation(sSettings.sSnmp.sysLocation);
+  SNMP_SetManagerIP(sSettings.sSnmp.managerIP);
+  SNMP_SetObjID();
+  SNMP_SetTrapOnOff(1);
+  
+  SNMP_InitTrapsBase();
+	
+  snmp_init();
+  udp_init();
+  
+  SNMP_TrapQueue = xQueueCreate(SNMP_TRAP_QUEUE_SIZE, sizeof(uint8_t));
+}
+
+/**
+  * @brief  Пользовательская функция для отправки трапа из массива traps[] 
+  *         Трап помещается в очередь. Работа с очередью происходит по принципу
+  *         FIFO буфера. 
+  *         Если в настройках трапа отправка отключена, то трап игнорируется.
+  * @retval 
+  */
+void SNMP_SendUserTrap(uint8_t trapName)
+{
+  uint16_t availableSpace;
+  uint8_t  dummyTrap;
+  
+  if (traps[trapName].trapEnable)
+  {	
+    availableSpace = uxQueueSpacesAvailable(SNMP_TrapQueue);
+  
+    if (availableSpace == 0)
+	  xQueueReceive(SNMP_TrapQueue, &dummyTrap, 0);
+  
+    xQueueSend(SNMP_TrapQueue, &trapName, 0);
+  }
+}
+
+/**
+  * @brief  Установить SNMP Descriptor
+  * @retval 
+  */
+// TODO
+void SNMP_SetObjDescr(void)
+{
+  static uint8_t len;
+  
+  strcpy(sSettings.sSnmp.sysDescr, sSettings.sSnmp.sysName);
+  strcat(sSettings.sSnmp.sysDescr, " ");
+  strcat(sSettings.sSnmp.sysDescr, VERSION);
+  strcat(sSettings.sSnmp.sysDescr, " ");
+  strcat(sSettings.sSnmp.sysDescr, sSettings.sSnmp.sysContact);
+  strcat(sSettings.sSnmp.sysDescr, " ");
+  strcat(sSettings.sSnmp.sysDescr, sSettings.sInfo.serialNumber);
+  
+  len = strlen(sSettings.sSnmp.sysDescr);
+  snmp_set_sysdesr((u8_t*)sSettings.sSnmp.sysDescr, &len);
+}
+
+/**
+  * @brief  Установить SNMP Community для чтения
+  */
+void SNMP_SetReadCommunity(char *comm)
+{
+  strcpy(sSettings.sSnmp.readCommunity, comm);
+}
+
+/**
+  * @brief  Установить SNMP Community для записи
+  */
+void SNMP_SetWriteCommunity(char *comm)
+{
+  strcpy(sSettings.sSnmp.writeCommunity, comm);
+}
+
+/**
+  * @brief  Установить SNMP SysContact
+  * @retval 
+  */
+void SNMP_SetSysContact(char *con)
+{
+  static uint8_t len;
+  
+  len = strlen(con);
+  snmp_set_syscontact((u8_t*)con, &len);
+}
+
+/**
+  * @brief  Установить SNMP SysName
+  * @retval 
+  */
+void SNMP_SetSysName(char *name)
+{
+  static uint8_t len;
+  
+  len = strlen(name);
+  snmp_set_sysname((u8_t*)name, &len);
+}
+
+/**
+  * @brief  Установить SNMP SysLocation
+  * @retval 
+  */
+void SNMP_SetSysLocation(char *loc)
+{
+  static uint8_t len;
+  
+  len = strlen(loc);
+  snmp_set_syslocation((u8_t*)loc, &len);
+}
+
+/**
+  * @brief  Установить SNMP SysManagerIP
+  * @retval 
+  */
+void SNMP_SetManagerIP(char *ip)
+{
+  static ip_addr_t trap_addr;
+  
+  ipaddr_aton(ip, &trap_addr);
+  snmp_trap_dst_ip_set(0, &trap_addr);
+}
+
+/**
+  * @brief  Установить SNMP Object ID
+  * @retval 
+  */
+void SNMP_SetObjID(void)
+{
+  static struct snmp_obj_id my_object_id = {9, {1, 3, 6, 1, 4, 1, 41752, 911, 1}};
+  
+  snmp_set_sysobjid(&my_object_id);
+}
+
+/**
+  * @brief  Вкл/выкл трапы
+  * @retval 
+  */
+void SNMP_SetTrapOnOff(uint8_t state)
+{
+  snmp_trap_dst_enable(0, (u8_t)state);
+}
+
+
+/********************************* (C) ROTEK **********************************/

+ 121 - 0
modules/Ethernet/snmp_api.h

@@ -0,0 +1,121 @@
+/********************************* (C) РОТЕК ***********************************
+ * @module  snmp_api
+ * @file    snmp_api.h
+ * @version 1.0.0
+ * @date    XX.XX.XXXX
+ * $brief   snmp_api
+ *******************************************************************************
+ * @history     Version  Author         Comment
+ * XX.XX.XXXX   1.0.0    Telenkov D.A.  First release.
+ *******************************************************************************
+ */
+
+/* Define to prevent recursive  ----------------------------------------------*/
+#ifndef SNMP_API_H
+#define SNMP_API_H
+
+/**
+  * @brief  Инициализация параметров SNMP
+  */
+void SNMP_Init(void);  
+
+
+void SNMP_SysUpTimeTask(void *arg);
+
+/**
+  * @brief  Тестовый таск для проверки отправки трапов
+  */
+void snmp_trap_tread(void *arg);
+
+
+/**
+  * @brief  Инициализация SNMP агента
+  */
+void SNMP_AgentInit(void);
+
+/**
+  * @brief  Пользовательская функция для отправки трапа из массива traps[] 
+  *         Трап помещается в очередь. Работа с очередью происходит по принципу
+  *         FIFO буфера. 
+  *         Если в настройках трапа отправка отключена, то трап игнорируется.
+  */
+void SNMP_SendUserTrap(uint8_t trapName);
+
+/**
+  * @brief  Установить SNMP Descriptor
+  */
+void SNMP_SetObjDescr(void);
+
+/**
+  * @brief  Установить SNMP Community для чтения
+  */
+void SNMP_SetReadCommunity(char *comm);
+
+/**
+  * @brief  Установить SNMP Community для записи
+  */
+void SNMP_SetWriteCommunity(char *comm);
+
+/**
+  * @brief  Установить SNMP Community отправки трапов
+  */
+void SNMP_SetTrapCommunity(char *comm);
+
+/**
+  * @brief  Установить SNMP SysContact
+  */
+void SNMP_SetSysContact(char *con);
+
+/**
+  * @brief  Установить SNMP SysName
+  */
+void SNMP_SetSysName(char *name);
+
+/**
+  * @brief  Установить SNMP SysLocation
+  */
+void SNMP_SetSysLocation(char *loc);
+
+/**
+  * @brief  Установить SNMP SysManagerIP
+  */
+void SNMP_SetManagerIP(char *ip);
+
+/**
+  * @brief  Установить SNMP Object ID
+  */
+void SNMP_SetObjID(void);
+
+/**
+  * @brief  Вкл/выкл трапы
+  */
+void SNMP_SetTrapOnOff(uint8_t state);
+
+/**
+  * @brief  Установить IP адрес для отправки трапов
+  */
+void SNMP_SetTrapDestination(char *ip);
+
+/**
+  * @brief  Текущее TRAP community
+  */
+void SNMP_GetTrapCommunity(char *str, uint8_t *len);
+
+/**
+  * @brief  Текущее community для чтения
+  */
+void SNMP_GetReadCommunity(char *str, uint8_t *len);
+
+/**
+  * @brief  Текущее community для записи
+  */
+void SNMP_GetWriteCommunity(char *str, uint8_t *len);
+
+/**
+  * @brief  IP SNMP менеджера
+  */
+void SNMP_GetManagerIp(char *str, uint8_t *len);
+
+#endif /* #ifndef SNMP_API_H */
+
+/********************************* (C) РОТЕК **********************************/

+ 208 - 0
modules/Ethernet/trap_api.c

@@ -0,0 +1,208 @@
+/********************************* (C) ROTEK ***********************************
+ * @module  trap_api
+ * @file    trap_api.c
+ * @version 1.0.0
+ * @date    XX.XX.XXXX
+ * $brief   trap_api
+ *******************************************************************************
+ * @history     Version  Author         Comment
+ * XX.XX.XXXX   1.0.0    Telenkov D.A.  First release.
+ *******************************************************************************
+ */
+
+#include "stm32f4xx.h"  
+#include "trap_api.h"
+#include "parameters.h"
+#include "settings_api.h"
+
+#include "lwip/snmp.h"
+#include "lwip/snmp_msg.h"
+#include "lwip/snmp_asn1.h"
+#include "lwip/snmp_structs.h"
+
+#ifdef PRINTF_STDLIB
+#include <stdio.h>
+#endif
+#ifdef PRINTF_CUSTOM
+#include "tinystdio.h"
+#endif
+#include <string.h>
+#include <stdbool.h>
+
+/**
+  * @brief  Общая структура настроек
+  */
+extern SETTINGS_t sSettings;
+
+/**
+  * @brief  Пул всех возможных трапов устройства
+  */
+TRAP_t traps[15];
+
+/**
+  * @brief  Инициализация базы трапов
+  * @retval 
+  */
+void SNMP_InitTrapsBase(void)
+{
+  /* 1. FWVersionUpdate */ // +
+  traps[FW_VERSION_UPDATE].trapId = FW_VERSION_UPDATE;
+  traps[FW_VERSION_UPDATE].varbindId = 1;
+  traps[FW_VERSION_UPDATE].trapEnable = true;
+  traps[FW_VERSION_UPDATE].handle = GetVersionStr; /* FWVersion */
+  
+  /* 2. FWVersionUpdated */ // +
+  traps[FW_VERSION_UPDATED].trapId = FW_VERSION_UPDATED;
+  traps[FW_VERSION_UPDATED].varbindId = 1;
+  traps[FW_VERSION_UPDATED].trapEnable = true;
+  traps[FW_VERSION_UPDATED].handle = GetVersionStr; /* FWVersion */
+  
+  /* 3. DeviceRestored */ // +
+  traps[DEVICE_RESTORED].trapId = DEVICE_RESTORED;
+  traps[DEVICE_RESTORED].varbindId = 2;
+  traps[DEVICE_RESTORED].trapEnable = true;
+  traps[DEVICE_RESTORED].handle = GetRestore; /* RestoreSignal */
+  
+  /* 4. DeviceRebooted */ // +
+  traps[DEVICE_REBOOTED].trapId = DEVICE_REBOOTED;
+  traps[DEVICE_REBOOTED].varbindId = 3;
+  traps[DEVICE_REBOOTED].trapEnable = true;
+  traps[DEVICE_REBOOTED].handle = GetReboot; /* RebootSignal */
+  
+  /* 5. BatteryTemperatureNorm */ // +
+  traps[BATTERY_TEMPERATURE_NORM].trapId = BATTERY_TEMPERATURE_NORM;
+  traps[BATTERY_TEMPERATURE_NORM].varbindId = 4;
+  traps[BATTERY_TEMPERATURE_NORM].trapEnable = true;
+  traps[BATTERY_TEMPERATURE_NORM].handle = GetInternalTempStr; /* BatteryTemperature */  
+  
+  /* 6. BatteryTemperatureAlarm */ // +
+  traps[BATTERY_TEMPERATURE_ALARM].trapId = BATTERY_TEMPERATURE_ALARM;
+  traps[BATTERY_TEMPERATURE_ALARM].varbindId = 4;
+  traps[BATTERY_TEMPERATURE_ALARM].trapEnable = true;
+  traps[BATTERY_TEMPERATURE_ALARM].handle = GetInternalTempStr; /* BatteryTemperature */
+  
+  /* 7. LineAlarm */ // +
+  traps[LINE_ALARM].trapId = LINE_ALARM;
+  traps[LINE_ALARM].varbindId = 9;
+  traps[LINE_ALARM].trapEnable = true;
+  traps[LINE_ALARM].handle = GetInputVoltageStr; /* LineAlarm */
+  
+  /* 8. LineNorm */ // +
+  traps[LINE_NORM].trapId = LINE_NORM;
+  traps[LINE_NORM].varbindId = 9;
+  traps[LINE_NORM].trapEnable = true;
+  traps[LINE_NORM].handle = GetInputVoltageStr; /* LineNorm */
+  
+  /* 9. LowBatAlarm */ // +
+  traps[LOW_BAT_ALARM].trapId = LOW_BAT_ALARM;
+  traps[LOW_BAT_ALARM].varbindId = 12;
+  traps[LOW_BAT_ALARM].trapEnable = true;
+  traps[LOW_BAT_ALARM].handle = GetBatCapacityStr; /* LowBatAlarm */
+  
+  /* 10. LowBatNorm */ // +
+  traps[LOW_BAT_NORM].trapId = LOW_BAT_NORM;
+  traps[LOW_BAT_NORM].varbindId = 12;
+  traps[LOW_BAT_NORM].trapEnable = true;
+  traps[LOW_BAT_NORM].handle = GetBatCapacityStr; /* LowBatNorm */
+  
+  /* 11. PowerAlarm */ // +
+  traps[POWER_ALARM].trapId = POWER_ALARM;
+  traps[POWER_ALARM].varbindId = 11;
+  traps[POWER_ALARM].trapEnable = true;
+  traps[POWER_ALARM].handle = GetPowerStr; /* PowerAlarm */
+  
+  /* 12. PowerNorm */ // +
+  traps[POWER_NORM].trapId = POWER_NORM;
+  traps[POWER_NORM].varbindId = 11;
+  traps[POWER_NORM].trapEnable = true;
+  traps[POWER_NORM].handle = GetPowerStr; /* PowerNorm */
+  
+  /* 13. ConnectMonitorAlarm */ // 
+  traps[CONNECT_MONITOR_ALARM].trapId = CONNECT_MONITOR_ALARM;
+  traps[CONNECT_MONITOR_ALARM].varbindId = 13;
+  traps[CONNECT_MONITOR_ALARM].trapEnable = true;
+  traps[CONNECT_MONITOR_ALARM].handle = GetConnectMonitorStr; /* ConnectMonitor */
+  
+  /* 14. ConnectMonitorNorm */ // 
+  traps[CONNECT_MONITOR_NORM].trapId = CONNECT_MONITOR_NORM;
+  traps[CONNECT_MONITOR_NORM].varbindId = 13;
+  traps[CONNECT_MONITOR_NORM].trapEnable = true;
+  traps[CONNECT_MONITOR_NORM].handle = GetConnectMonitorStr; /* ConnectMonitor */
+}
+
+/**
+  * @brief  Отправка обычного трапа с сообщением, зарегистрированного в базе.
+  * @retval 
+  */
+bool SNMP_SendMessageTrap(TRAP_t trap, char* str, uint8_t len)
+{
+  const uint8_t maxMsgLen = 30;
+  char msg[30];
+  struct snmp_varbind *vb;
+  struct snmp_obj_id trapObjId = {11, {1, 3, 6, 1, 4, 1, 41752, 911, 1, 2, 1}};
+
+  if (len <= maxMsgLen)
+  {
+    trapObjId.id[trapObjId.len - 1] = trap.trapId;
+	
+	strcpy(msg, str);
+	
+    vb = snmp_varbind_alloc(&trapObjId, SNMP_ASN1_OPAQUE, strlen(msg));
+	
+	vb->value = msg;
+	            
+    trap_msg.outvb.head = vb;
+    trap_msg.outvb.tail = vb;
+    trap_msg.outvb.count = 1;
+	
+    snmp_send_trap(SNMP_GENTRAP_ENTERPRISESPC, &trapObjId, 0);
+     
+    trap_msg.outvb.head = NULL;
+    trap_msg.outvb.tail = NULL;
+    trap_msg.outvb.count = 0;
+     
+	snmp_varbind_list_free(&trap_msg.outvb);
+    snmp_varbind_free(vb);  
+	
+	return true;
+  }
+  else
+	return false;
+}
+
+/**
+  * @brief  Отправка трапа с переменной, зарегистрированного в базе.
+  * @retval 
+  */
+bool SNMP_SendVarbindTrap(TRAP_t *trap)
+{
+  char msg[255];
+  uint8_t len = 0;
+  struct snmp_varbind *vb;
+  struct snmp_obj_id trapObjId = {11, {1, 3, 6, 1, 4, 1, 41752, 911, 1, 2, 1}};
+  struct snmp_obj_id varObjId  = {11, {1, 3, 6, 1, 4, 1, 41752, 911, 1, 1, 1}};
+  
+  trapObjId.id[trapObjId.len - 1] = trap->trapId;
+  varObjId.id[varObjId.len - 1] = trap->varbindId;
+    
+  trap->handle(msg, &len);
+  vb = snmp_varbind_alloc(&varObjId, SNMP_ASN1_OC_STR, len);
+    
+  if(vb != NULL ) {
+        memcpy(vb->value, msg, len);
+  
+	snmp_varbind_tail_add(&trap_msg.outvb, vb);
+			
+        snmp_send_trap(SNMP_GENTRAP_ENTERPRISESPC, &trapObjId, 0);
+	  
+        snmp_varbind_list_free(&trap_msg.outvb);
+  
+        return true;
+  }
+  else {
+        return false;
+  }
+}  
+
+
+/********************************* (C) ROTEK **********************************/

+ 82 - 0
modules/Ethernet/trap_api.h

@@ -0,0 +1,82 @@
+/********************************* (C) РОТЕК ***********************************
+ * @module  trap_api
+ * @file    trap_api.h
+ * @version 1.0.0
+ * @date    XX.XX.XXXX
+ * $brief   trap_api
+ *******************************************************************************
+ * @history     Version  Author         Comment
+ * XX.XX.XXXX   1.0.0    Telenkov D.A.  First release.
+ *******************************************************************************
+ */
+
+/* Define to prevent recursive  ----------------------------------------------*/
+#ifndef TRAP_API_H
+#define TRAP_API_H
+
+#include <stdbool.h>
+
+typedef enum
+{
+  SIMPLE_TRAP = 0,
+  VARBIND_TRAP,
+  
+} TRAP_TYPE_t;
+
+typedef enum
+{
+  FW_VERSION_UPDATE = 1,
+  FW_VERSION_UPDATED,
+  DEVICE_RESTORED,
+  DEVICE_REBOOTED,
+  BATTERY_TEMPERATURE_NORM,
+  BATTERY_TEMPERATURE_ALARM,
+  LINE_ALARM,
+  LINE_NORM,
+  LOW_BAT_ALARM,
+  LOW_BAT_NORM,
+  POWER_ALARM,
+  POWER_NORM,
+  CONNECT_MONITOR_ALARM,
+  CONNECT_MONITOR_NORM,
+  
+} TRAP_LIST_t;
+
+/**
+  * @brief  
+  */
+typedef struct
+{
+  TRAP_LIST_t listName;
+  uint8_t  trapId;     // ID в ветке traps
+  uint8_t  varbindId;  // ID присоединенной переменной 
+  bool     trapEnable; // false - отправка трапа не разрешена, true - отправка разрешена
+  void     (*handle)(char*, uint8_t*); 
+  
+} TRAP_t;
+
+/**
+  * @brief  Отправка обычного трапа с сообщением, зарегистрированного в базе.
+  */
+bool SNMP_SendMessageTrap(TRAP_t trap, char* msg, uint8_t len);
+
+/**
+  * @brief  Отправка трапа с переменной, зарегистрированного в базе.
+  * @retval 
+  */
+bool SNMP_SendVarbindTrap(TRAP_t *trap);
+
+/**
+  * @brief  Инициализация базы трапов
+  */
+void SNMP_InitTrapsBase(void);
+
+/**
+  * @brief  Отправка трапа, зарегистрированного в базе
+  */
+bool SNMP_SendTrap(TRAP_t trap);
+
+
+#endif /* #ifndef TRAP_API_H */
+
+/********************************* (C) РОТЕК **********************************/

+ 178 - 0
modules/HTTP_Server/fs.c

@@ -0,0 +1,178 @@
+/**
+ * Copyright (c) 2001-2003 Swedish Institute of Computer Science.
+ * All rights reserved. 
+ * 
+ * Redistribution and use in source and binary forms, with or without modification, 
+ * are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
+ * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 
+ * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
+ * OF SUCH DAMAGE.
+ *
+ * This file is part of the lwIP TCP/IP stack.
+ * 
+ * Author: Adam Dunkels <adam@sics.se>
+ *
+ **/
+#include "lwip/opt.h"
+#include "lwip/def.h"
+#include "fs.h"
+#include "fsdata.h"
+#include <string.h>
+
+/** Set this to 1 to include "fsdata_custom.c" instead of "fsdata.c" for the
+ * file system (to prevent changing the file included in CVS) */
+#ifndef HTTPD_USE_CUSTUM_FSDATA
+#define HTTPD_USE_CUSTUM_FSDATA 0
+#endif
+
+#if HTTPD_USE_CUSTUM_FSDATA
+#include "fsdata_custom.c"
+#else /* HTTPD_USE_CUSTUM_FSDATA */
+#include "fsdata.c"
+#endif /* HTTPD_USE_CUSTUM_FSDATA */
+
+/*-----------------------------------------------------------------------------------*/
+/* Define the number of open files that we can support. */
+#ifndef LWIP_MAX_OPEN_FILES
+#define LWIP_MAX_OPEN_FILES     10
+#endif
+
+/* Define the file system memory allocation structure. */
+struct fs_table {
+  struct fs_file file;
+  u8_t inuse;
+};
+
+/* Allocate file system memory */
+struct fs_table fs_memory[LWIP_MAX_OPEN_FILES];
+
+#if LWIP_HTTPD_CUSTOM_FILES
+int fs_open_custom(struct fs_file *file, const char *name);
+void fs_close_custom(struct fs_file *file);
+#endif /* LWIP_HTTPD_CUSTOM_FILES */
+
+
+/*-----------------------------------------------------------------------------------*/
+static struct fs_file *
+fs_malloc(void)
+{
+  int i;
+  for(i = 0; i < LWIP_MAX_OPEN_FILES; i++) {
+    if(fs_memory[i].inuse == 0) {
+      fs_memory[i].inuse = 1;
+      return(&fs_memory[i].file);
+    }
+  }
+  return(NULL);
+}
+
+/*-----------------------------------------------------------------------------------*/
+static void
+fs_free(struct fs_file *file)
+{
+  int i;
+  for(i = 0; i < LWIP_MAX_OPEN_FILES; i++) {
+    if(&fs_memory[i].file == file) {
+      fs_memory[i].inuse = 0;
+      break;
+    }
+  }
+  return;
+}
+
+/*-----------------------------------------------------------------------------------*/
+struct fs_file *
+fs_open(const char *name)
+{
+  struct fs_file *file;
+  const struct fsdata_file *f;
+
+  file = fs_malloc();
+  if(file == NULL) {
+    return NULL;
+  }
+
+#if LWIP_HTTPD_CUSTOM_FILES
+  if(fs_open_custom(file, name)) {
+    file->is_custom_file = 1;
+    return file;
+  }
+  file->is_custom_file = 0;
+#endif /* LWIP_HTTPD_CUSTOM_FILES */
+
+  for(f = FS_ROOT; f != NULL; f = f->next) {
+    if (!strcmp(name, (char *)f->name)) {
+      file->data = (const char *)f->data;
+      file->len = f->len;
+      file->index = f->len;
+      file->pextension = NULL;
+      file->http_header_included = f->http_header_included;
+#if HTTPD_PRECALCULATED_CHECKSUM
+      file->chksum_count = f->chksum_count;
+      file->chksum = f->chksum;
+#endif /* HTTPD_PRECALCULATED_CHECKSUM */
+#if LWIP_HTTPD_FILE_STATE
+      file->state = fs_state_init(file, name);
+#endif /* #if LWIP_HTTPD_FILE_STATE */
+      return file;
+    }
+  }
+  fs_free(file);
+  return NULL;
+}
+
+/*-----------------------------------------------------------------------------------*/
+void
+fs_close(struct fs_file *file)
+{
+#if LWIP_HTTPD_CUSTOM_FILES
+  if (file->is_custom_file) {
+    fs_close_custom(file);
+  }
+#endif /* LWIP_HTTPD_CUSTOM_FILES */
+#if LWIP_HTTPD_FILE_STATE
+  fs_state_free(file, file->state);
+#endif /* #if LWIP_HTTPD_FILE_STATE */
+  fs_free(file);
+}
+/*-----------------------------------------------------------------------------------*/
+int
+fs_read(struct fs_file *file, char *buffer, int count)
+{
+  int read;
+
+  if(file->index == file->len) {
+    return -1;
+  }
+
+  read = file->len - file->index;
+  if(read > count) {
+    read = count;
+  }
+
+  MEMCPY(buffer, (file->data + file->index), read);
+  file->index += read;
+
+  return(read);
+}
+/*-----------------------------------------------------------------------------------*/
+int fs_bytes_left(struct fs_file *file)
+{
+  return file->len - file->index;
+}

+ 101 - 0
modules/HTTP_Server/fs.h

@@ -0,0 +1,101 @@
+/**
+ * Copyright (c) 2001-2003 Swedish Institute of Computer Science.
+ * All rights reserved. 
+ * 
+ * Redistribution and use in source and binary forms, with or without modification, 
+ * are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
+ * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 
+ * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
+ * OF SUCH DAMAGE.
+ *
+ * This file is part of the lwIP TCP/IP stack.
+ * 
+ * Author: Adam Dunkels <adam@sics.se>
+ *
+ **/
+#ifndef __FS_H__
+#define __FS_H__
+
+#include "lwip/opt.h"
+
+/** Set this to 1 and provide the functions:
+ * - "int fs_open_custom(struct fs_file *file, const char *name)"
+ *    Called first for every opened file to allow opening files
+ *    that are not included in fsdata(_custom).c
+ * - "void fs_close_custom(struct fs_file *file)"
+ *    Called to free resources allocated by fs_open_custom().
+ */
+#ifndef LWIP_HTTPD_CUSTOM_FILES
+#define LWIP_HTTPD_CUSTOM_FILES       0
+#endif
+
+/** Set this to 1 to include an application state argument per file
+ * that is opened. This allows to keep a state per connection/file.
+ */
+#ifndef LWIP_HTTPD_FILE_STATE
+#define LWIP_HTTPD_FILE_STATE         0
+#endif
+
+/** HTTPD_PRECALCULATED_CHECKSUM==1: include precompiled checksums for
+ * predefined (MSS-sized) chunks of the files to prevent having to calculate
+ * the checksums at runtime. */
+#ifndef HTTPD_PRECALCULATED_CHECKSUM
+#define HTTPD_PRECALCULATED_CHECKSUM  0
+#endif
+
+#if HTTPD_PRECALCULATED_CHECKSUM
+struct fsdata_chksum {
+  u32_t offset;
+  u16_t chksum;
+  u16_t len;
+};
+#endif /* HTTPD_PRECALCULATED_CHECKSUM */
+
+struct fs_file {
+  const char *data;
+  int len;
+  int index;
+  void *pextension;
+#if HTTPD_PRECALCULATED_CHECKSUM
+  const struct fsdata_chksum *chksum;
+  u16_t chksum_count;
+#endif /* HTTPD_PRECALCULATED_CHECKSUM */
+  u8_t http_header_included;
+#if LWIP_HTTPD_CUSTOM_FILES
+  u8_t is_custom_file;
+#endif /* LWIP_HTTPD_CUSTOM_FILES */
+#if LWIP_HTTPD_FILE_STATE
+  void *state;
+#endif /* LWIP_HTTPD_FILE_STATE */
+};
+
+struct fs_file *fs_open(const char *name);
+void fs_close(struct fs_file *file);
+int fs_read(struct fs_file *file, char *buffer, int count);
+int fs_bytes_left(struct fs_file *file);
+struct fs_file *fs_open(const char *name);
+
+#if LWIP_HTTPD_FILE_STATE
+/** This user-defined function is called when a file is opened. */
+void *fs_state_init(struct fs_file *file, const char *name);
+/** This user-defined function is called when a file is closed. */
+void fs_state_free(struct fs_file *file, void *state);
+#endif /* #if LWIP_HTTPD_FILE_STATE */
+
+#endif /* __FS_H__ */

BIN
modules/HTTP_Server/fs/favicon.ico


BIN
modules/HTTP_Server/fs/index.html


BIN
modules/HTTP_Server/fs/info.html


BIN
modules/HTTP_Server/fs/main.css


BIN
modules/HTTP_Server/fs/main.js


BIN
modules/HTTP_Server/fs/rotek.png


BIN
modules/HTTP_Server/fs/settings.html


+ 1894 - 0
modules/HTTP_Server/fsdata.c

@@ -0,0 +1,1894 @@
+#include "lwip/def.h"
+#include "fsdata.h"
+
+
+#define file_NULL (struct fsdata_file *) NULL
+
+
+static const unsigned int dummy_align__favicon_ico = 0;
+static const unsigned char data__favicon_ico[] = {
+/* /favicon.ico (13 chars) */
+0x2f,0x66,0x61,0x76,0x69,0x63,0x6f,0x6e,0x2e,0x69,0x63,0x6f,0x00,0x00,0x00,0x00,
+
+/* HTTP header */
+/* "HTTP/1.1 200 OK
+" (17 bytes) */
+0x48,0x54,0x54,0x50,0x2f,0x31,0x2e,0x31,0x20,0x32,0x30,0x30,0x20,0x4f,0x4b,0x0d,
+0x0a,
+/* "Server: lwIP/1.3.1 (http://savannah.nongnu.org/projects/lwip)
+" (63 bytes) */
+0x53,0x65,0x72,0x76,0x65,0x72,0x3a,0x20,0x6c,0x77,0x49,0x50,0x2f,0x31,0x2e,0x33,
+0x2e,0x31,0x20,0x28,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x73,0x61,0x76,0x61,0x6e,
+0x6e,0x61,0x68,0x2e,0x6e,0x6f,0x6e,0x67,0x6e,0x75,0x2e,0x6f,0x72,0x67,0x2f,0x70,
+0x72,0x6f,0x6a,0x65,0x63,0x74,0x73,0x2f,0x6c,0x77,0x69,0x70,0x29,0x0d,0x0a,
+/* "Content-Length: 1150
+" (18+ bytes) */
+0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x4c,0x65,0x6e,0x67,0x74,0x68,0x3a,0x20,
+0x31,0x31,0x35,0x30,0x0d,0x0a,
+/* "Connection: Close
+" (19 bytes) */
+0x43,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x69,0x6f,0x6e,0x3a,0x20,0x43,0x6c,0x6f,0x73,
+0x65,0x0d,0x0a,
+/* "Content-type: image/x-icon
+Cache-Control: private, max-age=86400
+
+" (69 bytes) */
+0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x74,0x79,0x70,0x65,0x3a,0x20,0x69,0x6d,
+0x61,0x67,0x65,0x2f,0x78,0x2d,0x69,0x63,0x6f,0x6e,0x0d,0x0a,0x43,0x61,0x63,0x68,
+0x65,0x2d,0x43,0x6f,0x6e,0x74,0x72,0x6f,0x6c,0x3a,0x20,0x70,0x72,0x69,0x76,0x61,
+0x74,0x65,0x2c,0x20,0x6d,0x61,0x78,0x2d,0x61,0x67,0x65,0x3d,0x38,0x36,0x34,0x30,
+0x30,0x0d,0x0a,0x0d,0x0a,
+/* raw file data (1150 bytes) */
+0x00,0x00,0x01,0x00,0x01,0x00,0x10,0x10,0x00,0x00,0x00,0x00,0x20,0x00,0x68,0x04,
+0x00,0x00,0x16,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x20,0x00,
+0x00,0x00,0x01,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x40,0x04,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,
+0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xd2,0xd2,0xd2,0xff,0xd2,0xd2,
+0xd2,0xff,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0x8d,0x8d,0x8d,0xff,0x84,0x84,0x84,0xff,0x89,0x89,0x89,0xff,0x89,0x89,
+0x89,0xff,0x84,0x84,0x84,0xff,0x8d,0x8d,0x8d,0xff,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xa4,0xa4,0xa4,0xff,0x84,0x84,
+0x84,0xff,0xae,0xae,0xae,0xff,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0xff,0xff,0xff,0x01,0xae,0xae,0xae,0xff,0x84,0x84,0x84,0xff,0xa4,0xa4,
+0xa4,0xff,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0x81,0x81,0x81,0xff,0xff,0xff,
+0xff,0x01,0xff,0xff,0xff,0x01,0xa0,0xa0,0xa0,0xff,0x9a,0x9a,0x9a,0xff,0xff,0xff,
+0xff,0x01,0xc7,0xc7,0xc7,0xff,0x8f,0x8f,0x8f,0xff,0x85,0x85,0x85,0xff,0x85,0x85,
+0x85,0xff,0x8f,0x8f,0x8f,0xff,0xca,0xca,0xca,0xff,0xff,0xff,0xff,0x01,0xd5,0xd5,
+0xd5,0xff,0xff,0xff,0xff,0x01,0x77,0x77,0x77,0xff,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0xd5,0xd5,0xd5,0xff,0x84,0x84,0x84,0xff,0xff,0xff,0xff,0x01,0xa8,0xa8,
+0xa8,0xff,0x8c,0x8c,0x8c,0xff,0xbb,0xbb,0xbb,0xff,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0xba,0xba,0xba,0xff,0xaf,0xaf,0xaf,0xff,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0x65,0x64,0x5b,0xff,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0x98,0x98,0x98,0xff,0xb0,0xb0,0xb0,0xff,0xd5,0xd5,0xd5,0xff,0x84,0x84,
+0x84,0xff,0xda,0xda,0xda,0xff,0x95,0x95,0x95,0xff,0x84,0x84,0x84,0xff,0x9d,0x9d,
+0x9d,0xff,0xd7,0xd7,0xd7,0xff,0xff,0xff,0xff,0x01,0x98,0x98,0x97,0xff,0x7b,0x7a,
+0x73,0xff,0xdb,0xce,0x79,0xff,0xd2,0xc0,0x55,0xff,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0x93,0x93,0x93,0xff,0xff,0xff,0xff,0x01,0xa4,0xa4,0xa4,0xff,0xbe,0xbe,
+0xbe,0xff,0xbd,0xbd,0xbd,0xff,0xd1,0xd1,0xd1,0xff,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0xb5,0xb4,0xae,0xff,0x5f,0x5f,0x5d,0xff,0x9d,0x97,0x6b,0xff,0xd2,0xc0,
+0x55,0xff,0xff,0xff,0xff,0x01,0xc9,0xb5,0x35,0xff,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0xf0,0xf0,0xf0,0xff,0xff,0xff,0xff,0x01,0xf1,0xf1,0xf1,0xff,0xff,0xff,
+0xff,0x01,0xd5,0xd5,0xd5,0xff,0xd0,0xcf,0xce,0xff,0x85,0x85,0x85,0xff,0x60,0x60,
+0x60,0xff,0x94,0x91,0x85,0xff,0xca,0xb5,0x37,0xff,0xff,0xff,0xff,0x01,0xcc,0xb9,
+0x41,0xff,0xff,0xff,0xff,0x01,0xc9,0xb4,0x33,0xff,0xff,0xff,0xff,0x01,0x62,0x62,
+0x62,0xff,0x5e,0x5d,0x5c,0xff,0x5c,0x5c,0x5c,0xff,0x5e,0x5d,0x5c,0xff,0x61,0x61,
+0x60,0xff,0x67,0x65,0x5b,0xff,0x86,0x84,0x7b,0xff,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0xff,0xff,0xff,0x01,0xca,0xb5,0x37,0xff,0xff,0xff,0xff,0x01,0xcc,0xb9,
+0x41,0xff,0xff,0xff,0xff,0x01,0xc9,0xb4,0x33,0xff,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0xc9,0xb5,0x35,0xff,0xff,0xff,0xff,0x01,0xd2,0xc0,0x55,0xff,0xff,0xff,
+0xff,0x01,0xd4,0xc4,0x5e,0xff,0xd4,0xc3,0x5c,0xff,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0xd4,0xc3,0x5c,0xff,0xd4,0xc4,0x5e,0xff,0xdb,0xce,0x79,0xff,0xd2,0xc0,
+0x55,0xff,0xff,0xff,0xff,0x01,0xc9,0xb5,0x35,0xff,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0xd1,0xc0,0x54,0xff,0xdc,0xcf,0x7d,0xff,0xff,0xff,0xff,0x01,0xc9,0xb4,
+0x33,0xff,0xff,0xff,0xff,0x01,0xd0,0xbe,0x50,0xff,0xc9,0xb4,0x33,0xff,0xc9,0xb4,
+0x33,0xff,0xd2,0xc0,0x55,0xff,0xff,0xff,0xff,0x01,0xc9,0xb4,0x33,0xff,0xff,0xff,
+0xff,0x01,0xdb,0xce,0x79,0xff,0xd2,0xc0,0x55,0xff,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0xff,0xff,0xff,0x01,0xc9,0xb4,0x33,0xff,0xff,0xff,0xff,0x01,0xd9,0xca,
+0x6f,0xff,0xcc,0xb9,0x41,0xff,0xe1,0xd6,0x8f,0xff,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0xe0,0xd5,0x8c,0xff,0xcc,0xb9,0x40,0xff,0xdb,0xce,0x79,0xff,0xff,0xff,
+0xff,0x01,0xc9,0xb4,0x33,0xff,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0xff,0xff,0xff,0x01,0xd5,0xc5,0x62,0xff,0xd2,0xc1,0x58,0xff,0xff,0xff,
+0xff,0x01,0xff,0xff,0xff,0x01,0xce,0xbb,0x46,0xff,0xc9,0xb5,0x35,0xff,0xc9,0xb5,
+0x35,0xff,0xce,0xbb,0x46,0xff,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xd2,0xc0,
+0x55,0xff,0xd5,0xc5,0x62,0xff,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xd7,0xc8,0x69,0xff,0xc9,0xb4,
+0x33,0xff,0xdb,0xce,0x79,0xff,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0xff,0xff,0xff,0x01,0xdb,0xce,0x79,0xff,0xc9,0xb4,0x33,0xff,0xd7,0xc8,
+0x69,0xff,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x0d,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0xcd,0xb9,0x42,0xff,0xc9,0xb4,0x33,0xff,0xcb,0xb7,0x3b,0xff,0xcb,0xb7,
+0x3b,0xff,0xc9,0xb4,0x33,0xff,0xcd,0xb9,0x42,0xff,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xeb,0xe4,0xb5,0xff,0xeb,0xe4,
+0xb5,0xff,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,
+0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0xff,0xff,0xff,0x01,0x00,0x00,
+0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,
+0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,
+0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,
+0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,0xff,0xff,};
+
+static const unsigned int dummy_align__index_html = 1;
+static const unsigned char data__index_html[] = {
+/* /index.html (12 chars) */
+0x2f,0x69,0x6e,0x64,0x65,0x78,0x2e,0x68,0x74,0x6d,0x6c,0x00,
+
+/* HTTP header */
+/* "HTTP/1.1 200 OK
+" (17 bytes) */
+0x48,0x54,0x54,0x50,0x2f,0x31,0x2e,0x31,0x20,0x32,0x30,0x30,0x20,0x4f,0x4b,0x0d,
+0x0a,
+/* "Server: lwIP/1.3.1 (http://savannah.nongnu.org/projects/lwip)
+" (63 bytes) */
+0x53,0x65,0x72,0x76,0x65,0x72,0x3a,0x20,0x6c,0x77,0x49,0x50,0x2f,0x31,0x2e,0x33,
+0x2e,0x31,0x20,0x28,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x73,0x61,0x76,0x61,0x6e,
+0x6e,0x61,0x68,0x2e,0x6e,0x6f,0x6e,0x67,0x6e,0x75,0x2e,0x6f,0x72,0x67,0x2f,0x70,
+0x72,0x6f,0x6a,0x65,0x63,0x74,0x73,0x2f,0x6c,0x77,0x69,0x70,0x29,0x0d,0x0a,
+/* "Content-Length: 905
+" (18+ bytes) */
+0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x4c,0x65,0x6e,0x67,0x74,0x68,0x3a,0x20,
+0x39,0x30,0x35,0x0d,0x0a,
+/* "Connection: Close
+" (19 bytes) */
+0x43,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x69,0x6f,0x6e,0x3a,0x20,0x43,0x6c,0x6f,0x73,
+0x65,0x0d,0x0a,
+/* "Content-type: text/html
+Content-Encoding: gzip
+
+" (51 bytes) */
+0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x74,0x79,0x70,0x65,0x3a,0x20,0x74,0x65,
+0x78,0x74,0x2f,0x68,0x74,0x6d,0x6c,0x0d,0x0a,0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,
+0x2d,0x45,0x6e,0x63,0x6f,0x64,0x69,0x6e,0x67,0x3a,0x20,0x67,0x7a,0x69,0x70,0x0d,
+0x0a,0x0d,0x0a,
+/* raw file data (905 bytes) */
+0x1f,0x8b,0x08,0x00,0x00,0x00,0x00,0x00,0x04,0x0a,0x9d,0x55,0x5d,0x6f,0xd4,0x46,
+0x14,0xfd,0x2b,0x53,0xf7,0x25,0x91,0x62,0xb6,0xbc,0x21,0x75,0x6d,0x29,0x04,0x2a,
+0xf1,0x54,0x84,0xda,0xaa,0x3c,0x45,0xb3,0xf6,0xdd,0x78,0xa8,0xbf,0xf0,0x5c,0xef,
+0x26,0x6f,0x21,0x14,0x5a,0x09,0xa4,0x45,0x48,0x48,0xbc,0x00,0x7f,0x21,0x14,0xb6,
+0x4d,0xd2,0x4d,0xf8,0x0b,0xe3,0x7f,0xd4,0x33,0xe3,0x35,0x5d,0x12,0x2b,0xd0,0x3e,
+0xd8,0xde,0x6b,0xcf,0x3d,0xf7,0xcc,0xb9,0xe7,0xee,0x0c,0xbf,0xba,0xf1,0xfd,0xd6,
+0x0f,0x77,0x6f,0xdf,0x14,0x09,0x67,0x69,0x38,0xb4,0x77,0x91,0xca,0x7c,0x27,0xf0,
+0x3c,0x44,0x24,0xe3,0x70,0x98,0x11,0x4b,0x11,0x25,0xb2,0xd2,0xc4,0x81,0x57,0xf3,
+0xd8,0xbf,0x86,0x6f,0xee,0x6d,0xc2,0x5c,0xfa,0x74,0xbf,0x56,0x93,0xc0,0xfb,0xd9,
+0xff,0x71,0xd3,0xdf,0x2a,0xb2,0x52,0xb2,0x1a,0xa5,0xe4,0x89,0xa8,0xc8,0x99,0x72,
+0xa4,0xdc,0xba,0x19,0x50,0xbc,0x43,0x5d,0x52,0x2e,0x33,0x0a,0xbc,0x89,0xa2,0x69,
+0x59,0x54,0xbc,0xb2,0x6e,0xaa,0x62,0x4e,0x82,0x98,0x26,0x2a,0x22,0xdf,0x05,0x1b,
+0x2a,0x57,0xac,0x64,0xea,0xeb,0x48,0xa6,0x14,0x5c,0xdd,0xc8,0xe4,0xae,0xca,0xea,
+0xec,0x63,0x5c,0x6b,0xaa,0x5c,0x20,0x51,0x32,0xf8,0x06,0x25,0x58,0x71,0x4a,0xa1,
+0x79,0x63,0x0e,0x9b,0x7d,0x73,0x68,0x16,0x66,0xde,0x1c,0x34,0xfb,0xcd,0x93,0xe1,
+0xa0,0xfd,0x32,0x4c,0x55,0xfe,0x8b,0x48,0x2a,0x1a,0x07,0x5e,0x26,0x55,0x7e,0x25,
+0xd2,0xda,0x13,0x15,0xa5,0x81,0xa7,0x79,0x2f,0x25,0x9d,0x10,0x31,0x70,0x06,0xed,
+0xe6,0x47,0x45,0xbc,0x17,0x0e,0x63,0x35,0x11,0x51,0x2a,0xb5,0x0e,0xbc,0x5c,0x4e,
+0x46,0xb2,0x12,0xed,0xc3,0x8f,0x69,0x2c,0xeb,0x94,0xbb,0x70,0xac,0x76,0x29,0xf6,
+0xb9,0x28,0x01,0x70,0x21,0xc7,0xb7,0x88,0x54,0xb5,0x9f,0xc2,0xa1,0x5c,0x92,0x50,
+0x79,0x4c,0xbb,0x57,0xac,0xf0,0x90,0xa2,0xad,0x91,0x16,0x3b,0x85,0xa5,0x20,0x71,
+0x01,0xa6,0xbb,0x77,0x19,0x5f,0x7b,0x42,0xc5,0x60,0x4f,0x79,0xed,0x2b,0xa8,0xbc,
+0x5c,0x5a,0xa7,0x5d,0x3e,0xc8,0x75,0x8c,0xf0,0xb3,0x5d,0x6d,0x7f,0x84,0xd8,0xfc,
+0xa5,0x85,0x65,0xc4,0x6a,0x82,0x46,0xf5,0xc9,0x67,0xc9,0xd8,0xf4,0x55,0x08,0x38,
+0x82,0x55,0xbe,0xa3,0x5b,0xfa,0xa1,0x79,0x05,0xd5,0x1f,0x58,0xbd,0xcd,0x99,0x39,
+0x36,0x27,0xe6,0xa8,0xdd,0xc3,0xf9,0x34,0x95,0x8f,0x8b,0x2e,0xe5,0xa5,0x39,0x6d,
+0x7e,0x35,0x67,0x48,0x59,0x20,0xf9,0xb1,0x39,0x6a,0x66,0xff,0x26,0x0d,0x6a,0x78,
+0xb2,0x95,0x60,0x45,0xce,0x69,0x25,0xcb,0x12,0x42,0x3a,0x15,0x96,0x2e,0xc3,0xde,
+0x92,0xab,0xbd,0xbc,0xf1,0x7a,0xb5,0x17,0xa5,0xcc,0x29,0x15,0xee,0xde,0x75,0x0f,
+0xb9,0x2b,0xe8,0xed,0x27,0xdb,0x2b,0xec,0xac,0xad,0xa1,0x6f,0x17,0x53,0xdb,0x38,
+0xf3,0xd2,0xee,0x0e,0x64,0x7f,0x33,0xa7,0xe6,0xc8,0x9c,0x08,0xf3,0x01,0x7c,0x0f,
+0x60,0x33,0x84,0x96,0xb7,0x6b,0xd6,0x05,0x2c,0xeb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0xe6,0xf6,0x04,0xbd,0xb6,0x63,0xff,0xf4,0x02,0xfe,0x05,0x93,
+0x8e,0x24,0x6f,0x47,0xd2,0xfe,0x3f,0xf6,0xc8,0xbc,0x1c,0x01,0x70,0x7d,0xe8,0xfe,
+0x44,0xac,0xe3,0x4f,0xb1,0x03,0x98,0xea,0x00,0x7c,0x17,0x18,0xb7,0x39,0x98,0x63,
+0x07,0x58,0x80,0x67,0x8f,0x98,0x2a,0xcf,0xa9,0xda,0x66,0xca,0x2e,0x2d,0xf1,0xda,
+0xcd,0x31,0xba,0xd5,0xfc,0x0e,0xdc,0x39,0xa2,0x99,0x40,0x60,0x45,0x59,0xd8,0x6a,
+0xf6,0xe4,0x78,0x6b,0x0d,0xec,0xce,0x8d,0xf3,0x83,0x66,0xf7,0xc0,0x2a,0xa3,0xed,
+0x94,0xc6,0xee,0xa8,0x38,0x3f,0x73,0x9f,0x36,0xae,0x15,0x79,0x79,0x6f,0xcf,0x13,
+0x1d,0x55,0xaa,0x64,0xc1,0x7b,0x25,0x4e,0x42,0xa6,0x5d,0x1e,0xdc,0x93,0x13,0xd9,
+0xbe,0xf5,0x84,0xae,0xa2,0xe5,0xd9,0x74,0x4f,0x3b,0xa1,0xdc,0x6a,0x4c,0xfa,0x65,
+0x59,0x61,0x2c,0x59,0x7e,0x87,0x03,0xe6,0x56,0xbe,0xb6,0xbe,0x51,0xca,0x4a,0x66,
+0xfa,0x0e,0x61,0xd0,0x74,0xb2,0xb6,0xfe,0x2d,0xd4,0x5e,0x82,0x0c,0xdc,0x41,0xff,
+0x0f,0x1e,0xf1,0x43,0xea,0xf8,0x07,0x00,0x00,};
+
+static const unsigned int dummy_align__info_html = 2;
+static const unsigned char data__info_html[] = {
+/* /info.html (11 chars) */
+0x2f,0x69,0x6e,0x66,0x6f,0x2e,0x68,0x74,0x6d,0x6c,0x00,0x00,
+
+/* HTTP header */
+/* "HTTP/1.1 200 OK
+" (17 bytes) */
+0x48,0x54,0x54,0x50,0x2f,0x31,0x2e,0x31,0x20,0x32,0x30,0x30,0x20,0x4f,0x4b,0x0d,
+0x0a,
+/* "Server: lwIP/1.3.1 (http://savannah.nongnu.org/projects/lwip)
+" (63 bytes) */
+0x53,0x65,0x72,0x76,0x65,0x72,0x3a,0x20,0x6c,0x77,0x49,0x50,0x2f,0x31,0x2e,0x33,
+0x2e,0x31,0x20,0x28,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x73,0x61,0x76,0x61,0x6e,
+0x6e,0x61,0x68,0x2e,0x6e,0x6f,0x6e,0x67,0x6e,0x75,0x2e,0x6f,0x72,0x67,0x2f,0x70,
+0x72,0x6f,0x6a,0x65,0x63,0x74,0x73,0x2f,0x6c,0x77,0x69,0x70,0x29,0x0d,0x0a,
+/* "Content-Length: 1102
+" (18+ bytes) */
+0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x4c,0x65,0x6e,0x67,0x74,0x68,0x3a,0x20,
+0x31,0x31,0x30,0x32,0x0d,0x0a,
+/* "Connection: Close
+" (19 bytes) */
+0x43,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x69,0x6f,0x6e,0x3a,0x20,0x43,0x6c,0x6f,0x73,
+0x65,0x0d,0x0a,
+/* "Content-type: text/html
+Content-Encoding: gzip
+
+" (51 bytes) */
+0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x74,0x79,0x70,0x65,0x3a,0x20,0x74,0x65,
+0x78,0x74,0x2f,0x68,0x74,0x6d,0x6c,0x0d,0x0a,0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,
+0x2d,0x45,0x6e,0x63,0x6f,0x64,0x69,0x6e,0x67,0x3a,0x20,0x67,0x7a,0x69,0x70,0x0d,
+0x0a,0x0d,0x0a,
+/* raw file data (1102 bytes) */
+0x1f,0x8b,0x08,0x00,0x00,0x00,0x00,0x00,0x04,0x0a,0x9d,0x56,0xdd,0x6e,0xdb,0x36,
+0x14,0x7e,0x15,0x96,0xdb,0x45,0x0c,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7e,0x6a,0xcf,0xea,0x17,0xe1,0xd0,0xdb,0xc2,0x4c,0xc8,0x87,0x64,0xaa,0xf9,
+0x38,0xa2,0x39,0x13,0x72,0x90,0x94,0x25,0x25,0x9a,0x67,0x11,0x2d,0xcd,0x61,0xc6,
+0xcb,0x29,0xe7,0x06,0x32,0x0d,0xfd,0xf1,0x47,0x2a,0x3d,0x8c,0xc3,0x54,0xcc,0x48,
+0x92,0xb1,0xb2,0x8c,0xa8,0x64,0xb3,0x11,0xd3,0xc4,0x7f,0x05,0x29,0x1f,0xb3,0x2a,
+0x33,0xed,0x72,0x2c,0x0e,0x78,0x1a,0x18,0x55,0x40,0x82,0x6b,0x31,0x01,0x66,0xe4,
+0xda,0x9b,0xe2,0x90,0x35,0x4d,0x08,0x99,0xf2,0x83,0x01,0x42,0x0f,0x60,0xf8,0x1a,
+0x99,0x9a,0x28,0x6c,0x81,0xc1,0x03,0x69,0xda,0xcf,0x36,0xe2,0x03,0x4a,0x44,0x0a,
+0xdd,0x73,0x59,0x05,0x02,0x70,0x6e,0x5c,0xab,0xac,0x8d,0x87,0xe6,0xda,0x8e,0xe0,
+0xd5,0x7b,0xe3,0x4b,0x0c,0x87,0x5f,0x5b,0x38,0xb6,0xbf,0x02,0x4e,0x47,0x76,0x0e,
+0x78,0x2d,0xea,0x93,0xfa,0xa8,0x7e,0xe6,0xab,0xa3,0xff,0xd5,0x18,0x20,0x81,0x11,
+0x72,0x52,0xfa,0x7e,0x63,0xfb,0x33,0x84,0x1d,0x63,0x80,0xbd,0xb0,0x6f,0xec,0x5f,
+0xf6,0x6c,0x7d,0x98,0x90,0x63,0xd5,0x3d,0x22,0x4b,0x8c,0x98,0x01,0x29,0xd6,0x5f,
+0x15,0x1e,0x1c,0xcb,0x0e,0x2b,0x60,0xa5,0x87,0xe0,0x0a,0x9c,0xfb,0x9a,0x15,0x05,
+0x00,0xe9,0x50,0x68,0x78,0x06,0x67,0x9b,0x6e,0xbe,0x27,0x1b,0x18,0x42,0x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,0xea,0xa4,0xf9,0xcd,0x78,0x50,0xe2,0x8d,0xfa,0xfd,0x38,0xfc,
+0xc7,0xa8,0x78,0xc2,0xcd,0xe7,0xf7,0xef,0xdd,0xdd,0xb8,0x1c,0x25,0xfd,0x71,0x25,
+0xdd,0x78,0xd9,0x90,0xbd,0x6f,0x3f,0xdc,0xa0,0x8d,0x96,0x7b,0x03,0x21,0x81,0x5b,
+0x9f,0xed,0xed,0xdc,0x89,0xe4,0xc0,0x6f,0xf6,0xc1,0x9c,0x3b,0xdd,0x76,0xad,0x6e,
+0x0f,0x8d,0xad,0x1a,0xbb,0xe6,0x66,0x17,0x1d,0x2e,0x55,0xd7,0x75,0x59,0xed,0xbb,
+0x12,0x8d,0xc4,0xba,0x2e,0x8d,0xf0,0xd0,0xc1,0x0b,0xa8,0x6b,0x76,0x7b,0x68,0xf4,
+0x3a,0xe8,0x0d,0x60,0xb8,0x56,0x1c,0x5a,0x77,0x6b,0x34,0xac,0x38,0x79,0x69,0xbb,
+0xc2,0x5b,0xf4,0x68,0xf9,0x72,0xe9,0xd0,0xec,0xf4,0x2b,0x93,0xec,0x32,0xcd,0x72,
+0x84,0xc2,0x24,0x7d,0xc9,0x4d,0xfb,0xdb,0xf3,0x35,0xfc,0x1b,0x91,0x13,0x9e,0x82,
+0x65,0xcd,0xee,0xa3,0x0e,0xba,0xf0,0xbf,0x41,0x9b,0x0d,0x0a,0xbf,0x53,0x0b,0x52,
+0x3f,0x06,0x9d,0xcf,0x51,0x68,0x20,0xbb,0xe7,0x30,0xec,0x50,0x75,0xf5,0xe3,0xfa,
+0x7b,0xcf,0x0c,0xe2,0xac,0x4b,0x37,0x48,0x16,0x03,0xda,0x7b,0xd4,0xfb,0xf8,0xf2,
+0x8a,0x87,0xee,0x0f,0xd2,0xdf,0xd1,0xc2,0x82,0xd3,0x30,0x09,0x00,0x00,};
+
+static const unsigned int dummy_align__main_css = 3;
+static const unsigned char data__main_css[] = {
+/* /main.css (10 chars) */
+0x2f,0x6d,0x61,0x69,0x6e,0x2e,0x63,0x73,0x73,0x00,0x00,0x00,
+
+/* HTTP header */
+/* "HTTP/1.1 200 OK
+" (17 bytes) */
+0x48,0x54,0x54,0x50,0x2f,0x31,0x2e,0x31,0x20,0x32,0x30,0x30,0x20,0x4f,0x4b,0x0d,
+0x0a,
+/* "Server: lwIP/1.3.1 (http://savannah.nongnu.org/projects/lwip)
+" (63 bytes) */
+0x53,0x65,0x72,0x76,0x65,0x72,0x3a,0x20,0x6c,0x77,0x49,0x50,0x2f,0x31,0x2e,0x33,
+0x2e,0x31,0x20,0x28,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x73,0x61,0x76,0x61,0x6e,
+0x6e,0x61,0x68,0x2e,0x6e,0x6f,0x6e,0x67,0x6e,0x75,0x2e,0x6f,0x72,0x67,0x2f,0x70,
+0x72,0x6f,0x6a,0x65,0x63,0x74,0x73,0x2f,0x6c,0x77,0x69,0x70,0x29,0x0d,0x0a,
+/* "Content-Length: 6235
+" (18+ bytes) */
+0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x4c,0x65,0x6e,0x67,0x74,0x68,0x3a,0x20,
+0x36,0x32,0x33,0x35,0x0d,0x0a,
+/* "Connection: Close
+" (19 bytes) */
+0x43,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x69,0x6f,0x6e,0x3a,0x20,0x43,0x6c,0x6f,0x73,
+0x65,0x0d,0x0a,
+/* "Content-type: text/css
+Content-Encoding: gzip
+Cache-Control: private, max-age=86400
+
+" (89 bytes) */
+0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x74,0x79,0x70,0x65,0x3a,0x20,0x74,0x65,
+0x78,0x74,0x2f,0x63,0x73,0x73,0x0d,0x0a,0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,
+0x45,0x6e,0x63,0x6f,0x64,0x69,0x6e,0x67,0x3a,0x20,0x67,0x7a,0x69,0x70,0x0d,0x0a,
+0x43,0x61,0x63,0x68,0x65,0x2d,0x43,0x6f,0x6e,0x74,0x72,0x6f,0x6c,0x3a,0x20,0x70,
+0x72,0x69,0x76,0x61,0x74,0x65,0x2c,0x20,0x6d,0x61,0x78,0x2d,0x61,0x67,0x65,0x3d,
+0x38,0x36,0x34,0x30,0x30,0x0d,0x0a,0x0d,0x0a,
+/* raw file data (6235 bytes) */
+0x1f,0x8b,0x08,0x00,0x00,0x00,0x00,0x00,0x04,0x0a,0xd5,0x3c,0x6b,0x8f,0xe3,0x38,
+0x8e,0x7f,0xc5,0xbb,0x85,0x3e,0x4c,0x4f,0xdb,0x99,0x3c,0xeb,0xe1,0x60,0x0a,0xb7,
+0x33,0xbb,0x87,0x3b,0xe0,0x06,0xd8,0x0f,0x3b,0x9f,0xfa,0xea,0x83,0x13,0x2b,0x15,
+0x4f,0x3b,0x76,0x60,0x3b,0xd5,0xd5,0x93,0xcb,0x7f,0x3f,0x52,0x22,0x25,0xca,0xaf,
+0x64,0xe7,0x80,0x03,0x0e,0xe9,0x87,0x2d,0x51,0x12,0x49,0x91,0x14,0x45,0xd1,0xfa,
+0xe1,0xfb,0x3f,0x05,0x45,0x59,0x1d,0x92,0x3c,0xfb,0x5d,0x4d,0xb6,0x75,0x1d,0xbc,
+0x2d,0x26,0xd3,0xc9,0x3c,0xf8,0xef,0xe0,0x97,0xff,0xf8,0x47,0xf0,0x9f,0xd9,0x56,
+0x15,0xb5,0x82,0xb7,0xd7,0xac,0x99,0x64,0xe5,0x0f,0x16,0x36,0xf8,0xfe,0x87,0x49,
+0x5e,0xbe,0x96,0x61,0x52,0x35,0xd9,0x36,0x57,0x61,0x52,0x67,0xa9,0x0a,0x53,0xd5,
+0x24,0x59,0x5e,0x87,0xbb,0xec,0x75,0x9b,0x1c,0x9b,0xac,0x2c,0xf0,0xf1,0x54,0xa9,
+0x70,0x57,0x96,0x8d,0xaa,0xc2,0xbd,0x4a,0x52,0xfc,0xef,0xb5,0x2a,0x4f,0xc7,0xf0,
+0x90,0x64,0x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0xe3,0x17,0xa7,0xc3,0x46,0x55,0x2f,
+0x40,0x10,0xad,0x4d,0x9a,0xca,0x08,0x97,0xbd,0x88,0x66,0x69,0x0c,0x1a,0xec,0x8c,
+0xaa,0x24,0x34,0xeb,0x8f,0x96,0x6a,0xd1,0xb2,0xbd,0x04,0x0a,0x14,0xff,0x77,0x5a,
+0x65,0x97,0x0a,0xb1,0xa8,0xa2,0x92,0xed,0x32,0x95,0xa7,0x92,0xd3,0x84,0x81,0xa3,
+0xd4,0x14,0x44,0x60,0xe8,0xb7,0x2a,0xef,0x21,0x76,0xa8,0x81,0x5b,0x22,0x07,0x17,
+0x74,0x3d,0x38,0x08,0xae,0x95,0x8a,0xc9,0x02,0x8c,0x52,0x30,0xb9,0x47,0xdb,0x14,
+0x4c,0x1e,0xe0,0xdf,0x35,0x2b,0x63,0x30,0x3f,0xbe,0xb3,0xcc,0xa0,0x49,0xae,0xcb,
+0x3c,0x4b,0x83,0x3a,0x83,0x55,0xb1,0xd2,0xda,0x18,0x69,0xc3,0x1c,0xf1,0x2a,0xf3,
+0x8c,0x1a,0x6a,0xca,0xe2,0x64,0x87,0xee,0x8d,0x2b,0xe8,0x05,0xda,0x28,0x50,0x3c,
+0xe3,0x1f,0x44,0x4d,0x59,0xe6,0xe0,0x69,0xc8,0x86,0x5c,0xc4,0x60,0xe0,0x57,0x25,
+0xd5,0x2e,0x7b,0x67,0x18,0xfb,0x6e,0x01,0xc0,0x78,0x80,0x0b,0x05,0xf3,0xbe,0xcb,
+0x4f,0x59,0x6a,0xe1,0x5a,0xc5,0x1d,0xf0,0x0e,0x60,0xcc,0x20,0x69,0x1e,0xed,0xcb,
+0x2a,0xfb,0x1d,0x7b,0xc8,0x83,0xd4,0x76,0xd9,0x29,0xe7,0x06,0x68,0x49,0x64,0x13,
+0xf0,0x7b,0xa0,0x40,0xf3,0x89,0x47,0x19,0x03,0xe1,0x6e,0x0e,0x65,0x0a,0xab,0xb6,
+0x71,0x12,0xb9,0x9d,0x57,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xc1,0x8f,0x1a,
+0x59,0x70,0x50,0xc6,0xc9,0x91,0x59,0x25,0x68,0xda,0x43,0x69,0xdf,0xc8,0x8f,0x3b,
+0xf8,0xb1,0x71,0xfc,0xcb,0xcf,0x3f,0x2d,0x7e,0x9e,0xf6,0xaf,0x0f,0x43,0xab,0x89,
+0x31,0xe8,0x01,0xa8,0xf4,0xe7,0x6d,0x9e,0xd4,0xf5,0xf7,0x3f,0xc2,0x63,0xf4,0xe2,
+0xd6,0xa9,0xba,0x81,0x10,0xed,0xd6,0xae,0x52,0x5a,0x9d,0x40,0x4c,0xf3,0xd3,0xa1,
+0x20,0x67,0x55,0x07,0x67,0x75,0x79,0xd0,0xa4,0x5e,0x2f,0x21,0x95,0xee,0xbd,0xd2,
+0x6b,0x7d,0xab,0x3c,0x97,0x3d,0x4b,0x0d,0x36,0x16,0x18,0x79,0xa1,0xe9,0x31,0xa1,
+0x69,0x08,0xe1,0x63,0xec,0x85,0xe1,0xac,0x1c,0x68,0x9e,0xb5,0x02,0x49,0xc6,0xed,
+0x90,0x21,0x6d,0xbd,0x84,0xf7,0xb1,0x56,0x3b,0x77,0x3a,0xcc,0xec,0x2c,0xb3,0x70,
+0x9b,0x6c,0x30,0xe0,0xaa,0x07,0x38,0x5b,0x7d,0x04,0x23,0x7d,0xc5,0x4d,0x04,0x20,
+0x72,0x27,0x22,0x1d,0x41,0x0d,0x8d,0x6f,0x01,0x9b,0x21,0x8c,0x82,0x9b,0x78,0x29,
+0x17,0x99,0x9d,0x17,0xcc,0x81,0xde,0x0a,0x4a,0x90,0x96,0x0f,0x02,0xe6,0xcf,0xc0,
+0x22,0x4f,0xc0,0x57,0xe0,0x85,0x16,0x42,0xdb,0xe8,0x25,0x80,0x51,0x68,0xad,0x1e,
+0xfd,0x94,0xc2,0x48,0x18,0xd0,0xfe,0x43,0xe2,0xe5,0x23,0xf0,0x3c,0x49,0xab,0xf2,
+0x08,0xce,0x72,0x11,0xd8,0x27,0x58,0xf5,0x5f,0x5f,0xe1,0x80,0x85,0x20,0x25,0xf5,
+0x86,0x15,0xcf,0x13,0x1d,0xd1,0xf5,0x00,0xa8,0xec,0x39,0xf1,0x4b,0x5b,0xaf,0x3d,
+0xed,0x74,0xd1,0x73,0x42,0xce,0x90,0x8d,0x44,0x1a,0x36,0xe9,0xb1,0x99,0x87,0xb8,
+0x26,0xcb,0xd0,0x33,0xee,0x35,0x98,0x9f,0x68,0xf1,0x54,0xd5,0xc7,0xce,0xce,0x31,
+0x00,0x2a,0x28,0xa8,0xa8,0xb1,0x53,0xc6,0xe5,0x6c,0x2d,0x3a,0x7a,0x6c,0x39,0x8b,
+0x81,0x98,0xf4,0x28,0x83,0x28,0xbd,0x15,0x86,0xe1,0x99,0xef,0xb4,0xe1,0x65,0x8e,
+0xfc,0x22,0x18,0xd3,0x7a,0x69,0x18,0xf3,0x3b,0xd5,0x10,0xb0,0x67,0x81,0x72,0x32,
+0x26,0x97,0xdd,0x4e,0x97,0xb2,0xf2,0x06,0x94,0x24,0xf8,0x68,0x5f,0x8c,0xaa,0xe1,
+0xb8,0xe3,0x54,0x84,0x87,0x4e,0x11,0x61,0x0b,0xdb,0x5c,0xc1,0x44,0xb3,0x83,0x16,
+0x75,0x7d,0xb4,0x80,0x3d,0x23,0x1f,0xa7,0x3b,0xbc,0xab,0xbb,0x85,0x12,0x07,0x3d,
+0xd6,0x13,0xd3,0x61,0xb7,0x0b,0x44,0x8a,0x79,0xef,0xa0,0xcc,0xe4,0x50,0x75,0x8b,
+0x58,0x4b,0x90,0xa7,0xc1,0x9f,0x48,0x4b,0xfa,0x94,0xbf,0x8b,0x9a,0xf0,0xf2,0x18,
+0x37,0xe0,0xb1,0xc7,0x56,0x2b,0x14,0x58,0xa1,0xb7,0x54,0xcc,0x54,0x10,0x0f,0x27,
+0x17,0x3c,0xae,0x11,0x7c,0x56,0x3a,0x32,0x2b,0x9f,0x04,0xe0,0xcd,0x48,0x18,0xb9,
+0x64,0x19,0x24,0x9f,0x6b,0x70,0x2e,0xf4,0x42,0x62,0x6b,0xcd,0x22,0x04,0xf1,0xfa,
+0x63,0x59,0xd4,0x70,0x20,0xf9,0x4c,0x1e,0x5b,0x6b,0xbb,0xf6,0xa7,0xec,0x70,0x2c,
+0xab,0x26,0x81,0x53,0x2b,0x96,0xf4,0xb6,0x02,0x99,0x05,0x8a,0x8f,0x3c,0x19,0x6a,
+0xa4,0x14,0xa2,0x48,0xad,0x51,0x83,0xf6,0x2e,0x86,0x82,0x3b,0x68,0x5d,0x79,0x63,
+0x89,0x73,0x1b,0xa3,0xbd,0x6d,0x21,0x82,0xae,0xe3,0x27,0x83,0xbc,0x25,0xce,0xa0,
+0x28,0x6a,0xc4,0x90,0x16,0x48,0x63,0xc8,0x93,0x82,0xb0,0x7e,0x8d,0x68,0x22,0x81,
+0x84,0x10,0x74,0xdc,0x29,0x3d,0x2c,0x31,0xd2,0xb8,0x23,0x52,0x7f,0x61,0xe1,0x95,
+0xaf,0xb0,0xd0,0xfb,0x03,0xde,0xd0,0x82,0x1d,0x39,0x6d,0x03,0x79,0xde,0xfd,0x01,
+0x9d,0x9a,0xe1,0x78,0xee,0x6d,0x68,0x38,0x07,0xd1,0x86,0xb7,0x83,0x91,0x2e,0xba,
+0x85,0xcd,0x38,0xfa,0x92,0x5a,0xc1,0x2c,0xb6,0xfd,0x2d,0x0d,0xb6,0xa6,0xd2,0x2c,
+0xc4,0x2d,0x28,0xb3,0xd3,0x37,0xd3,0xa6,0x17,0xea,0xc0,0xc8,0x51,0x0b,0xcc,0x6a,
+0x1a,0x19,0x34,0xd8,0x72,0x93,0x34,0x98,0x5e,0xa9,0x15,0xcd,0x17,0x37,0x46,0x9b,
+0xe8,0xe4,0xc6,0x83,0xd4,0x51,0x12,0x5c,0xd5,0x3d,0x33,0xd3,0xc2,0x95,0x7a,0x65,
+0x58,0x96,0x86,0x3e,0xfb,0x41,0x33,0xda,0x3b,0x46,0xb7,0x9d,0x13,0x53,0x1e,0x1f,
+0x51,0xed,0xe5,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xcb,0x28,0x4a,0xec,0xa4,0x74,0x8d,
+0xe6,0x5f,0x2b,0x3e,0xcf,0xed,0x87,0xf5,0xef,0xc0,0xce,0x54,0xbd,0x63,0x26,0x15,
+0x23,0x16,0x99,0xa8,0xb4,0xe5,0x4e,0x9e,0x75,0xb7,0xf2,0x62,0xf7,0xbf,0xa6,0xed,
+0x0b,0xa6,0x62,0x71,0x88,0xdb,0xf4,0x05,0x61,0x75,0xcb,0xd7,0x3e,0x0e,0x98,0x50,
+0xbf,0xcb,0xf7,0x99,0x61,0xf6,0x4e,0xb7,0x0f,0xd8,0x0a,0x72,0xbf,0x98,0x9a,0x63,
+0xfb,0x7e,0x4e,0x38,0x6c,0x2e,0x25,0x4c,0x3d,0xe0,0x8f,0x95,0xd9,0x8b,0xa4,0x6b,
+0xdb,0x60,0xfb,0x77,0x7d,0x81,0x08,0x18,0xa1,0x95,0x82,0x40,0xb1,0xfe,0x96,0xd9,
+0x84,0x8c,0x24,0xc6,0x65,0x1a,0xe8,0x64,0x23,0x91,0x22,0x93,0x26,0x05,0x1c,0xc5,
+0xca,0x0c,0xbc,0xc8,0x14,0x71,0x3e,0x96,0x3e,0x9a,0x27,0xa3,0xee,0x83,0x99,0x3c,
+0x13,0x0f,0x0e,0xc5,0xdc,0x03,0xc2,0x02,0x0f,0x02,0xc4,0x1a,0xdc,0xe9,0x6f,0x1e,
+0x10,0x95,0x79,0x70,0xf5,0x69,0xbb,0x85,0xa4,0x35,0x0f,0x8e,0xca,0x3c,0xb8,0xaf,
+0x49,0x55,0x80,0xb3,0xe2,0xc1,0x51,0x99,0x85,0x2b,0x8f,0xaa,0x70,0x21,0x02,0x0a,
+0x0c,0x18,0xba,0x34,0xf5,0xe1,0x64,0x04,0xc2,0x50,0x39,0x06,0x82,0x34,0x8e,0xd5,
+0x13,0x79,0x63,0x20,0x44,0xd9,0x18,0x08,0x11,0xd5,0xca,0xd1,0x94,0xeb,0x16,0x30,
+0xf6,0x95,0xd3,0x31,0xcd,0xa2,0x01,0x29,0x30,0x3f,0x41,0x5a,0x67,0x9e,0x6c,0x94,
+0xb3,0x16,0x9e,0x54,0x93,0xc5,0x71,0x46,0x22,0x7e,0xc0,0xb5,0xe1,0xe3,0xb9,0xbd,
+0x94,0xf4,0x2a,0x8c,0x96,0x23,0x2b,0xe8,0x78,0x68,0x3a,0x43,0xf3,0xde,0xda,0x2f,
+0x89,0x23,0xba,0xc9,0x13,0x28,0x8b,0x7f,0x92,0x71,0x0f,0x25,0x9d,0xa8,0xdb,0xfa,
+0xeb,0x1e,0x02,0x14,0xfa,0x2c,0x0a,0x29,0x42,0x81,0x1e,0x38,0xe9,0xd0,0x89,0x94,
+0xe5,0x69,0xbb,0x8f,0x70,0xf9,0x84,0x9c,0xcf,0x43,0x52,0x64,0xc7,0x13,0x26,0x9d,
+0x96,0x05,0x18,0x8f,0xa1,0x1a,0x3f,0xc3,0xca,0x46,0xdd,0x4e,0x90,0xbc,0x09,0x09,
+0x9c,0x98,0xf6,0x65,0x34,0x4f,0x67,0x4f,0xf5,0x94,0xd6,0x51,0xa7,0xb0,0x53,0x40,
+0xe6,0xcd,0x2d,0x68,0x32,0xce,0xe7,0xaf,0x8a,0x60,0x20,0x38,0x8f,0x8a,0xa6,0x8b,
+0xf7,0x78,0xd6,0x53,0x87,0x29,0x25,0x29,0x9f,0xb8,0xc4,0x58,0x2a,0xe1,0x13,0x5c,
+0x84,0x71,0x95,0xa4,0x00,0xdd,0x12,0x01,0x6e,0x1e,0xcf,0x9c,0x6d,0x69,0xb2,0x29,
+0x83,0x66,0x9f,0x15,0x6b,0x2e,0xe3,0xbc,0x2a,0x93,0x43,0x06,0xcb,0xd2,0xab,0xf1,
+0x1f,0x8d,0x07,0x86,0xfb,0x51,0x82,0x84,0x80,0xf6,0x0e,0x52,0x86,0xe2,0x48,0x07,
+0xbe,0x5b,0xb8,0x08,0xb4,0x4c,0x82,0x27,0xb9,0x2e,0xda,0x75,0x74,0xb4,0x99,0xcc,
+0x5f,0x72,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80,0x58,0xf3,0x7c,
+0x0e,0x89,0x3d,0xd7,0x33,0xee,0x57,0xba,0x21,0x9b,0x74,0x05,0x8a,0xa9,0xb9,0x06,
+0x66,0xc8,0xba,0x06,0x65,0xcc,0x8e,0xb0,0x29,0x24,0x46,0xd7,0x55,0xa2,0xbd,0x0d,
+0x46,0xd7,0xb5,0x13,0x91,0x67,0x43,0x16,0xd1,0x7a,0xcf,0x02,0xad,0xbb,0xef,0x81,
+0xc6,0xbc,0x9c,0x96,0x40,0x2f,0x52,0x93,0xac,0x83,0xc2,0x32,0xe2,0x28,0x09,0x83,
+0xce,0x60,0xcc,0x29,0xad,0xc8,0xec,0x4f,0x89,0xd9,0xe6,0xa2,0xab,0xda,0x78,0x13,
+0xf2,0x73,0x50,0xc6,0x04,0xe2,0x00,0x36,0x3b,0x03,0xcf,0x71,0xe6,0x3f,0xaf,0x1e,
+0x1f,0x61,0xa7,0x24,0x91,0x67,0xd5,0x32,0x82,0xce,0x24,0x71,0x29,0xcb,0x4a,0x6f,
+0x93,0x1e,0x22,0x9d,0xc2,0xd1,0xb7,0x02,0xbd,0x0d,0xa5,0x11,0x6a,0x8f,0x68,0x5c,
+0x66,0x0f,0x1b,0xa7,0x1d,0x03,0xc5,0x7d,0x58,0xba,0x46,0x3d,0x68,0xba,0xca,0xbe,
+0x59,0x11,0xb5,0xdd,0xf9,0x11,0x95,0xe3,0xda,0x48,0x84,0x0d,0x6a,0x23,0x13,0x4e,
+0x8c,0x1a,0x52,0x0d,0x06,0x1b,0x57,0x20,0x82,0x62,0x6a,0xae,0x74,0x46,0xfc,0xbf,
+0x06,0x35,0xa4,0x8d,0x94,0xd6,0xe5,0xcb,0x56,0x8f,0x62,0xb4,0x74,0x92,0x9b,0x75,
+0x14,0x0d,0xd4,0xcf,0xc8,0x24,0xf9,0xd8,0xe3,0x6a,0xb9,0xda,0x6e,0x1e,0x57,0xdb,
+0x96,0x64,0x2f,0xb7,0x89,0x5a,0xd2,0x22,0x39,0xb2,0x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x44,0xb0,0x7d,0x27,0xe0,
+0x3e,0xed,0xe4,0x21,0x6f,0x00,0x61,0x02,0xfb,0xba,0x31,0x12,0x61,0x76,0x49,0x83,
+0xf5,0x23,0x1d,0x08,0x59,0x62,0x8c,0x7a,0xcd,0x94,0x80,0x23,0x99,0x13,0x25,0xb6,
+0xa5,0x25,0x5c,0xea,0xb9,0xad,0x15,0xf6,0x4a,0x34,0x36,0xdd,0xf5,0xb6,0x34,0x55,
+0xae,0x19,0x6f,0x3a,0x44,0x16,0xa4,0x6f,0x82,0xf5,0x17,0x16,0xd9,0x56,0x6a,0x1f,
+0xea,0x3f,0x3b,0x0c,0x5a,0x52,0xe1,0xc6,0x29,0xfb,0x4e,0x1f,0x68,0x61,0x91,0xaf,
+0xe0,0xd3,0xcb,0x9d,0x46,0xfb,0xd7,0x23,0xda,0xa1,0xbf,0xc3,0xfd,0x03,0xe1,0xdd,
+0x16,0x2e,0x51,0x6d,0xf0,0x13,0xf1,0x1e,0x41,0xb6,0x2e,0x11,0xb8,0x24,0xc2,0x1b,
+0xe2,0x23,0xa6,0x9b,0x9d,0x40,0xbb,0xc5,0xd0,0x3b,0xc5,0x3b,0xb8,0xcf,0x2f,0xff,
+0x06,0xd9,0xc4,0x4d,0x03,0x39,0xb3,0x80,0x02,0x59,0x5c,0x55,0x55,0x65,0x65,0xdf,
+0xe0,0x7a,0x56,0x48,0x05,0xc5,0x0d,0x0c,0x7c,0xcc,0xe2,0xdc,0x38,0x26,0x92,0x36,
+0x62,0x72,0x8b,0xbd,0x82,0x2d,0x76,0xa7,0xef,0x61,0x7a,0xed,0x48,0x23,0xe3,0xb2,
+0xf5,0xd4,0x0e,0x62,0x77,0x5b,0x69,0xb8,0x4b,0xdf,0x5c,0x01,0x6f,0x91,0x95,0x11,
+0x26,0x65,0x9f,0xbd,0x86,0x76,0xaf,0x00,0x77,0xef,0x41,0x86,0xab,0x89,0x7e,0x99,
+0xad,0xac,0xd8,0xf5,0x70,0xe0,0x41,0x07,0xb8,0x9c,0xeb,0x49,0xcc,0x96,0xe1,0x20,
+0x70,0x3e,0x79,0x83,0x05,0xc0,0x33,0x1a,0x58,0xcf,0x21,0xf6,0xbd,0x84,0x8f,0x37,
+0xd8,0xbb,0x43,0x5f,0x92,0x5d,0xf6,0xa9,0x3e,0xe2,0x74,0x2d,0xe7,0x1d,0x69,0x38,
+0x63,0xf3,0x05,0x34,0x37,0xfc,0x5e,0xe8,0xbb,0xba,0x7a,0xba,0xa2,0xec,0x05,0xd7,
+0xd5,0xa2,0xcd,0x78,0xb1,0xe4,0x43,0x74,0x64,0x6b,0x3f,0xc8,0xc2,0x64,0x40,0x9e,
+0x6f,0x6f,0x86,0x1d,0xc1,0xf0,0xf5,0xd1,0xd3,0xbd,0x74,0x9d,0x19,0x5e,0xcf,0x93,
+0xd7,0x31,0x84,0x61,0xa7,0x8b,0x95,0x07,0x0b,0xd7,0xde,0x45,0x9b,0xa4,0x79,0x2b,
+0xf3,0x66,0x16,0xde,0x89,0xb7,0xb9,0xf7,0xb6,0xf0,0xde,0x96,0x67,0xed,0x07,0x99,
+0x9b,0x99,0x21,0x11,0x39,0x98,0xd5,0x81,0x82,0xbb,0x9f,0xc0,0xc2,0x44,0x90,0xc3,
+0x7d,0xf9,0x1f,0xe4,0xa7,0xdd,0xbc,0xd7,0x5a,0x00,0x00,};
+
+static const unsigned int dummy_align__main_js = 4;
+static const unsigned char data__main_js[] = {
+/* /main.js (9 chars) */
+0x2f,0x6d,0x61,0x69,0x6e,0x2e,0x6a,0x73,0x00,0x00,0x00,0x00,
+
+/* HTTP header */
+/* "HTTP/1.1 200 OK
+" (17 bytes) */
+0x48,0x54,0x54,0x50,0x2f,0x31,0x2e,0x31,0x20,0x32,0x30,0x30,0x20,0x4f,0x4b,0x0d,
+0x0a,
+/* "Server: lwIP/1.3.1 (http://savannah.nongnu.org/projects/lwip)
+" (63 bytes) */
+0x53,0x65,0x72,0x76,0x65,0x72,0x3a,0x20,0x6c,0x77,0x49,0x50,0x2f,0x31,0x2e,0x33,
+0x2e,0x31,0x20,0x28,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x73,0x61,0x76,0x61,0x6e,
+0x6e,0x61,0x68,0x2e,0x6e,0x6f,0x6e,0x67,0x6e,0x75,0x2e,0x6f,0x72,0x67,0x2f,0x70,
+0x72,0x6f,0x6a,0x65,0x63,0x74,0x73,0x2f,0x6c,0x77,0x69,0x70,0x29,0x0d,0x0a,
+/* "Content-Length: 7792
+" (18+ bytes) */
+0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x4c,0x65,0x6e,0x67,0x74,0x68,0x3a,0x20,
+0x37,0x37,0x39,0x32,0x0d,0x0a,
+/* "Connection: Close
+" (19 bytes) */
+0x43,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x69,0x6f,0x6e,0x3a,0x20,0x43,0x6c,0x6f,0x73,
+0x65,0x0d,0x0a,
+/* "Content-type: application/x-javascript
+Content-Encoding: gzip
+Cache-Control: private, max-age=86400
+
+" (105 bytes) */
+0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x74,0x79,0x70,0x65,0x3a,0x20,0x61,0x70,
+0x70,0x6c,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e,0x2f,0x78,0x2d,0x6a,0x61,0x76,0x61,
+0x73,0x63,0x72,0x69,0x70,0x74,0x0d,0x0a,0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,
+0x45,0x6e,0x63,0x6f,0x64,0x69,0x6e,0x67,0x3a,0x20,0x67,0x7a,0x69,0x70,0x0d,0x0a,
+0x43,0x61,0x63,0x68,0x65,0x2d,0x43,0x6f,0x6e,0x74,0x72,0x6f,0x6c,0x3a,0x20,0x70,
+0x72,0x69,0x76,0x61,0x74,0x65,0x2c,0x20,0x6d,0x61,0x78,0x2d,0x61,0x67,0x65,0x3d,
+0x38,0x36,0x34,0x30,0x30,0x0d,0x0a,0x0d,0x0a,
+/* raw file data (7792 bytes) */
+0x1f,0x8b,0x08,0x00,0x00,0x00,0x00,0x00,0x04,0x0a,0xcd,0x5c,0x79,0x73,0xdc,0xc6,
+0x95,0xff,0x2a,0x20,0xa2,0x50,0x03,0x0f,0x38,0x1c,0xea,0xb0,0x93,0x19,0x82,0x53,
+0xba,0x6c,0x2b,0x6b,0x1d,0x2b,0xd1,0xeb,0x64,0x29,0x86,0x85,0xa3,0x67,0x06,0xe2,
+0x0c,0x30,0x06,0x30,0xa2,0x18,0x92,0x55,0x49,0xbc,0x39,0xaa,0xec,0x8a,0xab,0xbc,
+0x7f,0xec,0xd6,0xd6,0x6e,0xa5,0xf6,0x1b,0x38,0x5e,0x2b,0x51,0xec,0xc4,0xa9,0xda,
+0x4f,0x40,0x7e,0xa3,0xfd,0xbd,0xd7,0xdd,0x40,0x03,0x33,0x94,0xe4,0xa3,0x76,0xb7,
+0x12,0x8b,0x83,0x46,0x1f,0xaf,0x5f,0xbf,0xfb,0xbd,0xc6,0x70,0x9e,0x84,0x45,0x9c,
+0x26,0xd6,0x85,0x96,0xef,0x1c,0x65,0xa2,0x98,0x67,0x89,0x15,0xa5,0xe1,0x7c,0x2a,
+0x92,0xa2,0x33,0x12,0xc5,0xad,0x89,0xa0,0x9f,0xd7,0x0f,0x6f,0x47,0xe8,0x71,0x32,
+0xd4,0xfd,0xf1,0xea,0x46,0x9a,0xee,0xc7,0x82,0xc6,0xd9,0xf3,0x5c,0x58,0x79,0x91,
+0xc5,0x61,0x61,0xf7,0x87,0x69,0xd6,0x7a,0xe2,0x67,0x56,0xe0,0x95,0xf3,0x84,0xdc,
+0xd3,0x0d,0xbd,0xa0,0x93,0xcf,0x26,0x71,0xd1,0xb2,0xfb,0x96,0xed,0xb8,0x91,0xd7,
+0xed,0x47,0x9b,0x61,0x67,0x22,0x92,0x51,0x31,0xee,0x47,0xed,0xb6,0x73,0x44,0x23,
+0x85,0x17,0xee,0x44,0xbb,0xba,0xab,0x67,0x3b,0xfd,0x78,0xd8,0x12,0x3b,0xdd,0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a,0x5b,0x04,0x42,0x98,0x09,0xda,0x2d,0xc8,0xa3,0xc9,0xad,0xfc,0xe2,0xa6,
+0x12,0x02,0x38,0xc8,0x11,0x49,0x80,0x96,0x03,0xfe,0xad,0x48,0x93,0xfb,0x28,0xe1,
+0xd0,0xb2,0xa3,0xf8,0x09,0x8e,0x98,0xce,0x30,0x34,0xf6,0xe8,0xf7,0xc3,0xce,0x30,
+0xce,0xf2,0xe2,0xc6,0x38,0x9e,0x44,0x7d,0x27,0xe8,0xf8,0xb3,0x99,0x48,0x22,0x7e,
+0x44,0xcf,0xea,0x9d,0xa3,0x91,0x18,0x54,0x30,0xd2,0x41,0xdd,0x9b,0x83,0x18,0x17,
+0x69,0x6d,0xa3,0x4e,0xbf,0x90,0x0e,0x90,0x38,0x93,0x35,0xd0,0xe7,0x55,0x67,0xb3,
+0xeb,0x68,0xd2,0x8c,0x62,0x48,0x1b,0xff,0xd0,0xb3,0x93,0x34,0x11,0x76,0x5f,0x4c,
+0x72,0xc1,0x7b,0x0d,0xcf,0x25,0xd2,0x70,0x81,0x48,0x25,0xb9,0xb4,0xf8,0xf0,0xf5,
+0xbc,0x15,0x1b,0xe9,0x16,0xbd,0x52,0x70,0x7c,0x6c,0x07,0x93,0x34,0xdc,0xb7,0x2b,
+0x08,0x43,0xc5,0x61,0xc1,0x4b,0x39,0x2c,0x20,0x0e,0xbb,0x7a,0x2e,0x87,0x05,0x2f,
+0xe5,0xb0,0xb0,0xc1,0x61,0x89,0x28,0x20,0xb8,0x0a,0x48,0xa0,0x7c,0x2f,0x1c,0xfb,
+0xc9,0x48,0x00,0xf7,0xa0,0x73,0x40,0x04,0x9c,0xd9,0x45,0x36,0x17,0xb6,0xe7,0x2d,
+0xe9,0xb5,0xba,0xba,0x62,0xb6,0x8a,0xa7,0x22,0x9c,0x17,0x22,0x72,0x8e,0x96,0xb5,
+0x42,0x1c,0x30,0x64,0xbe,0x67,0x90,0xd5,0xc5,0x4d,0xd0,0x84,0x15,0x47,0x9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0x4c,0xe3,0x24,0x9e,0xce,0xa7,0x10,0x64,0x46,0x9b,0xff,0x94,
+0xdb,0x48,0x9c,0x05,0x24,0x98,0x0c,0xcd,0x28,0x01,0x86,0x7c,0x83,0xb5,0xa2,0x48,
+0x55,0x6c,0x8d,0x06,0xad,0xc8,0x14,0xcc,0xa7,0xff,0x42,0x68,0x29,0x35,0xfd,0x33,
+0xcb,0x6e,0x87,0x6d,0x08,0x02,0x58,0x18,0xa4,0xf1,0xbf,0x02,0x62,0x60,0x8a,0x90,
+0xb5,0xf0,0x21,0x59,0x12,0x1a,0x59,0xd4,0x4f,0x90,0xf4,0x7f,0x21,0x39,0x44,0x24,
+0x5d,0x41,0x10,0xbd,0xd1,0xd6,0xf0,0xdb,0xae,0x4b,0xa6,0x10,0xec,0x13,0xac,0x3b,
+0x7c,0xf5,0x75,0x69,0xef,0xee,0x78,0x91,0xd7,0x6b,0x02,0xe9,0x15,0x09,0x12,0x1e,
+0xef,0xfa,0x4f,0x89,0x29,0xfd,0xb5,0x9f,0x5d,0x5b,0xfb,0xc7,0xdd,0xf6,0x85,0x75,
+0x8d,0xd6,0xba,0x04,0x20,0x5b,0x07,0x1a,0x1b,0x90,0x82,0xd3,0x4d,0x24,0x42,0x28,
+0x93,0xb9,0x46,0xd4,0xf9,0x47,0x45,0x7b,0x20,0x59,0x74,0x86,0x90,0xf8,0x82,0x84,
+0xc4,0x97,0xd4,0xca,0x56,0x16,0x89,0xef,0xe7,0x74,0x04,0x64,0xa5,0x7d,0x41,0x76,
+0x20,0xec,0x3b,0x0b,0x54,0xfe,0xfc,0xec,0x9f,0x88,0xa8,0x6d,0x37,0xfa,0x0e,0xd8,
+0x33,0x9f,0x07,0xd3,0xb8,0x78,0x13,0xfa,0x38,0x87,0x1a,0x86,0x7a,0x27,0x43,0xae,
+0x65,0x9f,0x7e,0x82,0xe5,0xb0,0xae,0xb4,0x21,0xa5,0x49,0x78,0xf6,0x1b,0x02,0xd5,
+0x22,0x8b,0x93,0x40,0xc4,0x7f,0x00,0xce,0xb4,0x5d,0xd9,0xd0,0x24,0xf2,0xa8,0x4c,
+0xd5,0x3f,0xd3,0x26,0x06,0xb6,0x03,0xd3,0x41,0x6a,0xd5,0xb5,0x38,0x81,0xfa,0x2c,
+0x1f,0xb5,0x92,0xd5,0x14,0xbe,0x73,0x79,0x57,0xd2,0x2c,0x69,0x64,0x28,0x61,0xd9,
+0x5d,0xf1,0x9d,0xdb,0x34,0x1b,0x06,0x34,0x29,0x35,0x42,0x45,0x75,0xe4,0x4e,0xe0,
+0xb1,0x99,0xe6,0x7a,0xdd,0x01,0x70,0xb1,0x3f,0xd3,0xce,0x6b,0xf8,0x07,0x4e,0x6f,
+0x19,0x35,0x4b,0xef,0x56,0x3b,0x3b,0xca,0xd3,0x31,0x04,0x1c,0x82,0x07,0xd1,0x8f,
+0xef,0xbc,0x73,0x33,0x25,0x45,0x58,0x31,0x75,0x3f,0xf2,0x54,0xa4,0x05,0x2f,0xdf,
+0x2e,0x8a,0xd9,0x03,0x19,0x23,0x18,0x50,0x80,0xa5,0xde,0xd4,0xa3,0xa6,0x6b,0x08,
+0x49,0x3d,0x11,0x3f,0xbe,0x17,0x3c,0x86,0x89,0xda,0xb2,0xef,0xc4,0x61,0x96,0xe6,
+0xe9,0xb0,0xe8,0x50,0xdf,0xed,0xed,0xfb,0x30,0x44,0x22,0x60,0x49,0x24,0xad,0xc0,
+0xf5,0xd9,0x26,0xe1,0xa8,0x51,0x1f,0x8d,0x09,0x19,0x4d,0x87,0x39,0xf9,0xf1,0x72,
+0xbf,0x9e,0x36,0x79,0x71,0xa4,0x57,0x3c,0x2f,0xea,0x70,0x07,0xf6,0xe8,0x81,0x79,
+0x81,0x06,0xea,0x3c,0xcf,0xdd,0x4b,0xdd,0xae,0xe7,0x89,0x41,0x6b,0x76,0x10,0xdd,
+0xce,0x6f,0xa4,0x59,0x86,0xb5,0xb9,0x7b,0x3e,0x83,0xb8,0x11,0xdb,0x70,0xf8,0x5d,
+0x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93,0x96,0xee,0x09,0xc4,
+0x2a,0x95,0x02,0x0c,0x06,0xab,0xab,0x3e,0x60,0x5d,0xe9,0xe2,0x90,0x42,0x36,0xea,
+0x81,0x65,0x3a,0xaf,0x16,0xac,0xe7,0x9e,0xea,0xb0,0x42,0x1d,0x40,0x80,0x8a,0x2f,
+0xca,0x9e,0xd2,0x89,0x5c,0x07,0x85,0x07,0x5b,0x78,0x1f,0xac,0xad,0x95,0x48,0x5e,
+0x83,0x8d,0x09,0x55,0x0c,0x3c,0x57,0x51,0xa4,0xc0,0x0d,0x4e,0x5c,0x0a,0x40,0x56,
+0x42,0x9d,0x8c,0x72,0x19,0xb0,0x72,0x8e,0x70,0x3e,0x75,0x1b,0x9d,0x0f,0x57,0x5b,
+0xfd,0x14,0xd4,0xbc,0x56,0x20,0x40,0x19,0xc0,0xb7,0xa7,0x18,0x4e,0xee,0x07,0x13,
+0x11,0xd9,0x6e,0xf5,0xd3,0xa1,0xd5,0xc9,0x2f,0x78,0xd5,0xbe,0x53,0x9f,0x3c,0x87,
+0x57,0xe9,0x8d,0xf0,0x16,0xe6,0x2e,0x61,0xc9,0xc4,0x34,0x7d,0x22,0x96,0x81,0x53,
+0xc1,0xf0,0x92,0x3e,0x6a,0xed,0x17,0xf4,0x32,0xd0,0x14,0x27,0xc3,0x54,0xd9,0x63,
+0x0d,0xb7,0x0b,0xb4,0xcc,0x58,0x96,0x5c,0xc8,0x3e,0x97,0x3e,0x1e,0xec,0x4c,0xf3,
+0x26,0x93,0xfe,0x94,0x02,0x63,0x65,0x63,0x64,0x98,0x16,0x6a,0x6a,0x61,0xaa,0xd6,
+0x4b,0xe4,0x1d,0x20,0xf4,0x01,0xbd,0x46,0x7a,0x8f,0xb4,0xe2,0xd9,0xaf,0xd9,0x0a,
+0xc7,0x48,0xc3,0xf5,0xa9,0x8f,0x01,0x17,0xc3,0x85,0x81,0xe7,0x44,0x1a,0x87,0x3d,
+0x98,0x2f,0xf1,0x17,0x76,0x08,0x1b,0x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x05,0x83,0x82,0xf4,0x2d,0x92,0x84,0xf4,0x07,0x36,0xcc,0x10,
+0x16,0x42,0x5c,0x34,0x66,0xc7,0xa4,0xd0,0xab,0x27,0xc6,0xbe,0x6a,0x90,0xb6,0x86,
+0x28,0x4f,0x5b,0x42,0x75,0x4d,0xf5,0x61,0x90,0x1f,0xa5,0x65,0xdd,0xc8,0x15,0xa8,
+0xb8,0xd6,0xa5,0xfc,0x43,0x0a,0x8a,0xfa,0xb0,0x9a,0x7d,0x1d,0x8a,0x13,0x04,0x13,
+0xea,0x7d,0xc9,0xc4,0x41,0x62,0x73,0xe4,0xee,0xf8,0xbb,0xe4,0xe2,0x62,0x43,0x94,
+0xe5,0x74,0x05,0x75,0x06,0xc3,0x70,0xbf,0x9b,0x62,0xe8,0xcf,0x27,0xc5,0xa0,0xd9,
+0x80,0x50,0xb5,0x8f,0x10,0x2d,0xdd,0x28,0x90,0x94,0x4c,0xb5,0x30,0x84,0xc7,0x11,
+0x1b,0x2e,0x7d,0x98,0x5d,0x0d,0xa3,0x03,0x53,0x34,0x9b,0x90,0xe1,0x1d,0x52,0x11,
+0x0d,0xa6,0x82,0xb8,0xf2,0xd5,0x09,0x41,0xbc,0x26,0x94,0xdf,0xc4,0xf6,0x97,0xec,
+0xbe,0x69,0x9d,0x18,0xbb,0x77,0x8e,0x4a,0xab,0xce,0xe7,0x24,0xb3,0xf2,0x34,0x90,
+0xce,0xa5,0x6c,0x28,0x1f,0x38,0x31,0x53,0x87,0xad,0x9d,0x9b,0x62,0x52,0xf8,0xd2,
+0x4e,0x65,0x0d,0x8d,0xf0,0xb9,0xf9,0x66,0x8b,0xc1,0x8a,0x44,0x81,0x58,0xdf,0xea,
+0x2a,0x4f,0x50,0x75,0x93,0xcd,0x9b,0x70,0x1e,0xd4,0x8b,0x74,0x86,0xa8,0x61,0x13,
+0x47,0xaf,0x86,0xb4,0x73,0xf7,0xa8,0x4c,0x9d,0xda,0x06,0x2f,0xff,0x00,0x11,0x84,
+0x0e,0x6c,0x9a,0x1b,0x28,0x3a,0x6c,0x80,0x45,0x36,0xda,0x15,0x78,0x1c,0xe7,0xbe,
+0xc7,0x09,0xbd,0x68,0x31,0xb6,0x88,0x6a,0xab,0xd1,0x79,0x06,0xa8,0x7a,0x1d,0xfb,
+0x19,0xad,0x47,0xac,0xe3,0x63,0x53,0xfa,0x19,0xc7,0xa6,0x20,0x61,0x47,0x07,0x01,
+0x02,0x9c,0xe3,0xa4,0x00,0xdc,0xf4,0x2b,0x84,0xea,0x51,0x3f,0xa7,0xc0,0x22,0xff,
+0x6c,0x5d,0xb9,0xca,0x81,0x84,0xf3,0x45,0xdd,0x4a,0x9d,0xa1,0x95,0x48,0x44,0xd9,
+0x37,0x95,0x52,0x5c,0x79,0x9d,0x13,0xb0,0x8c,0xf3,0xa6,0xe4,0xd9,0xea,0x1e,0x1f,
+0x07,0x5b,0xde,0x95,0x1f,0xac,0xae,0x5e,0x7d,0x63,0x8b,0xa2,0x15,0xdf,0x8c,0x88,
+0x97,0xe2,0x88,0x4f,0xde,0x40,0x8d,0x8b,0x84,0x59,0x45,0x53,0x1d,0x9d,0x5c,0x45,
+0x7d,0x38,0xa9,0x6f,0xb2,0x84,0x94,0xd7,0xaa,0xbd,0x55,0x19,0x89,0x7f,0x48,0x1e,
+0x67,0x50,0xf7,0x8d,0xc8,0x0b,0xed,0xad,0xd5,0xb6,0x44,0x4d,0x92,0xb0,0xd4,0x6c,
+0x20,0x55,0x14,0xba,0x5f,0xed,0x2a,0xa1,0x2b,0x27,0x43,0xc2,0x7d,0xd9,0x71,0x92,
+0x71,0x5a,0x41,0x0a,0xad,0xd2,0x80,0x08,0x68,0x54,0x96,0x59,0x38,0x11,0x7e,0xb6,
+0xad,0x42,0x57,0x0c,0x80,0xea,0x0a,0x5b,0x48,0xd0,0xa5,0x15,0xe9,0x77,0xeb,0xc6,
+0x65,0x8b,0x49,0x48,0xcc,0xe5,0x88,0x64,0x54,0x19,0x82,0xbc,0x6d,0x62,0xa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,0x27,0x34,0x17,0xf1,0xca,0xfd,0x0c,0x17,0x3e,
+0x10,0x0a,0x45,0x90,0x94,0x27,0x6b,0xb4,0x99,0xb3,0x41,0xa6,0xb1,0x0d,0x70,0x9d,
+0x8d,0x02,0xd4,0x03,0xd0,0x24,0x27,0x2e,0x00,0xde,0x66,0xb0,0x6b,0xbb,0x44,0x82,
+0xf3,0x60,0x8f,0x71,0xdd,0x61,0x14,0x68,0x23,0x8a,0xa2,0xac,0x72,0x6b,0x3a,0x73,
+0x4e,0xb1,0xd5,0x4e,0x02,0xf9,0xba,0x0d,0xf3,0x14,0x4c,0x11,0xe0,0x11,0x96,0x28,
+0x94,0x34,0x55,0x96,0xc3,0x94,0x87,0x15,0xa0,0xa9,0x4a,0xde,0x23,0xf3,0x8e,0x40,
+0xb3,0xc6,0x6a,0x5a,0xed,0x43,0x65,0xb2,0x2d,0x33,0x72,0xc7,0x7d,0x5b,0x15,0x94,
+0x98,0xb5,0x4c,0xad,0x11,0x1b,0x39,0x37,0x51,0xf8,0xe3,0x8e,0xa8,0x8c,0x83,0xe8,
+0xbe,0x35,0x22,0x93,0x98,0x7f,0x39,0xed,0x4b,0x57,0x70,0xe7,0xed,0xf5,0x2e,0xfd,
+0x9f,0x6f,0xbe,0x8d,0xbd,0x51,0xfd,0xaa,0x1b,0x64,0x43,0x19,0x0c,0xe1,0x7b,0x7f,
+0xea,0xb2,0x9d,0x48,0x42,0x00,0xfb,0xee,0x83,0xdb,0xa8,0x8d,0x46,0x49,0x15,0x80,
+0x47,0x8d,0x66,0xbb,0x35,0x1e,0xd4,0xee,0xcd,0x8d,0xc9,0x20,0x6b,0xb7,0x22,0x6a,
+0x85,0x49,0x36,0x46,0x1d,0x53,0x24,0x9b,0x04,0x35,0x21,0xf9,0xe6,0xc7,0x09,0xdd,
+0xaf,0x93,0x8d,0x43,0x6a,0xcc,0x71,0x3b,0x25,0x13,0x64,0x92,0x82,0x9a,0x00,0xa9,
+0xb1,0xef,0xea,0x62,0x19,0x78,0xc3,0xb0,0xc0,0x18,0x30,0x75,0xc3,0x70,0xbd,0xff,
+0x28,0x5f,0x1f,0x01,0x6c,0x5c,0x16,0xa3,0x8b,0x87,0x7c,0x11,0x11,0xd6,0x64,0xc0,
+0xd7,0x10,0x5d,0x59,0x78,0xa4,0xc3,0xde,0x7c,0x71,0xd0,0xd1,0xb7,0x10,0x61,0x4d,
+0x2e,0xec,0xa9,0x93,0xc3,0x19,0x45,0x61,0xaf,0x32,0x5b,0xdb,0x1b,0xae,0x2e,0x5b,
+0x82,0xa0,0x51,0xe4,0x96,0xcc,0x27,0x13,0x54,0x85,0x89,0x89,0x01,0xaa,0x2c,0x98,
+0x03,0x49,0xc8,0x13,0x24,0x94,0x4b,0x11,0xb8,0x1c,0x9d,0xad,0xc0,0x40,0x51,0x20,
+0xb1,0x11,0xd6,0x50,0x14,0x72,0xa3,0x81,0x5d,0x75,0x75,0x70,0x0d,0x57,0x07,0xd7,
+0x1a,0x17,0x07,0x81,0xb9,0x8a,0x84,0xde,0x2d,0xe2,0x09,0x28,0x5d,0x53,0x14,0x3d,
+0x42,0x4c,0xcd,0xf9,0x1a,0x58,0x0d,0x60,0x75,0x1f,0x4e,0x5e,0xfc,0xb2,0xa0,0xd0,
+0x02,0xdc,0xf1,0x1a,0xfb,0xf9,0xbd,0x83,0x84,0x98,0x06,0xa5,0x5e,0x87,0xad,0x10,
+0x52,0x7c,0xc5,0xdf,0x09,0x77,0x49,0x98,0xe3,0x8f,0x17,0xe0,0x1f,0x9c,0xd3,0x05,
+0x63,0xa6,0x92,0xe3,0xcb,0xad,0x62,0xf3,0xf5,0x20,0xf0,0x09,0x38,0x49,0x03,0xb4,
+0x0d,0x8f,0xc3,0xe4,0x3a,0x2d,0xa1,0x2c,0x1f,0x14,0x25,0xb5,0x2e,0x22,0x53,0x12,
+0x8d,0x39,0x58,0xa5,0x7a,0x90,0x72,0x3a,0xe0,0x8b,0x34,0x7b,0x63,0xe4,0x23,0xf0,
+0xd6,0x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38,0xf4,0x31,0xa4,0xd4,0x63,0x0f,0x5d,
+0x30,0xde,0xa7,0x79,0x6e,0xd0,0x75,0xda,0x16,0xe2,0x8d,0xd2,0xbb,0x03,0x5a,0xa8,
+0xc0,0xda,0x78,0x85,0x3b,0x41,0xf2,0xd5,0x7d,0x5c,0xec,0xe5,0xe2,0xeb,0xb4,0xa3,
+0x38,0xcb,0xdb,0xa7,0x99,0x24,0xf1,0x61,0x06,0x0e,0x29,0x1a,0x84,0xc7,0x75,0xf1,
+0x8a,0x72,0x4a,0x29,0x81,0x43,0x42,0x69,0xef,0x38,0x3d,0xb8,0x41,0x01,0x48,0x11,
+0xb5,0x42,0x94,0x3d,0x05,0x20,0x40,0xf8,0xcc,0x40,0xd9,0x49,0x8c,0x1d,0xd1,0xa5,
+0x85,0x0b,0xb8,0x3d,0xcd,0xdb,0x89,0xd9,0x4b,0x91,0x5b,0xc1,0xef,0x41,0x6b,0x7f,
+0x75,0x75,0x1f,0x39,0x5f,0x74,0x04,0x4f,0x41,0x20,0xdd,0x90,0x6c,0x8e,0x89,0xf6,
+0xc9,0xfe,0x00,0x09,0x2d,0xdb,0x93,0xf9,0xa6,0xb1,0x25,0x9c,0xa4,0xde,0x50,0xec,
+0xf4,0x56,0x30,0xff,0x63,0x00,0x61,0xcc,0x64,0x40,0xf3,0x18,0x31,0x21,0x03,0x53,
+0xe6,0xac,0xd4,0xab,0x7a,0x2d,0xb1,0x65,0x4c,0x8d,0x57,0x29,0x09,0x43,0x96,0x5e,
+0x52,0xeb,0x12,0x0d,0x56,0x5c,0xa6,0xeb,0x05,0x29,0xd6,0xc0,0x08,0x08,0xf8,0x16,
+0xf9,0x8a,0x70,0x8a,0x31,0xe4,0x86,0xc5,0xa1,0x14,0xaa,0x8f,0x6e,0xd9,0x77,0x53,
+0x0b,0xce,0x04,0x95,0x52,0x5a,0x53,0x8a,0x98,0x20,0x39,0x68,0x15,0x98,0x4c,0x14,
+0xb8,0x3f,0x6a,0x0d,0x29,0x4c,0xd4,0x41,0x80,0x04,0x84,0xb5,0x90,0x4e,0x63,0xdc,
+0xc8,0x34,0x16,0x46,0x20,0xe2,0x8b,0x20,0xbe,0x3d,0x47,0x5e,0x01,0x84,0x65,0x66,
+0xd6,0x96,0x2e,0xaa,0x46,0x58,0xb8,0x32,0x2e,0xe4,0x32,0xa4,0xc2,0x8a,0x31,0xbc,
+0x1a,0x5e,0x9d,0x16,0xd5,0xa2,0x82,0x73,0x5a,0x44,0xca,0x4a,0x2b,0x55,0xf2,0x00,
+0xa1,0x57,0x32,0x3b,0x0c,0x22,0xa8,0x90,0x80,0x28,0x56,0x69,0x70,0x79,0x43,0x49,
+0x01,0x02,0x9c,0x21,0xd9,0x17,0x52,0x71,0x6c,0x6a,0x1f,0xd0,0x0c,0x75,0x47,0x8a,
+0xc7,0x24,0x84,0xa1,0x3b,0xd6,0x07,0x5a,0x23,0x08,0xc9,0x0c,0xb5,0xf3,0xeb,0x13,
+0x9b,0x34,0x4e,0x1a,0x88,0xa8,0x51,0xbc,0xe2,0x9e,0x98,0xf4,0x64,0xe3,0x1c,0x8c,
+0x2d,0x58,0x30,0x63,0x2f,0x16,0x16,0x84,0x5c,0x04,0x2b,0x2c,0x11,0x16,0xd8,0x2a,
+0x0d,0x63,0xe8,0xc0,0xc8,0x3a,0x88,0x8b,0x31,0x61,0xa8,0x63,0x71,0x54,0x95,0x7e,
+0x5a,0xc4,0xc2,0x16,0x92,0x42,0xb2,0x73,0x4c,0xe7,0xa5,0xb5,0x59,0x09,0xbd,0x87,
+0x9d,0xd7,0x84,0x0c,0x15,0xc5,0xeb,0x8f,0x48,0x0c,0xe9,0xc4,0xc6,0xa6,0x7a,0xd5,
+0xd8,0x40,0x81,0x3d,0xd4,0xa3,0x34,0x90,0x21,0xa7,0xc2,0x46,0xd8,0x09,0x6a,0x87,
+0x6c,0x75,0xd7,0x40,0x59,0x85,0xff,0xea,0x0a,0x82,0x24,0x41,0x79,0x02,0x98,0x45,
+0xf1,0x24,0x62,0x91,0x88,0x50,0x51,0xe1,0xb1,0x64,0x32,0x64,0x59,0xea,0xec,0x60,
+0xbe,0x2c,0xa5,0x8a,0x64,0x86,0x13,0x59,0xe3,0x21,0xe5,0x63,0xb5,0x24,0x42,0x69,
+0x1c,0x13,0x61,0xba,0x0f,0x89,0x62,0x90,0x9e,0x3f,0xd8,0xdb,0x06,0x45,0x49,0x1a,
+0x46,0xe4,0x2d,0xf2,0xf0,0x41,0x09,0xf9,0x1d,0x0c,0x17,0x8d,0x5a,0xa1,0x91,0xd6,
+0x8c,0xb4,0xae,0x64,0xfb,0x93,0x9e,0x16,0xed,0xcf,0x1e,0xaa,0xc4,0x34,0x5d,0x6a,
+0xfb,0x93,0x3e,0x15,0x70,0xbe,0xd9,0xa9,0xcf,0x42,0xda,0x0e,0x25,0xd6,0x0d,0xa8,
+0x21,0xb4,0x18,0x6e,0xe2,0x56,0x96,0xdb,0xcb,0x40,0x87,0xef,0x10,0x79,0xc3,0x65,
+0xa0,0x8f,0x18,0xf4,0xd1,0x6e,0x7f,0x24,0x35,0x00,0xf1,0x5e,0xb4,0x33,0xda,0x85,
+0x75,0x23,0xab,0x45,0x60,0x36,0x13,0xd8,0x47,0xd4,0x48,0xfe,0x40,0x8f,0xc2,0x77,
+0x74,0xfb,0xe2,0x71,0x8a,0x90,0x33,0x98,0xd6,0xe9,0x07,0xa8,0xc7,0xd8,0x3f,0xa1,
+0xd0,0xa2,0x20,0x5e,0x71,0x11,0xfd,0x95,0xfd,0x1c,0x79,0x03,0x17,0x67,0x26,0x9f,
+0xf1,0x55,0x01,0x6c,0xa1,0x42,0x2b,0xb8,0x86,0x36,0xe6,0xda,0x28,0x9b,0x87,0x99,
+0xf8,0x52,0xcb,0xc8,0xb0,0x74,0x7c,0x17,0xaa,0x25,0x9e,0x1a,0x88,0xe0,0xfb,0xce,
+0x52,0x2d,0x56,0xd6,0x57,0x87,0x3a,0x69,0x9c,0xc3,0x39,0xc3,0x53,0x4b,0xc7,0xc3,
+0xd7,0x7f,0xfa,0x28,0x6f,0x1f,0xe3,0xbf,0x0b,0xeb,0x23,0x2d,0x2e,0x88,0xaa,0xf0,
+0xe5,0x01,0x78,0x01,0x81,0xcb,0x4e,0x49,0x82,0x8b,0x39,0xb8,0x29,0xf8,0x33,0x21,
+0x67,0xae,0xd6,0xd3,0x62,0xd2,0x5b,0x7f,0x94,0x63,0x0e,0x73,0x0a,0x5e,0x25,0x70,
+0xca,0xa9,0xe8,0x46,0x2a,0x49,0x1a,0xad,0xe6,0xaa,0x49,0x58,0x35,0x11,0xd5,0x85,
+0xec,0xbc,0x3d,0x10,0xa3,0x5b,0x4f,0x67,0x2d,0xfb,0xd1,0xa3,0x80,0x2f,0x5d,0xd1,
+0x5f,0xd7,0xae,0x5d,0xd1,0x54,0x77,0x19,0x43,0x52,0x97,0x24,0x3e,0x4b,0x1b,0x44,
+0xeb,0x9b,0x6a,0x72,0xe6,0x21,0x43,0x83,0xd2,0x33,0xce,0x28,0x30,0xf2,0xcb,0x0a,
+0x23,0x46,0x13,0x6a,0xc7,0x70,0x73,0x8e,0xc2,0x4f,0x06,0x07,0x35,0xe6,0x34,0xba,
+0x83,0x3b,0x1b,0x18,0x32,0xe7,0x6f,0x60,0x40,0x6a,0x9b,0x4a,0x0e,0x97,0x3a,0xa0,
+0x9a,0x9f,0x63,0x25,0x7c,0x92,0x28,0xe6,0x1d,0x84,0x65,0x7c,0x03,0xd2,0xa3,0x26,
+0xc2,0xcb,0xa1,0xfa,0x6c,0xcf,0x7b,0x4f,0xae,0x39,0x9c,0x6e,0x44,0xef,0x5e,0xab,
+0x3e,0x70,0x13,0xc1,0x18,0x06,0x0d,0x93,0x26,0xab,0xa1,0x1c,0x64,0x5a,0xa2,0x1c,
+0x16,0x50,0x63,0x4e,0x5d,0x01,0x12,0xd0,0xad,0xeb,0x6e,0x7f,0x08,0x86,0x60,0xae,
+0xc1,0x07,0x63,0xe8,0x82,0x29,0x3d,0x57,0xa8,0x85,0xf1,0x12,0x75,0x66,0x73,0x18,
+0x72,0xd4,0x5e,0xa9,0x23,0x76,0x73,0x97,0x99,0x72,0x35,0x1c,0x20,0x44,0xc5,0xd5,
+0x32,0x2a,0x82,0xa2,0x6d,0xc1,0x3e,0x93,0x8a,0x1b,0x91,0x46,0xa5,0xc2,0x58,0x3f,
+0x0b,0x61,0x3f,0xe9,0x5f,0x25,0xcb,0x52,0x45,0x17,0xd2,0x3e,0x47,0xfc,0xd5,0x1e,
+0xee,0xa4,0x44,0xcc,0x06,0xea,0x27,0xa5,0xf4,0x5a,0x35,0xa4,0x97,0xc0,0x66,0xc2,
+0x1d,0xb1,0xdb,0x17,0x52,0x04,0xc0,0x82,0xc3,0x93,0xee,0x89,0x8f,0xf8,0xb8,0x91,
+0xfc,0x82,0x0f,0xb6,0x44,0xdf,0xea,0xd1,0x12,0x0c,0xbf,0x95,0x78,0xc2,0x67,0x7b,
+0xc8,0x7b,0x2f,0x8d,0x57,0x63,0x2f,0x74,0x71,0xc9,0x88,0x05,0xd5,0x76,0x42,0xe1,
+0x12,0xba,0x36,0x03,0x07,0x87,0x3e,0xb0,0xa2,0xaa,0xd3,0xbe,0x47,0x0b,0x7a,0xb4,
+0x87,0x70,0xa0,0x65,0x23,0x32,0x34,0x4e,0x2f,0xd0,0x4c,0x1a,0xf1,0x6a,0x6f,0x43,
+0x73,0xbd,0xf2,0x42,0xc8,0x79,0x29,0xb0,0x99,0x21,0x80,0x35,0x04,0x09,0xe4,0xcf,
+0x12,0x37,0x14,0x8d,0x71,0x1b,0x0e,0x8e,0xb1,0x80,0x16,0xb4,0x00,0x96,0xee,0x00,
+0x6d,0x0c,0x2e,0xda,0xd6,0x54,0x44,0xb1,0x8f,0xe2,0x24,0xce,0x83,0xdb,0xd6,0xfa,
+0xd6,0xa3,0xe4,0x62,0xef,0xa2,0xcd,0x7f,0xab,0x2f,0x41,0xf0,0x9c,0xad,0x8b,0x8f,
+0x92,0x4d,0x54,0x18,0xef,0x5b,0xb8,0x53,0x84,0x21,0xe4,0x43,0xe5,0xe4,0x43,0xd9,
+0xea,0xfb,0x13,0x17,0x21,0x35,0x29,0xa8,0x56,0x41,0xf0,0x60,0x8e,0x7c,0x54,0x69,
+0xb1,0x1a,0xb2,0x42,0x03,0xd0,0x58,0x7f,0xeb,0x62,0xcf,0xde,0xb2,0x97,0xad,0xcb,
+0xab,0x59,0x94,0x22,0xf5,0x6c,0xfa,0x00,0xce,0x3a,0xdc,0x39,0x1b,0x9f,0xaa,0x21,
+0x41,0x8d,0x0f,0xd7,0x10,0x2c,0x5b,0x8b,0x22,0x18,0x1a,0x51,0xaf,0x6e,0x05,0xe4,
+0xa0,0x97,0x4f,0xf4,0x65,0x94,0xf2,0x21,0xd0,0x97,0x13,0x34,0x86,0x11,0xac,0x1f,
+0xd0,0x47,0x16,0xf8,0x3e,0xdd,0x81,0x9f,0x25,0xe4,0xe0,0x50,0xfd,0xb6,0x59,0x31,
+0x48,0x53,0xa8,0x01,0x8f,0x07,0x01,0x3c,0x57,0xe1,0x92,0xd5,0xbb,0xc1,0x89,0x26,
+0x7c,0xe6,0xa9,0x73,0x20,0x82,0xfd,0xb8,0x50,0x17,0x0e,0xaf,0xe1,0xca,0x30,0xc7,
+0xf1,0xf8,0xeb,0x44,0x6c,0x05,0xe0,0x13,0x43,0xf4,0xb9,0xa2,0xc6,0x9b,0xa1,0x57,
+0x2b,0x4a,0xf0,0xde,0x78,0xfd,0x07,0x74,0x79,0x04,0x51,0xd7,0x91,0xb7,0xd2,0x8a,
+0x56,0x57,0xc9,0x5a,0xc1,0xec,0x08,0x71,0xd0,0x9d,0x4b,0x8a,0xf9,0x0d,0x56,0x36,
+0x28,0x07,0x18,0xe3,0x50,0x64,0xac,0x0c,0x31,0x7e,0x2b,0xce,0xad,0x40,0x90,0x3d,
+0x8b,0x10,0x44,0x04,0x23,0xca,0xf2,0x2d,0xdc,0xe3,0xc8,0x8b,0xb8,0x88,0xe7,0x64,
+0x73,0xc2,0xa5,0x5f,0xb2,0xbc,0x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
+0x96,0x3f,0x14,0x41,0xda,0xbb,0xf5,0x01,0xd8,0xb5,0x90,0xf2,0xde,0xc7,0x75,0xe9,
+0x94,0x62,0x19,0x8e,0x3b,0x21,0x84,0xc9,0xb8,0xb2,0xc4,0x17,0x6e,0xba,0xb8,0x5d,
+0x28,0xe1,0x88,0xb7,0x1e,0xf5,0x26,0x4e,0xcf,0xb8,0xc1,0x45,0x57,0x18,0x14,0x8c,
+0x05,0xf0,0x82,0x13,0xa9,0xd0,0x12,0x57,0xef,0xe8,0xa3,0x64,0x25,0xc1,0x3c,0x46,
+0x7b,0x31,0x80,0x97,0xb8,0x94,0x1e,0x61,0xb9,0xeb,0xc0,0x76,0x9d,0x4f,0xbc,0x08,
+0x85,0x7f,0xe7,0x0d,0xc2,0xc2,0xe7,0x0d,0xc3,0xda,0x32,0x15,0xac,0x22,0x1a,0xde,
+0x0e,0x4a,0x90,0x7e,0x06,0xe4,0x48,0x6e,0xb5,0x77,0x11,0xe2,0xb0,0xeb,0x4b,0xd9,
+0x08,0x75,0xd8,0x1a,0x6b,0xed,0x14,0x91,0x8e,0xae,0x9b,0x81,0x03,0x31,0x4e,0xb5,
+0xd6,0xfb,0xbb,0xb9,0x7c,0x29,0xd1,0xdd,0x78,0x57,0x78,0x19,0x82,0x92,0x79,0x3f,
+0x87,0x2f,0x83,0x0c,0xbd,0xe6,0x02,0x8a,0x79,0x2a,0x86,0xf0,0x34,0x6a,0x4a,0x84,
+0xb5,0x48,0xcf,0xd3,0x6b,0x87,0x6c,0x08,0x19,0x0c,0xc7,0xe1,0xe0,0xc4,0x42,0x3f,
+0x17,0x25,0x41,0xf7,0xf8,0xc9,0xee,0x4d,0x3d,0x9c,0x83,0xa4,0xa1,0x3e,0x37,0xa9,
+0x03,0xc4,0x0b,0x1c,0x82,0xf9,0x22,0x81,0x44,0x7a,0x82,0xe8,0x35,0xce,0x40,0x35,
+0x23,0xba,0x44,0x19,0xf5,0xde,0x82,0x87,0xa6,0x76,0xca,0xd2,0x0b,0xae,0x16,0x7d,
+0x62,0x0d,0x4c,0x43,0x52,0x26,0x49,0x0b,0x88,0x0b,0xae,0x5e,0x81,0x04,0x56,0xc7,
+0x3f,0x3d,0xb1,0x53,0xbe,0x43,0x5d,0xd5,0xda,0x4e,0xd3,0x08,0xea,0x00,0x31,0xac,
+0xe5,0x2f,0x3a,0xf8,0x80,0x1d,0x62,0x79,0xf9,0x40,0xf6,0xd3,0x8f,0x9e,0x6a,0xf6,
+0x10,0x67,0xd6,0x88,0xa9,0xe6,0x94,0xc1,0x30,0xa8,0x75,0x0e,0x8a,0x75,0xfc,0x69,
+0x34,0x90,0x3f,0x2b,0x46,0x28,0x29,0x32,0xc0,0x4d,0xde,0x85,0xb5,0xb9,0x00,0x58,
+0x93,0x1e,0x6f,0xce,0x83,0x4c,0x69,0x19,0x71,0xb6,0x32,0x45,0x21,0x4d,0x99,0xc1,
+0xd1,0x89,0x4a,0x0b,0x39,0xfd,0xff,0x01,0xb5,0x79,0xd0,0x91,0xc2,0x50,0x00,0x00,
+};
+
+static const unsigned int dummy_align__rotek_png = 5;
+static const unsigned char data__rotek_png[] = {
+/* /rotek.png (11 chars) */
+0x2f,0x72,0x6f,0x74,0x65,0x6b,0x2e,0x70,0x6e,0x67,0x00,0x00,
+
+/* HTTP header */
+/* "HTTP/1.1 200 OK
+" (17 bytes) */
+0x48,0x54,0x54,0x50,0x2f,0x31,0x2e,0x31,0x20,0x32,0x30,0x30,0x20,0x4f,0x4b,0x0d,
+0x0a,
+/* "Server: lwIP/1.3.1 (http://savannah.nongnu.org/projects/lwip)
+" (63 bytes) */
+0x53,0x65,0x72,0x76,0x65,0x72,0x3a,0x20,0x6c,0x77,0x49,0x50,0x2f,0x31,0x2e,0x33,
+0x2e,0x31,0x20,0x28,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x73,0x61,0x76,0x61,0x6e,
+0x6e,0x61,0x68,0x2e,0x6e,0x6f,0x6e,0x67,0x6e,0x75,0x2e,0x6f,0x72,0x67,0x2f,0x70,
+0x72,0x6f,0x6a,0x65,0x63,0x74,0x73,0x2f,0x6c,0x77,0x69,0x70,0x29,0x0d,0x0a,
+/* "Content-Length: 5959
+" (18+ bytes) */
+0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x4c,0x65,0x6e,0x67,0x74,0x68,0x3a,0x20,
+0x35,0x39,0x35,0x39,0x0d,0x0a,
+/* "Connection: Close
+" (19 bytes) */
+0x43,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x69,0x6f,0x6e,0x3a,0x20,0x43,0x6c,0x6f,0x73,
+0x65,0x0d,0x0a,
+/* "Content-type: image/png
+Cache-Control: private, max-age=86400
+
+" (66 bytes) */
+0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x74,0x79,0x70,0x65,0x3a,0x20,0x69,0x6d,
+0x61,0x67,0x65,0x2f,0x70,0x6e,0x67,0x0d,0x0a,0x43,0x61,0x63,0x68,0x65,0x2d,0x43,
+0x6f,0x6e,0x74,0x72,0x6f,0x6c,0x3a,0x20,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x2c,
+0x20,0x6d,0x61,0x78,0x2d,0x61,0x67,0x65,0x3d,0x38,0x36,0x34,0x30,0x30,0x0d,0x0a,
+0x0d,0x0a,
+/* raw file data (5959 bytes) */
+0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52,
+0x00,0x00,0x01,0x57,0x00,0x00,0x00,0xae,0x08,0x06,0x00,0x00,0x00,0x82,0xdb,0x4e,
+0x7d,0x00,0x00,0x17,0x0e,0x49,0x44,0x41,0x54,0x78,0xda,0xed,0x9d,0x7d,0xac,0x2c,
+0x67,0x59,0xc0,0xcf,0xa1,0x80,0x7a,0x85,0x32,0x45,0x4b,0x14,0x10,0xb6,0x4d,0x2d,
+0xa6,0x0a,0xae,0x8a,0xb6,0xd8,0x52,0xc7,0x45,0x31,0x41,0x2d,0x1b,0x45,0x10,0x7a,
+0x0b,0x53,0x7a,0x69,0xbc,0x60,0x60,0x4d,0x63,0x94,0xd8,0x26,0xc3,0x55,0x6c,0xac,
+0xd2,0xc5,0xc6,0x5e,0x28,0x91,0x2c,0x1f,0x95,0x92,0x4a,0x5d,0x88,0xd5,0x4a,0x02,
+0xdd,0x3f,0x6a,0x52,0x93,0xa2,0x1b,0xac,0x36,0x46,0xa2,0x1b,0x01,0x69,0x6d,0x6b,
+0xe7,0xd2,0x72,0xfb,0x71,0x29,0x77,0x7d,0xdf,0x93,0x77,0x75,0x9c,0xce,0xce,0xbc,
+0x9f,0x33,0xb3,0x7b,0x7e,0x7f,0xfc,0x72,0x6f,0xce,0x39,0x3b,0xfb,0x39,0xbf,0x7d,
+0xe6,0x79,0x9e,0xf7,0x79,0x77,0x96,0xcb,0xe5,0x0e,0x00,0x00,0xf8,0x85,0x17,0x01,
+0x00,0x00,0xb9,0x02,0x00,0x20,0x57,0x00,0x00,0xe4,0x0a,0x00,0x00,0xc8,0x15,0x00,
+0x00,0xb9,0x02,0x00,0x20,0x57,0x00,0x00,0x40,0xae,0x00,0x00,0xc8,0x15,0x00,0x00,
+0xb9,0x02,0x00,0x00,0x72,0x05,0x00,0x40,0xae,0x00,0x00,0xc8,0x15,0x00,0x00,0x90,
+0x2b,0x00,0x00,0x72,0x05,0x00,0x40,0xae,0x00,0x00,0x80,0x5c,0x01,0x00,0x90,0x2b,
+0x00,0x00,0x72,0x05,0x00,0x00,0xe4,0x0a,0x00,0x80,0x5c,0x01,0x00,0x90,0x2b,0x00,
+0x00,0x20,0x57,0x00,0x00,0xe4,0x0a,0x00,0x80,0x5c,0x01,0x00,0x00,0xb9,0x02,0x00,
+0x20,0x57,0x00,0x00,0xe4,0x0a,0x00,0x00,0xc8,0x15,0x00,0x00,0xb9,0x02,0x00,0x20,
+0x57,0x00,0x00,0xe4,0xea,0x9f,0xc1,0x6b,0x5f,0xb7,0x96,0xdd,0x8f,0xde,0xbe,0x0d,
+0x44,0x82,0x38,0x47,0x9a,0x23,0xff,0xf3,0xde,0x96,0x3c,0xdf,0xd6,0x38,0xed,0x7d,
+0x37,0x56,0x7e,0x9e,0x00,0x24,0xc8,0x75,0x33,0xe5,0xda,0x17,0x8c,0x04,0x13,0xc1,
+0x5c,0xb0,0xb4,0x40,0xde,0x6e,0xaa,0x8e,0x13,0x23,0x4d,0xe4,0x0a,0xc8,0x75,0x3f,
+0xca,0x55,0x46,0xa5,0x89,0x92,0x61,0x66,0x29,0xd3,0x3a,0x32,0x75,0xfc,0x44,0xdd,
+0x1f,0x22,0x45,0xae,0x80,0x5c,0xb7,0x56,0xae,0xb1,0x8a,0x4e,0x97,0x2d,0x20,0x45,
+0x3b,0x44,0xa6,0xc8,0x15,0x90,0xeb,0x36,0xc9,0x55,0x46,0x8f,0x8b,0x96,0xa4,0x5a,
+0x64,0x41,0x34,0x8b,0x5c,0x01,0xb9,0x6e,0xba,0x5c,0xbb,0x24,0xd5,0xb2,0xb4,0xc1,
+0x08,0xb9,0x22,0x57,0x40,0xae,0x9b,0x24,0xd7,0xd8,0xa1,0x30,0x55,0xc5,0x2c,0x50,
+0x24,0x1b,0x23,0x57,0xe4,0x01,0xc8,0xb5,0xcb,0x72,0x95,0x97,0xda,0x63,0x07,0xd1,
+0xcd,0xd5,0xed,0x57,0x15,0xff,0x48,0xb3,0x5d,0x2b,0x51,0xb7,0x9b,0x3b,0xe6,0x64,
+0x23,0xe4,0x0a,0x80,0x5c,0xbb,0x26,0xd7,0xbe,0x45,0x0a,0x20,0x53,0x05,0xae,0xa1,
+0x47,0xb1,0x45,0xea,0x78,0x13,0x8b,0x4e,0x84,0x6c,0x3f,0x16,0xbd,0x90,0x2b,0x20,
+0xd7,0xee,0xca,0x75,0x64,0x71,0x79,0xdf,0x54,0x51,0x29,0xb1,0x48,0x27,0x8c,0x91,
+0x2b,0x00,0x72,0x6d,0x5b,0xae,0x13,0x43,0xa9,0xb6,0x95,0xdf,0xec,0x59,0x3c,0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x45,0x90,0x6e,0x80,0x5c,0x27,0x16,0x91,0xeb,0x3a,0x46,
+0x36,0xcb,0x68,0x0b,0x85,0xac,0x91,0xe5,0xc9,0x17,0x07,0x90,0xab,0x69,0x25,0xdc,
+0x34,0x95,0xd1,0x76,0xeb,0x55,0x71,0x86,0x6b,0xc8,0xc8,0x35,0x42,0xae,0x0d,0xb7,
+0x62,0x19,0xd0,0x53,0x27,0x90,0xfc,0xc0,0xa7,0xaa,0x70,0x35,0x0f,0x2d,0x5a,0x19,
+0xd1,0x0a,0x81,0xf6,0xb6,0x58,0xae,0xb3,0x36,0x17,0x0e,0x14,0xd2,0x01,0x4b,0x8d,
+0xee,0x80,0x26,0xe5,0x3a,0x1e,0x84,0xeb,0x14,0xe8,0xb7,0x20,0xd6,0x99,0xc7,0xe7,
+0xba,0x1c,0x34,0xdc,0xe9,0x80,0x5c,0x1b,0x62,0x25,0xb4,0xdc,0x07,0x35,0x11,0xd2,
+0xdb,0xeb,0x5c,0x08,0x31,0x61,0x49,0xca,0x5c,0x76,0x20,0x54,0xc9,0xb5,0x44,0xb0,
+0x33,0xc3,0x82,0x53,0x1b,0x72,0xed,0x92,0x58,0xe7,0x0e,0x9f,0x09,0xd3,0x28,0x73,
+0xe4,0xf9,0xb2,0x7d,0x16,0x38,0x8d,0x11,0xfa,0xf2,0x3c,0x74,0x8a,0xc2,0x39,0x7a,
+0x45,0xae,0xed,0xc8,0x75,0x0f,0x29,0x3d,0xf9,0xaf,0x14,0x60,0xae,0xc1,0x79,0xe2,
+0xb3,0x0a,0x2a,0x8e,0x9d,0x49,0x89,0xcb,0x68,0xb6,0x4c,0xae,0x9a,0x4b,0x7a,0x4d,
+0x5b,0xab,0xa6,0x86,0xf3,0x6f,0x75,0xe5,0xda,0x6b,0x43,0xaa,0x32,0xc7,0x5a,0xd2,
+0xd3,0xea,0x9a,0x9b,0x4b,0x07,0xfe,0xdb,0x9a,0x4c,0x52,0x52,0x93,0xc0,0x8f,0x37,
+0xc4,0x8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3,0xfb,0x1a,0x36,0x12,0xbd,0x22,0x57,0x7b,0xc6,0x86,0x91,0x46,0x64,
+0x19,0x49,0x2c,0x0a,0x69,0x84,0xb1,0x6e,0x64,0x20,0xe4,0x9a,0x8f,0x66,0x8d,0x3a,
+0x0e,0x64,0x94,0x26,0x22,0xd9,0x54,0xae,0xfa,0x2a,0x91,0xeb,0xc4,0x62,0x82,0xd6,
+0xc2,0x71,0x68,0x8b,0xe9,0x80,0xec,0xbe,0xc6,0x92,0x57,0xd7,0x4d,0x09,0xb3,0xc0,
+0x11,0xa0,0x6e,0xc4,0x64,0x3b,0x34,0x7a,0xa7,0x03,0x51,0xb1,0xcf,0x94,0x9c,0xae,
+0x14,0xd3,0x26,0xa2,0x57,0xe4,0x6a,0xcf,0xd0,0x22,0xef,0x3a,0xb5,0x78,0xe3,0xfa,
+0x15,0x09,0xff,0x4a,0xd1,0x2a,0xb9,0x16,0x4f,0x6e,0xa3,0x6f,0x6d,0x39,0xa1,0x4b,
+0x2e,0xad,0xcd,0xc9,0xb5,0x2a,0x77,0xba,0xf0,0xb8,0x53,0x6e,0x13,0x03,0xb2,0xa7,
+0x8e,0x72,0x35,0x69,0x69,0xb2,0xd9,0xaf,0x69,0x32,0x08,0x53,0x20,0x33,0xcd,0x15,
+0x67,0x83,0x06,0xaa,0xeb,0x81,0x9e,0x6b,0x7f,0x4d,0xa0,0x93,0x85,0x8e,0x5e,0x91,
+0xab,0x3d,0x91,0xc5,0x65,0x57,0x62,0xf9,0x8d,0x5f,0x17,0xf1,0xac,0x0a,0x63,0x5a,
+0xdf,0xac,0xa2,0x80,0x35,0x34,0x89,0x46,0xd4,0x0a,0xb2,0x54,0xe5,0x46,0x27,0x9e,
+0xb7,0x14,0xef,0xed,0xb6,0x37,0x20,0xdb,0x48,0xd8,0x15,0xdb,0xba,0xd4,0x45,0x82,
+0xa3,0xc0,0x91,0x52,0x97,0x06,0x64,0x77,0x79,0x5b,0x18,0x1f,0xcb,0x67,0x63,0xe4,
+0xda,0xcc,0x0a,0xad,0x99,0x45,0x11,0x62,0x61,0x59,0x15,0x9e,0x18,0x5c,0x96,0x25,
+0x35,0x72,0xcd,0x57,0x81,0x67,0x06,0x51,0xec,0xa2,0xa2,0xab,0xa0,0x6a,0x7b,0xf0,
+0x85,0x63,0xbe,0x35,0xd4,0x80,0xec,0x78,0xd7,0xdf,0x9e,0x59,0x93,0xc2,0x89,0xd7,
+0xb7,0xb9,0x52,0xb0,0x6c,0xf2,0xef,0xd2,0x80,0xec,0x2e,0x31,0xf7,0x58,0x58,0x34,
+0x4e,0x7b,0x20,0x57,0x37,0x46,0x16,0x79,0xad,0xc4,0x61,0x3d,0xb3,0x49,0x84,0x92,
+0xa9,0x6f,0xe7,0x5e,0x85,0x5c,0xad,0x24,0x2b,0xb7,0xab,0x31,0x28,0x64,0xc5,0x16,
+0x5b,0x8a,0xbb,0x76,0x0a,0xa4,0x21,0xe4,0x1a,0x62,0x06,0x84,0x85,0x14,0x5c,0xab,
+0xe7,0xa1,0x07,0x64,0x77,0x89,0xba,0xe7,0x3a,0x09,0x19,0xbd,0x22,0xd7,0x70,0xa9,
+0x81,0x99,0x65,0xf4,0x3a,0xd5,0xc8,0x39,0x65,0x16,0x1f,0xb2,0x58,0x33,0x4a,0xd1,
+0x8a,0xb4,0x64,0x14,0x97,0xdb,0x25,0xa1,0x2a,0x6a,0x9d,0xec,0xfa,0xd9,0xf5,0x35,
+0xc4,0x80,0x6c,0xa3,0xe5,0xb4,0x0d,0x09,0x21,0xb3,0x68,0xfb,0x09,0xb9,0xec,0x75,
+0x93,0xe5,0x9a,0x0e,0xfc,0x16,0xc7,0x8c,0xa2,0x57,0xe4,0xea,0xce,0xd4,0xe2,0x1b,
+0xae,0x2e,0x29,0x3f,0xd6,0x90,0xfa,0xc4,0x32,0x22,0xd2,0xa9,0x14,0x27,0x3a,0x02,
+0x97,0x91,0x9c,0xda,0x01,0x77,0xb4,0xda,0x1a,0x7c,0xa0,0xbf,0x3d,0xf8,0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6d,0x66,0x0d,0xa4,0x3e,0x66,0xc8,0xb5,
+0x99,0x61,0xd9,0x0b,0xcb,0x08,0x34,0xd1,0xcc,0x95,0xf6,0x3b,0x20,0xd8,0x48,0xa3,
+0x3f,0x30,0x13,0x72,0x9d,0xd6,0x44,0xad,0x91,0xa5,0x5c,0x23,0x8d,0x68,0x33,0x09,
+0x21,0xd7,0x35,0x83,0x5b,0x5c,0xa3,0xd5,0xa1,0x87,0xf7,0xa4,0xa9,0x06,0xff,0x7e,
+0x4b,0x63,0x07,0x9b,0x1a,0x74,0x9d,0xf9,0x8e,0x5e,0x91,0x6b,0x33,0xb9,0xd7,0xba,
+0x5c,0x97,0x6e,0x43,0x73,0x1a,0x30,0x8a,0xcd,0xe7,0x58,0xa7,0x35,0xf9,0xaa,0xda,
+0xae,0x82,0xef,0x3d,0x72,0xd4,0x75,0x45,0x56,0x5d,0x0b,0xd5,0x64,0x4d,0x1e,0x36,
+0xde,0x0d,0xb4,0x1f,0x97,0xa7,0xe8,0x6d,0x31,0xf0,0xb0,0x6d,0x73,0x43,0x9d,0x02,
+0x65,0x9f,0x91,0x91,0x8a,0xd8,0xba,0x2e,0xda,0xd1,0xa0,0x99,0xae,0x88,0x05,0x72,
+0x6d,0x26,0xb2,0x9b,0x39,0x14,0x91,0x74,0xab,0xff,0x99,0x67,0xc9,0x46,0x15,0xb3,
+0x07,0xaa,0xee,0xa7,0x36,0x8a,0x3d,0xfb,0x8a,0x23,0xae,0x1d,0x02,0x9d,0x22,0x27,
+0x97,0xb9,0xc5,0x09,0x38,0xf6,0xb1,0x7b,0x05,0x6c,0x0e,0xc8,0xd5,0xff,0xf6,0x2f,
+0x99,0x43,0x0f,0xeb,0xc8,0x22,0x5f,0x97,0x58,0x8a,0x76,0xa8,0xd9,0x69,0x50,0x77,
+0xf9,0x5a,0x99,0x8b,0x95,0x63,0x0c,0x2d,0xa3,0xca,0x2e,0xca,0xb5,0xf8,0xe5,0x12,
+0xab,0xf7,0x2c,0x5d,0x43,0xdc,0x91,0x7c,0x39,0x20,0xd7,0xad,0xd8,0xa0,0x30,0x75,
+0xcc,0x7b,0x0d,0x2d,0x2f,0x3f,0xe7,0xb9,0x9d,0x0e,0x86,0x25,0xc3,0x87,0xd3,0x5c,
+0x37,0x81,0xcd,0xe5,0x4f,0xbf,0x26,0xfa,0x9d,0xd5,0x08,0x76,0x3c,0x28,0xdf,0x71,
+0x76,0x53,0xe5,0x0a,0x80,0x5c,0x5b,0xd8,0xfd,0xb5,0x4e,0x60,0x89,0x46,0x04,0x3c,
+0xef,0x48,0xee,0xca,0xa4,0x98,0xb6,0xf6,0x8b,0xe5,0xbc,0x83,0x87,0x8a,0xad,0x5a,
+0xc8,0x15,0x90,0x2b,0x72,0xb5,0xca,0x63,0x66,0x03,0xf7,0x45,0x02,0xe9,0xa0,0xdd,
+0x16,0x18,0x9b,0x02,0x48,0x5c,0xf1,0x98,0xf7,0x04,0x8b,0x5c,0x01,0xb9,0x22,0xd7,
+0x90,0xdd,0x03,0xba,0xf2,0xea,0x39,0x0c,0x98,0x70,0xd9,0xf1,0xb2,0xa7,0xf9,0xd8,
+0x8c,0x22,0x6f,0xb9,0xd8,0xc0,0xa1,0x15,0x0b,0xb9,0x02,0x72,0x45,0xae,0xda,0x3d,
+0xac,0xba,0xbd,0x87,0x3d,0x95,0x33,0x0d,0x15,0xc9,0x66,0x06,0x52,0xcd,0x77,0x37,
+0xac,0x5b,0xe4,0x50,0x35,0xff,0xc0,0xa8,0xdf,0x12,0xb9,0x02,0x72,0x45,0xae,0xb6,
+0xfd,0x73,0x73,0xc3,0x49,0x48,0x89,0xea,0x14,0xf0,0x21,0x5a,0xd3,0x8e,0x83,0xb2,
+0xe2,0x55,0x55,0x5e,0x36,0xdd,0x16,0xc1,0x22,0x0c,0x40,0xae,0xdd,0x92,0xab,0x6e,
+0x0f,0x6b,0x66,0xd1,0xf8,0xbc,0x5a,0x39,0x33,0x52,0xf7,0x51,0xd5,0xdc,0xbd,0x9a,
+0x2f,0x30,0xc9,0xb5,0x09,0xf9,0x5c,0x02,0x9b,0x59,0xcc,0xb0,0xdd,0x28,0xc1,0x22,
+0x0c,0x40,0xae,0xdd,0x93,0xab,0xe9,0x4e,0x02,0xbd,0x8e,0x7d,0x50,0x7a,0x03,0xfd,
+0x69,0xf7,0x89,0xe1,0xfa,0xf4,0x64,0x53,0x04,0x8b,0x30,0x00,0xb9,0x76,0x53,0xae,
+0xa6,0x03,0x22,0xc6,0x1d,0x68,0x40,0x8f,0x0c,0x3b,0x16,0xc6,0x1a,0x51,0x76,0xe6,
+0x3a,0x63,0x14,0xb9,0x02,0x72,0x45,0xae,0xd6,0x83,0xa8,0x07,0x35,0x5b,0xb5,0x34,
+0x10,0xa9,0x9a,0xb6,0x81,0x25,0x06,0xc7,0x9e,0xfb,0x98,0x65,0x8a,0x5c,0x01,0xb9,
+0x22,0xd7,0xb2,0x08,0xce,0x74,0x91,0xc0,0xd4,0xf3,0xc0,0x8f,0xaa,0x25,0xb1,0xa1,
+0x67,0x91,0x46,0x25,0xcf,0x7f,0x61,0x13,0xa9,0x23,0x57,0x40,0xae,0xc8,0xd5,0x66,
+0x7c,0xdf,0xba,0x68,0x76,0x25,0xda,0xbe,0x87,0x08,0x35,0x19,0xd8,0xed,0x66,0xe0,
+0x3a,0x8b,0xb4,0x4c,0xb0,0xb6,0xf3,0x46,0x91,0x2b,0x20,0x57,0xe4,0x6a,0xbf,0x29,
+0x60,0x4d,0x17,0xc0,0xb8,0x62,0xae,0x40,0xac,0x7e,0x9e,0x9f,0x2f,0xe0,0xd2,0xc6,
+0xe5,0x6b,0x16,0x69,0x99,0x60,0xc7,0x2e,0xc7,0x44,0xae,0x80,0x5c,0x91,0x6b,0xd7,
+0x96,0xba,0xb6,0x31,0xee,0x70,0x9d,0x60,0x87,0x21,0x5e,0x63,0xe4,0x0a,0xc8,0x75,
+0x7f,0xca,0xd5,0xa6,0x3a,0xdf,0xc5,0x25,0xb1,0x3e,0x04,0x9b,0x85,0xe8,0x94,0x40,
+0xae,0x80,0x5c,0xf7,0xaf,0x5c,0x8b,0x92,0x5d,0x74,0x24,0x52,0x6d,0xa2,0x5b,0x21,
+0xdf,0xa6,0x35,0x21,0x72,0x05,0xe4,0x8a,0x5c,0x43,0x33,0x34,0x68,0xe0,0xf7,0xb9,
+0x69,0x5e,0xd2,0xc2,0x73,0xed,0xbb,0xe6,0x5c,0x91,0x2b,0x20,0x57,0xe4,0x6a,0x13,
+0xcd,0xae,0x5a,0xa5,0x7c,0x47,0xb4,0x0b,0x75,0xdc,0x64,0xb0,0xc5,0x93,0xf3,0x91,
+0x2b,0x20,0x57,0xe4,0xaa,0x2b,0xdb,0xd5,0x0e,0x03,0x75,0x73,0x05,0xf2,0x12,0x9d,
+0xa9,0xc8,0x74,0xd5,0x59,0xd0,0xdb,0x2f,0x1f,0x76,0xe4,0x0a,0xc8,0x15,0x00,0x00,
+0x90,0x2b,0x00,0x00,0x72,0x05,0x00,0x40,0xae,0x00,0x00,0x80,0x5c,0x01,0x00,0x90,
+0x2b,0x00,0x00,0x72,0x05,0x00,0x00,0xe4,0x0a,0x00,0x80,0x5c,0x01,0x00,0x90,0x2b,
+0x00,0x00,0x20,0x57,0x00,0x00,0xe4,0x0a,0x00,0x80,0x5c,0x01,0x00,0x00,0xb9,0x02,
+0x00,0x20,0x57,0x00,0x00,0xe4,0x0a,0x00,0x00,0xc8,0x15,0x00,0x00,0xb9,0x02,0x00,
+0x20,0x57,0x00,0x00,0x40,0xae,0x00,0x00,0xc8,0x15,0x00,0x00,0xb9,0x02,0x00,0x00,
+0x72,0x05,0x00,0x40,0xae,0x00,0x00,0xc8,0x15,0x00,0x00,0x90,0x2b,0x00,0x00,0x72,
+0x05,0x00,0x40,0xae,0x00,0x00,0xfb,0x5c,0xae,0x3f,0xf6,0x85,0x66,0x79,0xca,0x83,
+0x18,0x0e,0xdb,0x81,0x37,0x1f,0x00,0x90,0x6b,0x40,0xb9,0xb6,0x75,0xff,0x9a,0x92,
+0x3f,0x76,0xcb,0x45,0xad,0xc3,0x89,0x02,0xd0,0x6d,0xb9,0x1e,0x76,0x90,0xeb,0x33,
+0x04,0x17,0x09,0x3e,0x28,0xf8,0x82,0xe0,0x41,0xc1,0x49,0xc1,0x23,0x82,0x7f,0x13,
+0xdc,0x22,0x78,0x87,0xe0,0x79,0x0d,0xcb,0xf5,0x4d,0x82,0xf3,0x3a,0x2c,0xd7,0x97,
+0x0b,0x2e,0x41,0xae,0x00,0xdb,0x2b,0xd7,0x8b,0x05,0x99,0x85,0x5c,0x9f,0x2e,0xb8,
+0x4c,0xf0,0x9f,0x82,0xa5,0x06,0x27,0x04,0xd7,0x0b,0xbe,0xbb,0x01,0xb9,0x1e,0x10,
+0x7c,0x45,0x70,0xa7,0x60,0xb7,0x83,0x72,0xdd,0x15,0xdc,0x21,0xf8,0x9a,0xe0,0x59,
+0xc8,0x15,0x60,0xfb,0xe4,0x3a,0x10,0x3c,0x21,0x78,0xd4,0x50,0xae,0x3f,0x2c,0xf8,
+0x27,0x4d,0xa9,0x16,0x79,0x58,0x70,0x79,0x60,0xb9,0xbe,0x27,0x77,0x7f,0x07,0x3b,
+0x28,0xd7,0x37,0x08,0x96,0x8a,0xf7,0x22,0x57,0x80,0xed,0x92,0xeb,0x4b,0x05,0xc7,
+0x04,0x4b,0x85,0xae,0x5c,0x7f,0x41,0xf0,0x8d,0x82,0x30,0xbf,0x25,0xf8,0xbc,0xe0,
+0xdd,0x82,0x5f,0x14,0x5c,0x20,0x78,0xb5,0xe0,0xb0,0xe0,0x13,0x2a,0x45,0x50,0x94,
+0xec,0x9f,0x08,0x9e,0x16,0x40,0xae,0x2f,0x12,0x1c,0xcf,0xdd,0xcf,0x57,0x55,0x24,
+0xdb,0x15,0xb9,0x1e,0x10,0xfc,0x47,0x4e,0xae,0x8f,0x09,0xce,0x40,0xae,0x00,0xdb,
+0x21,0xd7,0xd3,0x05,0x5f,0xca,0x89,0x55,0x57,0xae,0x03,0xc1,0x13,0x05,0x49,0x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f,0x18,0xee,0xfe,0xfa,0x03,0x06,0x79,0xd3,0xfc,0xdc,0xd6,0x33,0x15,0x0f,0x1b,
+0xde,0xf6,0x01,0x15,0x29,0xeb,0xca,0xf5,0x54,0xd5,0xec,0x6f,0x22,0xc8,0x87,0x05,
+0x67,0x2a,0xee,0x32,0xbc,0xad,0x1c,0xae,0x7d,0x0e,0x72,0x05,0x08,0x27,0x57,0x39,
+0x63,0xe0,0x1f,0x95,0x5c,0xaf,0xf0,0x31,0x9e,0xd0,0x40,0xae,0x3b,0xea,0xf2,0xf9,
+0xf2,0xc2,0x90,0xea,0x2a,0x4e,0xa8,0x68,0xf5,0x74,0xed,0x35,0xfd,0x4f,0xdd,0x5e,
+0xa6,0x29,0xc6,0x06,0x72,0xfd,0xa3,0x06,0x72,0xad,0x45,0x3e,0x8b,0x5c,0x01,0xc2,
+0xce,0x73,0x7d,0xd9,0xba,0xf1,0x81,0x0d,0xc8,0x35,0x3f,0x14,0xfb,0x22,0x95,0xdf,
+0x94,0x83,0x5a,0x1e,0x54,0x82,0xfa,0x86,0x5a,0x06,0xfb,0x17,0x82,0x77,0xa8,0x2e,
+0x01,0xb3,0x21,0xd5,0x76,0xbb,0xbf,0xfa,0xc3,0xdf,0xb0,0xec,0x60,0x70,0xa2,0x00,
+0x98,0xf3,0x3f,0x7f,0x63,0xcb,0xae,0xe6,0x24,0xed,0x24,0x00,0x00,0x00,0x00,0x49,
+0x45,0x4e,0x44,0xae,0x42,0x60,0x82,};
+
+static const unsigned int dummy_align__settings_html = 6;
+static const unsigned char data__settings_html[] = {
+/* /settings.html (15 chars) */
+0x2f,0x73,0x65,0x74,0x74,0x69,0x6e,0x67,0x73,0x2e,0x68,0x74,0x6d,0x6c,0x00,0x00,
+
+/* HTTP header */
+/* "HTTP/1.1 200 OK
+" (17 bytes) */
+0x48,0x54,0x54,0x50,0x2f,0x31,0x2e,0x31,0x20,0x32,0x30,0x30,0x20,0x4f,0x4b,0x0d,
+0x0a,
+/* "Server: lwIP/1.3.1 (http://savannah.nongnu.org/projects/lwip)
+" (63 bytes) */
+0x53,0x65,0x72,0x76,0x65,0x72,0x3a,0x20,0x6c,0x77,0x49,0x50,0x2f,0x31,0x2e,0x33,
+0x2e,0x31,0x20,0x28,0x68,0x74,0x74,0x70,0x3a,0x2f,0x2f,0x73,0x61,0x76,0x61,0x6e,
+0x6e,0x61,0x68,0x2e,0x6e,0x6f,0x6e,0x67,0x6e,0x75,0x2e,0x6f,0x72,0x67,0x2f,0x70,
+0x72,0x6f,0x6a,0x65,0x63,0x74,0x73,0x2f,0x6c,0x77,0x69,0x70,0x29,0x0d,0x0a,
+/* "Content-Length: 2073
+" (18+ bytes) */
+0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x4c,0x65,0x6e,0x67,0x74,0x68,0x3a,0x20,
+0x32,0x30,0x37,0x33,0x0d,0x0a,
+/* "Connection: Close
+" (19 bytes) */
+0x43,0x6f,0x6e,0x6e,0x65,0x63,0x74,0x69,0x6f,0x6e,0x3a,0x20,0x43,0x6c,0x6f,0x73,
+0x65,0x0d,0x0a,
+/* "Content-type: text/html
+Content-Encoding: gzip
+
+" (51 bytes) */
+0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,0x2d,0x74,0x79,0x70,0x65,0x3a,0x20,0x74,0x65,
+0x78,0x74,0x2f,0x68,0x74,0x6d,0x6c,0x0d,0x0a,0x43,0x6f,0x6e,0x74,0x65,0x6e,0x74,
+0x2d,0x45,0x6e,0x63,0x6f,0x64,0x69,0x6e,0x67,0x3a,0x20,0x67,0x7a,0x69,0x70,0x0d,
+0x0a,0x0d,0x0a,
+/* raw file data (2073 bytes) */
+0x1f,0x8b,0x08,0x00,0x00,0x00,0x00,0x00,0x04,0x0a,0xb5,0x58,0xdd,0x6e,0xdc,0xc6,
+0x15,0x7e,0x15,0x9a,0x69,0x83,0x5d,0x40,0xdc,0x95,0x6c,0x24,0x28,0xec,0x25,0x81,
+0x56,0x76,0x03,0x5f,0x24,0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0xe0,0xdb,0xac,0x08,0x65,0xf3,0xba,0x2d,0x76,0x79,0xe0,0xc8,
+0xa4,0x09,0xe1,0x95,0x33,0x0e,0x45,0x3d,0x85,0x1a,0x45,0xb7,0x37,0x62,0x75,0xa2,
+0x88,0x38,0xe0,0xbb,0x03,0x02,0x87,0x56,0x1b,0xd8,0x3c,0x21,0x41,0xd8,0xaa,0x14,
+0xcd,0x89,0x77,0xb4,0x21,0x23,0x1e,0x17,0x8e,0x80,0x2b,0xeb,0xad,0x45,0xd8,0x58,
+0x03,0xc2,0x35,0x12,0xe1,0x51,0xef,0xa6,0x07,0x0f,0x09,0x7a,0x2e,0x63,0xaf,0x76,
+0xfd,0x82,0xcc,0x4d,0xf9,0x55,0x7d,0xad,0xb9,0xd3,0x7e,0xf3,0x0c,0x60,0x4a,0x8a,
+0x78,0x92,0xaf,0xca,0x4b,0xb1,0x3f,0x03,0x06,0x9d,0x87,0x0c,0xa4,0x43,0x97,0x8a,
+0x88,0xb7,0x13,0x4d,0xc1,0x2b,0xbf,0x43,0x42,0x7f,0x81,0x60,0xde,0x07,0xeb,0x45,
+0xf5,0x25,0xc5,0xf7,0x92,0xf5,0xb0,0x00,0x6e,0x9e,0x71,0x01,0x61,0x44,0x4a,0x71,
+0xa2,0x61,0x43,0x21,0x21,0x74,0x9b,0x6e,0x9c,0x2b,0x00,0x96,0x47,0x30,0x0d,0xed,
+0x45,0x5c,0x09,0xe4,0x2d,0xf2,0xd4,0x19,0x27,0xbb,0x64,0x36,0xa2,0xaf,0xd2,0x97,
+0x3e,0xd3,0x03,0x62,0xa3,0xc9,0xe4,0x56,0x57,0x7f,0x22,0x96,0x59,0xfd,0xc1,0xb5,
+0x1b,0x38,0xd8,0xe0,0x93,0x64,0x63,0x6c,0xc3,0xa1,0xda,0xd3,0xfa,0x5d,0x6f,0x50,
+0x6c,0x97,0xeb,0x70,0x00,0x81,0x85,0x69,0xcd,0x77,0xf2,0x38,0x4a,0x97,0x41,0xac,
+0xcd,0x78,0x83,0x8d,0x6d,0xef,0x93,0x8f,0x3e,0xdc,0x5a,0x9a,0x61,0xe5,0x4c,0xcc,
+0xe5,0x1c,0xa6,0xfe,0x2f,0x39,0x0a,0xb9,0x71,0x50,0x7d,0xbd,0xc4,0x94,0x73,0xfd,
+0xd7,0x31,0x22,0x69,0x2a,0x79,0x94,0x9a,0x32,0x03,0xf8,0xa8,0x84,0x90,0x56,0xb5,
+0xc0,0xb4,0x12,0xaa,0x88,0x85,0xbb,0xc1,0x6e,0x05,0x79,0x81,0x5b,0x8a,0xf7,0xe3,
+0x1a,0x70,0x17,0x08,0x99,0xfb,0x3a,0x68,0x5a,0xa8,0x5c,0xa1,0x43,0x48,0xbf,0x4a,
+0x9f,0x10,0xc8,0xb9,0x88,0xb5,0x31,0xe0,0xd1,0x02,0x94,0x1d,0xc3,0xfb,0x5f,0x54,
+0xf7,0x47,0xc3,0xf1,0x8a,0x1c,0x0a,0xae,0x26,0x59,0x52,0x50,0x4a,0x85,0x6c,0xcc,
+0x43,0x0b,0x4b,0xae,0xcd,0x77,0x25,0x29,0x71,0x2b,0x02,0x38,0x91,0xdb,0x8f,0x80,
+0xf4,0x4f,0xaa,0x6f,0x09,0x1c,0x01,0xfc,0xc8,0x67,0x42,0xca,0x2f,0xcb,0x05,0x82,
+0x8f,0x0e,0x79,0xa3,0x9c,0x87,0xdc,0x97,0x8d,0x7a,0x8a,0x6c,0x8d,0x82,0x96,0xc2,
+0x15,0x27,0x8f,0x74,0x40,0x99,0x94,0x6b,0x74,0x33,0x97,0x10,0x34,0x9a,0x14,0x48,
+0x52,0xbd,0xf8,0xdf,0x62,0xb3,0xae,0x1c,0x0a,0xf9,0x0c,0x11,0x21,0xd7,0x3f,0x21,
+0x04,0x2a,0x65,0x53,0x7c,0xe8,0xad,0x15,0x88,0x70,0xb2,0xad,0x45,0x06,0x87,0x5b,
+0x53,0xa1,0xea,0x86,0x2e,0x47,0x8a,0xe8,0x99,0x0c,0x78,0xa1,0x55,0x18,0xa2,0x1b,
+0x65,0x07,0xd5,0x10,0x75,0xe5,0x17,0xb6,0x0b,0x68,0x77,0xed,0x42,0xec,0xde,0xae,
+0x5d,0xd8,0x6e,0xc7,0x2e,0xda,0x26,0x67,0x2c,0x63,0xc6,0xd5,0x77,0xca,0xf6,0xa7,
+0x28,0xfe,0x08,0x86,0xf2,0x18,0x37,0x05,0x18,0xe4,0x6e,0x7b,0x49,0x78,0x88,0xaa,
+0xfa,0xb3,0xaa,0xad,0x3f,0x94,0xa7,0x54,0x95,0xa9,0x3c,0xeb,0xc0,0x01,0x04,0x3d,
+0x27,0x0c,0x8d,0x34,0x51,0x65,0x45,0x63,0x49,0x1d,0x67,0x66,0x91,0x6a,0xbf,0xd6,
+0xf6,0x1a,0x33,0x1d,0xb4,0xbe,0xcc,0x00,0xf6,0x94,0x88,0xab,0x2b,0x28,0x5a,0x53,
+0x2a,0x81,0xed,0xfa,0x27,0x12,0xb7,0x8c,0x5e,0x1f,0xc5,0x0f,0xce,0x3c,0xc6,0x4d,
+0xe1,0xef,0x50,0x46,0xd5,0xa9,0x36,0x8c,0xb4,0x05,0x8c,0xb0,0x6b,0x48,0xfe,0xf2,
+0x99,0x61,0x52,0xee,0x68,0xa4,0x98,0xbd,0x95,0x08,0x30,0x98,0x76,0x22,0x80,0x12,
+0xe8,0x8c,0xff,0x9f,0x95,0x19,0x2d,0x99,0xb7,0x90,0x19,0x26,0xed,0xae,0x5d,0xde,
+0x5a,0x66,0x18,0x4c,0x3b,0x76,0x31,0x33,0xc3,0x7c,0x6e,0x6a,0xd6,0x6a,0xd1,0x41,
+0xc5,0x22,0xac,0x57,0x55,0x6f,0x86,0x1b,0xed,0x0b,0x0a,0x81,0x2e,0x4c,0xcf,0x45,
+0x79,0x23,0x16,0x33,0xdc,0x78,0x6e,0xf9,0x49,0x14,0x15,0xe8,0x35,0x50,0x01,0x3e,
+0xc6,0xbb,0x85,0x3e,0x46,0xbf,0xb7,0x31,0x4c,0x9e,0x34,0xf3,0x46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,0xda,0x06,0xbf,0xd4,
+0x37,0xf8,0xab,0x18,0x3e,0x57,0x00,0x46,0x53,0x2c,0xfa,0xac,0xc8,0xac,0x2d,0x89,
+0x33,0x90,0xec,0xbd,0xbc,0x17,0x68,0xc0,0xaa,0x66,0xa9,0xcf,0xb0,0xff,0x9a,0xf2,
+0x26,0xed,0xe8,0x5d,0x58,0xef,0xf7,0xef,0x5c,0x59,0x46,0xdf,0x50,0x8d,0xb0,0xff,
+0x0f,0x0b,0x40,0x5d,0x3d,0xd2,0x16,0x00,0x00,};
+
+
+
+const struct fsdata_file file__favicon_ico[] = { {
+file_NULL,
+data__favicon_ico,
+data__favicon_ico + 16,
+sizeof(data__favicon_ico) - 16,
+1,
+}};
+
+const struct fsdata_file file__index_html[] = { {
+file__favicon_ico,
+data__index_html,
+data__index_html + 12,
+sizeof(data__index_html) - 12,
+1,
+}};
+
+const struct fsdata_file file__info_html[] = { {
+file__index_html,
+data__info_html,
+data__info_html + 12,
+sizeof(data__info_html) - 12,
+1,
+}};
+
+const struct fsdata_file file__main_css[] = { {
+file__info_html,
+data__main_css,
+data__main_css + 12,
+sizeof(data__main_css) - 12,
+1,
+}};
+
+const struct fsdata_file file__main_js[] = { {
+file__main_css,
+data__main_js,
+data__main_js + 12,
+sizeof(data__main_js) - 12,
+1,
+}};
+
+const struct fsdata_file file__rotek_png[] = { {
+file__main_js,
+data__rotek_png,
+data__rotek_png + 12,
+sizeof(data__rotek_png) - 12,
+1,
+}};
+
+const struct fsdata_file file__settings_html[] = { {
+file__rotek_png,
+data__settings_html,
+data__settings_html + 16,
+sizeof(data__settings_html) - 16,
+1,
+}};
+
+#define FS_ROOT file__settings_html
+#define FS_NUMFILES 7
+

+ 56 - 0
modules/HTTP_Server/fsdata.h

@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2001-2003 Swedish Institute of Computer Science.
+ * All rights reserved. 
+ * 
+ * Redistribution and use in source and binary forms, with or without modification, 
+ * are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
+ * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 
+ * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
+ * OF SUCH DAMAGE.
+ *
+ * This file is part of the lwIP TCP/IP stack.
+ * 
+ * Author: Adam Dunkels <adam@sics.se>
+ *
+ **/
+#ifndef __FSDATA_H__
+#define __FSDATA_H__
+
+#include "lwip/opt.h"
+
+struct fsdata_file {
+  const struct fsdata_file *next;
+  const unsigned char *name;
+  const unsigned char *data;
+  int len;
+  u8_t http_header_included;
+#if HTTPD_PRECALCULATED_CHECKSUM
+  u16_t chksum_count;
+  const struct fsdata_chksum *chksum;
+#endif /* HTTPD_PRECALCULATED_CHECKSUM */
+};
+
+struct fsdata_file_noconst {
+  struct fsdata_file *next;
+  char *name;
+  char *data;
+  int len;
+};
+
+#endif /* __FSDATA_H__ */

+ 769 - 0
modules/HTTP_Server/http_server.c

@@ -0,0 +1,769 @@
+#include "lwip/opt.h"
+#include "lwip/arch.h"
+#include "lwip/api.h"
+#include "lwip/tcp.h"
+
+#include "http_server.h"
+#include "web_params_api.h"
+#include "parameters.h"
+#include "trap_params.h"
+#include "fsdata.c"
+#include "settings_api.h"
+#include "netconf.h"
+#include "common_config.h"
+//#include "testing.h"
+#include "rtc.h"
+
+#ifdef PRINTF_STDLIB
+#include <stdio.h>
+#endif
+#ifdef PRINTF_CUSTOM
+#include "tinystdio.h"
+#endif
+#include <string.h>
+#include <stdlib.h>
+
+static int fs_open(char *name, struct fs_file *file);
+static err_t http_sent(void *arg, struct tcp_pcb *pcb, u16_t len);
+static void send_data(struct tcp_pcb *pcb, struct http_state *hs);
+
+SET_PAGE_t SET_PAGE = SET_PAGE_IDLE;
+
+#define SEND_BUF_MAX_LEN   2000
+#define RECIVE_BUF_MAX_LEN   1500
+char sendBuf[SEND_BUF_MAX_LEN];
+uint16_t sendBufLoadLen = 0;
+
+uint16_t printLen = 0;
+//char printBuf[1000];
+
+char receiveBuf[RECIVE_BUF_MAX_LEN];
+uint16_t receivedBufLen = 0;
+
+/**
+  * @brief  closes tcp connection
+  * @param  pcb: pointer to a tcp_pcb struct
+  * @param  hs: pointer to a http_state struct
+  * @retval
+  */
+static void close_conn(struct tcp_pcb *pcb, struct http_state *hs)
+{
+  tcp_arg(pcb, NULL);
+  tcp_sent(pcb, NULL);
+  tcp_recv(pcb, NULL);
+  mem_free(hs);
+  tcp_close(pcb);
+}
+
+/**
+  * @brief callback function for handling TCP HTTP traffic
+  * @param arg: pointer to an argument structure to be passed to callback function
+  * @param pcb: pointer to a tcp_pcb structure
+  * @param p: pointer to a packet buffer
+  * @param err: LwIP error code
+  * @retval err
+  */
+static err_t http_recv(void *arg, struct tcp_pcb *pcb,  struct pbuf *p, err_t err)
+{
+  char *data;
+  struct http_state *hs;
+  struct fs_file file = {0, 0};
+  
+  hs = arg;
+
+  if (err == ERR_OK && p != NULL)
+  {
+    tcp_recved(pcb, p->tot_len);
+  
+	if (hs->file == NULL)
+    {
+      data = p->payload;
+/*	  
+	  printLen = p->tot_len;
+	  memcpy(printBuf, p->payload , printLen);
+	  printf(printBuf);
+*/	  
+	  receivedBufLen = p->tot_len;
+	  memcpy(receiveBuf, p->payload , receivedBufLen);
+	
+	  if (strncmp(data, "GET /main.css", 13) == 0) // +
+	  {
+	    fs_open("/main.css", &file);
+        hs->file = file.data;
+        hs->left = file.len;
+        send_data(pcb, hs);
+        tcp_sent(pcb, http_sent);
+	  }
+	  else if (strncmp(data, "GET /rotek.png", 14) == 0) // +
+	  {
+	    fs_open("/rotek.png", &file);
+        hs->file = file.data;
+        hs->left = file.len;
+        send_data(pcb, hs);
+        tcp_sent(pcb, http_sent);
+	  }
+      else if (strncmp(data, "GET /favicon.ico", 16) == 0) // ?                 
+      {                                                                     
+        fs_open("/favicon.ico", &file);                                     
+        hs->file = file.data;                                               
+        hs->left = file.len;                                                
+        send_data(pcb, hs);                                                 
+        tcp_sent(pcb, http_sent);                                           
+      }
+	  else if (strncmp(data, "GET /main.js", 12) == 0) // +
+	  {
+	    fs_open("/main.js", &file);
+        hs->file = file.data;
+        hs->left = file.len;
+        send_data(pcb, hs);
+        tcp_sent(pcb, http_sent);
+		
+	  }
+	  else if (strncmp(data, "GET /settings.html", 18) == 0) // +
+	  {
+	    fs_open("/settings.html", &file);
+        hs->file = file.data;
+        hs->left = file.len;
+        send_data(pcb, hs);
+        tcp_sent(pcb, http_sent);
+	  }
+	  else if (strncmp(data, "GET /info.html", 14) == 0) // +
+	  {
+	    fs_open("/info.html", &file);
+        hs->file = file.data;
+        hs->left = file.len;
+        send_data(pcb, hs);
+        tcp_sent(pcb, http_sent);
+	  }
+	  else if (strncmp(data, "GET /getJson.cgi", 16) == 0) // +
+	  {
+		HTTP_GetParamsPage1(sendBuf);
+		hs->file = sendBuf;
+        hs->left = strlen(sendBuf);
+		send_data(pcb, hs);
+		tcp_sent(pcb, http_sent);
+	  }	  
+	  else if (strncmp(data, "GET /settings.cgi", 17) == 0) // +
+	  {
+		SET_PAGE = SET_PAGE_PAGE2;
+		
+		if (HTTP_SettingsPage(receiveBuf, sendBuf, receivedBufLen, &sendBufLoadLen) == SEND_REQUIRED_YES)
+		{
+		  hs->file = sendBuf;
+          hs->left = sendBufLoadLen;
+		  send_data(pcb, hs);
+		  tcp_sent(pcb, http_sent);
+		}
+		else
+		{
+		  fs_open("/settings.html", &file);
+          hs->file = file.data;
+          hs->left = file.len;
+          send_data(pcb, hs);
+          tcp_sent(pcb, http_sent);
+		}
+	  }
+	  else if (strncmp(data, "GET /info.cgi", 13) == 0) // +
+	  {
+		if (HTTP_InfoPage(receiveBuf, sendBuf, receivedBufLen, &sendBufLoadLen) == SEND_REQUIRED_YES)
+		{
+		  hs->file = sendBuf;
+          hs->left = sendBufLoadLen;
+		  send_data(pcb, hs);
+		  tcp_sent(pcb, http_sent);
+		}
+		else
+		{
+		  fs_open("/info.html", &file);
+          hs->file = file.data;
+          hs->left = file.len;
+          send_data(pcb, hs);
+          tcp_sent(pcb, http_sent);
+		}
+	  }
+	  /* Сброс настроек и сохранине */
+	  else if (strncmp(data, "GET /reset.cgi", 14) == 0)
+	  {
+	    HTTP_ResetSettings();
+		HTTP_SaveSettings();
+		
+		fs_open("/settings.html", &file);
+        hs->file = file.data;
+        hs->left = file.len;
+        send_data(pcb, hs);
+        tcp_sent(pcb, http_sent);
+	  }
+	  /* Перезагрузка контроллера */
+	  else if (strncmp(data, "GET /reboot.cgi", 15) == 0)
+	  {
+	    HTTP_Reboot();
+	  }	
+	  /* Подтверждение новых сетевых настроек */
+	  else if (strncmp(data, "GET /confirm.cgi", 16) == 0)
+	  {
+		SetWebReinitFlag(false);
+	    SetConfirmWebParamsFlag();
+		
+		fs_open("/index.html", &file);
+        hs->file = file.data;
+        hs->left = file.len;
+        send_data(pcb, hs);
+        tcp_sent(pcb, http_sent);
+	  }
+	  /* Проверка пароля, переход в bootloader */
+	  else if (strncmp(data, "POST /checkpwd.cgi", 18) == 0)
+	  {
+		HTTP_ConfirmBootPwd(receiveBuf, sendBuf, receivedBufLen, &sendBufLoadLen);
+		
+		hs->file = sendBuf;
+        hs->left = sendBufLoadLen;
+		send_data(pcb, hs);
+		tcp_sent(pcb, http_sent);
+	  }	
+      // На производстве
+	  else if (strncmp(data, "GET /setProdate.cgi", 19) == 0)
+	  {
+        HTTP_Prodate(receiveBuf, sendBuf, receivedBufLen, &sendBufLoadLen);
+		
+		hs->file = sendBuf;
+        hs->left = sendBufLoadLen;
+		send_data(pcb, hs);
+		tcp_sent(pcb, http_sent);
+	  }
+      // На производстве
+	  else if (strncmp(data, "GET /progon.cgi", 15) == 0)
+	  {
+        HTTP_Progon(receiveBuf, sendBuf, receivedBufLen, &sendBufLoadLen);
+		
+		hs->file = sendBuf;
+        hs->left = sendBufLoadLen;
+		send_data(pcb, hs);
+		tcp_sent(pcb, http_sent);
+	  }
+	  else
+	  {  
+        fs_open("/index.html", &file); // +
+        hs->file = file.data;
+        hs->left = file.len;
+        send_data(pcb, hs);
+        tcp_sent(pcb, http_sent);
+	  }
+	}
+    pbuf_free(p);
+    close_conn(pcb,hs);
+  }
+  if (err == ERR_OK && p == NULL)
+  {
+    close_conn(pcb, hs);
+  }
+  return ERR_OK;
+} 
+
+/**
+  * @brief  callback function for handling connection errors
+  * @param  arg: pointer to an argument to be passed to callback function
+  * @param  err: LwIP error code   
+  * @retval none
+  */
+static void conn_err(void *arg, err_t err)
+{
+  struct http_state *hs;
+
+  hs = arg;
+  mem_free(hs);
+}
+
+/**
+  * @brief callback function called after a successfull TCP data packet transmission  
+  * @param arg: pointer to an argument to be passed to callback function
+  * @param pcb: pointer on tcp_pcb structure
+  * @param len
+  * @retval err : LwIP error code
+  */
+static err_t http_sent(void *arg, struct tcp_pcb *pcb, u16_t len)
+{
+  struct http_state *hs;
+
+  hs = arg;
+
+  if (hs->left > 0)
+  {
+    send_data(pcb, hs);
+  }
+  else
+  {
+    close_conn(pcb, hs);      
+  }
+  return ERR_OK;
+}
+
+/**
+  * @brief sends data found in  member "file" of a http_state struct
+  * @param pcb: pointer to a tcp_pcb struct
+  * @param hs: pointer to a http_state struct
+  * @retval none
+  */
+static void send_data(struct tcp_pcb *pcb, struct http_state *hs)
+{
+  err_t err;
+  u16_t len;
+
+  /* We cannot send more data than space available in the send
+     buffer */
+  if (tcp_sndbuf(pcb) < hs->left)
+  {
+    len = tcp_sndbuf(pcb);
+  }
+  else
+  {
+    len = hs->left;
+  }
+  err = tcp_write(pcb, hs->file, len, 0);
+  if (err == ERR_OK)
+  {
+    hs->file += len;
+    hs->left -= len;
+  }
+}
+
+/**
+  * @brief tcp poll callback function
+  * @param arg: pointer to an argument to be passed to callback function
+  * @param pcb: pointer on tcp_pcb structure
+  * @retval err_t
+  */
+static err_t http_poll(void *arg, struct tcp_pcb *pcb)
+{
+  if (arg == NULL)
+  {
+    tcp_close(pcb);
+  }
+  else
+  {
+    send_data(pcb, (struct http_state *)arg);
+  }
+  return ERR_OK;
+}
+
+/**
+  * @brief  callback function on TCP connection setup ( on port 80)
+  * @param  arg: pointer to an argument structure to be passed to callback function
+  * @param  pcb: pointer to a tcp_pcb structure
+  * &param  err: Lwip stack error code
+  * @retval err
+  */
+static err_t http_accept(void *arg, struct tcp_pcb *pcb, err_t err)
+{
+  struct http_state *hs;
+
+  /* Allocate memory for the structure that holds the state of the connection */
+  hs = mem_malloc(sizeof(struct http_state));
+
+  if (hs == NULL)
+  {
+    return ERR_MEM;
+  }
+
+  /* Initialize the structure. */
+  hs->file = NULL;
+  hs->left = 0;
+
+  /* Tell TCP that this is the structure we wish to be passed for our
+     callbacks. */
+  tcp_arg(pcb, hs);
+
+  /* Tell TCP that we wish to be informed of incoming data by a call
+     to the http_recv() function. */
+  tcp_recv(pcb, http_recv);
+
+  tcp_err(pcb, conn_err);
+
+  tcp_poll(pcb, http_poll, 10);
+  return ERR_OK;
+}
+
+/**
+  * @brief  Opens a file defined in fsdata.c ROM filesystem 
+  * @param  name : pointer to a file name
+  * @param  file : pointer to a fs_file structure  
+  * @retval  1 if success, 0 if fail
+  */
+static int fs_open(char *name, struct fs_file *file)
+{
+  struct fsdata_file_noconst *f;
+
+  for (f = (struct fsdata_file_noconst *)FS_ROOT; f != NULL; f = (struct fsdata_file_noconst *)f->next)
+  {
+    if (!strcmp(name, f->name))
+    {
+      file->data = f->data;
+      file->len = f->len;
+      return 1;
+    }
+  }
+  return 0;
+}
+
+/**
+  * @brief  Initialize the HTTP server (start its thread) 
+  * @param  none
+  * @retval None
+  */
+void HTTP_Init()
+{
+  //sys_thread_new("HTTP", http_server_netconn_thread, NULL, 3000, 2);
+  struct tcp_pcb *pcb;
+  /*create new pcb*/
+  pcb = tcp_new();
+  /* bind HTTP traffic to pcb */
+  tcp_bind(pcb, IP_ADDR_ANY, 80);
+  /* start listening on port 80 */
+  pcb = tcp_listen(pcb);
+  /* define callback function for TCP connection setup */
+  tcp_accept(pcb, http_accept);
+}
+
+/**
+  * @brief  
+  * @retval None
+  */
+int HTTP_SettingsPage(char *bufIn, char *bufOut, uint16_t lenBufIn, uint16_t *lenBufOut)
+{
+  char tempStr[30];
+  strncpy(tempStr, bufIn, 30);
+  
+  /* В запросе нет параметров, нужно формировать JSON ответ */
+  if (strpbrk(tempStr,"?") == 0)
+  {
+	memset(bufOut, 0, SEND_BUF_MAX_LEN);
+	
+	HTTP_GetSettings(bufOut);
+	
+    //printf(bufOut);
+    
+    *lenBufOut = strlen(bufOut);
+	
+	return SEND_REQUIRED_YES;
+  }
+  /* В запросе есть параметры, нужно парсить и сохранять настройки */
+  else
+  {
+	HTTP_SetSettings(bufIn, lenBufIn);
+	
+    return SEND_REQUIRED_NO;
+  }
+}
+
+/**
+  * @brief  
+  * @retval None
+  */
+int HTTP_InfoPage(char *bufIn, char *bufOut, uint16_t lenBufIn, uint16_t *lenBufOut)
+{
+  char tempStr[30];
+  strncpy(tempStr, bufIn, 30);
+  
+  /* В запросе нет параметров, нужно формировать JSON ответ */
+  if (strpbrk(tempStr,"?") == 0)
+  {
+	memset(bufOut, 0, SEND_BUF_MAX_LEN);
+	
+	HTTP_GetInfo(bufOut);
+		
+    *lenBufOut = strlen(bufOut);
+	
+	return SEND_REQUIRED_YES;
+  }
+  /* В запросе есть параметры, нужно парсить и сохранять настройки */
+  else
+  {
+	HTTP_SetInfo(bufIn, lenBufIn);
+	return SEND_REQUIRED_NO;
+/*	
+	HTTP_SetSettings(bufIn, lenBufIn);
+    return SEND_REQUIRED_NO;
+*/	
+  }
+}  
+  
+/**
+  * @brief  Установка даты производства
+  */
+// TODO Убрать заглушку!
+void HTTP_Prodate(char *bufIn, char *bufOut, uint16_t lenBufIn, uint16_t *lenBufOut)
+{
+  uint8_t valueLen = 0;
+  char value[20];
+  
+  memset(bufOut, 0, SEND_BUF_MAX_LEN);
+  
+  ClearParamString(bufIn);
+  
+  memset(value, 0, 20);
+  GetParamValue(bufIn, "prodate=", value, &valueLen);
+  /*
+  printf("Prodate: ");
+  printf(value);
+  printf("\r\n");
+  */
+  
+  /* Устанавливаем дату производства */
+  SETTINGS_SetProDate(value, valueLen);
+  
+  /* Устанавливаем дату следующей профилактики +1 год */
+  RTC_SetProfTime(value);
+  
+  /* Пока отправляем true */
+  strcpy(bufOut, "HTTP/1.0 200 OK\r\nContent-Type:text/html\r\n\r\nTrue");
+  *lenBufOut = strlen(bufOut);
+  
+ // TEST_SetServerFlag();
+}
+
+/**
+  * @brief  Возвращает uptime, freq, dutycicle
+  */
+void HTTP_Progon(char *bufIn, char *bufOut, uint16_t lenBufIn, uint16_t *lenBufOut)
+{
+  memset(bufOut, 0, SEND_BUF_MAX_LEN);
+    
+  HTTP_GetProgonParams(bufOut);
+  *lenBufOut = strlen(bufOut);
+}
+
+/**
+  * @brief  
+  * @retval None
+  */
+void HTTP_SetSettings(char *buf, uint16_t lenBuf)
+{
+  uint8_t valueLen = 0;
+  const uint8_t len = 20;
+  char value[20];
+
+  //printf(buf);
+  
+  ClearParamString(buf);
+  
+  memset(value, 0, len);
+  
+  /* SNMP */
+  GetParamValue(buf, "read_community=", value, &valueLen);
+  SetReadCommunity(value);
+  memset(value, 0, len);
+  
+  GetParamValue(buf, "write_community=", value, &valueLen);
+  SetWriteCommunity(value);
+  memset(value, 0, len);
+      
+  GetParamValue(buf, "managerIP=", value, &valueLen);
+  SetManagerIp(value);
+  memset(value, 0, len);
+
+  GetParamValue(buf, "managerIP2=", value, &valueLen);
+  SetManagerIp2(value);
+  memset(value, 0, len);
+
+  GetParamValue(buf, "managerIP3=", value, &valueLen);
+  SetManagerIp3(value);
+  memset(value, 0, len);
+  
+  /* Сетевые параметры */
+  GetParamValue(buf, "dhcp=", value, &valueLen);
+  SetDhcpStateStr(value);
+  
+  if (strncmp(value, "on", 2) != 0)  // Если dhcp off устанавливаем параметры
+  {
+    memset(value, 0, len);
+
+    GetParamValue(buf, "ipaddr=", value, &valueLen);
+    SetIPStr(value);
+    memset(value, 0, len);
+  
+    GetParamValue(buf, "gw=", value, &valueLen);
+    SetGatewayStr(value);
+    memset(value, 0, len);
+  
+    GetParamValue(buf, "mask=", value, &valueLen);
+    SetMaskStr(value);
+    memset(value, 0, len);
+  }
+    
+  memset(value, 0, len);  
+
+  
+  /* Если параметры WEB изменились выставляем флаг, сохраняем настройки и перезагружаемся */
+  if (GetStateWebReinit() == true)
+  {	
+	SetWebReinitFlag(true);
+	HTTP_SaveSettings();
+    /* Блокируем управление ключем на тау секунд*/
+    //IO_KeyBlockOn();
+    vTaskDelay(1010);
+	NVIC_SystemReset();
+  }	
+  
+  HTTP_SaveSettings();
+}
+
+/**
+  * @brief  
+  * @retval None
+  */
+void HTTP_SetInfo(char *buf, uint16_t lenBuf)
+{
+  uint8_t valueLen = 0;
+  const uint8_t len = 110;
+  char value[110];
+
+  ClearParamString(buf);
+  
+  memset(value, 0, len);
+  
+  /* Владелец */
+  GetParamValue(buf, "owner=", value, &valueLen);
+  HTTP_ReplaceSimbol(value, '+', ' ');
+  SetOwner(value);
+  memset(value, 0, len);
+  
+  /* Владелец */
+  GetParamValue(buf, "sysLocation=", value, &valueLen);
+  HTTP_ReplaceSimbol(value, '+', ' ');
+  SetLocation(value);
+  memset(value, 0, len);
+  
+  /* Комментарий */
+  GetParamValue(buf, "comment=", value, &valueLen);
+  HTTP_ReplaceSimbol(value, '+', ' ');
+  SetComment(value);
+  memset(value, 0, len);
+ 
+  HTTP_SaveSettings();
+}
+
+/**
+  * @brief  Проверка пароля для перехода в режим bootloader
+  * @retval None
+  */
+void HTTP_ConfirmBootPwd(char *bufIn, char *bufOut, uint16_t lenBufIn, uint16_t *lenBufOut)
+{
+  char tempStr[50];
+  strncpy(tempStr, bufIn, 50);
+  char value[20];
+  uint8_t valueLen;
+  
+  memset(value, 0, 20);
+  
+  if (GetParamValue(tempStr, "password=", value, &valueLen))
+  {
+	if (strcmp(BOOTLOADER_PASWORD, value) == 0)
+	{  
+	  *bufOut = '1';
+	  /* Запускаем задачу отложенной перезагрузки. Контроллер должен успеть
+       отправить ответ серверу о статусе пароля */
+	  HTTP_StartResetTask(true); 
+	}  
+	else
+	  *bufOut = '0';
+	
+	*lenBufOut = 1;
+  }
+}
+
+/**
+  * @brief  
+  * @retval None
+  */
+uint8_t GetParamValue(char *inStr, char *paramName, char *paramValue, uint8_t *paramLen)
+{
+  char *beginValue = 0;
+  char *endValue = 0;
+  int  len = 0;
+  char *strPtr = 0;
+  
+  strPtr = strstr(inStr, paramName);
+  
+  if (strPtr != 0)
+  {
+    beginValue = strpbrk(strPtr,"=");
+    endValue = strpbrk(strPtr,"&");
+    if (endValue == 0)
+      endValue = strpbrk(strPtr," ");
+    len = endValue - beginValue - 1;
+    strncpy(paramValue, beginValue + 1, len);
+    *endValue = '0';
+    *beginValue = '0';
+	*paramLen = len;
+	return 1;
+  }
+  else
+  {	
+	*paramLen = 0;
+	return 0;
+  }
+}
+
+/**
+  * @brief  
+  * @retval None
+  */
+/*
+uint8_t GetParamValueInEnd(char *inStr, char *paramName, char *paramValue, uint8_t *paramLen)
+{
+  char *beginValue = 0;
+  char *endValue = 0;
+  int  len = 0;
+  char *strPtr = 0;
+  
+  strPtr = strstr(inStr, paramName);
+  
+  if (strPtr != 0)
+  {
+    beginValue = strpbrk(strPtr,"=");
+    endValue = strpbrk(strPtr," ");
+    len = endValue - beginValue - 1;
+    strncpy(paramValue, beginValue + 1, len);
+    *endValue = '0';
+    *beginValue = '0';
+	*paramLen = len;
+	return 1;
+  }
+  else
+  {	
+	*paramLen = 0;
+	return 0;
+  }
+}
+*/
+
+void ClearParamString(char *inBuf)
+{
+  uint16_t len;
+  char *str;
+  
+  str = strstr(inBuf, "HTTP");
+  
+  if (str != 0)
+  {
+    len = str - inBuf;
+	memset(str, 0, RECIVE_BUF_MAX_LEN - len - 1);
+  }
+}
+
+/**
+  * @brief  Замена символа в строке
+  * @param  *str - входная строка
+  * @param  sim1 - символ который надо заменить
+  * @param  sim2 - символ на который надо заменить
+  */
+void HTTP_ReplaceSimbol(char *str, char sim1, char sim2)
+{
+  uint16_t len = strlen(str);
+  
+  for (uint16_t i = 0; i < len; i++)
+  {
+    if (*str == sim1)
+	  *str = sim2;
+	str++;
+  }
+}

+ 98 - 0
modules/HTTP_Server/http_server.h

@@ -0,0 +1,98 @@
+#include "lwip/opt.h"
+#include "lwip/arch.h"
+#include "lwip/api.h"
+
+typedef enum
+{
+  SET_PAGE_IDLE = 0,
+  SET_PAGE_PAGE1,
+  SET_PAGE_PAGE2,
+  SET_PAGE_PAGE3,
+  SET_PAGE_PAGE4,
+} SET_PAGE_t;
+
+typedef enum
+{
+  SEND_REQUIRED_YES = 0,
+  SEND_REQUIRED_NO,
+} REQ_TYPE_t;
+
+struct http_state
+{
+  char *file;
+  u32_t left;
+};
+
+struct fs_file {
+  char *data;
+  int len;
+};
+
+void HTTP_Init();
+
+static err_t http_accept(void *arg, struct tcp_pcb *pcb, err_t err);
+static err_t http_recv(void *arg, struct tcp_pcb *pcb,  struct pbuf *p, err_t err);
+
+
+void http_server_netconn_init();
+
+/**
+  * @brief  Выводим запросы в консоль
+  */
+void vTaskPrintHttp(void *pvParameters);
+
+/**
+  * @brief  Установка даты производства
+  */
+void HTTP_Prodate(char *bufIn, char *bufOut, uint16_t lenBufIn, uint16_t *lenBufOut);
+
+/**
+  * @brief  Возвращает uptime, freq, dutycicle
+  */
+void HTTP_Progon(char *bufIn, char *bufOut, uint16_t lenBufIn, uint16_t *lenBufOut);
+
+/**
+  * @brief  Парсинг строки настроек
+  */
+void HTTP_SetSettings(char *buf, uint16_t lenBuf);
+
+/**
+  * @brief  
+  */
+void HTTP_SetInfo(char *buf, uint16_t lenBuf);
+
+/**
+  * @brief  
+  */
+int HTTP_SettingsPage(char *bufIn, char *bufOut, uint16_t lenBufIn, uint16_t *lenBufOut);
+
+/**
+  * @brief  
+  */
+int HTTP_InfoPage(char *bufIn, char *bufOut, uint16_t lenBufIn, uint16_t *lenBufOut);
+
+/**
+  * @brief  Проверка пароля для перехода в режим bootloader
+  */
+void HTTP_ConfirmBootPwd(char *bufIn, char *bufOut, uint16_t lenBufIn, uint16_t *lenBufOut);
+
+/**
+  * @brief  
+  */
+uint8_t GetParamValue(char *inStr, char *paramName, char *paramValue, uint8_t *paramLen);
+
+/**
+  * @brief  
+  * @retval None
+  */
+uint8_t GetParamValueInEnd(char *inStr, char *paramName, char *paramValue, uint8_t *paramLen);
+
+void ClearParamString(char *inBuf);
+
+/**
+  * @brief  Замена символа в строке
+  * @param  *str - входная строка
+  * @param  sim1 - символ который надо заменить
+  * @param  sim2 - символ на который надо заменить
+  */
+void HTTP_ReplaceSimbol(char *str, char sim1, char sim2);

BIN
modules/HTTP_Server/makefsdata.exe


+ 7 - 0
modules/HTTP_Server/readme.txt

@@ -0,0 +1,7 @@
+В дайнной прошивке используется веб-сервер из примеров lwip.
+Весь веб контент необходимо положить в папку ./fs и запустить утилиту makefsdata.exe.
+Утилита переводит файлы в hex формат. Результат попадает в файл fsdata.c. Подключить его можно без изменений.
+
+ВНИМАНИЕ: 
+Исходные файлы утилиты makefsdata лежат в папке $PROJDIR/utils/makefsdata 
+Исходные файлы веб-интерфейса лежат в папке $PROJDIR/web-interface

+ 40 - 0
modules/HTTP_Server/trap_params.c

@@ -0,0 +1,40 @@
+/********************************* (C) РОТЕК ***********************************
+ * @module  trap_params
+ * @file    trap_params.c
+ * @version 1.0.0
+ * @date    XX.XX.XXXX
+ * $brief   trap_params
+ *******************************************************************************
+ * @history     Version  Author         Comment
+ * XX.XX.XXXX   1.0.0    Telenkov D.A.  First release.
+ *******************************************************************************
+ */
+
+#include "stm32f4xx.h"  
+#include "trap_params.h"
+#include "settings_api.h"
+#include "trap_api.h"
+
+#ifdef PRINTF_STDLIB
+#include <stdio.h>
+#endif
+#ifdef PRINTF_CUSTOM
+#include "tinystdio.h"
+#endif
+#include <string.h>
+#include <stdlib.h>
+   
+/**
+  * @brief  Общая структура настроек
+  */
+extern SETTINGS_t sSettings;
+
+/**
+  * @brief  Пул всех возможных трапов устройства
+  */
+extern TRAP_t traps[];
+
+
+
+
+/********************************* (C) РОТЕК **********************************/

+ 185 - 0
modules/HTTP_Server/trap_params.h

@@ -0,0 +1,185 @@
+/********************************* (C) РОТЕК ***********************************
+ * @module  trap_params
+ * @file    trap_params.h
+ * @version 1.0.0
+ * @date    XX.XX.XXXX
+ * $brief   trap_params
+ *******************************************************************************
+ * @history     Version  Author         Comment
+ * XX.XX.XXXX   1.0.0    Telenkov D.A.  First release.
+ *******************************************************************************
+ */
+
+/* Define to prevent recursive  ----------------------------------------------*/
+#ifndef TRAP_PARAMS_H
+#define TRAP_PARAMS_H
+
+/**
+  * @brief  Нормализация напряжения на АКБ
+  */
+void GetBatteryVoltageNorm(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetBatteryVoltageAlarm(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetBatterySimmetryNorm(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetBatterySimmetryAlarm(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetBatteryControlChanged(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetBatteryChargeControlChanged(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetBatteryCurrentNorm(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetBatteryCurrentAlarm(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetBatteryTemperatureNorm(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetBatteryTemperatureAlarm(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetDoorNorm(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetDoorAlarm(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetLoadVoltageNorm(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetLoadVoltageAlarm(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetLoadCurrentNorm(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetLoadCurrentAlarm(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetLoadControlChanged(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetTemperatureNorm(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetTemperatureAlarm(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetPPSOutVoltageNorm(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetPPSOutVoltageAlarm(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetPPSOutCurrentNorm(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetPPSOutCurrentAlarm(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetPPSControlChanged(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetCheck220VACNorm(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetCheck220VACAlarm(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetDeviceRestored(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetDeviceRebooted(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetModeChanged(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetBatteryTimeout(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetFWVersionUpdate(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetFWVersionUpdated(char *str, uint8_t *len);
+
+/**
+  * @brief  
+  */
+void GetBatteryProfilaction(char *str, uint8_t *len);
+
+
+#endif /* #ifndef TRAP_PARAMS_H */
+
+/********************************* (C) РОТЕК **********************************/

+ 351 - 0
modules/HTTP_Server/web_params_api.c

@@ -0,0 +1,351 @@
+/********************************* (C) ROTEK ***********************************
+ * @module  web_params_api
+ * @file    web_params_api.c
+ * @version 1.0.0
+ * @date    XX.XX.XXXX
+ * $brief   web_params_api
+ *******************************************************************************
+ * @history     Version  Author         Comment
+ * XX.XX.XXXX   1.0.0    Telenkov D.A.  First release.
+ *******************************************************************************
+ */
+
+#include "stm32f4xx.h"  
+#include "web_params_api.h"
+#include "parameters.h"
+#include "trap_params.h"
+#include "snmp_api.h"
+#include "trap_api.h"
+#include "settings_api.h"
+#include "common_config.h"
+#include "snmp.h"
+
+#include "FreeRTOS.h"
+#include "task.h"
+
+#ifdef PRINTF_STDLIB
+#include <stdio.h>
+#endif
+#ifdef PRINTF_CUSTOM
+#include "tinystdio.h"
+#endif
+#include <string.h>
+
+typedef  void (*pFunction)(void);
+pFunction Jump_To_Application;
+uint32_t JumpAddress;
+
+/**
+  * @brief  Возвращяет строку с настройками на первой странице
+  * @retval None
+  */
+void HTTP_GetParamsPage1(char *buf)
+{
+  char str[40];
+  uint8_t len;
+  memset(buf, 0, 1000);
+  
+  // Headers для поддержки saffari 
+  strcpy(buf, "HTTP/1.0 200 OK\r\nContent-Type:text/html\r\n\r\n");
+  
+  // Параметры UPS
+  
+  GetInputVoltageStr(str, &len);
+  strcat(buf, "{\"AC\":\"");
+  strncat(buf, str, len);
+  
+  GetOutputVoltageStr(str, &len);
+  strcat(buf, "\",\"DC\":\"");
+  strncat(buf, str, len);
+  
+  GetInputFreqStr(str, &len);
+  strcat(buf, "\",\"in_freq\":\"");
+  strncat(buf, str, len);
+  
+  GetOutputFreqStr(str, &len);
+  strcat(buf, "\",\"out_freq\":\"");
+  strncat(buf, str, len);
+  
+  GetPowerStr(str, &len);
+  strcat(buf, "\",\"pwr\":\"");
+  strncat(buf, str, len);
+  
+  GetLineFailBitStr(str, &len);
+  strcat(buf, "\",\"line_fail\":");
+  strncat(buf, str, len);
+  
+  GetLowBatteryBitStr(str, &len);
+  strcat(buf, ",\"low_battery\":");
+  strncat(buf, str, len);
+  
+  GetBatCapacityStr(str, &len);
+  strcat(buf, ",\"bat_cap\":\"");
+  strncat(buf, str, len);
+  
+  GetInternalTempStr(str, &len);
+  strcat(buf, "\",\"inner_temp\":\"");
+  strncat(buf, str, len);
+  
+  GetRuntimeStr(str, &len);
+  strcat(buf, "\",\"bat_time_left\":\"");
+  strncat(buf, str, len);
+ 
+  // Дополнительные параметры
+  
+  // Мониторинг
+  // load_monitor (нагрузка, 0 - норма, 1 - fail)
+  // temp_monitor (внутренняя температура, 0 - норма, 1 - fail)
+  // connect_monitor (связь с UPSом, 0 - норма, 1 - fail)
+  
+  GetLoadMonitorStr(str, &len);
+  strcat(buf, "\",\"load_monitor\":");
+  strncat(buf, str, len);
+  
+  GetTempMonitorStr(str, &len);
+  strcat(buf, ",\"temp_monitor\":");
+  strncat(buf, str, len);
+  
+  GetConnectMonitorStr(str, &len);
+  strcat(buf, ",\"connect_monitor\":");
+  strncat(buf, str, len);
+  
+  // Признак изменения сетевых настроек 
+  GetWebReinitFlag(str, &len);
+  strcat(buf, ",\"netsettings_changed\":\"");
+  strncat(buf, str, len);
+
+  strncat(buf, "\"}", 2);
+  
+  //printf(buf);
+}
+
+/**
+  * @brief  Возвращяет строку с настройками на второй странице
+  * @retval None
+  */
+void HTTP_GetSettings(char *buf)
+{
+  char str[30];
+  uint8_t len;
+   
+  /* Headers для поддержки saffari */
+  strcpy(buf, "HTTP/1.0 200 OK\r\nContent-Type:text/html\r\n\r\n");
+  
+  /* SNMP */
+  GetReadCommunity(str, &len);  
+  strcat(buf, "{\"read_community\":\"");
+  strncat(buf, str, len);	
+  
+  GetWriteCommunity(str, &len);  
+  strcat(buf, "\",\"write_community\":\"");
+  strncat(buf, str, len);
+  
+  GetManagerIp(str, &len);  
+  strcat(buf, "\",\"managerIP\":\"");
+  strncat(buf, str, len);
+  
+  GetManagerIp2(str, &len);  
+  strcat(buf, "\",\"managerIP2\":\"");
+  strncat(buf, str, len);
+  
+  GetManagerIp3(str, &len);  
+  strcat(buf, "\",\"managerIP3\":\"");
+  strncat(buf, str, len);
+	
+  /* WEB */
+  GetIpStr(str, &len);  
+  strcat(buf, "\",\"ipaddr\":\"");
+  strncat(buf, str, len);
+  
+  GetGatewayStr(str, &len);  
+  strcat(buf, "\",\"gw\":\"");
+  strncat(buf, str, len);
+  
+  GetMaskStr(str, &len);  
+  strcat(buf, "\",\"mask\":\"");
+  strncat(buf, str, len);
+  
+  GetDhcpStateStr(str, &len);  
+  strcat(buf, "\",\"dhcp\":");
+  strncat(buf, str, len);
+ 
+  /* Признак изменения сетевых настроек */ 
+  GetWebReinitFlag(str, &len);
+  strcat(buf, ",\"netsettings_changed\":\"");
+  strncat(buf, str, len);
+  
+  strncat(buf, "\"}", 2);
+  
+  //printf(buf);
+}
+
+/**
+  * @brief  Возвращяет строку с информацией об устройстве
+  * @retval None
+  */
+// TODO Согласовать максимальную длину строк
+void HTTP_GetInfo(char *buf)
+{
+  char str[40];
+  uint8_t len;
+  
+  /* Headers для поддержки saffari */
+  strcpy(buf, "HTTP/1.0 200 OK\r\nContent-Type:text/html\r\n\r\n");
+  
+  GetWorkTimeStr(str, &len);  
+  strcat(buf, "{\"uptime\":\"");
+  strncat(buf, str, len);	
+  
+  GetModelStr(str, &len);  
+  strcat(buf, "\",\"model\":\"");
+  strncat(buf, str, len);
+  
+  GetProductionDataStr(str, &len);  
+  strcat(buf, "\",\"prodate\":\"");
+  strncat(buf, str, len);
+  
+  GetVersionStr(str, &len);  
+  strcat(buf, "\",\"fwversion\":\"");
+  strncat(buf, str, len);
+  
+  GetMacStr(str, &len);  
+  strcat(buf, "\",\"macaddr\":\"");
+  strncat(buf, str, len);
+  
+  GetSerialNumberStr(str, &len);  
+  strcat(buf, "\",\"serno\":\"");
+  strncat(buf, str, len);
+  
+  GetOwnerStr(str, &len);  
+  strcat(buf, "\",\"owner\":\"");
+  strncat(buf, str, len);
+  
+  GetLocationStr(str, &len);  
+  strcat(buf, "\",\"sysLocation\":\"");
+  strncat(buf, str, len);
+  
+  GetCommentsStr(str, &len);  
+  strcat(buf, "\",\"comment\":\"");
+  strncat(buf, str, len);
+ 
+  /* Признак изменения сетевых настроек */ 
+  GetWebReinitFlag(str, &len);
+  strcat(buf, "\",\"netsettings_changed\":\"");
+  strncat(buf, str, len);
+  
+  strncat(buf, "\"}", 2);
+  
+}
+
+
+/**
+  * @brief  Возвращает uptime, freq, dutycicle
+  */
+void HTTP_GetProgonParams(char *buf)
+{
+  char str[20];
+  u32_t tick;  
+  
+  strcpy(buf, "HTTP/1.0 200 OK\r\nContent-Type:text/html\r\n\r\n");
+    
+  strcat(buf, "{\"uptime\":\"");
+  snmp_get_sysuptime(&tick);
+  tick = tick/100;
+  memset(str, 0, 20);
+  sprintf(str, "%d", tick);
+  strncat(buf, str, strlen(str));
+
+  strncat(buf, "\"}", 2);
+}
+
+
+
+
+
+/**
+  * @brief  Сброс настроек (всё кроме сетевых параметров)
+  */
+void HTTP_ResetSettings(void)
+{
+  //taskENTER_CRITICAL();
+    
+  SETTINGS_SetPartDefault();
+  SETTINGS_Save();
+	  
+  //taskEXIT_CRITICAL();
+}
+
+/**
+  * @brief  Сброс настроек
+  */
+void HTTP_SaveSettings(void)
+{
+//  taskENTER_CRITICAL();
+  
+  SETTINGS_Save();
+  
+//  taskEXIT_CRITICAL();
+  
+  //SETTINGS_ApplyAlgorithmParams();
+}
+
+/**
+  * @brief  Перезагрузка контроллера
+  */
+void HTTP_Reboot(void)
+{
+  vTaskDelay(1010);
+  NVIC_SystemReset();
+}
+
+/**
+  * @brief  Запускает задачу ресета контроллера
+  * @param fBootMode:
+  *        true - перед перезагрузкой будет установлен флаг входа в режим 
+  *        bootloader и перезаписаны настройки
+  *
+  *        false - обычная перезагрузка 
+  */
+void HTTP_StartResetTask(bool fBootMode)
+{
+  static bool temp;
+ 
+  temp = fBootMode;
+  xTaskCreate(vTaskReboot, "RebootTask", configMINIMAL_STACK_SIZE, 
+			  (void*)&temp, tskIDLE_PRIORITY, NULL);
+}
+
+/**
+  * @brief  
+  */
+void vTaskReboot(void * pvParameters)
+{
+  bool mode = false;  // тип перезагрузки (нужно ли устанавливать флаг bootloader)
+  
+  for (;;)
+  {
+	mode = *(bool*)pvParameters;
+	
+	if (mode)
+	{
+	  SetLoadMode();
+	  HTTP_SaveSettings();
+	  SNMP_SendUserTrap(FW_VERSION_UPDATE);
+      vTaskDelay(1000);
+      /* Блокируем управление ключем на тау секунд*/
+      //IO_KeyBlockOn();
+      vTaskDelay(1010);
+	  NVIC_SystemReset();
+	}  
+	else
+	{
+	  vTaskDelay(1000);
+      /* Блокируем управление ключем на тау секунд*/
+      //IO_KeyBlockOn();
+      vTaskDelay(1010);
+	  NVIC_SystemReset();
+	}
+  }	
+}
+
+/********************************* (C) ROTEK **********************************/

+ 66 - 0
modules/HTTP_Server/web_params_api.h

@@ -0,0 +1,66 @@
+/********************************* (C) РОТЕК ***********************************
+ * @module  web_params_api
+ * @file    web_params_api.h
+ * @version 1.0.0
+ * @date    XX.XX.XXXX
+ * $brief   template
+ *******************************************************************************
+ * @history     Version  Author         Comment
+ * XX.XX.XXXX   1.0.0    Telenkov D.A.  First release.
+ *******************************************************************************
+ */
+
+/* Define to prevent recursive  ----------------------------------------------*/
+#ifndef WEB_PARAMS_API_H
+#define WEB_PARAMS_API_H
+
+#include "stdbool.h"
+
+/**
+  * @brief  Заполнение JSON строки параметров
+  */
+void HTTP_GetParamsPage1(char *buf);
+  
+/**
+  * @brief  Возвращяет строку с настройками на второй странице
+  */
+void HTTP_GetSettings(char *buf);
+
+/**
+  * @brief  Возвращяет строку с информацией об устройстве
+  */
+void HTTP_GetInfo(char *buf);
+
+/**
+  * @brief  Возвращает uptime, freq, dutycicle
+  */
+void HTTP_GetProgonParams(char *buf);
+
+/**
+  * @brief  Сброс настроек
+  */
+void HTTP_ResetSettings(void);
+	
+/**
+  * @brief  Сброс настроек
+  */
+void HTTP_SaveSettings(void);
+
+/**
+  * @brief  Перезагрузка контроллера
+  */
+void HTTP_Reboot(void);
+
+/**
+  * @brief  
+  */
+void HTTP_StartResetTask(bool fBootMode);
+
+/**
+  * @brief  
+  */
+void vTaskReboot(void * pvParameters);
+
+#endif /* #ifndef WEB_PARAMS_API_H */
+
+/********************************* (C) РОТЕК **********************************/

+ 101 - 0
modules/Makefile

@@ -0,0 +1,101 @@
+TARGET := stm32$(HARDWARE)
+
+
+#ifeq ($(DEBUG), 1)
+	CFLAGS += -DDEBUG -g
+#endif
+
+ifeq ($(MAC),)
+	#Print default MAC
+	MAC = $(shell awk '/\#define DEVICE_MAC/{print $$3}' ./Modules/settings_api.h )
+else
+    #Set device MAC
+	CFLAGS += -DDEVICE_MAC='"$(MAC)"'
+endif
+
+ifeq ($(FLASH_ERASE), 1)
+    	CFLAGS += -DFLASH_ERASE
+endif
+
+CFLAGS += -DPRINTF_$(shell echo $(PRINTF) | tr a-z A-Z)
+
+INCLUDES = -I../config
+INCLUDES += -I../stm32/stm32f4xx_spl/inc 
+INCLUDES += -I../stm32/system
+INCLUDES += -I../peripheral_modules/inc
+INCLUDES += -I../user
+INCLUDES += -I../thirdparty/TinyStdio
+INCLUDES += -I.
+
+CSRC = $(wildcard ../stm32/stm32f4xx_spl/src/*.c)
+CSRC += $(wildcard ../stm32/system/*.c)
+CSRC += $(wildcard ../peripheral_modules/src/*.c)
+CSRC += $(wildcard ../user/*.c)
+CSRC += $(wildcard ../thirdparty/TinyStdio/*.c)
+CSRC += $(wildcard *.c)
+
+CFLAGS += -DOS_FREERTOS
+CFLAGS += -DHARDWARE_$(shell echo $(HARDWARE) | tr a-z A-Z)
+
+#FreeRTOS
+LDSCRIPT := startup/stm32_flash.ld
+
+INCLUDES +=  -I../thirdparty/FreeRTOS/include -I../thirdparty/FreeRTOS/portable/GCC/ARM_CM3
+CSRC += $(wildcard ../thirdparty/FreeRTOS/*.c ../thirdparty/FreeRTOS/portable/GCC/ARM_CM3/*.c)
+ASMSRC = startup/startup_stm32f4xx.s
+
+# MemMang
+CSRC += $(wildcard ../thirdparty/FreeRTOS/portable/MemMang/heap_4.c)
+	
+	
+	# LwIP + Web #	
+    INCLUDES += -IHTTP_Server
+    INCLUDES += -I../thirdparty/lwip/src/include
+    INCLUDES += -I../thirdparty/lwip/src/include/netif
+    INCLUDES += -I../thirdparty/lwip/src/include/lwip
+    INCLUDES += -I../thirdparty/lwip/src/include/ipv4
+    INCLUDES += -I../thirdparty/lwip/src/netif/ppp
+    INCLUDES += -I../thirdparty/lwip/port
+    INCLUDES += -I../thirdparty/lwip/port/FreeRTOS
+    INCLUDES += -IEthernet
+ # INCLUDES += -I../stm32/stm32f4x7_ethernet 
+ 	INCLUDES += -ISTM32F4x7_ETH_Driver
+    CSRC += $(wildcard HTTP_Server/http_server.c)
+    CSRC += $(wildcard HTTP_Server/trap_params.c)
+    CSRC += $(wildcard HTTP_Server/web_params_api.c)
+    CSRC += $(wildcard ../thirdparty/lwip/src/*.c)
+    CSRC += $(wildcard ../thirdparty/lwip/src/api/*.c)
+    CSRC += $(wildcard ../thirdparty/lwip/src/core/*.c)
+    CSRC += $(wildcard ../thirdparty/lwip/src/core/ipv4/*.c)
+    CSRC += $(wildcard ../thirdparty/lwip/src/core/snmp/*.c)
+    CSRC += $(wildcard ../thirdparty/lwip/src/netif/*.c)
+    CSRC += $(wildcard ../thirdparty/lwip/src/netif/ppp/*.c)
+    CSRC += $(wildcard ../thirdparty/lwip/port/FreeRTOS/*.c)
+    CSRC += $(wildcard Ethernet/*.c)
+  #  CSRC += $(wildcard ../stm32/stm32f4x7_ethernet/*.c)
+  	CSRC += $(wildcard STM32F4x7_ETH_Driver/*.c)
+    
+CSRC += $(wildcard ../stm32/system/syscalls/syscalls.c)
+    
+    
+CFLAGS += -DUSE_STDPERIPH_DRIVER -DSTM32F40_41xxx -DLOG_ENABLE
+
+BUILDDIR = ../build/bt6702/$(TARGET)
+
+FW_FLASH_START = $(shell awk '/USER_FLASH_FIRST_PAGE_ADDRESS/{print $$3}' ../config/common_config.h )
+FW_FLASH_CRC = $(shell awk '/USER_FLASH_CRC_ADDRESS/{print $$3}' ../config/common_config.h )
+
+FW_NAME = BT_6702xx
+
+-include ../Makefile.inc.stm32
+
+prebuild:
+	@echo "Hardware version: $(HARDWARE)"
+	
+postbuild: $(BUILDDIR)/$(TARGET).bin
+	@echo "FW start address: $(FW_FLASH_START)"
+	@echo "FW CRC address: $(FW_FLASH_CRC)"
+	@echo "Copying to: $(OUTPUTDIR)/$(FW_NAME).bin"
+	@cp $(BUILDDIR)/$(TARGET).bin $(OUTPUTDIR)/$(FW_NAME).bin
+	
+	

+ 952 - 0
modules/STM32F4x7_ETH_Driver/Release_Notes.html

@@ -0,0 +1,952 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head>
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<link rel="File-List" href="Release_Notes_for_STM32F2xx_StdPeriph_Driver_files/filelist.xml">
+<link rel="Edit-Time-Data" href="Release_Notes_for_STM32F2xx_StdPeriph_Driver_files/editdata.mso"><!--[if !mso]>
+<style>
+v\:* {behavior:url(#default#VML);}
+o\:* {behavior:url(#default#VML);}
+w\:* {behavior:url(#default#VML);}
+.shape {behavior:url(#default#VML);}
+</style>
+<![endif]-->
+
+
+
+<title>Release Notes for STM32F4x7 Ethernet Driver</title><!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+  <o:Author>STMicroelectronics</o:Author>
+  <o:LastAuthor>Raouf Hosni</o:LastAuthor>
+  <o:Revision>39</o:Revision>
+  <o:TotalTime>137</o:TotalTime>
+  <o:Created>2009-02-27T19:26:00Z</o:Created>
+  <o:LastSaved>2010-10-15T11:07:00Z</o:LastSaved>
+  <o:Pages>3</o:Pages>
+  <o:Words>973</o:Words>
+  <o:Characters>5548</o:Characters>
+  <o:Company>STMicroelectronics</o:Company>
+  <o:Lines>46</o:Lines>
+  <o:Paragraphs>13</o:Paragraphs>
+  <o:CharactersWithSpaces>6508</o:CharactersWithSpaces>
+  <o:Version>12.00</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]--><link rel="themeData" href="Release_Notes_for_STM32F2xx_StdPeriph_Driver_files/themedata.thmx">
+<link rel="colorSchemeMapping" href="Release_Notes_for_STM32F2xx_StdPeriph_Driver_files/colorschememapping.xml"><!--[if gte mso 9]><xml>
+ <w:WordDocument>
+  <w:Zoom>110</w:Zoom>
+  <w:TrackMoves>false</w:TrackMoves>
+  <w:TrackFormatting/>
+  <w:ValidateAgainstSchemas/>
+  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
+  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
+  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
+  <w:DoNotPromoteQF/>
+  <w:LidThemeOther>EN-US</w:LidThemeOther>
+  <w:LidThemeAsian>X-NONE</w:LidThemeAsian>
+  <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
+  <w:Compatibility>
+   <w:BreakWrappedTables/>
+   <w:SnapToGridInCell/>
+   <w:WrapTextWithPunct/>
+   <w:UseAsianBreakRules/>
+   <w:DontGrowAutofit/>
+   <w:SplitPgBreakAndParaMark/>
+   <w:DontVertAlignCellWithSp/>
+   <w:DontBreakConstrainedForcedTables/>
+   <w:DontVertAlignInTxbx/>
+   <w:Word11KerningPairs/>
+   <w:CachedColBalance/>
+  </w:Compatibility>
+  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
+  <m:mathPr>
+   <m:mathFont m:val="Cambria Math"/>
+   <m:brkBin m:val="before"/>
+   <m:brkBinSub m:val="&#45;-"/>
+   <m:smallFrac m:val="off"/>
+   <m:dispDef/>
+   <m:lMargin m:val="0"/>
+   <m:rMargin m:val="0"/>
+   <m:defJc m:val="centerGroup"/>
+   <m:wrapIndent m:val="1440"/>
+   <m:intLim m:val="subSup"/>
+   <m:naryLim m:val="undOvr"/>
+  </m:mathPr></w:WordDocument>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="false"
+  DefSemiHidden="false" DefQFormat="false" LatentStyleCount="267">
+  <w:LsdException Locked="false" QFormat="true" Name="Normal"/>
+  <w:LsdException Locked="false" QFormat="true" Name="heading 1"/>
+  <w:LsdException Locked="false" QFormat="true" Name="heading 2"/>
+  <w:LsdException Locked="false" QFormat="true" Name="heading 3"/>
+  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
+   QFormat="true" Name="heading 4"/>
+  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
+   QFormat="true" Name="heading 5"/>
+  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
+   QFormat="true" Name="heading 6"/>
+  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
+   QFormat="true" Name="heading 7"/>
+  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
+   QFormat="true" Name="heading 8"/>
+  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
+   QFormat="true" Name="heading 9"/>
+  <w:LsdException Locked="false" SemiHidden="true" UnhideWhenUsed="true"
+   QFormat="true" Name="caption"/>
+  <w:LsdException Locked="false" QFormat="true" Name="Title"/>
+  <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
+  <w:LsdException Locked="false" QFormat="true" Name="Subtitle"/>
+  <w:LsdException Locked="false" QFormat="true" Name="Strong"/>
+  <w:LsdException Locked="false" QFormat="true" Name="Emphasis"/>
+  <w:LsdException Locked="false" Priority="99" Name="No List"/>
+  <w:LsdException Locked="false" Priority="99" SemiHidden="true"
+   Name="Placeholder Text"/>
+  <w:LsdException Locked="false" Priority="1" QFormat="true" Name="No Spacing"/>
+  <w:LsdException Locked="false" Priority="60" Name="Light Shading"/>
+  <w:LsdException Locked="false" Priority="61" Name="Light List"/>
+  <w:LsdException Locked="false" Priority="62" Name="Light Grid"/>
+  <w:LsdException Locked="false" Priority="63" Name="Medium Shading 1"/>
+  <w:LsdException Locked="false" Priority="64" Name="Medium Shading 2"/>
+  <w:LsdException Locked="false" Priority="65" Name="Medium List 1"/>
+  <w:LsdException Locked="false" Priority="66" Name="Medium List 2"/>
+  <w:LsdException Locked="false" Priority="67" Name="Medium Grid 1"/>
+  <w:LsdException Locked="false" Priority="68" Name="Medium Grid 2"/>
+  <w:LsdException Locked="false" Priority="69" Name="Medium Grid 3"/>
+  <w:LsdException Locked="false" Priority="70" Name="Dark List"/>
+  <w:LsdException Locked="false" Priority="71" Name="Colorful Shading"/>
+  <w:LsdException Locked="false" Priority="72" Name="Colorful List"/>
+  <w:LsdException Locked="false" Priority="73" Name="Colorful Grid"/>
+  <w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 1"/>
+  <w:LsdException Locked="false" Priority="61" Name="Light List Accent 1"/>
+  <w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 1"/>
+  <w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 1"/>
+  <w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 1"/>
+  <w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 1"/>
+  <w:LsdException Locked="false" Priority="99" SemiHidden="true" Name="Revision"/>
+  <w:LsdException Locked="false" Priority="34" QFormat="true"
+   Name="List Paragraph"/>
+  <w:LsdException Locked="false" Priority="29" QFormat="true" Name="Quote"/>
+  <w:LsdException Locked="false" Priority="30" QFormat="true"
+   Name="Intense Quote"/>
+  <w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 1"/>
+  <w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 1"/>
+  <w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 1"/>
+  <w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 1"/>
+  <w:LsdException Locked="false" Priority="70" Name="Dark List Accent 1"/>
+  <w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 1"/>
+  <w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 1"/>
+  <w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 1"/>
+  <w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 2"/>
+  <w:LsdException Locked="false" Priority="61" Name="Light List Accent 2"/>
+  <w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 2"/>
+  <w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 2"/>
+  <w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 2"/>
+  <w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 2"/>
+  <w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 2"/>
+  <w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 2"/>
+  <w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 2"/>
+  <w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 2"/>
+  <w:LsdException Locked="false" Priority="70" Name="Dark List Accent 2"/>
+  <w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 2"/>
+  <w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 2"/>
+  <w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 2"/>
+  <w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 3"/>
+  <w:LsdException Locked="false" Priority="61" Name="Light List Accent 3"/>
+  <w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 3"/>
+  <w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 3"/>
+  <w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 3"/>
+  <w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 3"/>
+  <w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 3"/>
+  <w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 3"/>
+  <w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 3"/>
+  <w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 3"/>
+  <w:LsdException Locked="false" Priority="70" Name="Dark List Accent 3"/>
+  <w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 3"/>
+  <w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 3"/>
+  <w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 3"/>
+  <w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 4"/>
+  <w:LsdException Locked="false" Priority="61" Name="Light List Accent 4"/>
+  <w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 4"/>
+  <w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 4"/>
+  <w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 4"/>
+  <w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 4"/>
+  <w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 4"/>
+  <w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 4"/>
+  <w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 4"/>
+  <w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 4"/>
+  <w:LsdException Locked="false" Priority="70" Name="Dark List Accent 4"/>
+  <w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 4"/>
+  <w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 4"/>
+  <w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 4"/>
+  <w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 5"/>
+  <w:LsdException Locked="false" Priority="61" Name="Light List Accent 5"/>
+  <w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 5"/>
+  <w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 5"/>
+  <w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 5"/>
+  <w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 5"/>
+  <w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 5"/>
+  <w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 5"/>
+  <w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 5"/>
+  <w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 5"/>
+  <w:LsdException Locked="false" Priority="70" Name="Dark List Accent 5"/>
+  <w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 5"/>
+  <w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 5"/>
+  <w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 5"/>
+  <w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 6"/>
+  <w:LsdException Locked="false" Priority="61" Name="Light List Accent 6"/>
+  <w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 6"/>
+  <w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 6"/>
+  <w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 6"/>
+  <w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 6"/>
+  <w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 6"/>
+  <w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 6"/>
+  <w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 6"/>
+  <w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 6"/>
+  <w:LsdException Locked="false" Priority="70" Name="Dark List Accent 6"/>
+  <w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 6"/>
+  <w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 6"/>
+  <w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 6"/>
+  <w:LsdException Locked="false" Priority="19" QFormat="true"
+   Name="Subtle Emphasis"/>
+  <w:LsdException Locked="false" Priority="21" QFormat="true"
+   Name="Intense Emphasis"/>
+  <w:LsdException Locked="false" Priority="31" QFormat="true"
+   Name="Subtle Reference"/>
+  <w:LsdException Locked="false" Priority="32" QFormat="true"
+   Name="Intense Reference"/>
+  <w:LsdException Locked="false" Priority="33" QFormat="true" Name="Book Title"/>
+  <w:LsdException Locked="false" Priority="37" SemiHidden="true"
+   UnhideWhenUsed="true" Name="Bibliography"/>
+  <w:LsdException Locked="false" Priority="39" SemiHidden="true"
+   UnhideWhenUsed="true" QFormat="true" Name="TOC Heading"/>
+ </w:LatentStyles>
+</xml><![endif]-->
+
+<style>
+<!--
+ /* Font Definitions */
+ @font-face
+	{font-family:"Cambria Math";
+	panose-1:2 4 5 3 5 4 6 3 2 4;
+	mso-font-charset:1;
+	mso-generic-font-family:roman;
+	mso-font-format:other;
+	mso-font-pitch:variable;
+	mso-font-signature:0 0 0 0 0 0;}
+@font-face
+	{font-family:Calibri;
+	panose-1:2 15 5 2 2 2 4 3 2 4;
+	mso-font-charset:0;
+	mso-generic-font-family:swiss;
+	mso-font-pitch:variable;
+	mso-font-signature:-1610611985 1073750139 0 0 159 0;}
+@font-face
+	{font-family:Tahoma;
+	panose-1:2 11 6 4 3 5 4 4 2 4;
+	mso-font-charset:0;
+	mso-generic-font-family:swiss;
+	mso-font-pitch:variable;
+	mso-font-signature:1627400839 -2147483648 8 0 66047 0;}
+@font-face
+	{font-family:Verdana;
+	panose-1:2 11 6 4 3 5 4 4 2 4;
+	mso-font-charset:0;
+	mso-generic-font-family:swiss;
+	mso-font-pitch:variable;
+	mso-font-signature:536871559 0 0 0 415 0;}
+ /* Style Definitions */
+ p.MsoNormal, li.MsoNormal, div.MsoNormal
+	{mso-style-unhide:no;
+	mso-style-qformat:yes;
+	mso-style-parent:"";
+	margin:0in;
+	margin-bottom:.0001pt;
+	mso-pagination:widow-orphan;
+	font-size:12.0pt;
+	font-family:"Times New Roman","serif";
+	mso-fareast-font-family:"Times New Roman";}
+h1
+	{mso-style-unhide:no;
+	mso-style-qformat:yes;
+	mso-style-link:"Heading 1 Char";
+	mso-margin-top-alt:auto;
+	margin-right:0in;
+	mso-margin-bottom-alt:auto;
+	margin-left:0in;
+	mso-pagination:widow-orphan;
+	mso-outline-level:1;
+	font-size:24.0pt;
+	font-family:"Times New Roman","serif";
+	mso-fareast-font-family:"Times New Roman";
+	mso-fareast-theme-font:minor-fareast;
+	font-weight:bold;}
+h2
+	{mso-style-unhide:no;
+	mso-style-qformat:yes;
+	mso-style-link:"Heading 2 Char";
+	mso-style-next:Normal;
+	margin-top:12.0pt;
+	margin-right:0in;
+	margin-bottom:3.0pt;
+	margin-left:0in;
+	mso-pagination:widow-orphan;
+	page-break-after:avoid;
+	mso-outline-level:2;
+	font-size:14.0pt;
+	font-family:"Arial","sans-serif";
+	mso-fareast-font-family:"Times New Roman";
+	mso-fareast-theme-font:minor-fareast;
+	font-weight:bold;
+	font-style:italic;}
+h3
+	{mso-style-unhide:no;
+	mso-style-qformat:yes;
+	mso-style-link:"Heading 3 Char";
+	mso-margin-top-alt:auto;
+	margin-right:0in;
+	mso-margin-bottom-alt:auto;
+	margin-left:0in;
+	mso-pagination:widow-orphan;
+	mso-outline-level:3;
+	font-size:13.5pt;
+	font-family:"Times New Roman","serif";
+	mso-fareast-font-family:"Times New Roman";
+	mso-fareast-theme-font:minor-fareast;
+	font-weight:bold;}
+a:link, span.MsoHyperlink
+	{mso-style-unhide:no;
+	color:blue;
+	text-decoration:underline;
+	text-underline:single;}
+a:visited, span.MsoHyperlinkFollowed
+	{mso-style-unhide:no;
+	color:blue;
+	text-decoration:underline;
+	text-underline:single;}
+p
+	{mso-style-unhide:no;
+	mso-margin-top-alt:auto;
+	margin-right:0in;
+	mso-margin-bottom-alt:auto;
+	margin-left:0in;
+	mso-pagination:widow-orphan;
+	font-size:12.0pt;
+	font-family:"Times New Roman","serif";
+	mso-fareast-font-family:"Times New Roman";}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+	{mso-style-unhide:no;
+	mso-style-link:"Balloon Text Char";
+	margin:0in;
+	margin-bottom:.0001pt;
+	mso-pagination:widow-orphan;
+	font-size:8.0pt;
+	font-family:"Tahoma","sans-serif";
+	mso-fareast-font-family:"Times New Roman";}
+span.Heading1Char
+	{mso-style-name:"Heading 1 Char";
+	mso-style-unhide:no;
+	mso-style-locked:yes;
+	mso-style-link:"Heading 1";
+	mso-ansi-font-size:14.0pt;
+	mso-bidi-font-size:14.0pt;
+	font-family:"Cambria","serif";
+	mso-ascii-font-family:Cambria;
+	mso-ascii-theme-font:major-latin;
+	mso-fareast-font-family:"Times New Roman";
+	mso-fareast-theme-font:major-fareast;
+	mso-hansi-font-family:Cambria;
+	mso-hansi-theme-font:major-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:major-bidi;
+	color:#365F91;
+	mso-themecolor:accent1;
+	mso-themeshade:191;
+	font-weight:bold;}
+span.Heading2Char
+	{mso-style-name:"Heading 2 Char";
+	mso-style-unhide:no;
+	mso-style-locked:yes;
+	mso-style-link:"Heading 2";
+	mso-ansi-font-size:13.0pt;
+	mso-bidi-font-size:13.0pt;
+	font-family:"Cambria","serif";
+	mso-ascii-font-family:Cambria;
+	mso-ascii-theme-font:major-latin;
+	mso-fareast-font-family:"Times New Roman";
+	mso-fareast-theme-font:major-fareast;
+	mso-hansi-font-family:Cambria;
+	mso-hansi-theme-font:major-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:major-bidi;
+	color:#4F81BD;
+	mso-themecolor:accent1;
+	font-weight:bold;}
+span.Heading3Char
+	{mso-style-name:"Heading 3 Char";
+	mso-style-unhide:no;
+	mso-style-locked:yes;
+	mso-style-link:"Heading 3";
+	mso-ansi-font-size:12.0pt;
+	mso-bidi-font-size:12.0pt;
+	font-family:"Cambria","serif";
+	mso-ascii-font-family:Cambria;
+	mso-ascii-theme-font:major-latin;
+	mso-fareast-font-family:"Times New Roman";
+	mso-fareast-theme-font:major-fareast;
+	mso-hansi-font-family:Cambria;
+	mso-hansi-theme-font:major-latin;
+	mso-bidi-font-family:"Times New Roman";
+	mso-bidi-theme-font:major-bidi;
+	color:#4F81BD;
+	mso-themecolor:accent1;
+	font-weight:bold;}
+span.BalloonTextChar
+	{mso-style-name:"Balloon Text Char";
+	mso-style-unhide:no;
+	mso-style-locked:yes;
+	mso-style-link:"Balloon Text";
+	mso-ansi-font-size:8.0pt;
+	mso-bidi-font-size:8.0pt;
+	font-family:"Tahoma","sans-serif";
+	mso-ascii-font-family:Tahoma;
+	mso-hansi-font-family:Tahoma;
+	mso-bidi-font-family:Tahoma;}
+.MsoChpDefault
+	{mso-style-type:export-only;
+	mso-default-props:yes;
+	font-size:10.0pt;
+	mso-ansi-font-size:10.0pt;
+	mso-bidi-font-size:10.0pt;}
+@page WordSection1
+	{size:8.5in 11.0in;
+	margin:1.0in 1.25in 1.0in 1.25in;
+	mso-header-margin:.5in;
+	mso-footer-margin:.5in;
+	mso-paper-source:0;}
+div.WordSection1
+	{page:WordSection1;}
+ /* List Definitions */
+ @list l0
+	{mso-list-id:62067358;
+	mso-list-template-ids:-174943062;}
+@list l0:level1
+	{mso-level-number-format:bullet;
+	mso-level-text:\F0B7;
+	mso-level-tab-stop:.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;
+	mso-ansi-font-size:10.0pt;
+	font-family:Symbol;}
+@list l0:level2
+	{mso-level-tab-stop:1.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level3
+	{mso-level-tab-stop:1.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level4
+	{mso-level-tab-stop:2.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level5
+	{mso-level-tab-stop:2.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level6
+	{mso-level-tab-stop:3.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level7
+	{mso-level-tab-stop:3.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level8
+	{mso-level-tab-stop:4.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l0:level9
+	{mso-level-tab-stop:4.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1
+	{mso-list-id:128015942;
+	mso-list-template-ids:-90681214;}
+@list l1:level1
+	{mso-level-tab-stop:.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level2
+	{mso-level-tab-stop:1.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level3
+	{mso-level-tab-stop:1.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level4
+	{mso-level-tab-stop:2.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level5
+	{mso-level-tab-stop:2.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level6
+	{mso-level-tab-stop:3.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level7
+	{mso-level-tab-stop:3.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level8
+	{mso-level-tab-stop:4.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l1:level9
+	{mso-level-tab-stop:4.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l2
+	{mso-list-id:216556000;
+	mso-list-template-ids:925924412;}
+@list l2:level1
+	{mso-level-number-format:bullet;
+	mso-level-text:\F0B7;
+	mso-level-tab-stop:.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;
+	mso-ansi-font-size:10.0pt;
+	font-family:Symbol;}
+@list l2:level2
+	{mso-level-number-format:bullet;
+	mso-level-text:\F0B7;
+	mso-level-tab-stop:1.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;
+	mso-ansi-font-size:10.0pt;
+	font-family:Symbol;}
+@list l2:level3
+	{mso-level-tab-stop:1.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l2:level4
+	{mso-level-tab-stop:2.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l2:level5
+	{mso-level-tab-stop:2.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l2:level6
+	{mso-level-tab-stop:3.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l2:level7
+	{mso-level-tab-stop:3.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l2:level8
+	{mso-level-tab-stop:4.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l2:level9
+	{mso-level-tab-stop:4.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l3
+	{mso-list-id:562446694;
+	mso-list-template-ids:913898366;}
+@list l3:level1
+	{mso-level-number-format:bullet;
+	mso-level-text:\F0B7;
+	mso-level-tab-stop:.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;
+	mso-ansi-font-size:10.0pt;
+	font-family:Symbol;}
+@list l3:level2
+	{mso-level-tab-stop:1.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l3:level3
+	{mso-level-tab-stop:1.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l3:level4
+	{mso-level-tab-stop:2.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l3:level5
+	{mso-level-tab-stop:2.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l3:level6
+	{mso-level-tab-stop:3.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l3:level7
+	{mso-level-tab-stop:3.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l3:level8
+	{mso-level-tab-stop:4.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l3:level9
+	{mso-level-tab-stop:4.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l4
+	{mso-list-id:797802132;
+	mso-list-template-ids:-1971191336;}
+@list l4:level1
+	{mso-level-tab-stop:.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l4:level2
+	{mso-level-tab-stop:1.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l4:level3
+	{mso-level-tab-stop:1.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l4:level4
+	{mso-level-tab-stop:2.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l4:level5
+	{mso-level-tab-stop:2.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l4:level6
+	{mso-level-tab-stop:3.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l4:level7
+	{mso-level-tab-stop:3.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l4:level8
+	{mso-level-tab-stop:4.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l4:level9
+	{mso-level-tab-stop:4.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l5
+	{mso-list-id:907304066;
+	mso-list-template-ids:1969781532;}
+@list l5:level1
+	{mso-level-tab-stop:.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l5:level2
+	{mso-level-tab-stop:1.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l5:level3
+	{mso-level-tab-stop:1.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l5:level4
+	{mso-level-tab-stop:2.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l5:level5
+	{mso-level-tab-stop:2.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l5:level6
+	{mso-level-tab-stop:3.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l5:level7
+	{mso-level-tab-stop:3.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l5:level8
+	{mso-level-tab-stop:4.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l5:level9
+	{mso-level-tab-stop:4.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l6
+	{mso-list-id:1050613616;
+	mso-list-template-ids:-1009886748;}
+@list l6:level1
+	{mso-level-number-format:bullet;
+	mso-level-text:\F0B7;
+	mso-level-tab-stop:.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;
+	mso-ansi-font-size:10.0pt;
+	font-family:Symbol;}
+@list l6:level2
+	{mso-level-number-format:bullet;
+	mso-level-text:\F0B7;
+	mso-level-tab-stop:1.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;
+	mso-ansi-font-size:10.0pt;
+	font-family:Symbol;}
+@list l6:level3
+	{mso-level-tab-stop:1.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l6:level4
+	{mso-level-tab-stop:2.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l6:level5
+	{mso-level-tab-stop:2.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l6:level6
+	{mso-level-tab-stop:3.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l6:level7
+	{mso-level-tab-stop:3.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l6:level8
+	{mso-level-tab-stop:4.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l6:level9
+	{mso-level-tab-stop:4.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l7
+	{mso-list-id:1234970193;
+	mso-list-template-ids:2055904002;}
+@list l7:level1
+	{mso-level-number-format:bullet;
+	mso-level-text:\F0B7;
+	mso-level-tab-stop:.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;
+	mso-ansi-font-size:10.0pt;
+	font-family:Symbol;}
+@list l7:level2
+	{mso-level-number-format:bullet;
+	mso-level-text:\F0B7;
+	mso-level-tab-stop:1.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;
+	mso-ansi-font-size:10.0pt;
+	font-family:Symbol;}
+@list l7:level3
+	{mso-level-tab-stop:1.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l7:level4
+	{mso-level-tab-stop:2.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l7:level5
+	{mso-level-tab-stop:2.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l7:level6
+	{mso-level-tab-stop:3.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l7:level7
+	{mso-level-tab-stop:3.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l7:level8
+	{mso-level-tab-stop:4.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l7:level9
+	{mso-level-tab-stop:4.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l8
+	{mso-list-id:1846092290;
+	mso-list-template-ids:-768590846;}
+@list l8:level1
+	{mso-level-start-at:2;
+	mso-level-tab-stop:.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l8:level2
+	{mso-level-tab-stop:1.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l8:level3
+	{mso-level-tab-stop:1.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l8:level4
+	{mso-level-tab-stop:2.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l8:level5
+	{mso-level-tab-stop:2.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l8:level6
+	{mso-level-tab-stop:3.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l8:level7
+	{mso-level-tab-stop:3.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l8:level8
+	{mso-level-tab-stop:4.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l8:level9
+	{mso-level-tab-stop:4.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l9
+	{mso-list-id:1894656566;
+	mso-list-template-ids:1199983812;}
+@list l9:level1
+	{mso-level-start-at:2;
+	mso-level-tab-stop:.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l9:level2
+	{mso-level-tab-stop:1.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l9:level3
+	{mso-level-tab-stop:1.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l9:level4
+	{mso-level-tab-stop:2.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l9:level5
+	{mso-level-tab-stop:2.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l9:level6
+	{mso-level-tab-stop:3.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l9:level7
+	{mso-level-tab-stop:3.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l9:level8
+	{mso-level-tab-stop:4.0in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+@list l9:level9
+	{mso-level-tab-stop:4.5in;
+	mso-level-number-position:left;
+	text-indent:-.25in;}
+ol
+	{margin-bottom:0in;}
+ul
+	{margin-bottom:0in;}
+-->
+</style><!--[if gte mso 10]>
+<style>
+ /* Style Definitions */
+ table.MsoNormalTable
+	{mso-style-name:"Table Normal";
+	mso-tstyle-rowband-size:0;
+	mso-tstyle-colband-size:0;
+	mso-style-noshow:yes;
+	mso-style-priority:99;
+	mso-style-qformat:yes;
+	mso-style-parent:"";
+	mso-padding-alt:0in 5.4pt 0in 5.4pt;
+	mso-para-margin:0in;
+	mso-para-margin-bottom:.0001pt;
+	mso-pagination:widow-orphan;
+	font-size:10.0pt;
+	font-family:"Times New Roman","serif";}
+</style>
+<![endif]--><!--[if gte mso 9]><xml>
+ <o:shapedefaults v:ext="edit" spidmax="7170"/>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <o:shapelayout v:ext="edit">
+  <o:idmap v:ext="edit" data="1"/>
+ </o:shapelayout></xml><![endif]--></head>
+<body style="" lang="EN-US" link="blue" vlink="blue">
+
+<div class="WordSection1">
+
+<p class="MsoNormal"><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;;"><o:p>&nbsp;</o:p></span></p>
+
+<div align="center">
+
+<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
+ <tbody><tr style="">
+  <td style="padding: 0in;" valign="top">
+  <table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
+   <tbody><tr style="">
+    <td style="padding: 0in 5.4pt;" valign="top">
+    <p class="MsoNormal"><span style="font-size: 8pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; color: blue;"><a href="../../Release_Notes.html">Back to Release page</a></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
+    </td>
+   </tr>
+   <tr style="">
+    <td style="padding: 1.5pt;">
+    <h1 style="margin-bottom: 0.25in; text-align: center;" align="center"><span style="font-size: 20pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: rgb(51, 102, 255);">Release Notes for STM32F4x7 Ethernet Driver</span><span style="font-size: 20pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><o:p></o:p></span></h1>
+    <p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; color: black;">Copyright
+    2011 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
+    <p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; color: black;"><img id="_x0000_i1026" src="../../_htmresc/logo.bmp" border="0" height="65" width="86"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
+    </td>
+   </tr>
+  </tbody></table>
+  <p class="MsoNormal"><span style="font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; display: none;"><o:p>&nbsp;</o:p></span></p>
+  <table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
+   <tbody><tr style="">
+    <td style="padding: 0in;" valign="top">
+    <h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><span style="font-size: 12pt; color: white;">Contents<o:p></o:p></span></h2>
+    <ol style="margin-top: 0in;" start="1" type="1">
+     <li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><a href="#History">STM32F4x7 Ethernet Driver
+         update History</a><o:p></o:p></span></li>
+     <li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;"><a href="#License">License</a><o:p></o:p></span></li>
+    </ol>
+    <h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">STM32F4x7 Ethernet Driver&nbsp; update History</span></h2><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 168px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0 / 14-October-2011</span></h3><p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
+Changes<o:p></o:p></span></u></b></p>
+<ul style="margin-top: 0cm;" type="square"><li class="MsoNormal" style="color: black; margin-top: 4.5pt; margin-bottom: 4.5pt;"><span style="font-size: 10pt; font-family: Verdana;">First official release&nbsp;for <span style="font-weight: bold; font-style: italic;">STM32F407xx/417xx</span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-weight: bold; font-style: italic;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-weight: bold; font-style: italic;"> devices</span></span></li></ul><span style="font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;"><br></span>
+    <h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span></h2>
+    <p class="MsoNormal" style="margin: 4.5pt 0in;"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: black;">The enclosed firmware and all the related documentation are
+    not covered by a License Agreement, if you need such License you can
+    contact your local STMicroelectronics office.<u1:p></u1:p><o:p></o:p></span></p>
+    <p class="MsoNormal"><b><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: black;">THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING
+    CUSTOMERS WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR
+    THEM TO SAVE TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE
+    FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY
+    CLAIMS ARISING FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY
+    CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH
+    THEIR PRODUCTS. <o:p></o:p></span></b></p>
+    <p class="MsoNormal"><span style="color: black;"><o:p>&nbsp;</o:p></span></p>
+    <div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
+    <hr align="center" size="2" width="100%">
+    </span></div>
+    <p class="MsoNormal" style="margin: 4.5pt 0in 4.5pt 0.25in; text-align: center;" align="center"><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;; color: black;">For
+    complete documentation on </span><span style="font-size: 10pt; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">STM32(<span style="color: black;">CORTEX M3) 32-Bit
+    Microcontrollers visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/family/141.jsp" target="_blank">www.st.com/STM32</a></span></u></span><span style="color: black;"><o:p></o:p></span></p>
+    </td>
+   </tr>
+  </tbody></table>
+  <p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
+  </td>
+ </tr>
+</tbody></table>
+
+</div>
+
+<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
+
+</div>
+
+</body></html>

+ 2719 - 0
modules/STM32F4x7_ETH_Driver/stm32f4x7_eth.c

@@ -0,0 +1,2719 @@
+/**
+  ******************************************************************************
+  * @file    stm32f4x7_eth.c
+  * @author  MCD Application Team
+  * @version V1.0.0
+  * @date    14-October-2011
+  * @brief   This file is the low level driver for STM32F407xx/417xx Ethernet Controller.
+  *          This driver does not include low level functions for PTP time-stamp.            
+  ******************************************************************************
+  * @attention
+  *
+  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
+  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
+  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
+  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
+  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+  *
+  * <h2><center>&copy; Portions COPYRIGHT 2011 STMicroelectronics</center></h2>
+  ******************************************************************************
+  */
+/**
+  ******************************************************************************
+  * <h2><center>&copy; Portions COPYRIGHT 2012 Embest Tech. Co., Ltd.</center></h2>
+  * @file    stm32f4x7_eth.c
+  * @author  CMP Team
+  * @version V1.0.0
+  * @date    28-December-2012
+  * @brief   This file is the low level driver for STM32F407xx/417xx Ethernet Controller.
+  *          This driver does not include low level functions for PTP time-stamp.     
+  ******************************************************************************
+  * @attention
+  *
+  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
+  * TIME. AS A RESULT, Embest SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
+  * OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
+  * OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
+  * CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+  ******************************************************************************
+  */
+/* Includes ------------------------------------------------------------------*/
+#include "stm32f4x7_eth.h"
+#include "stm32f4xx_rcc.h"
+#include <string.h>
+
+/** @addtogroup STM32F4x7_ETH_Driver
+  * @brief ETH driver modules
+  * @{
+  */
+
+/** @defgroup ETH_Private_TypesDefinitions
+  * @{
+  */ 
+/**
+  * @}
+  */ 
+
+
+/** @defgroup ETH_Private_Defines
+  * @{
+  */ 
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Private_Macros
+  * @{
+  */ 
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Private_Variables
+  * @{
+  */ 
+
+#if defined   (__CC_ARM) /*!< ARM Compiler */
+  __align(4) 
+   ETH_DMADESCTypeDef  DMARxDscrTab[ETH_RXBUFNB];/* Ethernet Rx MA Descriptor */
+  __align(4) 
+   ETH_DMADESCTypeDef  DMATxDscrTab[ETH_TXBUFNB];/* Ethernet Tx DMA Descriptor */
+  __align(4) 
+   uint8_t Rx_Buff[ETH_RXBUFNB][ETH_RX_BUF_SIZE]; /* Ethernet Receive Buffer */
+  __align(4) 
+   uint8_t Tx_Buff[ETH_TXBUFNB][ETH_TX_BUF_SIZE]; /* Ethernet Transmit Buffer */
+
+#elif defined ( __ICCARM__ ) /*!< IAR Compiler */
+  #pragma data_alignment=4
+   ETH_DMADESCTypeDef  DMARxDscrTab[ETH_RXBUFNB];/* Ethernet Rx MA Descriptor */
+  #pragma data_alignment=4
+   ETH_DMADESCTypeDef  DMATxDscrTab[ETH_TXBUFNB];/* Ethernet Tx DMA Descriptor */
+  #pragma data_alignment=4
+   uint8_t Rx_Buff[ETH_RXBUFNB][ETH_RX_BUF_SIZE]; /* Ethernet Receive Buffer */
+  #pragma data_alignment=4
+   uint8_t Tx_Buff[ETH_TXBUFNB][ETH_TX_BUF_SIZE]; /* Ethernet Transmit Buffer */
+
+#elif defined (__GNUC__) /*!< GNU Compiler */
+  ETH_DMADESCTypeDef  DMARxDscrTab[ETH_RXBUFNB] __attribute__ ((aligned (4))); /* Ethernet Rx DMA Descriptor */
+  ETH_DMADESCTypeDef  DMATxDscrTab[ETH_TXBUFNB] __attribute__ ((aligned (4))); /* Ethernet Tx DMA Descriptor */
+  uint8_t Rx_Buff[ETH_RXBUFNB][ETH_RX_BUF_SIZE] __attribute__ ((aligned (4))); /* Ethernet Receive Buffer */
+  uint8_t Tx_Buff[ETH_TXBUFNB][ETH_TX_BUF_SIZE] __attribute__ ((aligned (4))); /* Ethernet Transmit Buffer */
+
+#elif defined  (__TASKING__) /*!< TASKING Compiler */                           
+  __align(4) 
+   ETH_DMADESCTypeDef  DMARxDscrTab[ETH_RXBUFNB];/* Ethernet Rx MA Descriptor */
+  __align(4) 
+   ETH_DMADESCTypeDef  DMATxDscrTab[ETH_TXBUFNB];/* Ethernet Tx DMA Descriptor */
+  __align(4) 
+   uint8_t Rx_Buff[ETH_RXBUFNB][ETH_RX_BUF_SIZE]; /* Ethernet Receive Buffer */
+  __align(4) 
+   uint8_t Tx_Buff[ETH_TXBUFNB][ETH_TX_BUF_SIZE]; /* Ethernet Transmit Buffer */
+
+#endif /* __CC_ARM */
+
+
+/* Global pointers on Tx and Rx descriptor used to track transmit and receive descriptors */
+__IO ETH_DMADESCTypeDef  *DMATxDescToSet;
+__IO ETH_DMADESCTypeDef  *DMARxDescToGet;
+
+
+/* Structure used to hold the last received packet descriptors info */
+
+ETH_DMA_Rx_Frame_infos RX_Frame_Descriptor;
+__IO ETH_DMA_Rx_Frame_infos *DMA_RX_FRAME_infos;
+__IO uint32_t Frame_Rx_index;
+
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Private_FunctionPrototypes
+  * @{
+  */ 
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Private_Functions
+  * @{
+  */
+
+#ifndef USE_Delay
+/**
+  * @brief  Inserts a delay time.
+  * @param  nCount: specifies the delay time length.
+  * @retval None
+  */
+static void ETH_Delay(__IO uint32_t nCount)
+{
+  __IO uint32_t index = 0; 
+  for(index = nCount; index != 0; index--)
+  {
+  }
+}
+#endif /* USE_Delay*/
+
+
+
+/******************************************************************************/                             
+/*                           Global ETH MAC/DMA functions                     */
+/******************************************************************************/
+
+/**
+  * @brief  Deinitializes the ETHERNET peripheral registers to their default reset values.
+  * @param  None 
+  * @retval None
+  */
+void ETH_DeInit(void)
+{
+  RCC_AHB1PeriphResetCmd(RCC_AHB1Periph_ETH_MAC, ENABLE);
+  RCC_AHB1PeriphResetCmd(RCC_AHB1Periph_ETH_MAC, DISABLE);
+}
+
+
+/**
+  * @brief  Fills each ETH_InitStruct member with its default value.
+  * @param  ETH_InitStruct: pointer to a ETH_InitTypeDef structure which will be initialized.
+  * @retval None
+  */
+void ETH_StructInit(ETH_InitTypeDef* ETH_InitStruct)
+{
+  /* ETH_InitStruct members default value */
+  /*------------------------   MAC Configuration   ---------------------------*/
+  
+  /* PHY Auto-negotiation enabled */
+  ETH_InitStruct->ETH_AutoNegotiation = ETH_AutoNegotiation_Enable;           
+  /* MAC watchdog enabled: cuts-off long frame */
+  ETH_InitStruct->ETH_Watchdog = ETH_Watchdog_Enable;
+  /* MAC Jabber enabled in Half-duplex mode */
+  ETH_InitStruct->ETH_Jabber = ETH_Jabber_Enable;                                                       
+  /* Ethernet interframe gap set to 96 bits */
+  ETH_InitStruct->ETH_InterFrameGap = ETH_InterFrameGap_96Bit;                                                                                                                             
+  /* Carrier Sense Enabled in Half-Duplex mode */ 
+  ETH_InitStruct->ETH_CarrierSense = ETH_CarrierSense_Enable;                                
+  /* PHY speed configured to 100Mbit/s */
+  ETH_InitStruct->ETH_Speed = ETH_Speed_100M; 
+  /* Receive own Frames in Half-Duplex mode enabled */
+  ETH_InitStruct->ETH_ReceiveOwn = ETH_ReceiveOwn_Enable;                
+  /* MAC MII loopback disabled */ 
+  ETH_InitStruct->ETH_LoopbackMode = ETH_LoopbackMode_Disable;              
+  /* Full-Duplex mode selected */
+  ETH_InitStruct->ETH_Mode = ETH_Mode_FullDuplex;                      
+  /* IPv4 and TCP/UDP/ICMP frame Checksum Offload disabled */
+  ETH_InitStruct->ETH_ChecksumOffload = ETH_ChecksumOffload_Disable;                                                             
+  /* Retry Transmission enabled for half-duplex mode */ 
+  ETH_InitStruct->ETH_RetryTransmission = ETH_RetryTransmission_Enable;                                                                                   
+  /* Automatic PAD/CRC strip disabled*/
+  ETH_InitStruct->ETH_AutomaticPadCRCStrip = ETH_AutomaticPadCRCStrip_Disable;                                                          
+  /* half-duplex mode retransmission Backoff time_limit = 10 slot times*/ 
+  ETH_InitStruct->ETH_BackOffLimit = ETH_BackOffLimit_10;     
+  /* half-duplex mode Deferral check disabled */
+  ETH_InitStruct->ETH_DeferralCheck = ETH_DeferralCheck_Disable;                                                                                                                  
+  /* Receive all frames disabled */ 
+  ETH_InitStruct->ETH_ReceiveAll = ETH_ReceiveAll_Disable;
+  /* Source address filtering (on the optional MAC addresses) disabled */
+  ETH_InitStruct->ETH_SourceAddrFilter = ETH_SourceAddrFilter_Disable;   
+  /* Do not forward control frames that do not pass the address filtering */
+  ETH_InitStruct->ETH_PassControlFrames = ETH_PassControlFrames_BlockAll;   
+  /* Disable reception of Broadcast frames */
+  ETH_InitStruct->ETH_BroadcastFramesReception = ETH_BroadcastFramesReception_Disable;
+  /* Normal Destination address filtering (not reverse addressing) */
+  ETH_InitStruct->ETH_DestinationAddrFilter = ETH_DestinationAddrFilter_Normal;
+  /* Promiscuous address filtering mode disabled */
+  ETH_InitStruct->ETH_PromiscuousMode = ETH_PromiscuousMode_Disable;                                                             
+  /* Perfect address filtering for multicast addresses */
+  ETH_InitStruct->ETH_MulticastFramesFilter = ETH_MulticastFramesFilter_Perfect;       
+  /* Perfect address filtering for unicast addresses */
+  ETH_InitStruct->ETH_UnicastFramesFilter = ETH_UnicastFramesFilter_Perfect;      
+  /* Initialize hash table high and low regs */
+  ETH_InitStruct->ETH_HashTableHigh = 0x0;                
+  ETH_InitStruct->ETH_HashTableLow = 0x0;                     
+  /* Flow control config (flow control disabled)*/
+  ETH_InitStruct->ETH_PauseTime = 0x0;                 
+  ETH_InitStruct->ETH_ZeroQuantaPause = ETH_ZeroQuantaPause_Disable;            
+  ETH_InitStruct->ETH_PauseLowThreshold = ETH_PauseLowThreshold_Minus4;         
+  ETH_InitStruct->ETH_UnicastPauseFrameDetect = ETH_UnicastPauseFrameDetect_Disable;   
+  ETH_InitStruct->ETH_ReceiveFlowControl = ETH_ReceiveFlowControl_Disable;        
+  ETH_InitStruct->ETH_TransmitFlowControl = ETH_TransmitFlowControl_Disable;
+  /* VLANtag config (VLAN field not checked) */
+  ETH_InitStruct->ETH_VLANTagComparison = ETH_VLANTagComparison_16Bit;          
+  ETH_InitStruct->ETH_VLANTagIdentifier = 0x0;          
+  
+  /*---------------------- DMA Configuration   -------------------------------*/
+
+  /* Drops frames with with TCP/IP checksum errors */
+  ETH_InitStruct->ETH_DropTCPIPChecksumErrorFrame = ETH_DropTCPIPChecksumErrorFrame_Disable; 
+  /* Store and forward mode enabled for receive */
+  ETH_InitStruct->ETH_ReceiveStoreForward = ETH_ReceiveStoreForward_Enable;       
+  /* Flush received frame that created FIFO overflow */
+  ETH_InitStruct->ETH_FlushReceivedFrame = ETH_FlushReceivedFrame_Enable; 
+  /* Store and forward mode enabled for transmit */
+  ETH_InitStruct->ETH_TransmitStoreForward = ETH_TransmitStoreForward_Enable;  
+  /* Threshold TXFIFO level set to 64 bytes (used when threshold mode is enabled) */
+  ETH_InitStruct->ETH_TransmitThresholdControl = ETH_TransmitThresholdControl_64Bytes;  
+  /* Disable forwarding frames with errors (short frames, CRC,...)*/
+  ETH_InitStruct->ETH_ForwardErrorFrames = ETH_ForwardErrorFrames_Disable; 
+  /* Disable undersized good frames */
+  ETH_InitStruct->ETH_ForwardUndersizedGoodFrames = ETH_ForwardUndersizedGoodFrames_Disable; 
+  /* Threshold RXFIFO level set to 64 bytes (used when Cut-through mode is enabled) */
+  ETH_InitStruct->ETH_ReceiveThresholdControl = ETH_ReceiveThresholdControl_64Bytes;                             
+  /* Disable Operate on second frame (transmit a second frame to FIFO without 
+  waiting status of previous frame*/                           
+  ETH_InitStruct->ETH_SecondFrameOperate = ETH_SecondFrameOperate_Disable;
+  /* DMA works on 32-bit aligned start source and destinations addresses */
+  ETH_InitStruct->ETH_AddressAlignedBeats = ETH_AddressAlignedBeats_Enable;
+  /* Enabled Fixed Burst Mode (mix of INC4, INC8, INC16 and SINGLE DMA transactions */
+  ETH_InitStruct->ETH_FixedBurst = ETH_FixedBurst_Enable;
+  /* DMA transfer max burst length = 32 beats = 32 x 32bits */
+  ETH_InitStruct->ETH_RxDMABurstLength = ETH_RxDMABurstLength_32Beat;
+  ETH_InitStruct->ETH_TxDMABurstLength = ETH_TxDMABurstLength_32Beat;
+  /* DMA Ring mode skip length = 0 */
+  ETH_InitStruct->ETH_DescriptorSkipLength = 0x0; 
+  /* Equal priority (round-robin) between transmit and receive DMA engines */
+  ETH_InitStruct->ETH_DMAArbitration = ETH_DMAArbitration_RoundRobin_RxTx_1_1;
+}
+
+
+/**
+  * @brief  Initializes the ETHERNET peripheral according to the specified
+  *   parameters in the ETH_InitStruct .
+  * @param ETH_InitStruct: pointer to a ETH_InitTypeDef structure that contains
+  *   the configuration information for the specified ETHERNET peripheral.
+  * @param PHYAddress: external PHY address                    
+  * @retval ETH_ERROR: Ethernet initialization failed
+  *         ETH_SUCCESS: Ethernet successfully initialized                 
+  */
+uint32_t ETH_Init(ETH_InitTypeDef* ETH_InitStruct, uint16_t PHYAddress)
+{
+  uint32_t RegValue = 0, tmpreg = 0;
+  __IO uint32_t i = 0;
+  RCC_ClocksTypeDef  rcc_clocks;
+  uint32_t hclk = 60000000;
+  __IO uint32_t timeout = 0;
+  /* Check the parameters */
+  /* MAC --------------------------*/ 
+  assert_param(IS_ETH_AUTONEGOTIATION(ETH_InitStruct->ETH_AutoNegotiation));
+  assert_param(IS_ETH_WATCHDOG(ETH_InitStruct->ETH_Watchdog));
+  assert_param(IS_ETH_JABBER(ETH_InitStruct->ETH_Jabber));
+  assert_param(IS_ETH_INTER_FRAME_GAP(ETH_InitStruct->ETH_InterFrameGap));
+  assert_param(IS_ETH_CARRIER_SENSE(ETH_InitStruct->ETH_CarrierSense));
+  assert_param(IS_ETH_SPEED(ETH_InitStruct->ETH_Speed));
+  assert_param(IS_ETH_RECEIVE_OWN(ETH_InitStruct->ETH_ReceiveOwn));
+  assert_param(IS_ETH_LOOPBACK_MODE(ETH_InitStruct->ETH_LoopbackMode));
+  assert_param(IS_ETH_DUPLEX_MODE(ETH_InitStruct->ETH_Mode));
+  assert_param(IS_ETH_CHECKSUM_OFFLOAD(ETH_InitStruct->ETH_ChecksumOffload));
+  assert_param(IS_ETH_RETRY_TRANSMISSION(ETH_InitStruct->ETH_RetryTransmission));
+  assert_param(IS_ETH_AUTOMATIC_PADCRC_STRIP(ETH_InitStruct->ETH_AutomaticPadCRCStrip));
+  assert_param(IS_ETH_BACKOFF_LIMIT(ETH_InitStruct->ETH_BackOffLimit));
+  assert_param(IS_ETH_DEFERRAL_CHECK(ETH_InitStruct->ETH_DeferralCheck));
+  assert_param(IS_ETH_RECEIVE_ALL(ETH_InitStruct->ETH_ReceiveAll));
+  assert_param(IS_ETH_SOURCE_ADDR_FILTER(ETH_InitStruct->ETH_SourceAddrFilter));
+  assert_param(IS_ETH_CONTROL_FRAMES(ETH_InitStruct->ETH_PassControlFrames));
+  assert_param(IS_ETH_BROADCAST_FRAMES_RECEPTION(ETH_InitStruct->ETH_BroadcastFramesReception));
+  assert_param(IS_ETH_DESTINATION_ADDR_FILTER(ETH_InitStruct->ETH_DestinationAddrFilter));
+  assert_param(IS_ETH_PROMISCIOUS_MODE(ETH_InitStruct->ETH_PromiscuousMode));
+  assert_param(IS_ETH_MULTICAST_FRAMES_FILTER(ETH_InitStruct->ETH_MulticastFramesFilter));  
+  assert_param(IS_ETH_UNICAST_FRAMES_FILTER(ETH_InitStruct->ETH_UnicastFramesFilter));
+  assert_param(IS_ETH_PAUSE_TIME(ETH_InitStruct->ETH_PauseTime));
+  assert_param(IS_ETH_ZEROQUANTA_PAUSE(ETH_InitStruct->ETH_ZeroQuantaPause));
+  assert_param(IS_ETH_PAUSE_LOW_THRESHOLD(ETH_InitStruct->ETH_PauseLowThreshold));
+  assert_param(IS_ETH_UNICAST_PAUSE_FRAME_DETECT(ETH_InitStruct->ETH_UnicastPauseFrameDetect));
+  assert_param(IS_ETH_RECEIVE_FLOWCONTROL(ETH_InitStruct->ETH_ReceiveFlowControl));
+  assert_param(IS_ETH_TRANSMIT_FLOWCONTROL(ETH_InitStruct->ETH_TransmitFlowControl));
+  assert_param(IS_ETH_VLAN_TAG_COMPARISON(ETH_InitStruct->ETH_VLANTagComparison));
+  assert_param(IS_ETH_VLAN_TAG_IDENTIFIER(ETH_InitStruct->ETH_VLANTagIdentifier));
+  /* DMA --------------------------*/
+  assert_param(IS_ETH_DROP_TCPIP_CHECKSUM_FRAME(ETH_InitStruct->ETH_DropTCPIPChecksumErrorFrame));
+  assert_param(IS_ETH_RECEIVE_STORE_FORWARD(ETH_InitStruct->ETH_ReceiveStoreForward));
+  assert_param(IS_ETH_FLUSH_RECEIVE_FRAME(ETH_InitStruct->ETH_FlushReceivedFrame));
+  assert_param(IS_ETH_TRANSMIT_STORE_FORWARD(ETH_InitStruct->ETH_TransmitStoreForward));
+  assert_param(IS_ETH_TRANSMIT_THRESHOLD_CONTROL(ETH_InitStruct->ETH_TransmitThresholdControl));
+  assert_param(IS_ETH_FORWARD_ERROR_FRAMES(ETH_InitStruct->ETH_ForwardErrorFrames));
+  assert_param(IS_ETH_FORWARD_UNDERSIZED_GOOD_FRAMES(ETH_InitStruct->ETH_ForwardUndersizedGoodFrames));
+  assert_param(IS_ETH_RECEIVE_THRESHOLD_CONTROL(ETH_InitStruct->ETH_ReceiveThresholdControl));
+  assert_param(IS_ETH_SECOND_FRAME_OPERATE(ETH_InitStruct->ETH_SecondFrameOperate));
+  assert_param(IS_ETH_ADDRESS_ALIGNED_BEATS(ETH_InitStruct->ETH_AddressAlignedBeats));
+  assert_param(IS_ETH_FIXED_BURST(ETH_InitStruct->ETH_FixedBurst));
+  assert_param(IS_ETH_RXDMA_BURST_LENGTH(ETH_InitStruct->ETH_RxDMABurstLength));
+  assert_param(IS_ETH_TXDMA_BURST_LENGTH(ETH_InitStruct->ETH_TxDMABurstLength)); 
+  assert_param(IS_ETH_DMA_DESC_SKIP_LENGTH(ETH_InitStruct->ETH_DescriptorSkipLength));  
+  assert_param(IS_ETH_DMA_ARBITRATION_ROUNDROBIN_RXTX(ETH_InitStruct->ETH_DMAArbitration));       
+  /*-------------------------------- MAC Config ------------------------------*/   
+  /*---------------------- ETHERNET MACMIIAR Configuration -------------------*/
+  /* Get the ETHERNET MACMIIAR value */
+  tmpreg = ETH->MACMIIAR;
+  /* Clear CSR Clock Range CR[2:0] bits */
+  tmpreg &= MACMIIAR_CR_MASK;
+  /* Get hclk frequency value */
+  RCC_GetClocksFreq(&rcc_clocks);
+  hclk = rcc_clocks.HCLK_Frequency;
+  
+  /* Set CR bits depending on hclk value */
+  if((hclk >= 20000000)&&(hclk < 35000000))
+  {
+    /* CSR Clock Range between 20-35 MHz */
+    tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div16;
+  }
+  else if((hclk >= 35000000)&&(hclk < 60000000))
+  {
+    /* CSR Clock Range between 35-60 MHz */ 
+    tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div26;    
+  }  
+  else if((hclk >= 60000000)&&(hclk < 100000000))
+  {
+    /* CSR Clock Range between 60-100 MHz */ 
+    tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div42;    
+  }  
+  else if((hclk >= 100000000)&&(hclk < 150000000))
+  {
+    /* CSR Clock Range between 100-150 MHz */ 
+    tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div62;    
+  }   
+  else /* ((hclk >= 150000000)&&(hclk <= 168000000)) */
+  {
+    /* CSR Clock Range between 150-168 MHz */ 
+    tmpreg |= (uint32_t)ETH_MACMIIAR_CR_Div102;    
+  }
+  
+  /* Write to ETHERNET MAC MIIAR: Configure the ETHERNET CSR Clock Range */
+  ETH->MACMIIAR = (uint32_t)tmpreg;  
+  /*-------------------- PHY initialization and configuration ----------------*/
+  /* Put the PHY in reset mode */
+  if(!(ETH_WritePHYRegister(PHYAddress, PHY_BCR, PHY_Reset)))
+  {
+    /* Return ERROR in case of write timeout */
+    return ETH_ERROR;
+  }
+  
+  /* Delay to assure PHY reset */
+  _eth_delay_(PHY_RESET_DELAY);
+    
+  if(ETH_InitStruct->ETH_AutoNegotiation != ETH_AutoNegotiation_Disable)
+  {  
+    /* We wait for linked status... */
+    do
+    {
+      timeout++;
+    } while (!(ETH_ReadPHYRegister(PHYAddress, PHY_BSR) & PHY_Linked_Status) && (timeout < PHY_READ_TO));
+
+    /* Return ERROR in case of timeout */
+    if(timeout == PHY_READ_TO)
+    {
+      return ETH_ERROR;
+    }
+
+    /* Reset Timeout counter */
+    timeout = 0; 
+    /* Enable Auto-Negotiation */
+    if(!(ETH_WritePHYRegister(PHYAddress, PHY_BCR, PHY_AutoNegotiation)))
+    {
+      /* Return ERROR in case of write timeout */
+      return ETH_ERROR;
+    }
+
+    /* Wait until the auto-negotiation will be completed */
+    do
+    {
+      timeout++;
+    } while (!(ETH_ReadPHYRegister(PHYAddress, PHY_BSR) & PHY_AutoNego_Complete) && (timeout < (uint32_t)PHY_READ_TO));  
+
+    /* Return ERROR in case of timeout */
+    if(timeout == PHY_READ_TO)
+    {
+      return ETH_ERROR;
+    }
+
+    /* Reset Timeout counter */
+    timeout = 0;
+    
+    /* Read the result of the auto-negotiation */
+    RegValue = ETH_ReadPHYRegister(PHYAddress, PHY_SR);
+
+		switch (RegValue & PHY_DUPLEX_SPEED_STATUS_MASK)
+		{
+		  case PHY_100BTX_FULL:
+			  ETH_InitStruct->ETH_Mode  = ETH_Mode_FullDuplex;
+				ETH_InitStruct->ETH_Speed = ETH_Speed_100M; 
+			  break;
+
+		  case PHY_100BTX_HALF:
+			  ETH_InitStruct->ETH_Mode  = ETH_Mode_HalfDuplex;
+				ETH_InitStruct->ETH_Speed = ETH_Speed_100M; 
+  			break;
+
+		  case PHY_10M_FULL:
+			  ETH_InitStruct->ETH_Mode  = ETH_Mode_FullDuplex;
+				ETH_InitStruct->ETH_Speed = ETH_Speed_10M;
+			  break;
+
+		  case PHY_10M_HALF:
+			  ETH_InitStruct->ETH_Mode  = ETH_Mode_HalfDuplex;
+				ETH_InitStruct->ETH_Speed = ETH_Speed_10M; 
+			  break;
+
+		  default:
+			  break;
+		}		   
+  }
+  else
+  {
+    if(!ETH_WritePHYRegister(PHYAddress, PHY_BCR, ((uint16_t)(ETH_InitStruct->ETH_Mode >> 3) |
+                                                   (uint16_t)(ETH_InitStruct->ETH_Speed >> 1))))
+    {
+      /* Return ERROR in case of write timeout */
+      return ETH_ERROR;
+    }
+    /* Delay to assure PHY configuration */
+    _eth_delay_(PHY_CONFIG_DELAY);
+    
+  }
+  /*------------------------ ETHERNET MACCR Configuration --------------------*/
+  /* Get the ETHERNET MACCR value */  
+  tmpreg = ETH->MACCR;
+  /* Clear WD, PCE, PS, TE and RE bits */
+  tmpreg &= MACCR_CLEAR_MASK;
+  /* Set the WD bit according to ETH_Watchdog value */
+  /* Set the JD: bit according to ETH_Jabber value */
+  /* Set the IFG bit according to ETH_InterFrameGap value */ 
+  /* Set the DCRS bit according to ETH_CarrierSense value */  
+  /* Set the FES bit according to ETH_Speed value */ 
+  /* Set the DO bit according to ETH_ReceiveOwn value */ 
+  /* Set the LM bit according to ETH_LoopbackMode value */ 
+  /* Set the DM bit according to ETH_Mode value */ 
+  /* Set the IPCO bit according to ETH_ChecksumOffload value */                   
+  /* Set the DR bit according to ETH_RetryTransmission value */ 
+  /* Set the ACS bit according to ETH_AutomaticPadCRCStrip value */ 
+  /* Set the BL bit according to ETH_BackOffLimit value */ 
+  /* Set the DC bit according to ETH_DeferralCheck value */                          
+  tmpreg |= (uint32_t)(ETH_InitStruct->ETH_Watchdog | 
+                  ETH_InitStruct->ETH_Jabber | 
+                  ETH_InitStruct->ETH_InterFrameGap |
+                  ETH_InitStruct->ETH_CarrierSense |
+                  ETH_InitStruct->ETH_Speed | 
+                  ETH_InitStruct->ETH_ReceiveOwn |
+                  ETH_InitStruct->ETH_LoopbackMode |
+                  ETH_InitStruct->ETH_Mode | 
+                  ETH_InitStruct->ETH_ChecksumOffload |    
+                  ETH_InitStruct->ETH_RetryTransmission | 
+                  ETH_InitStruct->ETH_AutomaticPadCRCStrip | 
+                  ETH_InitStruct->ETH_BackOffLimit | 
+                  ETH_InitStruct->ETH_DeferralCheck);
+  /* Write to ETHERNET MACCR */
+  ETH->MACCR = (uint32_t)tmpreg;
+  
+  /*----------------------- ETHERNET MACFFR Configuration --------------------*/ 
+  /* Set the RA bit according to ETH_ReceiveAll value */
+  /* Set the SAF and SAIF bits according to ETH_SourceAddrFilter value */
+  /* Set the PCF bit according to ETH_PassControlFrames value */
+  /* Set the DBF bit according to ETH_BroadcastFramesReception value */
+  /* Set the DAIF bit according to ETH_DestinationAddrFilter value */
+  /* Set the PR bit according to ETH_PromiscuousMode value */
+  /* Set the PM, HMC and HPF bits according to ETH_MulticastFramesFilter value */
+  /* Set the HUC and HPF bits according to ETH_UnicastFramesFilter value */
+  /* Write to ETHERNET MACFFR */  
+  ETH->MACFFR = (uint32_t)(ETH_InitStruct->ETH_ReceiveAll | 
+                          ETH_InitStruct->ETH_SourceAddrFilter |
+                          ETH_InitStruct->ETH_PassControlFrames |
+                          ETH_InitStruct->ETH_BroadcastFramesReception | 
+                          ETH_InitStruct->ETH_DestinationAddrFilter |
+                          ETH_InitStruct->ETH_PromiscuousMode |
+                          ETH_InitStruct->ETH_MulticastFramesFilter |
+                          ETH_InitStruct->ETH_UnicastFramesFilter); 
+  /*--------------- ETHERNET MACHTHR and MACHTLR Configuration ---------------*/
+  /* Write to ETHERNET MACHTHR */
+  ETH->MACHTHR = (uint32_t)ETH_InitStruct->ETH_HashTableHigh;
+  /* Write to ETHERNET MACHTLR */
+  ETH->MACHTLR = (uint32_t)ETH_InitStruct->ETH_HashTableLow;
+  /*----------------------- ETHERNET MACFCR Configuration --------------------*/
+  /* Get the ETHERNET MACFCR value */  
+  tmpreg = ETH->MACFCR;
+  /* Clear xx bits */
+  tmpreg &= MACFCR_CLEAR_MASK;
+  
+  /* Set the PT bit according to ETH_PauseTime value */
+  /* Set the DZPQ bit according to ETH_ZeroQuantaPause value */
+  /* Set the PLT bit according to ETH_PauseLowThreshold value */
+  /* Set the UP bit according to ETH_UnicastPauseFrameDetect value */
+  /* Set the RFE bit according to ETH_ReceiveFlowControl value */
+  /* Set the TFE bit according to ETH_TransmitFlowControl value */  
+  tmpreg |= (uint32_t)((ETH_InitStruct->ETH_PauseTime << 16) | 
+                   ETH_InitStruct->ETH_ZeroQuantaPause |
+                   ETH_InitStruct->ETH_PauseLowThreshold |
+                   ETH_InitStruct->ETH_UnicastPauseFrameDetect | 
+                   ETH_InitStruct->ETH_ReceiveFlowControl |
+                   ETH_InitStruct->ETH_TransmitFlowControl); 
+  /* Write to ETHERNET MACFCR */
+  ETH->MACFCR = (uint32_t)tmpreg;
+  /*----------------------- ETHERNET MACVLANTR Configuration -----------------*/
+  /* Set the ETV bit according to ETH_VLANTagComparison value */
+  /* Set the VL bit according to ETH_VLANTagIdentifier value */  
+  ETH->MACVLANTR = (uint32_t)(ETH_InitStruct->ETH_VLANTagComparison | 
+                             ETH_InitStruct->ETH_VLANTagIdentifier); 
+       
+  /*-------------------------------- DMA Config ------------------------------*/
+  /*----------------------- ETHERNET DMAOMR Configuration --------------------*/
+  /* Get the ETHERNET DMAOMR value */  
+  tmpreg = ETH->DMAOMR;
+  /* Clear xx bits */
+  tmpreg &= DMAOMR_CLEAR_MASK;
+  
+  /* Set the DT bit according to ETH_DropTCPIPChecksumErrorFrame value */
+  /* Set the RSF bit according to ETH_ReceiveStoreForward value */
+  /* Set the DFF bit according to ETH_FlushReceivedFrame value */
+  /* Set the TSF bit according to ETH_TransmitStoreForward value */
+  /* Set the TTC bit according to ETH_TransmitThresholdControl value */
+  /* Set the FEF bit according to ETH_ForwardErrorFrames value */
+  /* Set the FUF bit according to ETH_ForwardUndersizedGoodFrames value */
+  /* Set the RTC bit according to ETH_ReceiveThresholdControl value */
+  /* Set the OSF bit according to ETH_SecondFrameOperate value */
+  tmpreg |= (uint32_t)(ETH_InitStruct->ETH_DropTCPIPChecksumErrorFrame | 
+                  ETH_InitStruct->ETH_ReceiveStoreForward |
+                  ETH_InitStruct->ETH_FlushReceivedFrame |
+                  ETH_InitStruct->ETH_TransmitStoreForward | 
+                  ETH_InitStruct->ETH_TransmitThresholdControl |
+                  ETH_InitStruct->ETH_ForwardErrorFrames |
+                  ETH_InitStruct->ETH_ForwardUndersizedGoodFrames |
+                  ETH_InitStruct->ETH_ReceiveThresholdControl |                                   
+                  ETH_InitStruct->ETH_SecondFrameOperate); 
+  /* Write to ETHERNET DMAOMR */
+  ETH->DMAOMR = (uint32_t)tmpreg;
+  
+  /*----------------------- ETHERNET DMABMR Configuration --------------------*/ 
+  /* Set the AAL bit according to ETH_AddressAlignedBeats value */
+  /* Set the FB bit according to ETH_FixedBurst value */
+  /* Set the RPBL and 4*PBL bits according to ETH_RxDMABurstLength value */
+  /* Set the PBL and 4*PBL bits according to ETH_TxDMABurstLength value */
+  /* Set the DSL bit according to ETH_DesciptorSkipLength value */
+  /* Set the PR and DA bits according to ETH_DMAArbitration value */         
+  ETH->DMABMR = (uint32_t)(ETH_InitStruct->ETH_AddressAlignedBeats | 
+                          ETH_InitStruct->ETH_FixedBurst |
+                          ETH_InitStruct->ETH_RxDMABurstLength | /* !! if 4xPBL is selected for Tx or Rx it is applied for the other */
+                          ETH_InitStruct->ETH_TxDMABurstLength | 
+                         (ETH_InitStruct->ETH_DescriptorSkipLength << 2) |
+                          ETH_InitStruct->ETH_DMAArbitration |
+                          ETH_DMABMR_USP); /* Enable use of separate PBL for Rx and Tx */
+                          
+  #ifdef USE_ENHANCED_DMA_DESCRIPTORS
+    /* Enable the Enhanced DMA descriptors */
+    ETH->DMABMR |= ETH_DMABMR_EDE;
+  #endif /* USE_ENHANCED_DMA_DESCRIPTORS */
+                              
+  /* Return Ethernet configuration success */
+  return ETH_SUCCESS;
+}
+
+/**
+  * @brief  Enables ENET MAC and DMA reception/transmission 
+  * @param  None
+  * @retval None
+  */
+void ETH_Start(void)
+{
+  /* Enable transmit state machine of the MAC for transmission on the MII */  
+  ETH_MACTransmissionCmd(ENABLE);
+  /* Flush Transmit FIFO */
+  ETH_FlushTransmitFIFO();
+  /* Enable receive state machine of the MAC for reception from the MII */  
+  ETH_MACReceptionCmd(ENABLE);
+ 
+  /* Start DMA transmission */
+  ETH_DMATransmissionCmd(ENABLE); 
+  /* Start DMA reception */
+  ETH_DMAReceptionCmd(ENABLE);   
+}
+
+
+/**
+  * @brief  Enables or disables the MAC transmission.
+  * @param  NewState: new state of the MAC transmission.
+  *   This parameter can be: ENABLE or DISABLE.
+  * @retval None
+  */
+void ETH_MACTransmissionCmd(FunctionalState NewState)
+{ 
+  /* Check the parameters */
+  assert_param(IS_FUNCTIONAL_STATE(NewState));
+  
+  if (NewState != DISABLE)
+  {
+    /* Enable the MAC transmission */
+    ETH->MACCR |= ETH_MACCR_TE;  
+  }
+  else
+  {
+    /* Disable the MAC transmission */
+    ETH->MACCR &= ~ETH_MACCR_TE;
+  }
+}
+
+
+/**
+  * @brief  Enables or disables the MAC reception.
+  * @param  NewState: new state of the MAC reception.
+  *   This parameter can be: ENABLE or DISABLE.
+  * @retval None
+  */
+void ETH_MACReceptionCmd(FunctionalState NewState)
+{ 
+  /* Check the parameters */
+  assert_param(IS_FUNCTIONAL_STATE(NewState));
+  
+  if (NewState != DISABLE)
+  {
+    /* Enable the MAC reception */
+    ETH->MACCR |= ETH_MACCR_RE;  
+  }
+  else
+  {
+    /* Disable the MAC reception */
+    ETH->MACCR &= ~ETH_MACCR_RE;
+  }
+}
+
+
+/**
+  * @brief  Checks whether the ETHERNET flow control busy bit is set or not.
+  * @param  None
+  * @retval The new state of flow control busy status bit (SET or RESET).
+  */
+FlagStatus ETH_GetFlowControlBusyStatus(void)
+{
+  FlagStatus bitstatus = RESET;
+  /* The Flow Control register should not be written to until this bit is cleared */
+  if ((ETH->MACFCR & ETH_MACFCR_FCBBPA) != (uint32_t)RESET)
+  {
+    bitstatus = SET;
+  }
+  else
+  {
+    bitstatus = RESET;
+  }
+  return bitstatus;
+}
+
+
+/**
+  * @brief  Initiate a Pause Control Frame (Full-duplex only).
+  * @param  None
+  * @retval None
+  */
+void ETH_InitiatePauseControlFrame(void)  
+{ 
+  /* When Set In full duplex MAC initiates pause control frame */
+  ETH->MACFCR |= ETH_MACFCR_FCBBPA;  
+}
+
+
+/**
+  * @brief  Enables or disables the MAC BackPressure operation activation (Half-duplex only).
+  * @param  NewState: new state of the MAC BackPressure operation activation.
+  *   This parameter can be: ENABLE or DISABLE.
+  * @retval None
+  */
+void ETH_BackPressureActivationCmd(FunctionalState NewState)   
+{ 
+  /* Check the parameters */
+  assert_param(IS_FUNCTIONAL_STATE(NewState));
+    
+  if (NewState != DISABLE)
+  {
+    /* Activate the MAC BackPressure operation */
+    /* In Half duplex: during backpressure, when the MAC receives a new frame,
+    the transmitter starts sending a JAM pattern resulting in a collision */
+    ETH->MACFCR |= ETH_MACFCR_FCBBPA; 
+  }
+  else
+  {
+    /* Desactivate the MAC BackPressure operation */
+    ETH->MACFCR &= ~ETH_MACFCR_FCBBPA; 
+  } 
+}
+
+
+/**
+  * @brief  Checks whether the specified ETHERNET MAC flag is set or not.
+  * @param  ETH_MAC_FLAG: specifies the flag to check.
+  *   This parameter can be one of the following values:
+  *     @arg ETH_MAC_FLAG_TST  : Time stamp trigger flag   
+  *     @arg ETH_MAC_FLAG_MMCT : MMC transmit flag  
+  *     @arg ETH_MAC_FLAG_MMCR : MMC receive flag   
+  *     @arg ETH_MAC_FLAG_MMC  : MMC flag  
+  *     @arg ETH_MAC_FLAG_PMT  : PMT flag  
+  * @retval The new state of ETHERNET MAC flag (SET or RESET).
+  */
+FlagStatus ETH_GetMACFlagStatus(uint32_t ETH_MAC_FLAG)
+{
+  FlagStatus bitstatus = RESET;
+  /* Check the parameters */
+  assert_param(IS_ETH_MAC_GET_FLAG(ETH_MAC_FLAG)); 
+  if ((ETH->MACSR & ETH_MAC_FLAG) != (uint32_t)RESET)
+  {
+    bitstatus = SET;
+  }
+  else
+  {
+    bitstatus = RESET;
+  }
+  return bitstatus;
+}
+
+
+/**
+  * @brief  Checks whether the specified ETHERNET MAC interrupt has occurred or not.
+  * @param  ETH_MAC_IT: specifies the interrupt source to check.
+  *   This parameter can be one of the following values:
+  *     @arg ETH_MAC_IT_TST   : Time stamp trigger interrupt  
+  *     @arg ETH_MAC_IT_MMCT : MMC transmit interrupt 
+  *     @arg ETH_MAC_IT_MMCR : MMC receive interrupt  
+  *     @arg ETH_MAC_IT_MMC  : MMC interrupt 
+  *     @arg ETH_MAC_IT_PMT  : PMT interrupt 
+  * @retval The new state of ETHERNET MAC interrupt (SET or RESET).
+  */
+ITStatus ETH_GetMACITStatus(uint32_t ETH_MAC_IT)
+{
+  ITStatus bitstatus = RESET;
+  /* Check the parameters */
+  assert_param(IS_ETH_MAC_GET_IT(ETH_MAC_IT)); 
+  if ((ETH->MACSR & ETH_MAC_IT) != (uint32_t)RESET)
+  {
+    bitstatus = SET;
+  }
+  else
+  {
+    bitstatus = RESET;
+  }
+  return bitstatus;
+}
+
+
+/**
+  * @brief  Enables or disables the specified ETHERNET MAC interrupts.
+  * @param  ETH_MAC_IT: specifies the ETHERNET MAC interrupt sources to be
+  *   enabled or disabled.
+  *   This parameter can be any combination of the following values:
+  *     @arg ETH_MAC_IT_TST : Time stamp trigger interrupt 
+  *     @arg ETH_MAC_IT_PMT : PMT interrupt 
+  * @param  NewState: new state of the specified ETHERNET MAC interrupts.
+  *   This parameter can be: ENABLE or DISABLE.
+  * @retval None
+  */
+void ETH_MACITConfig(uint32_t ETH_MAC_IT, FunctionalState NewState)
+{
+  /* Check the parameters */
+  assert_param(IS_ETH_MAC_IT(ETH_MAC_IT));
+  assert_param(IS_FUNCTIONAL_STATE(NewState));  
+  
+  if (NewState != DISABLE)
+  {
+    /* Enable the selected ETHERNET MAC interrupts */
+    ETH->MACIMR &= (~(uint32_t)ETH_MAC_IT);
+  }
+  else
+  {
+    /* Disable the selected ETHERNET MAC interrupts */
+    ETH->MACIMR |= ETH_MAC_IT;
+  }
+}
+
+
+/**
+  * @brief  Configures the selected MAC address.
+  * @param  MacAddr: The MAC address to configure.
+  *   This parameter can be one of the following values:
+  *     @arg ETH_MAC_Address0 : MAC Address0 
+  *     @arg ETH_MAC_Address1 : MAC Address1 
+  *     @arg ETH_MAC_Address2 : MAC Address2
+  *     @arg ETH_MAC_Address3 : MAC Address3
+  * @param  Addr: Pointer on MAC address buffer data (6 bytes).
+  * @retval None
+  */
+void ETH_MACAddressConfig(uint32_t MacAddr, uint8_t *Addr)
+{
+  uint32_t tmpreg;
+  /* Check the parameters */
+  assert_param(IS_ETH_MAC_ADDRESS0123(MacAddr));
+  
+  /* Calculate the selected MAC address high register */
+  tmpreg = ((uint32_t)Addr[5] << 8) | (uint32_t)Addr[4];
+  /* Load the selected MAC address high register */
+  (*(__IO uint32_t *) (ETH_MAC_ADDR_HBASE + MacAddr)) = tmpreg;
+  /* Calculate the selected MAC address low register */
+  tmpreg = ((uint32_t)Addr[3] << 24) | ((uint32_t)Addr[2] << 16) | ((uint32_t)Addr[1] << 8) | Addr[0];
+ 
+  /* Load the selected MAC address low register */
+  (*(__IO uint32_t *) (ETH_MAC_ADDR_LBASE + MacAddr)) = tmpreg;
+}
+
+
+/**
+  * @brief  Get the selected MAC address.
+  * @param  MacAddr: The MAC address to return.
+  *   This parameter can be one of the following values:
+  *     @arg ETH_MAC_Address0 : MAC Address0 
+  *     @arg ETH_MAC_Address1 : MAC Address1 
+  *     @arg ETH_MAC_Address2 : MAC Address2
+  *     @arg ETH_MAC_Address3 : MAC Address3
+  * @param  Addr: Pointer on MAC address buffer data (6 bytes).
+  * @retval None
+  */
+void ETH_GetMACAddress(uint32_t MacAddr, uint8_t *Addr)
+{
+  uint32_t tmpreg;
+  /* Check the parameters */
+  assert_param(IS_ETH_MAC_ADDRESS0123(MacAddr));
+  
+  /* Get the selected MAC address high register */
+  tmpreg =(*(__IO uint32_t *) (ETH_MAC_ADDR_HBASE + MacAddr));
+ 
+  /* Calculate the selected MAC address buffer */
+  Addr[5] = ((tmpreg >> 8) & (uint8_t)0xFF);
+  Addr[4] = (tmpreg & (uint8_t)0xFF);
+  /* Load the selected MAC address low register */
+  tmpreg =(*(__IO uint32_t *) (ETH_MAC_ADDR_LBASE + MacAddr));
+  /* Calculate the selected MAC address buffer */
+  Addr[3] = ((tmpreg >> 24) & (uint8_t)0xFF);
+  Addr[2] = ((tmpreg >> 16) & (uint8_t)0xFF);
+  Addr[1] = ((tmpreg >> 8 ) & (uint8_t)0xFF);
+  Addr[0] = (tmpreg & (uint8_t)0xFF);
+}
+
+
+/**
+  * @brief  Enables or disables the Address filter module uses the specified
+  *   ETHERNET MAC address for perfect filtering 
+  * @param  MacAddr: specifies the ETHERNET MAC address to be used for perfect filtering.
+  *   This parameter can be one of the following values: 
+  *     @arg ETH_MAC_Address1 : MAC Address1 
+  *     @arg ETH_MAC_Address2 : MAC Address2
+  *     @arg ETH_MAC_Address3 : MAC Address3
+  * @param  NewState: new state of the specified ETHERNET MAC address use.
+  *   This parameter can be: ENABLE or DISABLE.
+  * @retval None
+  */
+void ETH_MACAddressPerfectFilterCmd(uint32_t MacAddr, FunctionalState NewState)
+{
+  /* Check the parameters */
+  assert_param(IS_ETH_MAC_ADDRESS123(MacAddr));
+  assert_param(IS_FUNCTIONAL_STATE(NewState));
+    
+  if (NewState != DISABLE)
+  {
+    /* Enable the selected ETHERNET MAC address for perfect filtering */
+    (*(__IO uint32_t *) (ETH_MAC_ADDR_HBASE + MacAddr)) |= ETH_MACA1HR_AE;
+  }
+  else
+  {
+    /* Disable the selected ETHERNET MAC address for perfect filtering */
+    (*(__IO uint32_t *) (ETH_MAC_ADDR_HBASE + MacAddr)) &=(~(uint32_t)ETH_MACA1HR_AE);
+  }
+}
+
+
+/**
+  * @brief  Set the filter type for the specified ETHERNET MAC address 
+  * @param  MacAddr: specifies the ETHERNET MAC address 
+  *   This parameter can be one of the following values: 
+  *     @arg ETH_MAC_Address1 : MAC Address1 
+  *     @arg ETH_MAC_Address2 : MAC Address2
+  *     @arg ETH_MAC_Address3 : MAC Address3
+  * @param  Filter: specifies the used frame received field for comparison 
+  *   This parameter can be one of the following values: 
+  *     @arg ETH_MAC_AddressFilter_SA : MAC Address is used to compare with the
+  *                                     SA fields of the received frame.
+  *     @arg ETH_MAC_AddressFilter_DA : MAC Address is used to compare with the
+  *                                     DA fields of the received frame.
+  * @retval None
+  */
+void ETH_MACAddressFilterConfig(uint32_t MacAddr, uint32_t Filter)
+{
+  /* Check the parameters */
+  assert_param(IS_ETH_MAC_ADDRESS123(MacAddr));
+  assert_param(IS_ETH_MAC_ADDRESS_FILTER(Filter));
+  
+  if (Filter != ETH_MAC_AddressFilter_DA)
+  {
+    /* The selected ETHERNET MAC address is used to compare with the SA fields of the
+       received frame. */
+    (*(__IO uint32_t *) (ETH_MAC_ADDR_HBASE + MacAddr)) |= ETH_MACA1HR_SA;
+  }
+  else
+  {
+    /* The selected ETHERNET MAC address is used to compare with the DA fields of the
+       received frame. */
+    (*(__IO uint32_t *) (ETH_MAC_ADDR_HBASE + MacAddr)) &=(~(uint32_t)ETH_MACA1HR_SA);
+  }
+}
+
+
+/**
+  * @brief  Set the filter type for the specified ETHERNET MAC address 
+  * @param  MacAddr: specifies the ETHERNET MAC address 
+  *   This parameter can be one of the following values: 
+  *     @arg ETH_MAC_Address1 : MAC Address1 
+  *     @arg ETH_MAC_Address2 : MAC Address2
+  *     @arg ETH_MAC_Address3 : MAC Address3
+  * @param  MaskByte: specifies the used address bytes for comparison 
+  *   This parameter can be any combination of the following values: 
+  *     @arg ETH_MAC_AddressMask_Byte6 : Mask MAC Address high reg bits [15:8].
+  *     @arg ETH_MAC_AddressMask_Byte5 : Mask MAC Address high reg bits [7:0].
+  *     @arg ETH_MAC_AddressMask_Byte4 : Mask MAC Address low reg bits [31:24].
+  *     @arg ETH_MAC_AddressMask_Byte3 : Mask MAC Address low reg bits [23:16].
+  *     @arg ETH_MAC_AddressMask_Byte2 : Mask MAC Address low reg bits [15:8].
+  *     @arg ETH_MAC_AddressMask_Byte1 : Mask MAC Address low reg bits [7:0].
+  * @retval None
+  */
+void ETH_MACAddressMaskBytesFilterConfig(uint32_t MacAddr, uint32_t MaskByte)
+{
+  /* Check the parameters */
+  assert_param(IS_ETH_MAC_ADDRESS123(MacAddr));
+  assert_param(IS_ETH_MAC_ADDRESS_MASK(MaskByte));
+  
+  /* Clear MBC bits in the selected MAC address  high register */
+  (*(__IO uint32_t *) (ETH_MAC_ADDR_HBASE + MacAddr)) &=(~(uint32_t)ETH_MACA1HR_MBC);
+  /* Set the selected Filter mask bytes */
+  (*(__IO uint32_t *) (ETH_MAC_ADDR_HBASE + MacAddr)) |= MaskByte;
+}
+
+
+/******************************************************************************/                             
+/*                           DMA Descriptors functions                        */
+/******************************************************************************/
+
+/**
+  * @brief  This function should be called to get the received frame (to be used 
+  * with polling method only).
+  * @param  none
+  * @retval Structure of type FrameTypeDef
+  */
+FrameTypeDef ETH_Get_Received_Frame(void)
+{ 
+  uint32_t framelength = 0;
+  FrameTypeDef frame = {0,0,0}; 
+  
+  /* Get the Frame Length of the received packet: substruct 4 bytes of the CRC */
+  framelength = ((DMARxDescToGet->Status & ETH_DMARxDesc_FL) >> ETH_DMARxDesc_FrameLengthShift) - 4;
+  frame.length = framelength;
+  
+  /* Get the address of the buffer start address */ 
+  /* Check if more than one segment in the frame */
+  if (DMA_RX_FRAME_infos->Seg_Count >1)
+  {
+    frame.buffer =(DMA_RX_FRAME_infos->FS_Rx_Desc)->Buffer1Addr;
+  }
+  else 
+  {
+    frame.buffer = DMARxDescToGet->Buffer1Addr;
+  }
+
+  frame.descriptor = DMARxDescToGet;
+  
+  /* Update the ETHERNET DMA global Rx descriptor with next Rx descriptor */      
+  /* Chained Mode */    
+  /* Selects the next DMA Rx descriptor list for next buffer to read */ 
+  DMARxDescToGet = (ETH_DMADESCTypeDef*) (DMARxDescToGet->Buffer2NextDescAddr);    
+  
+  /* Return Frame */
+  return (frame);  
+}
+
+
+/**
+  * @brief  This function should be called when a frame is received using DMA 
+  *         Receive interrupt, it allows scanning of Rx descriptors to get the
+  *         the receive frame (should be used with interrupt mode only)
+  * @param  None
+  * @retval Structure of type FrameTypeDef
+  */
+FrameTypeDef ETH_Get_Received_Frame_interrupt(void)
+{ 
+  FrameTypeDef frame={0,0,0};
+  __IO uint32_t descriptor_scan_counter = 0; 
+  
+  /* scan descriptors owned by CPU */
+  while (((DMARxDescToGet->Status & ETH_DMARxDesc_OWN) == (uint32_t)RESET)&&
+        (descriptor_scan_counter<ETH_RXBUFNB))
+  {
+    
+    /* Just by security */
+    descriptor_scan_counter++;
+    
+    /* check if first segment in frame */
+    if(((DMARxDescToGet->Status & ETH_DMARxDesc_FS) != (uint32_t)RESET)&&
+      ((DMARxDescToGet->Status & ETH_DMARxDesc_LS) == (uint32_t)RESET))
+    {
+      DMA_RX_FRAME_infos->FS_Rx_Desc = DMARxDescToGet;
+      DMA_RX_FRAME_infos->Seg_Count = 1;   
+      DMARxDescToGet = (ETH_DMADESCTypeDef*) (DMARxDescToGet->Buffer2NextDescAddr);
+    }
+    
+    /* check if intermediate segment */
+    else if (((DMARxDescToGet->Status & ETH_DMARxDesc_LS) == (uint32_t)RESET)&&
+            ((DMARxDescToGet->Status & ETH_DMARxDesc_FS) == (uint32_t)RESET))
+    {
+      (DMA_RX_FRAME_infos->Seg_Count) ++;
+      DMARxDescToGet = (ETH_DMADESCTypeDef*) (DMARxDescToGet->Buffer2NextDescAddr);
+    }
+
+    /* should be last segment */
+    else
+    { 
+      /* last segment */
+      DMA_RX_FRAME_infos->LS_Rx_Desc = DMARxDescToGet;
+      
+      (DMA_RX_FRAME_infos->Seg_Count)++;
+        
+      /* first segment is last segment */
+      if ((DMA_RX_FRAME_infos->Seg_Count)==1)
+        DMA_RX_FRAME_infos->FS_Rx_Desc = DMARxDescToGet;
+      
+      /* Get the Frame Length of the received packet: substruct 4 bytes of the CRC */
+      frame.length = ((DMARxDescToGet->Status & ETH_DMARxDesc_FL) >> ETH_DMARxDesc_FrameLengthShift) - 4;
+
+  
+      /* Get the address of the buffer start address */ 
+      /* Check if more than one segment in the frame */
+      if (DMA_RX_FRAME_infos->Seg_Count >1)
+      {
+        frame.buffer =(DMA_RX_FRAME_infos->FS_Rx_Desc)->Buffer1Addr;
+      }
+      else 
+      {
+        frame.buffer = DMARxDescToGet->Buffer1Addr;
+      }
+      
+      frame.descriptor = DMARxDescToGet;
+  
+      /* Update the ETHERNET DMA global Rx descriptor with next Rx descriptor */      
+      DMARxDescToGet = (ETH_DMADESCTypeDef*) (DMARxDescToGet->Buffer2NextDescAddr);
+     
+      /* Return Frame */
+      return (frame);  
+    }
+  }
+  return (frame); 
+}
+      
+          
+/**
+  * @brief  Prepares DMA Tx descriptors to transmit an ethernet frame
+  * @param  FrameLength : length of the frame to send
+  * @retval error status
+  */
+uint32_t ETH_Prepare_Transmit_Descriptors(u16 FrameLength)
+{   
+  uint32_t buf_count =0, size=0,i=0;
+  __IO ETH_DMADESCTypeDef *DMATxNextDesc;
+  
+  /* Check if the descriptor is owned by the ETHERNET DMA (when set) or CPU (when reset) */
+  if((DMATxDescToSet->Status & ETH_DMATxDesc_OWN) != (u32)RESET)
+  {  
+    /* Return ERROR: OWN bit set */
+    return ETH_ERROR;
+  }
+  
+  DMATxNextDesc = DMATxDescToSet;
+  
+  if (FrameLength > ETH_TX_BUF_SIZE)
+  {
+    buf_count = FrameLength/ETH_TX_BUF_SIZE;
+    if (FrameLength%ETH_TX_BUF_SIZE) buf_count++;
+  }
+  else buf_count =1;
+  
+  if (buf_count ==1)
+  {
+    /*set LAST and FIRST segment */
+    DMATxDescToSet->Status |=ETH_DMATxDesc_FS|ETH_DMATxDesc_LS;
+    /* Set frame size */
+    DMATxDescToSet->ControlBufferSize = (FrameLength& ETH_DMATxDesc_TBS1);
+    /* Set Own bit of the Tx descriptor Status: gives the buffer back to ETHERNET DMA */
+    DMATxDescToSet->Status |= ETH_DMATxDesc_OWN;
+    DMATxDescToSet= (ETH_DMADESCTypeDef *)(DMATxDescToSet->Buffer2NextDescAddr);
+  }
+  else
+  {
+    for (i=0; i< buf_count; i++)
+    {
+      if (i==0) 
+      {
+        /* Setting the first segment bit */
+        DMATxDescToSet->Status |= ETH_DMATxDesc_FS;  
+      }
+      
+      /* Program size */
+      DMATxNextDesc->ControlBufferSize = (ETH_TX_BUF_SIZE & ETH_DMATxDesc_TBS1);
+       
+      if (i== (buf_count-1))
+      {
+        /* Setting the last segment bit */
+        DMATxNextDesc->Status |= ETH_DMATxDesc_LS;
+        size = FrameLength - (buf_count-1)*ETH_TX_BUF_SIZE;
+        DMATxNextDesc->ControlBufferSize = (size & ETH_DMATxDesc_TBS1);
+      }
+        
+      /*give back descriptor to DMA */
+      DMATxNextDesc->Status |= ETH_DMATxDesc_OWN;
+      
+      DMATxNextDesc = (ETH_DMADESCTypeDef *)(DMATxNextDesc->Buffer2NextDescAddr);
+      /* Set Own bit of the Tx descriptor Status: gives the buffer back to ETHERNET DMA */
+     }
+    DMATxDescToSet = DMATxNextDesc ;
+  }
+    
+  /* When Tx Buffer unavailable flag is set: clear it and resume transmission */
+  if ((ETH->DMASR & ETH_DMASR_TBUS) != (u32)RESET)
+  {
+    /* Clear TBUS ETHERNET DMA flag */
+    ETH->DMASR = ETH_DMASR_TBUS;
+    /* Resume DMA transmission*/
+    ETH->DMATPDR = 0;
+  }
+  
+  /* Return SUCCESS */
+  return ETH_SUCCESS;   
+}
+
+
+/**
+  * @brief  Initializes the DMA Rx descriptors in chain mode.
+  * @param  DMARxDescTab: Pointer on the first Rx desc list 
+  * @param  RxBuff: Pointer on the first RxBuffer list
+  * @param  RxBuffCount: Number of the used Rx desc in the list
+  * @retval None
+  */
+void ETH_DMARxDescChainInit(ETH_DMADESCTypeDef *DMARxDescTab, uint8_t *RxBuff, uint32_t RxBuffCount)
+{
+  uint32_t i = 0;
+  ETH_DMADESCTypeDef *DMARxDesc;
+  
+  /* Set the DMARxDescToGet pointer with the first one of the DMARxDescTab list */
+  DMARxDescToGet = DMARxDescTab; 
+  /* Fill each DMARxDesc descriptor with the right values */
+  for(i=0; i < RxBuffCount; i++)
+  {
+    /* Get the pointer on the ith member of the Rx Desc list */
+    DMARxDesc = DMARxDescTab+i;
+    /* Set Own bit of the Rx descriptor Status */
+    DMARxDesc->Status = ETH_DMARxDesc_OWN;
+
+    /* Set Buffer1 size and Second Address Chained bit */
+    DMARxDesc->ControlBufferSize = ETH_DMARxDesc_RCH | (uint32_t)ETH_RX_BUF_SIZE;  
+    /* Set Buffer1 address pointer */
+    DMARxDesc->Buffer1Addr = (uint32_t)(&RxBuff[i*ETH_RX_BUF_SIZE]);
+    
+    /* Initialize the next descriptor with the Next Descriptor Polling Enable */
+    if(i < (RxBuffCount-1))
+    {
+      /* Set next descriptor address register with next descriptor base address */
+      DMARxDesc->Buffer2NextDescAddr = (uint32_t)(DMARxDescTab+i+1); 
+    }
+    else
+    {
+      /* For last descriptor, set next descriptor address register equal to the first descriptor base address */ 
+      DMARxDesc->Buffer2NextDescAddr = (uint32_t)(DMARxDescTab); 
+    }
+  }
+   
+  /* Set Receive Descriptor List Address Register */
+  ETH->DMARDLAR = (uint32_t) DMARxDescTab; 
+  
+
+  DMA_RX_FRAME_infos = &RX_Frame_Descriptor;
+
+}
+
+/**
+  * @brief  This function polls for a frame reception
+  * @param  None
+  * @retval Returns 1 when a frame is received, 0 if none.
+  */
+uint32_t ETH_CheckFrameReceived(void)
+{ 
+  /* check if last segment */
+  if(((DMARxDescToGet->Status & ETH_DMARxDesc_OWN) == (uint32_t)RESET) &&
+     ((DMARxDescToGet->Status & ETH_DMARxDesc_LS) != (uint32_t)RESET)) 
+    {   
+      DMA_RX_FRAME_infos->LS_Rx_Desc = DMARxDescToGet;
+      DMA_RX_FRAME_infos->Seg_Count++;
+      return 1;
+    }
+  
+    /* check if first segment */
+    else if(((DMARxDescToGet->Status & ETH_DMARxDesc_OWN) == (uint32_t)RESET) &&
+     ((DMARxDescToGet->Status & ETH_DMARxDesc_FS) != (uint32_t)RESET)&&
+     ((DMARxDescToGet->Status & ETH_DMARxDesc_LS) == (uint32_t)RESET))      
+    {
+      DMA_RX_FRAME_infos->FS_Rx_Desc = DMARxDescToGet;
+      DMA_RX_FRAME_infos->LS_Rx_Desc = NULL;
+      DMA_RX_FRAME_infos->Seg_Count = 1;   
+      DMARxDescToGet = (ETH_DMADESCTypeDef*) (DMARxDescToGet->Buffer2NextDescAddr);
+    }
+    
+    /* check if intermediate segment */ 
+    else if(((DMARxDescToGet->Status & ETH_DMARxDesc_OWN) == (uint32_t)RESET) &&
+     ((DMARxDescToGet->Status & ETH_DMARxDesc_FS) == (uint32_t)RESET)&&
+     ((DMARxDescToGet->Status & ETH_DMARxDesc_LS) == (uint32_t)RESET))
+    {
+      (DMA_RX_FRAME_infos->Seg_Count) ++;
+      DMARxDescToGet = (ETH_DMADESCTypeDef*) (DMARxDescToGet->Buffer2NextDescAddr);
+    } 
+    return 0;
+}
+
+
+
+/**
+  * @brief  Initializes the DMA Tx descriptors in chain mode.
+  * @param  DMATxDescTab: Pointer on the first Tx desc list 
+  * @param  TxBuff: Pointer on the first TxBuffer list
+  * @param  TxBuffCount: Number of the used Tx desc in the list
+  * @retval None
+  */
+void ETH_DMATxDescChainInit(ETH_DMADESCTypeDef *DMATxDescTab, uint8_t* TxBuff, uint32_t TxBuffCount)
+{
+  uint32_t i = 0;
+  ETH_DMADESCTypeDef *DMATxDesc;
+  
+  /* Set the DMATxDescToSet pointer with the first one of the DMATxDescTab list */
+  DMATxDescToSet = DMATxDescTab;
+  /* Fill each DMATxDesc descriptor with the right values */   
+  for(i=0; i < TxBuffCount; i++)
+  {
+    /* Get the pointer on the ith member of the Tx Desc list */
+    DMATxDesc = DMATxDescTab + i;
+    /* Set Second Address Chained bit */
+    DMATxDesc->Status = ETH_DMATxDesc_TCH;  
+       
+    /* Set Buffer1 address pointer */
+    DMATxDesc->Buffer1Addr = (uint32_t)(&TxBuff[i*ETH_TX_BUF_SIZE]);
+    
+    /* Initialize the next descriptor with the Next Descriptor Polling Enable */
+    if(i < (TxBuffCount-1))
+    {
+      /* Set next descriptor address register with next descriptor base address */
+      DMATxDesc->Buffer2NextDescAddr = (uint32_t)(DMATxDescTab+i+1);
+    }
+    else
+    {
+      /* For last descriptor, set next descriptor address register equal to the first descriptor base address */ 
+      DMATxDesc->Buffer2NextDescAddr = (uint32_t) DMATxDescTab;  
+    }
+  }
+   
+  /* Set Transmit Desciptor List Address Register */
+  ETH->DMATDLAR = (uint32_t) DMATxDescTab;
+}
+
+
+
+
+/**
+  * @brief  Checks whether the specified ETHERNET DMA Tx Desc flag is set or not.
+  * @param  DMATxDesc: pointer on a DMA Tx descriptor
+  * @param  ETH_DMATxDescFlag: specifies the flag to check.
+  *   This parameter can be one of the following values:
+  *     @arg ETH_DMATxDesc_OWN : OWN bit: descriptor is owned by DMA engine
+  *     @arg ETH_DMATxDesc_IC  : Interrupt on completion
+  *     @arg ETH_DMATxDesc_LS  : Last Segment
+  *     @arg ETH_DMATxDesc_FS  : First Segment
+  *     @arg ETH_DMATxDesc_DC  : Disable CRC
+  *     @arg ETH_DMATxDesc_DP  : Disable Pad
+  *     @arg ETH_DMATxDesc_TTSE: Transmit Time Stamp Enable
+  *     @arg ETH_DMATxDesc_CIC : Checksum insertion control      
+  *     @arg ETH_DMATxDesc_TER : Transmit End of Ring
+  *     @arg ETH_DMATxDesc_TCH : Second Address Chained
+  *     @arg ETH_DMATxDesc_TTSS: Tx Time Stamp Status
+  *     @arg ETH_DMATxDesc_IHE : IP Header Error
+  *     @arg ETH_DMATxDesc_ES  : Error summary
+  *     @arg ETH_DMATxDesc_JT  : Jabber Timeout
+  *     @arg ETH_DMATxDesc_FF  : Frame Flushed: DMA/MTL flushed the frame due to SW flush
+  *     @arg ETH_DMATxDesc_PCE : Payload Checksum Error
+  *     @arg ETH_DMATxDesc_LCA : Loss of Carrier: carrier lost during transmission
+  *     @arg ETH_DMATxDesc_NC  : No Carrier: no carrier signal from the transceiver
+  *     @arg ETH_DMATxDesc_LCO : Late Collision: transmission aborted due to collision
+  *     @arg ETH_DMATxDesc_EC  : Excessive Collision: transmission aborted after 16 collisions
+  *     @arg ETH_DMATxDesc_VF  : VLAN Frame
+  *     @arg ETH_DMATxDesc_CC  : Collision Count 
+  *     @arg ETH_DMATxDesc_ED  : Excessive Deferral
+  *     @arg ETH_DMATxDesc_UF  : Underflow Error: late data arrival from the memory
+  *     @arg ETH_DMATxDesc_DB  : Deferred Bit
+  * @retval The new state of ETH_DMATxDescFlag (SET or RESET).
+  */
+FlagStatus ETH_GetDMATxDescFlagStatus(ETH_DMADESCTypeDef *DMATxDesc, uint32_t ETH_DMATxDescFlag)
+{
+  FlagStatus bitstatus = RESET;
+  /* Check the parameters */
+  assert_param(IS_ETH_DMATxDESC_GET_FLAG(ETH_DMATxDescFlag));
+  
+  if ((DMATxDesc->Status & ETH_DMATxDescFlag) != (uint32_t)RESET)
+  {
+    bitstatus = SET;
+  }
+  else
+  {
+    bitstatus = RESET;
+  }
+  return bitstatus;
+}
+
+/**
+  * @brief  Returns the specified ETHERNET DMA Tx Desc collision count.
+  * @param  DMATxDesc: pointer on a DMA Tx descriptor                     
+  * @retval The Transmit descriptor collision counter value.
+  */
+uint32_t ETH_GetDMATxDescCollisionCount(ETH_DMADESCTypeDef *DMATxDesc)
+{
+  /* Return the Receive descriptor frame length */
+  return ((DMATxDesc->Status & ETH_DMATxDesc_CC) >> ETH_DMATXDESC_COLLISION_COUNTSHIFT);
+}
+
+/**
+  * @brief  Set the specified DMA Tx Desc Own bit.
+  * @param  DMATxDesc: Pointer on a Tx desc
+  * @retval None
+  */
+void ETH_SetDMATxDescOwnBit(ETH_DMADESCTypeDef *DMATxDesc)
+{
+  /* Set the DMA Tx Desc Own bit */
+  DMATxDesc->Status |= ETH_DMATxDesc_OWN;
+}
+
+/**
+  * @brief  Enables or disables the specified DMA Tx Desc Transmit interrupt.
+  * @param  DMATxDesc: Pointer on a Tx desc
+  * @param  NewState: new state of the DMA Tx Desc transmit interrupt.
+  *   This parameter can be: ENABLE or DISABLE.                   
+  * @retval None
+  */
+void ETH_DMATxDescTransmitITConfig(ETH_DMADESCTypeDef *DMATxDesc, FunctionalState NewState)
+{
+  /* Check the parameters */
+  assert_param(IS_FUNCTIONAL_STATE(NewState));
+  
+  if (NewState != DISABLE)
+  {
+    /* Enable the DMA Tx Desc Transmit interrupt */
+    DMATxDesc->Status |= ETH_DMATxDesc_IC;
+  }
+  else
+  {
+    /* Disable the DMA Tx Desc Transmit interrupt */
+    DMATxDesc->Status &=(~(uint32_t)ETH_DMATxDesc_IC);
+  }
+}
+
+/**
+  * @brief  configure Tx descriptor as last or first segment
+  * @param  DMATxDesc: Pointer on a Tx desc
+  * @param  DMATxDesc_FrameSegment: specifies is the actual Tx desc contain last or first segment.
+  *   This parameter can be one of the following values:
+  *     @arg ETH_DMATxDesc_LastSegment  : actual Tx desc contain last segment 
+  *     @arg ETH_DMATxDesc_FirstSegment : actual Tx desc contain first segment                   
+  * @retval None
+  */
+void ETH_DMATxDescFrameSegmentConfig(ETH_DMADESCTypeDef *DMATxDesc, uint32_t DMATxDesc_FrameSegment)
+{
+  /* Check the parameters */
+  assert_param(IS_ETH_DMA_TXDESC_SEGMENT(DMATxDesc_FrameSegment));
+  
+  /* Selects the DMA Tx Desc Frame segment */
+  DMATxDesc->Status |= DMATxDesc_FrameSegment;
+}
+
+/**
+  * @brief  Selects the specified ETHERNET DMA Tx Desc Checksum Insertion.
+  * @param  DMATxDesc: pointer on a DMA Tx descriptor 
+  * @param  DMATxDesc_Checksum: specifies is the DMA Tx desc checksum insertion.
+  *   This parameter can be one of the following values:
+  *     @arg ETH_DMATxDesc_ChecksumByPass : Checksum bypass
+  *     @arg ETH_DMATxDesc_ChecksumIPV4Header : IPv4 header checksum
+  *     @arg ETH_DMATxDesc_ChecksumTCPUDPICMPSegment : TCP/UDP/ICMP checksum. Pseudo header checksum is assumed to be present
+  *     @arg ETH_DMATxDesc_ChecksumTCPUDPICMPFull : TCP/UDP/ICMP checksum fully in hardware including pseudo header                                                                
+  * @retval None
+  */
+void ETH_DMATxDescChecksumInsertionConfig(ETH_DMADESCTypeDef *DMATxDesc, uint32_t DMATxDesc_Checksum)
+{
+  /* Check the parameters */
+  assert_param(IS_ETH_DMA_TXDESC_CHECKSUM(DMATxDesc_Checksum));
+  
+  /* Set the selected DMA Tx desc checksum insertion control */
+  DMATxDesc->Status |= DMATxDesc_Checksum;
+}
+
+/**
+  * @brief  Enables or disables the DMA Tx Desc CRC.
+  * @param  DMATxDesc: pointer on a DMA Tx descriptor
+  * @param  NewState: new state of the specified DMA Tx Desc CRC.
+  *   This parameter can be: ENABLE or DISABLE.
+  * @retval None
+  */
+void ETH_DMATxDescCRCCmd(ETH_DMADESCTypeDef *DMATxDesc, FunctionalState NewState)
+{
+  /* Check the parameters */
+  assert_param(IS_FUNCTIONAL_STATE(NewState));
+  
+  if (NewState != DISABLE)
+  {
+    /* Enable the selected DMA Tx Desc CRC */
+    DMATxDesc->Status &= (~(uint32_t)ETH_DMATxDesc_DC);
+  }
+  else
+  {
+    /* Disable the selected DMA Tx Desc CRC */
+    DMATxDesc->Status |= ETH_DMATxDesc_DC; 
+  }
+}
+
+
+/**
+  * @brief  Enables or disables the DMA Tx Desc second address chained.
+  * @param  DMATxDesc: pointer on a DMA Tx descriptor
+  * @param  NewState: new state of the specified DMA Tx Desc second address chained.
+  *   This parameter can be: ENABLE or DISABLE.
+  * @retval None
+  */
+void ETH_DMATxDescSecondAddressChainedCmd(ETH_DMADESCTypeDef *DMATxDesc, FunctionalState NewState)
+{
+  /* Check the parameters */
+  assert_param(IS_FUNCTIONAL_STATE(NewState));
+  
+  if (NewState != DISABLE)
+  {
+    /* Enable the selected DMA Tx Desc second address chained */
+    DMATxDesc->Status |= ETH_DMATxDesc_TCH;  
+  }
+  else
+  {
+    /* Disable the selected DMA Tx Desc second address chained */
+    DMATxDesc->Status &=(~(uint32_t)ETH_DMATxDesc_TCH); 
+  }
+}
+
+/**
+  * @brief  Enables or disables the DMA Tx Desc padding for frame shorter than 64 bytes.
+  * @param  DMATxDesc: pointer on a DMA Tx descriptor
+  * @param  NewState: new state of the specified DMA Tx Desc padding for frame shorter than 64 bytes.
+  *   This parameter can be: ENABLE or DISABLE.
+  * @retval None
+  */
+void ETH_DMATxDescShortFramePaddingCmd(ETH_DMADESCTypeDef *DMATxDesc, FunctionalState NewState)
+{
+  /* Check the parameters */
+  assert_param(IS_FUNCTIONAL_STATE(NewState));
+  
+  if (NewState != DISABLE)
+  {
+    /* Enable the selected DMA Tx Desc padding for frame shorter than 64 bytes */
+    DMATxDesc->Status &= (~(uint32_t)ETH_DMATxDesc_DP);
+  }
+  else
+  {
+    /* Disable the selected DMA Tx Desc padding for frame shorter than 64 bytes*/
+    DMATxDesc->Status |= ETH_DMATxDesc_DP; 
+  }
+}
+
+
+/**
+  * @brief  Configures the specified DMA Tx Desc buffer1 and buffer2 sizes.
+  * @param  DMATxDesc: Pointer on a Tx desc
+  * @param  BufferSize1: specifies the Tx desc buffer1 size.
+  * @param  BufferSize2: specifies the Tx desc buffer2 size (put "0" if not used).
+  * @retval None
+  */
+void ETH_DMATxDescBufferSizeConfig(ETH_DMADESCTypeDef *DMATxDesc, uint32_t BufferSize1, uint32_t BufferSize2)
+{
+  /* Check the parameters */
+  assert_param(IS_ETH_DMATxDESC_BUFFER_SIZE(BufferSize1));
+  assert_param(IS_ETH_DMATxDESC_BUFFER_SIZE(BufferSize2));
+  
+  /* Set the DMA Tx Desc buffer1 and buffer2 sizes values */
+  DMATxDesc->ControlBufferSize |= (BufferSize1 | (BufferSize2 << ETH_DMATXDESC_BUFFER2_SIZESHIFT));
+}
+
+
+/**
+  * @brief  Checks whether the specified ETHERNET Rx Desc flag is set or not.
+  * @param  DMARxDesc: pointer on a DMA Rx descriptor
+  * @param  ETH_DMARxDescFlag: specifies the flag to check.
+  *   This parameter can be one of the following values:
+  *     @arg ETH_DMARxDesc_OWN:         OWN bit: descriptor is owned by DMA engine 
+  *     @arg ETH_DMARxDesc_AFM:         DA Filter Fail for the rx frame
+  *     @arg ETH_DMARxDesc_ES:          Error summary
+  *     @arg ETH_DMARxDesc_DE:          Descriptor error: no more descriptors for receive frame
+  *     @arg ETH_DMARxDesc_SAF:         SA Filter Fail for the received frame
+  *     @arg ETH_DMARxDesc_LE:          Frame size not matching with length field
+  *     @arg ETH_DMARxDesc_OE:          Overflow Error: Frame was damaged due to buffer overflow
+  *     @arg ETH_DMARxDesc_VLAN:        VLAN Tag: received frame is a VLAN frame
+  *     @arg ETH_DMARxDesc_FS:          First descriptor of the frame
+  *     @arg ETH_DMARxDesc_LS:          Last descriptor of the frame
+  *     @arg ETH_DMARxDesc_IPV4HCE:     IPC Checksum Error/Giant Frame: Rx Ipv4 header checksum error 
+  *     @arg ETH_DMARxDesc_LC:          Late collision occurred during reception
+  *     @arg ETH_DMARxDesc_FT:          Frame type - Ethernet, otherwise 802.3
+  *     @arg ETH_DMARxDesc_RWT:         Receive Watchdog Timeout: watchdog timer expired during reception
+  *     @arg ETH_DMARxDesc_RE:          Receive error: error reported by MII interface
+  *     @arg ETH_DMARxDesc_DE:          Dribble bit error: frame contains non int multiple of 8 bits
+  *     @arg ETH_DMARxDesc_CE:          CRC error
+  *     @arg ETH_DMARxDesc_MAMPCE:      Rx MAC Address/Payload Checksum Error: Rx MAC address matched/ Rx Payload Checksum Error
+  * @retval The new state of ETH_DMARxDescFlag (SET or RESET).
+  */
+FlagStatus ETH_GetDMARxDescFlagStatus(ETH_DMADESCTypeDef *DMARxDesc, uint32_t ETH_DMARxDescFlag)
+{
+  FlagStatus bitstatus = RESET;
+  /* Check the parameters */
+  assert_param(IS_ETH_DMARxDESC_GET_FLAG(ETH_DMARxDescFlag));
+  if ((DMARxDesc->Status & ETH_DMARxDescFlag) != (uint32_t)RESET)
+  {
+    bitstatus = SET;
+  }
+  else
+  {
+    bitstatus = RESET;
+  }
+  return bitstatus;
+}
+
+#ifdef USE_ENHANCED_DMA_DESCRIPTORS
+/**
+  * @brief  Checks whether the specified ETHERNET PTP Rx Desc extended flag is set or not.
+  * @param  DMAPTPRxDesc: pointer on a DMA PTP Rx descriptor
+  * @param  ETH_DMAPTPRxDescFlag: specifies the extended flag to check.
+  *   This parameter can be one of the following values:
+  *     @arg ETH_DMAPTPRxDesc_PTPV:   PTP version  
+  *     @arg ETH_DMAPTPRxDesc_PTPFT:  PTP frame type
+  *     @arg ETH_DMAPTPRxDesc_PTPMT:  PTP message type   
+  *     @arg ETH_DMAPTPRxDesc_IPV6PR: IPv6 packet received   
+  *     @arg ETH_DMAPTPRxDesc_IPV4PR: IPv4 packet received    
+  *     @arg ETH_DMAPTPRxDesc_IPCB:   IP checksum bypassed  
+  *     @arg ETH_DMAPTPRxDesc_IPPE:   IP payload error
+  *     @arg ETH_DMAPTPRxDesc_IPHE:   IP header error 
+  *     @arg ETH_DMAPTPRxDesc_IPPT:   IP payload type 
+  * @retval The new state of ETH_DMAPTPRxDescExtendedFlag (SET or RESET).
+  */
+FlagStatus ETH_GetDMAPTPRxDescExtendedFlagStatus(ETH_DMADESCTypeDef *DMAPTPRxDesc, uint32_t ETH_DMAPTPRxDescExtendedFlag)
+{
+  FlagStatus bitstatus = RESET;
+
+  /* Check the parameters */
+  assert_param(IS_ETH_DMAPTPRxDESC_GET_EXTENDED_FLAG(ETH_DMAPTPRxDescExtendedFlag));
+
+  if ((DMAPTPRxDesc->ExtendedStatus & ETH_DMAPTPRxDescExtendedFlag) != (uint32_t)RESET)
+  {
+    bitstatus = SET;
+  }
+  else
+  {
+    bitstatus = RESET;
+  }
+  return bitstatus;
+}
+#endif /* USE_ENHANCED_DMA_DESCRIPTORS */
+
+/**
+  * @brief  Set the specified DMA Rx Desc Own bit.
+  * @param  DMARxDesc: Pointer on a Rx desc
+  * @retval None
+  */
+void ETH_SetDMARxDescOwnBit(ETH_DMADESCTypeDef *DMARxDesc)
+{
+  /* Set the DMA Rx Desc Own bit */
+  DMARxDesc->Status |= ETH_DMARxDesc_OWN;
+}
+
+/**
+  * @brief  Returns the specified DMA Rx Desc frame length.
+  * @param  DMARxDesc: pointer on a DMA Rx descriptor                     
+  * @retval The Rx descriptor received frame length.
+  */
+uint32_t ETH_GetDMARxDescFrameLength(ETH_DMADESCTypeDef *DMARxDesc)
+{
+  /* Return the Receive descriptor frame length */
+  return ((DMARxDesc->Status & ETH_DMARxDesc_FL) >> ETH_DMARXDESC_FRAME_LENGTHSHIFT);
+}
+
+/**
+  * @brief  Enables or disables the specified DMA Rx Desc receive interrupt.
+  * @param  DMARxDesc: Pointer on a Rx desc
+  * @param  NewState: new state of the specified DMA Rx Desc interrupt.
+  *   This parameter can be: ENABLE or DISABLE.                   
+  * @retval None
+  */
+void ETH_DMARxDescReceiveITConfig(ETH_DMADESCTypeDef *DMARxDesc, FunctionalState NewState)
+{
+  /* Check the parameters */
+  assert_param(IS_FUNCTIONAL_STATE(NewState));
+  
+  if (NewState != DISABLE)
+  {
+    /* Enable the DMA Rx Desc receive interrupt */
+    DMARxDesc->ControlBufferSize &=(~(uint32_t)ETH_DMARxDesc_DIC);
+  }
+  else
+  {
+    /* Disable the DMA Rx Desc receive interrupt */
+    DMARxDesc->ControlBufferSize |= ETH_DMARxDesc_DIC;
+  }
+}
+
+
+/**
+  * @brief  Returns the specified ETHERNET DMA Rx Desc buffer size.
+  * @param  DMARxDesc: pointer on a DMA Rx descriptor 
+  * @param  DMARxDesc_Buffer: specifies the DMA Rx Desc buffer.
+  *   This parameter can be any one of the following values:
+  *     @arg ETH_DMARxDesc_Buffer1 : DMA Rx Desc Buffer1
+  *     @arg ETH_DMARxDesc_Buffer2 : DMA Rx Desc Buffer2                     
+  * @retval The Receive descriptor frame length.
+  */
+uint32_t ETH_GetDMARxDescBufferSize(ETH_DMADESCTypeDef *DMARxDesc, uint32_t DMARxDesc_Buffer)
+{
+  /* Check the parameters */
+  assert_param(IS_ETH_DMA_RXDESC_BUFFER(DMARxDesc_Buffer));
+  
+  if(DMARxDesc_Buffer != ETH_DMARxDesc_Buffer1)
+  {
+    /* Return the DMA Rx Desc buffer2 size */
+    return ((DMARxDesc->ControlBufferSize & ETH_DMARxDesc_RBS2) >> ETH_DMARXDESC_BUFFER2_SIZESHIFT); 
+  }
+  else
+  {
+    /* Return the DMA Rx Desc buffer1 size */
+    return (DMARxDesc->ControlBufferSize & ETH_DMARxDesc_RBS1); 
+  }
+}
+
+
+/**
+  * @brief  Get the size of the received packet.
+  * @param  None
+  * @retval framelength: received packet size 
+  */
+uint32_t ETH_GetRxPktSize(ETH_DMADESCTypeDef *DMARxDesc)
+{
+  uint32_t frameLength = 0;
+  if(((DMARxDesc->Status & ETH_DMARxDesc_OWN) == (uint32_t)RESET) &&
+     ((DMARxDesc->Status & ETH_DMARxDesc_ES) == (uint32_t)RESET) &&
+     ((DMARxDesc->Status & ETH_DMARxDesc_LS) != (uint32_t)RESET)) 
+  {
+    /* Get the size of the packet: including 4 bytes of the CRC */
+    frameLength =  ETH_GetDMARxDescFrameLength(DMARxDesc);
+  }
+  
+  /* Return Frame Length */ 
+  return frameLength;
+}
+
+#ifdef USE_ENHANCED_DMA_DESCRIPTORS
+/**
+  * @brief  Enables or disables the Enhanced descriptor structure.
+  * @param  NewState: new state of the Enhanced descriptor structure.
+  *   This parameter can be: ENABLE or DISABLE. 
+  * @retval None
+  */
+void ETH_EnhancedDescriptorCmd(FunctionalState NewState)
+{ 
+  /* Check the parameters */
+  assert_param(IS_FUNCTIONAL_STATE(NewState));
+  
+  if (NewState != DISABLE)
+  {
+    /* Enable enhanced descriptor structure */
+    ETH->DMABMR |= ETH_DMABMR_EDE;  
+  }
+  else
+  {
+    /* Disable enhanced descriptor structure */
+    ETH->DMABMR &= ~ETH_DMABMR_EDE;
+  }
+}
+#endif /* USE_ENHANCED_DMA_DESCRIPTORS */
+
+/******************************************************************************/                             
+/*                           DMA functions                                    */
+/******************************************************************************/
+/**
+  * @brief  Resets all MAC subsystem internal registers and logic.
+  * @param  None
+  * @retval None
+  */
+void ETH_SoftwareReset(void)
+{
+  /* Set the SWR bit: resets all MAC subsystem internal registers and logic */
+  /* After reset all the registers holds their respective reset values */
+  ETH->DMABMR |= ETH_DMABMR_SR;
+}
+
+/**
+  * @brief  Checks whether the ETHERNET software reset bit is set or not.
+  * @param  None
+  * @retval The new state of DMA Bus Mode register SR bit (SET or RESET).
+  */
+FlagStatus ETH_GetSoftwareResetStatus(void)
+{
+  FlagStatus bitstatus = RESET;
+  if((ETH->DMABMR & ETH_DMABMR_SR) != (uint32_t)RESET)
+  {
+    bitstatus = SET;
+  }
+  else
+  {
+    bitstatus = RESET;
+  }
+  return bitstatus;
+}
+
+/**
+  * @brief  Checks whether the specified ETHERNET DMA flag is set or not.
+  * @param  ETH_DMA_FLAG: specifies the flag to check.
+  *   This parameter can be one of the following values:
+  *     @arg ETH_DMA_FLAG_TST : Time-stamp trigger flag
+  *     @arg ETH_DMA_FLAG_PMT : PMT flag 
+  *     @arg ETH_DMA_FLAG_MMC : MMC flag 
+  *     @arg ETH_DMA_FLAG_DataTransferError : Error bits 0-data buffer, 1-desc. access
+  *     @arg ETH_DMA_FLAG_ReadWriteError    : Error bits 0-write trnsf, 1-read transfr
+  *     @arg ETH_DMA_FLAG_AccessError       : Error bits 0-Rx DMA, 1-Tx DMA
+  *     @arg ETH_DMA_FLAG_NIS : Normal interrupt summary flag
+  *     @arg ETH_DMA_FLAG_AIS : Abnormal interrupt summary flag  
+  *     @arg ETH_DMA_FLAG_ER  : Early receive flag 
+  *     @arg ETH_DMA_FLAG_FBE : Fatal bus error flag 
+  *     @arg ETH_DMA_FLAG_ET  : Early transmit flag 
+  *     @arg ETH_DMA_FLAG_RWT : Receive watchdog timeout flag 
+  *     @arg ETH_DMA_FLAG_RPS : Receive process stopped flag 
+  *     @arg ETH_DMA_FLAG_RBU : Receive buffer unavailable flag 
+  *     @arg ETH_DMA_FLAG_R   : Receive flag 
+  *     @arg ETH_DMA_FLAG_TU  : Underflow flag 
+  *     @arg ETH_DMA_FLAG_RO  : Overflow flag 
+  *     @arg ETH_DMA_FLAG_TJT : Transmit jabber timeout flag 
+  *     @arg ETH_DMA_FLAG_TBU : Transmit buffer unavailable flag 
+  *     @arg ETH_DMA_FLAG_TPS : Transmit process stopped flag 
+  *     @arg ETH_DMA_FLAG_T   : Transmit flag 
+  * @retval The new state of ETH_DMA_FLAG (SET or RESET).
+  */
+FlagStatus ETH_GetDMAFlagStatus(uint32_t ETH_DMA_FLAG)
+{  
+  FlagStatus bitstatus = RESET;
+  /* Check the parameters */
+  assert_param(IS_ETH_DMA_GET_IT(ETH_DMA_FLAG));
+  if ((ETH->DMASR & ETH_DMA_FLAG) != (uint32_t)RESET)
+  {
+    bitstatus = SET;
+  }
+  else
+  {
+    bitstatus = RESET;
+  }
+  return bitstatus;
+}
+
+/**
+  * @brief  Clears the ETHERNET’s DMA pending flag.
+  * @param  ETH_DMA_FLAG: specifies the flag to clear.
+  *   This parameter can be any combination of the following values:
+  *     @arg ETH_DMA_FLAG_NIS : Normal interrupt summary flag
+  *     @arg ETH_DMA_FLAG_AIS : Abnormal interrupt summary flag 
+  *     @arg ETH_DMA_FLAG_ER  : Early receive flag 
+  *     @arg ETH_DMA_FLAG_FBE : Fatal bus error flag 
+  *     @arg ETH_DMA_FLAG_ETI : Early transmit flag 
+  *     @arg ETH_DMA_FLAG_RWT : Receive watchdog timeout flag 
+  *     @arg ETH_DMA_FLAG_RPS : Receive process stopped flag 
+  *     @arg ETH_DMA_FLAG_RBU : Receive buffer unavailable flag 
+  *     @arg ETH_DMA_FLAG_R   : Receive flag 
+  *     @arg ETH_DMA_FLAG_TU  : Transmit Underflow flag 
+  *     @arg ETH_DMA_FLAG_RO  : Receive Overflow flag 
+  *     @arg ETH_DMA_FLAG_TJT : Transmit jabber timeout flag 
+  *     @arg ETH_DMA_FLAG_TBU : Transmit buffer unavailable flag 
+  *     @arg ETH_DMA_FLAG_TPS : Transmit process stopped flag 
+  *     @arg ETH_DMA_FLAG_T   : Transmit flag
+  * @retval None
+  */
+void ETH_DMAClearFlag(uint32_t ETH_DMA_FLAG)
+{
+  /* Check the parameters */
+  assert_param(IS_ETH_DMA_FLAG(ETH_DMA_FLAG));
+  
+  /* Clear the selected ETHERNET DMA FLAG */
+  ETH->DMASR = (uint32_t) ETH_DMA_FLAG;
+}
+
+/**
+  * @brief  Enables or disables the specified ETHERNET DMA interrupts.
+  * @param  ETH_DMA_IT: specifies the ETHERNET DMA interrupt sources to be
+  *   enabled or disabled.
+  *   This parameter can be any combination of the following values:
+  *     @arg ETH_DMA_IT_NIS : Normal interrupt summary 
+  *     @arg ETH_DMA_IT_AIS : Abnormal interrupt summary  
+  *     @arg ETH_DMA_IT_ER  : Early receive interrupt 
+  *     @arg ETH_DMA_IT_FBE : Fatal bus error interrupt 
+  *     @arg ETH_DMA_IT_ET  : Early transmit interrupt 
+  *     @arg ETH_DMA_IT_RWT : Receive watchdog timeout interrupt 
+  *     @arg ETH_DMA_IT_RPS : Receive process stopped interrupt 
+  *     @arg ETH_DMA_IT_RBU : Receive buffer unavailable interrupt 
+  *     @arg ETH_DMA_IT_R   : Receive interrupt 
+  *     @arg ETH_DMA_IT_TU  : Underflow interrupt 
+  *     @arg ETH_DMA_IT_RO  : Overflow interrupt 
+  *     @arg ETH_DMA_IT_TJT : Transmit jabber timeout interrupt 
+  *     @arg ETH_DMA_IT_TBU : Transmit buffer unavailable interrupt 
+  *     @arg ETH_DMA_IT_TPS : Transmit process stopped interrupt 
+  *     @arg ETH_DMA_IT_T   : Transmit interrupt
+  * @param  NewState: new state of the specified ETHERNET DMA interrupts.
+  *   This parameter can be: ENABLE or DISABLE.
+  * @retval None
+  */
+void ETH_DMAITConfig(uint32_t ETH_DMA_IT, FunctionalState NewState)
+{
+  /* Check the parameters */
+  assert_param(IS_ETH_DMA_IT(ETH_DMA_IT));
+  assert_param(IS_FUNCTIONAL_STATE(NewState));  
+  
+  if (NewState != DISABLE)
+  {
+    /* Enable the selected ETHERNET DMA interrupts */
+    ETH->DMAIER |= ETH_DMA_IT;
+  }
+  else
+  {
+    /* Disable the selected ETHERNET DMA interrupts */
+    ETH->DMAIER &=(~(uint32_t)ETH_DMA_IT);
+  }
+}
+
+/**
+  * @brief  Checks whether the specified ETHERNET DMA interrupt has occurred or not.
+  * @param  ETH_DMA_IT: specifies the interrupt source to check.
+  *   This parameter can be one of the following values:
+  *     @arg ETH_DMA_IT_TST : Time-stamp trigger interrupt
+  *     @arg ETH_DMA_IT_PMT : PMT interrupt 
+  *     @arg ETH_DMA_IT_MMC : MMC interrupt
+  *     @arg ETH_DMA_IT_NIS : Normal interrupt summary 
+  *     @arg ETH_DMA_IT_AIS : Abnormal interrupt summary  
+  *     @arg ETH_DMA_IT_ER  : Early receive interrupt 
+  *     @arg ETH_DMA_IT_FBE : Fatal bus error interrupt 
+  *     @arg ETH_DMA_IT_ET  : Early transmit interrupt 
+  *     @arg ETH_DMA_IT_RWT : Receive watchdog timeout interrupt 
+  *     @arg ETH_DMA_IT_RPS : Receive process stopped interrupt 
+  *     @arg ETH_DMA_IT_RBU : Receive buffer unavailable interrupt 
+  *     @arg ETH_DMA_IT_R   : Receive interrupt 
+  *     @arg ETH_DMA_IT_TU  : Underflow interrupt 
+  *     @arg ETH_DMA_IT_RO  : Overflow interrupt 
+  *     @arg ETH_DMA_IT_TJT : Transmit jabber timeout interrupt 
+  *     @arg ETH_DMA_IT_TBU : Transmit buffer unavailable interrupt 
+  *     @arg ETH_DMA_IT_TPS : Transmit process stopped interrupt 
+  *     @arg ETH_DMA_IT_T   : Transmit interrupt 
+  * @retval The new state of ETH_DMA_IT (SET or RESET).
+  */
+ITStatus ETH_GetDMAITStatus(uint32_t ETH_DMA_IT)
+{  
+  ITStatus bitstatus = RESET;
+  /* Check the parameters */
+  assert_param(IS_ETH_DMA_GET_IT(ETH_DMA_IT));
+  if ((ETH->DMASR & ETH_DMA_IT) != (uint32_t)RESET)
+  {
+    bitstatus = SET;
+  }
+  else
+  {
+    bitstatus = RESET;
+  }
+  return bitstatus;
+}
+
+/**
+  * @brief  Clears the ETHERNET’s DMA IT pending bit.
+  * @param  ETH_DMA_IT: specifies the interrupt pending bit to clear.
+  *   This parameter can be any combination of the following values:
+  *     @arg ETH_DMA_IT_NIS : Normal interrupt summary 
+  *     @arg ETH_DMA_IT_AIS : Abnormal interrupt summary  
+  *     @arg ETH_DMA_IT_ER  : Early receive interrupt 
+  *     @arg ETH_DMA_IT_FBE : Fatal bus error interrupt 
+  *     @arg ETH_DMA_IT_ETI : Early transmit interrupt 
+  *     @arg ETH_DMA_IT_RWT : Receive watchdog timeout interrupt 
+  *     @arg ETH_DMA_IT_RPS : Receive process stopped interrupt 
+  *     @arg ETH_DMA_IT_RBU : Receive buffer unavailable interrupt 
+  *     @arg ETH_DMA_IT_R   : Receive interrupt 
+  *     @arg ETH_DMA_IT_TU  : Transmit Underflow interrupt 
+  *     @arg ETH_DMA_IT_RO  : Receive Overflow interrupt 
+  *     @arg ETH_DMA_IT_TJT : Transmit jabber timeout interrupt 
+  *     @arg ETH_DMA_IT_TBU : Transmit buffer unavailable interrupt 
+  *     @arg ETH_DMA_IT_TPS : Transmit process stopped interrupt 
+  *     @arg ETH_DMA_IT_T   : Transmit interrupt
+  * @retval None
+  */
+void ETH_DMAClearITPendingBit(uint32_t ETH_DMA_IT)
+{
+  /* Check the parameters */
+  assert_param(IS_ETH_DMA_IT(ETH_DMA_IT));
+  
+  /* Clear the selected ETHERNET DMA IT */
+  ETH->DMASR = (uint32_t) ETH_DMA_IT;
+}
+
+/**
+  * @brief  Returns the ETHERNET DMA Transmit Process State.
+  * @param  None
+  * @retval The new ETHERNET DMA Transmit Process State:
+  *   This can be one of the following values:
+  *     - ETH_DMA_TransmitProcess_Stopped   : Stopped - Reset or Stop Tx Command issued
+  *     - ETH_DMA_TransmitProcess_Fetching  : Running - fetching the Tx descriptor 
+  *     - ETH_DMA_TransmitProcess_Waiting   : Running - waiting for status
+  *     - ETH_DMA_TransmitProcess_Reading   : Running - reading the data from host memory
+  *     - ETH_DMA_TransmitProcess_Suspended : Suspended - Tx Descriptor unavailable
+  *     - ETH_DMA_TransmitProcess_Closing   : Running - closing Rx descriptor  
+  */
+uint32_t ETH_GetTransmitProcessState(void)
+{
+  return ((uint32_t)(ETH->DMASR & ETH_DMASR_TS)); 
+}
+
+/**
+  * @brief  Returns the ETHERNET DMA Receive Process State.
+  * @param  None
+  * @retval The new ETHERNET DMA Receive Process State:
+  *   This can be one of the following values:
+  *     - ETH_DMA_ReceiveProcess_Stopped   : Stopped - Reset or Stop Rx Command issued
+  *     - ETH_DMA_ReceiveProcess_Fetching  : Running - fetching the Rx descriptor 
+  *     - ETH_DMA_ReceiveProcess_Waiting   : Running - waiting for packet
+  *     - ETH_DMA_ReceiveProcess_Suspended : Suspended - Rx Descriptor unavailable
+  *     - ETH_DMA_ReceiveProcess_Closing   : Running - closing descriptor
+  *     - ETH_DMA_ReceiveProcess_Queuing   : Running - queuing the receive frame into host memory  
+  */
+uint32_t ETH_GetReceiveProcessState(void)
+{
+  return ((uint32_t)(ETH->DMASR & ETH_DMASR_RS)); 
+}
+
+/**
+  * @brief  Clears the ETHERNET transmit FIFO.
+  * @param  None                
+  * @retval None
+  */
+void ETH_FlushTransmitFIFO(void)
+{
+  /* Set the Flush Transmit FIFO bit */
+  ETH->DMAOMR |= ETH_DMAOMR_FTF;  
+}
+
+/**
+  * @brief  Checks whether the ETHERNET flush transmit FIFO bit is cleared or not.
+  * @param  None                
+  * @retval The new state of ETHERNET flush transmit FIFO bit (SET or RESET).
+  */
+FlagStatus ETH_GetFlushTransmitFIFOStatus(void)
+{   
+  FlagStatus bitstatus = RESET;
+  if ((ETH->DMAOMR & ETH_DMAOMR_FTF) != (uint32_t)RESET)
+  {
+    bitstatus = SET;
+  }
+  else
+  {
+    bitstatus = RESET;
+  }
+  return bitstatus; 
+}
+
+/**
+  * @brief  Enables or disables the DMA transmission.
+  * @param  NewState: new state of the DMA transmission.
+  *   This parameter can be: ENABLE or DISABLE.
+  * @retval None
+  */
+void ETH_DMATransmissionCmd(FunctionalState NewState)
+{ 
+  /* Check the parameters */
+  assert_param(IS_FUNCTIONAL_STATE(NewState));
+  
+  if (NewState != DISABLE)
+  {
+    /* Enable the DMA transmission */
+    ETH->DMAOMR |= ETH_DMAOMR_ST;  
+  }
+  else
+  {
+    /* Disable the DMA transmission */
+    ETH->DMAOMR &= ~ETH_DMAOMR_ST;
+  }
+}
+
+/**
+  * @brief  Enables or disables the DMA reception.
+  * @param  NewState: new state of the DMA reception.
+  *   This parameter can be: ENABLE or DISABLE.
+  * @retval None
+  */
+void ETH_DMAReceptionCmd(FunctionalState NewState)
+{ 
+  /* Check the parameters */
+  assert_param(IS_FUNCTIONAL_STATE(NewState));
+  
+  if (NewState != DISABLE)
+  {
+    /* Enable the DMA reception */
+    ETH->DMAOMR |= ETH_DMAOMR_SR;  
+  }
+  else
+  {
+    /* Disable the DMA reception */
+    ETH->DMAOMR &= ~ETH_DMAOMR_SR;
+  }
+}
+
+/**
+  * @brief  Checks whether the specified ETHERNET DMA overflow flag is set or not.
+  * @param  ETH_DMA_Overflow: specifies the DMA overflow flag to check.
+  *   This parameter can be one of the following values:
+  *     @arg ETH_DMA_Overflow_RxFIFOCounter : Overflow for FIFO Overflows Counter
+  *     @arg ETH_DMA_Overflow_MissedFrameCounter : Overflow for Buffer Unavailable Missed Frame Counter
+  * @retval The new state of ETHERNET DMA overflow Flag (SET or RESET).
+  */
+FlagStatus ETH_GetDMAOverflowStatus(uint32_t ETH_DMA_Overflow)
+{
+  FlagStatus bitstatus = RESET;
+  /* Check the parameters */
+  assert_param(IS_ETH_DMA_GET_OVERFLOW(ETH_DMA_Overflow));
+  
+  if ((ETH->DMAMFBOCR & ETH_DMA_Overflow) != (uint32_t)RESET)
+  {
+    bitstatus = SET;
+  }
+  else
+  {
+    bitstatus = RESET;
+  }
+  return bitstatus;
+}
+
+/**
+  * @brief  Get the ETHERNET DMA Rx Overflow Missed Frame Counter value.
+  * @param  None
+  * @retval The value of Rx overflow Missed Frame Counter.
+  */
+uint32_t ETH_GetRxOverflowMissedFrameCounter(void)
+{
+  return ((uint32_t)((ETH->DMAMFBOCR & ETH_DMAMFBOCR_MFA)>>ETH_DMA_RX_OVERFLOW_MISSEDFRAMES_COUNTERSHIFT));
+}
+
+/**
+  * @brief  Get the ETHERNET DMA Buffer Unavailable Missed Frame Counter value.
+  * @param  None
+  * @retval The value of Buffer unavailable Missed Frame Counter.
+  */
+uint32_t ETH_GetBufferUnavailableMissedFrameCounter(void)
+{
+  return ((uint32_t)(ETH->DMAMFBOCR) & ETH_DMAMFBOCR_MFC);
+}
+
+/**
+  * @brief  Get the ETHERNET DMA DMACHTDR register value.
+  * @param  None
+  * @retval The value of the current Tx desc start address.
+  */
+uint32_t ETH_GetCurrentTxDescStartAddress(void)
+{
+  return ((uint32_t)(ETH->DMACHTDR));
+}
+
+/**
+  * @brief  Get the ETHERNET DMA DMACHRDR register value.
+  * @param  None
+  * @retval The value of the current Rx desc start address.
+  */
+uint32_t ETH_GetCurrentRxDescStartAddress(void)
+{
+  return ((uint32_t)(ETH->DMACHRDR));
+}
+
+/**
+  * @brief  Get the ETHERNET DMA DMACHTBAR register value.
+  * @param  None
+  * @retval The value of the current transmit descriptor data buffer address.
+  */
+uint32_t ETH_GetCurrentTxBufferAddress(void)
+{
+  return ((uint32_t)(ETH->DMACHTBAR));
+}
+
+/**
+  * @brief  Get the ETHERNET DMA DMACHRBAR register value.
+  * @param  None
+  * @retval The value of the current receive descriptor data buffer address.
+  */
+uint32_t ETH_GetCurrentRxBufferAddress(void)
+{
+  return ((uint32_t)(ETH->DMACHRBAR));
+}
+
+/**
+  * @brief  Resumes the DMA Transmission by writing to the DmaTxPollDemand register
+  *   (the data written could be anything). This forces  the DMA to resume transmission.
+  * @param  None
+  * @retval None.
+  */
+void ETH_ResumeDMATransmission(void)
+{
+  ETH->DMATPDR = 0;
+}
+
+/**
+  * @brief  Resumes the DMA Transmission by writing to the DmaRxPollDemand register
+  *   (the data written could be anything). This forces the DMA to resume reception.
+  * @param  None
+  * @retval None.
+  */
+void ETH_ResumeDMAReception(void)
+{
+  ETH->DMARPDR = 0;
+}
+
+/**
+  * @brief  Set the DMA Receive status watchdog timer register value
+  * @param  Value: DMA Receive status watchdog timer register value   
+  * @retval None
+  */
+void ETH_SetReceiveWatchdogTimer(uint8_t Value)
+{
+  /* Set the DMA Receive status watchdog timer register */
+  ETH->DMARSWTR = Value;
+}
+
+/******************************************************************************/                             
+/*                                PHY functions                               */
+/******************************************************************************/
+
+/**
+  * @brief  Read a PHY register
+  * @param PHYAddress: PHY device address, is the index of one of supported 32 PHY devices. 
+  *   This parameter can be one of the following values: 0,..,31                  
+  * @param PHYReg: PHY register address, is the index of one of the 32 PHY register. 
+  *   This parameter can be one of the following values: 
+  *     @arg PHY_BCR: Transceiver Basic Control Register 
+  *     @arg PHY_BSR: Transceiver Basic Status Register 
+  *     @arg PHY_SR : Transceiver Status Register    
+  *     @arg More PHY register could be read depending on the used PHY
+  * @retval ETH_ERROR: in case of timeout
+  *         MAC MIIDR register value: Data read from the selected PHY register (correct read )
+  */
+uint16_t ETH_ReadPHYRegister(uint16_t PHYAddress, uint16_t PHYReg)
+{
+  uint32_t tmpreg = 0;     
+__IO uint32_t timeout = 0;
+  /* Check the parameters */
+  assert_param(IS_ETH_PHY_ADDRESS(PHYAddress));
+  assert_param(IS_ETH_PHY_REG(PHYReg));
+  
+  /* Get the ETHERNET MACMIIAR value */
+  tmpreg = ETH->MACMIIAR;
+  /* Keep only the CSR Clock Range CR[2:0] bits value */
+  tmpreg &= ~MACMIIAR_CR_MASK;
+  /* Prepare the MII address register value */
+  tmpreg |=(((uint32_t)PHYAddress<<11) & ETH_MACMIIAR_PA); /* Set the PHY device address */
+  tmpreg |=(((uint32_t)PHYReg<<6) & ETH_MACMIIAR_MR);      /* Set the PHY register address */
+  tmpreg &= ~ETH_MACMIIAR_MW;                              /* Set the read mode */
+  tmpreg |= ETH_MACMIIAR_MB;                               /* Set the MII Busy bit */
+  /* Write the result value into the MII Address register */
+  ETH->MACMIIAR = tmpreg;
+  /* Check for the Busy flag */
+  do
+  {
+    timeout++;
+    tmpreg = ETH->MACMIIAR;
+  } while ((tmpreg & ETH_MACMIIAR_MB) && (timeout < (uint32_t)PHY_READ_TO));
+  /* Return ERROR in case of timeout */
+  if(timeout == PHY_READ_TO)
+  {
+    return (uint16_t)ETH_ERROR;
+  }
+  
+  /* Return data register value */
+  return (uint16_t)(ETH->MACMIIDR);
+}
+
+/**
+  * @brief  Write to a PHY register
+  * @param PHYAddress: PHY device address, is the index of one of supported 32 PHY devices. 
+  *   This parameter can be one of the following values: 0,..,31
+  * @param PHYReg: PHY register address, is the index of one of the 32 PHY register. 
+  *   This parameter can be one of the following values: 
+  *     @arg PHY_BCR    : Transceiver Control Register  
+  *     @arg More PHY register could be written depending on the used PHY
+  * @param  PHYValue: the value to write
+  * @retval ETH_ERROR: in case of timeout
+  *         ETH_SUCCESS: for correct write
+  */
+uint32_t ETH_WritePHYRegister(uint16_t PHYAddress, uint16_t PHYReg, uint16_t PHYValue)
+{
+  uint32_t tmpreg = 0;     
+  __IO uint32_t timeout = 0;
+  /* Check the parameters */
+  assert_param(IS_ETH_PHY_ADDRESS(PHYAddress));
+  assert_param(IS_ETH_PHY_REG(PHYReg));
+  
+  /* Get the ETHERNET MACMIIAR value */
+  tmpreg = ETH->MACMIIAR;
+  /* Keep only the CSR Clock Range CR[2:0] bits value */
+  tmpreg &= ~MACMIIAR_CR_MASK;
+  /* Prepare the MII register address value */
+  tmpreg |=(((uint32_t)PHYAddress<<11) & ETH_MACMIIAR_PA); /* Set the PHY device address */
+  tmpreg |=(((uint32_t)PHYReg<<6) & ETH_MACMIIAR_MR);      /* Set the PHY register address */
+  tmpreg |= ETH_MACMIIAR_MW;                               /* Set the write mode */
+  tmpreg |= ETH_MACMIIAR_MB;                               /* Set the MII Busy bit */
+  /* Give the value to the MII data register */
+  ETH->MACMIIDR = PHYValue;
+  /* Write the result value into the MII Address register */
+  ETH->MACMIIAR = tmpreg;
+  /* Check for the Busy flag */
+  do
+  {
+    timeout++;
+    tmpreg = ETH->MACMIIAR;
+  } while ((tmpreg & ETH_MACMIIAR_MB) && (timeout < (uint32_t)PHY_WRITE_TO));
+  /* Return ERROR in case of timeout */
+  if(timeout == PHY_WRITE_TO)
+  {
+    return ETH_ERROR;
+  }
+  
+  /* Return SUCCESS */
+  return ETH_SUCCESS;  
+}
+
+/**
+  * @brief  Enables or disables the PHY loopBack mode.
+  * @Note: Don't be confused with ETH_MACLoopBackCmd function which enables internal
+  *  loopback at MII level
+  * @param  PHYAddress: PHY device address, is the index of one of supported 32 PHY devices.                   
+  * @param  NewState: new state of the PHY loopBack mode.
+  *   This parameter can be: ENABLE or DISABLE.    
+  * @retval ETH_ERROR: in case of bad PHY configuration
+  *         ETH_SUCCESS: for correct PHY configuration
+  */
+uint32_t ETH_PHYLoopBackCmd(uint16_t PHYAddress, FunctionalState NewState)
+{
+  uint16_t tmpreg = 0;
+  /* Check the parameters */
+  assert_param(IS_ETH_PHY_ADDRESS(PHYAddress));
+  assert_param(IS_FUNCTIONAL_STATE(NewState));
+    
+  /* Get the PHY configuration to update it */
+  tmpreg = ETH_ReadPHYRegister(PHYAddress, PHY_BCR); 
+  
+  if (NewState != DISABLE)
+  {
+    /* Enable the PHY loopback mode */
+    tmpreg |= PHY_Loopback;  
+  }
+  else
+  {
+    /* Disable the PHY loopback mode: normal mode */
+    tmpreg &= (uint16_t)(~(uint16_t)PHY_Loopback);
+  }
+  /* Update the PHY control register with the new configuration */
+  if(ETH_WritePHYRegister(PHYAddress, PHY_BCR, tmpreg) != (uint32_t)RESET)
+  {
+    return ETH_SUCCESS;
+  }
+  else
+  {
+    /* Return SUCCESS */
+    return ETH_ERROR; 
+  }   
+} 
+
+/******************************************************************************/                             
+/*                           Power Management(PMT) functions                  */
+/******************************************************************************/    
+/**
+  * @brief  Reset Wakeup frame filter register pointer.
+  * @param  None
+  * @retval None
+  */
+void ETH_ResetWakeUpFrameFilterRegisterPointer(void)
+{  
+  /* Resets the Remote Wake-up Frame Filter register pointer to 0x0000 */
+  ETH->MACPMTCSR |= ETH_MACPMTCSR_WFFRPR;  
+}
+
+/**
+  * @brief  Populates the remote wakeup frame registers.
+  * @param  Buffer: Pointer on remote WakeUp Frame Filter Register buffer data (8 words).
+  * @retval None
+  */
+void ETH_SetWakeUpFrameFilterRegister(uint32_t *Buffer)
+{
+  uint32_t i = 0;
+  
+  /* Fill Remote Wake-up Frame Filter register with Buffer data */
+  for(i =0; i<ETH_WAKEUP_REGISTER_LENGTH; i++)
+  {
+    /* Write each time to the same register */ 
+    ETH->MACRWUFFR = Buffer[i];
+  }
+}
+
+/**
+  * @brief  Enables or disables any unicast packet filtered by the MAC address
+  *   recognition to be a wake-up frame.
+  * @param  NewState: new state of the MAC Global Unicast Wake-Up.
+  *   This parameter can be: ENABLE or DISABLE.
+  * @retval None
+  */
+void ETH_GlobalUnicastWakeUpCmd(FunctionalState NewState)
+{ 
+  /* Check the parameters */
+  assert_param(IS_FUNCTIONAL_STATE(NewState));
+  
+  if (NewState != DISABLE)
+  {
+    /* Enable the MAC Global Unicast Wake-Up */
+    ETH->MACPMTCSR |= ETH_MACPMTCSR_GU;  
+  }
+  else
+  {
+    /* Disable the MAC Global Unicast Wake-Up */ 
+    ETH->MACPMTCSR &= ~ETH_MACPMTCSR_GU;
+  }
+}
+
+/**
+  * @brief  Checks whether the specified ETHERNET PMT flag is set or not.
+  * @param  ETH_PMT_FLAG: specifies the flag to check.
+  *   This parameter can be one of the following values:
+  *     @arg ETH_PMT_FLAG_WUFFRPR : Wake-Up Frame Filter Register Pointer Reset 
+  *     @arg ETH_PMT_FLAG_WUFR    : Wake-Up Frame Received 
+  *     @arg ETH_PMT_FLAG_MPR     : Magic Packet Received
+  * @retval The new state of ETHERNET PMT Flag (SET or RESET).
+  */
+FlagStatus ETH_GetPMTFlagStatus(uint32_t ETH_PMT_FLAG)
+{
+  FlagStatus bitstatus = RESET;
+  /* Check the parameters */
+  assert_param(IS_ETH_PMT_GET_FLAG(ETH_PMT_FLAG));
+  
+  if ((ETH->MACPMTCSR & ETH_PMT_FLAG) != (uint32_t)RESET)
+  {
+    bitstatus = SET;
+  }
+  else
+  {
+    bitstatus = RESET;
+  }
+  return bitstatus;
+}
+
+/**
+  * @brief  Enables or disables the MAC Wake-Up Frame Detection.
+  * @param  NewState: new state of the MAC Wake-Up Frame Detection.
+  *   This parameter can be: ENABLE or DISABLE.
+  * @retval None
+  */
+void ETH_WakeUpFrameDetectionCmd(FunctionalState NewState)
+{ 
+  /* Check the parameters */
+  assert_param(IS_FUNCTIONAL_STATE(NewState));
+  
+  if (NewState != DISABLE)
+  {
+    /* Enable the MAC Wake-Up Frame Detection */
+    ETH->MACPMTCSR |= ETH_MACPMTCSR_WFE;  
+  }
+  else
+  {
+    /* Disable the MAC Wake-Up Frame Detection */ 
+    ETH->MACPMTCSR &= ~ETH_MACPMTCSR_WFE;
+  }
+}
+
+/**
+  * @brief  Enables or disables the MAC Magic Packet Detection.
+  * @param  NewState: new state of the MAC Magic Packet Detection.
+  *   This parameter can be: ENABLE or DISABLE.
+  * @retval None
+  */
+void ETH_MagicPacketDetectionCmd(FunctionalState NewState)
+{ 
+  /* Check the parameters */
+  assert_param(IS_FUNCTIONAL_STATE(NewState));
+  
+  if (NewState != DISABLE)
+  {
+    /* Enable the MAC Magic Packet Detection */
+    ETH->MACPMTCSR |= ETH_MACPMTCSR_MPE;  
+  }
+  else
+  {
+    /* Disable the MAC Magic Packet Detection */ 
+    ETH->MACPMTCSR &= ~ETH_MACPMTCSR_MPE;
+  }
+}
+
+/**
+  * @brief  Enables or disables the MAC Power Down.
+  * @param  NewState: new state of the MAC Power Down.
+  *   This parameter can be: ENABLE or DISABLE.
+  * @retval None
+  */
+void ETH_PowerDownCmd(FunctionalState NewState)
+{ 
+  /* Check the parameters */
+  assert_param(IS_FUNCTIONAL_STATE(NewState));
+  
+  if (NewState != DISABLE)
+  {
+    /* Enable the MAC Power Down */
+    /* This puts the MAC in power down mode */
+    ETH->MACPMTCSR |= ETH_MACPMTCSR_PD;  
+  }
+  else
+  {
+    /* Disable the MAC Power Down */ 
+    ETH->MACPMTCSR &= ~ETH_MACPMTCSR_PD;
+  }
+} 
+
+/******************************************************************************/                             
+/*                              MMC functions                                 */
+/******************************************************************************/                            
+/**
+  * @brief  Preset and Initialize the MMC counters to almost-full value: 0xFFFF_FFF0 (full - 16)   
+  * @param  None
+  * @retval None
+  */
+void ETH_MMCCounterFullPreset(void)
+{
+  /* Preset and Initialize the MMC counters to almost-full value */
+  ETH->MMCCR |= ETH_MMCCR_MCFHP | ETH_MMCCR_MCP;
+}
+
+/**
+  * @brief  Preset and Initialize the MMC counters to almost-hal value: 0x7FFF_FFF0 (half - 16). 
+  * @param  None
+  * @retval None
+  */
+void ETH_MMCCounterHalfPreset(void)
+{
+  /* Preset the MMC counters to almost-full value */
+  ETH->MMCCR &= ~ETH_MMCCR_MCFHP;
+  /* Initialize the MMC counters to almost-half value */
+  ETH->MMCCR |= ETH_MMCCR_MCP;
+}
+
+ /**
+  * @brief  Enables or disables the MMC Counter Freeze.
+  * @param  NewState: new state of the MMC Counter Freeze.
+  *   This parameter can be: ENABLE or DISABLE.
+  * @retval None
+  */
+void ETH_MMCCounterFreezeCmd(FunctionalState NewState)
+{
+  /* Check the parameters */
+  assert_param(IS_FUNCTIONAL_STATE(NewState));
+  
+  if (NewState != DISABLE)
+  {
+    /* Enable the MMC Counter Freeze */
+    ETH->MMCCR |= ETH_MMCCR_MCF;
+  }
+  else
+  {
+    /* Disable the MMC Counter Freeze */
+    ETH->MMCCR &= ~ETH_MMCCR_MCF;
+  }
+}
+
+/**
+  * @brief  Enables or disables the MMC Reset On Read.
+  * @param  NewState: new state of the MMC Reset On Read.
+  *   This parameter can be: ENABLE or DISABLE.
+  * @retval None
+  */
+void ETH_MMCResetOnReadCmd(FunctionalState NewState)
+{
+  /* Check the parameters */
+  assert_param(IS_FUNCTIONAL_STATE(NewState));
+  
+  if (NewState != DISABLE)
+  {
+    /* Enable the MMC Counter reset on read */
+    ETH->MMCCR |= ETH_MMCCR_ROR; 
+  }
+  else
+  {
+    /* Disable the MMC Counter reset on read */
+    ETH->MMCCR &= ~ETH_MMCCR_ROR;
+  }
+}
+
+/**
+  * @brief  Enables or disables the MMC Counter Stop Rollover.
+  * @param  NewState: new state of the MMC Counter Stop Rollover.
+  *   This parameter can be: ENABLE or DISABLE.
+  * @retval None
+  */
+void ETH_MMCCounterRolloverCmd(FunctionalState NewState)
+{
+  /* Check the parameters */
+  assert_param(IS_FUNCTIONAL_STATE(NewState));
+  
+  if (NewState != DISABLE)
+  {
+    /* Disable the MMC Counter Stop Rollover  */
+    ETH->MMCCR &= ~ETH_MMCCR_CSR;
+  }
+  else
+  {
+    /* Enable the MMC Counter Stop Rollover */
+    ETH->MMCCR |= ETH_MMCCR_CSR; 
+  }
+}
+
+/**
+  * @brief  Resets the MMC Counters.
+  * @param  None
+  * @retval None
+  */
+void ETH_MMCCountersReset(void)
+{
+  /* Resets the MMC Counters */
+  ETH->MMCCR |= ETH_MMCCR_CR; 
+}
+
+/**
+  * @brief  Enables or disables the specified ETHERNET MMC interrupts.
+  * @param  ETH_MMC_IT: specifies the ETHERNET MMC interrupt sources to be enabled or disabled.
+  *   This parameter can be any combination of Tx interrupt or 
+  *   any combination of Rx interrupt (but not both)of the following values: 
+  *     @arg ETH_MMC_IT_TGF   : When Tx good frame counter reaches half the maximum value 
+  *     @arg ETH_MMC_IT_TGFMSC: When Tx good multi col counter reaches half the maximum value 
+  *     @arg ETH_MMC_IT_TGFSC : When Tx good single col counter reaches half the maximum value 
+  *     @arg ETH_MMC_IT_RGUF  : When Rx good unicast frames counter reaches half the maximum value  
+  *     @arg ETH_MMC_IT_RFAE  : When Rx alignment error counter reaches half the maximum value 
+  *     @arg ETH_MMC_IT_RFCE  : When Rx crc error counter reaches half the maximum value
+  * @param  NewState: new state of the specified ETHERNET MMC interrupts.
+  *   This parameter can be: ENABLE or DISABLE.
+  * @retval None
+  */
+void ETH_MMCITConfig(uint32_t ETH_MMC_IT, FunctionalState NewState)
+{ 
+  /* Check the parameters */
+  assert_param(IS_ETH_MMC_IT(ETH_MMC_IT));  
+  assert_param(IS_FUNCTIONAL_STATE(NewState));
+   
+  if ((ETH_MMC_IT & (uint32_t)0x10000000) != (uint32_t)RESET)
+  {
+    /* Remove Register mak from IT */
+    ETH_MMC_IT &= 0xEFFFFFFF;
+  
+    /* ETHERNET MMC Rx interrupts selected */
+    if (NewState != DISABLE)
+    {
+      /* Enable the selected ETHERNET MMC interrupts */
+      ETH->MMCRIMR &=(~(uint32_t)ETH_MMC_IT);
+    }
+    else
+    {
+      /* Disable the selected ETHERNET MMC interrupts */
+      ETH->MMCRIMR |= ETH_MMC_IT;    
+    }
+  }
+  else
+  {
+    /* ETHERNET MMC Tx interrupts selected */
+    if (NewState != DISABLE)
+    {
+      /* Enable the selected ETHERNET MMC interrupts */
+      ETH->MMCTIMR &=(~(uint32_t)ETH_MMC_IT);
+    }
+    else
+    {
+      /* Disable the selected ETHERNET MMC interrupts */
+      ETH->MMCTIMR |= ETH_MMC_IT;    
+    }  
+  }
+}
+
+/**
+  * @brief  Checks whether the specified ETHERNET MMC IT is set or not.
+  * @param  ETH_MMC_IT: specifies the ETHERNET MMC interrupt.
+  *   This parameter can be one of the following values:
+  *     @arg ETH_MMC_IT_TxFCGC: When Tx good frame counter reaches half the maximum value 
+  *     @arg ETH_MMC_IT_TxMCGC: When Tx good multi col counter reaches half the maximum value 
+  *     @arg ETH_MMC_IT_TxSCGC: When Tx good single col counter reaches half the maximum value 
+  *     @arg ETH_MMC_IT_RxUGFC: When Rx good unicast frames counter reaches half the maximum value  
+  *     @arg ETH_MMC_IT_RxAEC : When Rx alignment error counter reaches half the maximum value 
+  *     @arg ETH_MMC_IT_RxCEC : When Rx crc error counter reaches half the maximum value 
+  * @retval The value of ETHERNET MMC IT (SET or RESET).
+  */
+ITStatus ETH_GetMMCITStatus(uint32_t ETH_MMC_IT)
+{
+  ITStatus bitstatus = RESET;
+  /* Check the parameters */
+  assert_param(IS_ETH_MMC_GET_IT(ETH_MMC_IT)); 
+  
+  if ((ETH_MMC_IT & (uint32_t)0x10000000) != (uint32_t)RESET)
+  {
+    /* ETHERNET MMC Rx interrupts selected */
+    /* Check if the ETHERNET MMC Rx selected interrupt is enabled and occurred */ 
+    if ((((ETH->MMCRIR & ETH_MMC_IT) != (uint32_t)RESET)) && ((ETH->MMCRIMR & ETH_MMC_IT) == (uint32_t)RESET))
+    {
+      bitstatus = SET;
+    }
+    else
+    {
+      bitstatus = RESET;
+    }
+  }
+  else
+  {
+    /* ETHERNET MMC Tx interrupts selected */
+    /* Check if the ETHERNET MMC Tx selected interrupt is enabled and occurred */  
+    if ((((ETH->MMCTIR & ETH_MMC_IT) != (uint32_t)RESET)) && ((ETH->MMCRIMR & ETH_MMC_IT) == (uint32_t)RESET))
+    {
+      bitstatus = SET;
+    }
+    else
+    {
+      bitstatus = RESET;
+    }  
+  }    
+    
+  return bitstatus;
+}
+
+/**
+  * @brief  Get the specified ETHERNET MMC register value.
+  * @param  ETH_MMCReg: specifies the ETHERNET MMC register.
+  *   This parameter can be one of the following values:
+  *     @arg ETH_MMCCR      : MMC CR register 
+  *     @arg ETH_MMCRIR     : MMC RIR register 
+  *     @arg ETH_MMCTIR     : MMC TIR register 
+  *     @arg ETH_MMCRIMR    : MMC RIMR register 
+  *     @arg ETH_MMCTIMR    : MMC TIMR register 
+  *     @arg ETH_MMCTGFSCCR : MMC TGFSCCR register 
+  *     @arg ETH_MMCTGFMSCCR: MMC TGFMSCCR register  
+  *     @arg ETH_MMCTGFCR   : MMC TGFCR register
+  *     @arg ETH_MMCRFCECR  : MMC RFCECR register 
+  *     @arg ETH_MMCRFAECR  : MMC RFAECR register 
+  *     @arg ETH_MMCRGUFCR  : MMC RGUFCRregister 
+  * @retval The value of ETHERNET MMC Register value.
+  */
+uint32_t ETH_GetMMCRegister(uint32_t ETH_MMCReg)
+{
+  /* Check the parameters */
+  assert_param(IS_ETH_MMC_REGISTER(ETH_MMCReg));
+  
+  /* Return the selected register value */
+  return (*(__IO uint32_t *)(ETH_MAC_BASE + ETH_MMCReg));
+}
+
+
+                                                   
+/**
+  * @}
+  */
+
+/**
+  * @}
+  */

+ 1902 - 0
modules/STM32F4x7_ETH_Driver/stm32f4x7_eth.h

@@ -0,0 +1,1902 @@
+/**
+  ******************************************************************************
+  * @file    stm32f4x7_eth.h
+  * @author  MCD Application Team
+  * @version V1.0.0
+  * @date    14-October-2011
+  * @brief   This file contains all the functions prototypes for the Ethernet
+  *          firmware driver.
+  ******************************************************************************
+  * @attention
+  *
+  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
+  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
+  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
+  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
+  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+  *
+  * <h2><center>&copy; Portions COPYRIGHT 2011 STMicroelectronics</center></h2>
+  ******************************************************************************
+  */
+/**
+  ******************************************************************************
+  * <h2><center>&copy; Portions COPYRIGHT 2012 Embest Tech. Co., Ltd.</center></h2>
+  * @file    stm32f4x7_eth.h
+  * @author  CMP Team
+  * @version V1.0.0
+  * @date    28-December-2012
+  * @brief   This file contains all the functions prototypes for the Ethernet
+  *          firmware driver.     
+  ******************************************************************************
+  * @attention
+  *
+  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
+  * TIME. AS A RESULT, Embest SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
+  * OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
+  * OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
+  * CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+  ******************************************************************************
+  */
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32F4x7_ETH_H
+#define __STM32F4x7_ETH_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32f4x7_eth_conf.h"
+
+/** @addtogroup STM32F4x7_ETH_Driver
+  * @{
+  */
+
+/** @defgroup ETH_Exported_Types
+  * @{
+  */
+
+/** 
+  * @brief  ETH MAC Init structure definition
+  * @note   The user should not configure all the ETH_InitTypeDef structure's fields. 
+  *   By calling the ETH_StructInit function the structure’s fields are set to their default values.
+  *   Only the parameters that will be set to a non-default value should be configured.  
+  */ 
+typedef struct {
+/** 
+  * @brief / * MAC  
+  */ 
+  uint32_t             ETH_AutoNegotiation;           /*!< Selects or not the AutoNegotiation mode for the external PHY
+                                                           The AutoNegotiation allows an automatic setting of the Speed (10/100Mbps)
+                                                           and the mode (half/full-duplex).
+                                                           This parameter can be a value of @ref ETH_AutoNegotiation */
+
+  uint32_t             ETH_Watchdog;                  /*!< Selects or not the Watchdog timer
+                                                           When enabled, the MAC allows no more then 2048 bytes to be received.
+                                                           When disabled, the MAC can receive up to 16384 bytes.
+                                                           This parameter can be a value of @ref ETH_watchdog */  
+
+  uint32_t             ETH_Jabber;                    /*!< Selects or not Jabber timer
+                                                           When enabled, the MAC allows no more then 2048 bytes to be sent.
+                                                           When disabled, the MAC can send up to 16384 bytes.
+                                                           This parameter can be a value of @ref ETH_Jabber */
+
+  uint32_t             ETH_InterFrameGap;             /*!< Selects the minimum IFG between frames during transmission
+                                                           This parameter can be a value of @ref ETH_Inter_Frame_Gap */   
+
+  uint32_t             ETH_CarrierSense;              /*!< Selects or not the Carrier Sense
+                                                           This parameter can be a value of @ref ETH_Carrier_Sense */
+
+  uint32_t             ETH_Speed;                     /*!< Sets the Ethernet speed: 10/100 Mbps
+                                                           This parameter can be a value of @ref ETH_Speed */
+
+  uint32_t             ETH_ReceiveOwn;                /*!< Selects or not the ReceiveOwn
+                                                           ReceiveOwn allows the reception of frames when the TX_EN signal is asserted
+                                                           in Half-Duplex mode
+                                                           This parameter can be a value of @ref ETH_Receive_Own */  
+
+  uint32_t             ETH_LoopbackMode;              /*!< Selects or not the internal MAC MII Loopback mode
+                                                           This parameter can be a value of @ref ETH_Loop_Back_Mode */  
+
+  uint32_t             ETH_Mode;                      /*!< Selects the MAC duplex mode: Half-Duplex or Full-Duplex mode
+                                                           This parameter can be a value of @ref ETH_Duplex_Mode */  
+
+  uint32_t             ETH_ChecksumOffload;           /*!< Selects or not the IPv4 checksum checking for received frame payloads' TCP/UDP/ICMP headers.
+                                                           This parameter can be a value of @ref ETH_Checksum_Offload */    
+
+  uint32_t             ETH_RetryTransmission;         /*!< Selects or not the MAC attempt retries transmission, based on the settings of BL,
+                                                           when a collision occurs (Half-Duplex mode)
+                                                           This parameter can be a value of @ref ETH_Retry_Transmission */
+
+  uint32_t             ETH_AutomaticPadCRCStrip;      /*!< Selects or not the Automatic MAC Pad/CRC Stripping
+                                                           This parameter can be a value of @ref ETH_Automatic_Pad_CRC_Strip */ 
+
+  uint32_t             ETH_BackOffLimit;              /*!< Selects the BackOff limit value
+                                                           This parameter can be a value of @ref ETH_Back_Off_Limit */
+
+  uint32_t             ETH_DeferralCheck;             /*!< Selects or not the deferral check function (Half-Duplex mode)
+                                                           This parameter can be a value of @ref ETH_Deferral_Check */                                                                                                        
+
+  uint32_t             ETH_ReceiveAll;                /*!< Selects or not all frames reception by the MAC (No filtering)
+                                                           This parameter can be a value of @ref ETH_Receive_All */   
+
+  uint32_t             ETH_SourceAddrFilter;          /*!< Selects the Source Address Filter mode                                                           
+                                                           This parameter can be a value of @ref ETH_Source_Addr_Filter */                  
+
+  uint32_t             ETH_PassControlFrames;         /*!< Sets the forwarding mode of the control frames (including unicast and multicast PAUSE frames)                                                          
+                                                           This parameter can be a value of @ref ETH_Pass_Control_Frames */ 
+
+  uint32_t             ETH_BroadcastFramesReception;  /*!< Selects or not the reception of Broadcast Frames
+                                                           This parameter can be a value of @ref ETH_Broadcast_Frames_Reception */
+
+  uint32_t             ETH_DestinationAddrFilter;     /*!< Sets the destination filter mode for both unicast and multicast frames
+                                                           This parameter can be a value of @ref ETH_Destination_Addr_Filter */ 
+
+  uint32_t             ETH_PromiscuousMode;           /*!< Selects or not the Promiscuous Mode
+                                                           This parameter can be a value of @ref ETH_Promiscuous_Mode */
+
+  uint32_t             ETH_MulticastFramesFilter;     /*!< Selects the Multicast Frames filter mode: None/HashTableFilter/PerfectFilter/PerfectHashTableFilter
+                                                           This parameter can be a value of @ref ETH_Multicast_Frames_Filter */ 
+
+  uint32_t             ETH_UnicastFramesFilter;       /*!< Selects the Unicast Frames filter mode: HashTableFilter/PerfectFilter/PerfectHashTableFilter
+                                                           This parameter can be a value of @ref ETH_Unicast_Frames_Filter */ 
+
+  uint32_t             ETH_HashTableHigh;             /*!< This field holds the higher 32 bits of Hash table.  */    
+
+  uint32_t             ETH_HashTableLow;              /*!< This field holds the lower 32 bits of Hash table.  */    
+
+  uint32_t             ETH_PauseTime;                 /*!< This field holds the value to be used in the Pause Time field in the
+                                                           transmit control frame */
+
+  uint32_t             ETH_ZeroQuantaPause;           /*!< Selects or not the automatic generation of Zero-Quanta Pause Control frames
+                                                           This parameter can be a value of @ref ETH_Zero_Quanta_Pause */  
+
+  uint32_t             ETH_PauseLowThreshold;         /*!< This field configures the threshold of the PAUSE to be checked for
+                                                           automatic retransmission of PAUSE Frame
+                                                           This parameter can be a value of @ref ETH_Pause_Low_Threshold */
+                                                           
+  uint32_t             ETH_UnicastPauseFrameDetect;   /*!< Selects or not the MAC detection of the Pause frames (with MAC Address0
+                                                           unicast address and unique multicast address)
+                                                           This parameter can be a value of @ref ETH_Unicast_Pause_Frame_Detect */  
+
+  uint32_t             ETH_ReceiveFlowControl;        /*!< Enables or disables the MAC to decode the received Pause frame and
+                                                           disable its transmitter for a specified time (Pause Time)
+                                                           This parameter can be a value of @ref ETH_Receive_Flow_Control */
+
+  uint32_t             ETH_TransmitFlowControl;       /*!< Enables or disables the MAC to transmit Pause frames (Full-Duplex mode)
+                                                           or the MAC back-pressure operation (Half-Duplex mode)
+                                                           This parameter can be a value of @ref ETH_Transmit_Flow_Control */     
+
+  uint32_t             ETH_VLANTagComparison;         /*!< Selects the 12-bit VLAN identifier or the complete 16-bit VLAN tag for
+                                                           comparison and filtering
+                                                           This parameter can be a value of @ref ETH_VLAN_Tag_Comparison */ 
+
+  uint32_t             ETH_VLANTagIdentifier;         /*!< Holds the VLAN tag identifier for receive frames */
+
+/** 
+  * @brief / * DMA  
+  */ 
+
+  uint32_t             ETH_DropTCPIPChecksumErrorFrame; /*!< Selects or not the Dropping of TCP/IP Checksum Error Frames
+                                                             This parameter can be a value of @ref ETH_Drop_TCP_IP_Checksum_Error_Frame */ 
+
+  uint32_t             ETH_ReceiveStoreForward;         /*!< Enables or disables the Receive store and forward mode
+                                                             This parameter can be a value of @ref ETH_Receive_Store_Forward */ 
+
+  uint32_t             ETH_FlushReceivedFrame;          /*!< Enables or disables the flushing of received frames
+                                                             This parameter can be a value of @ref ETH_Flush_Received_Frame */ 
+
+  uint32_t             ETH_TransmitStoreForward;        /*!< Enables or disables Transmit store and forward mode
+                                                             This parameter can be a value of @ref ETH_Transmit_Store_Forward */ 
+
+  uint32_t             ETH_TransmitThresholdControl;    /*!< Selects or not the Transmit Threshold Control
+                                                             This parameter can be a value of @ref ETH_Transmit_Threshold_Control */
+
+  uint32_t             ETH_ForwardErrorFrames;          /*!< Selects or not the forward to the DMA of erroneous frames
+                                                             This parameter can be a value of @ref ETH_Forward_Error_Frames */
+
+  uint32_t             ETH_ForwardUndersizedGoodFrames; /*!< Enables or disables the Rx FIFO to forward Undersized frames (frames with no Error
+                                                             and length less than 64 bytes) including pad-bytes and CRC)
+                                                             This parameter can be a value of @ref ETH_Forward_Undersized_Good_Frames */
+
+  uint32_t             ETH_ReceiveThresholdControl;     /*!< Selects the threshold level of the Receive FIFO
+                                                             This parameter can be a value of @ref ETH_Receive_Threshold_Control */
+
+  uint32_t             ETH_SecondFrameOperate;          /*!< Selects or not the Operate on second frame mode, which allows the DMA to process a second
+                                                             frame of Transmit data even before obtaining the status for the first frame.
+                                                             This parameter can be a value of @ref ETH_Second_Frame_Operate */
+
+  uint32_t             ETH_AddressAlignedBeats;         /*!< Enables or disables the Address Aligned Beats
+                                                             This parameter can be a value of @ref ETH_Address_Aligned_Beats */
+
+  uint32_t             ETH_FixedBurst;                  /*!< Enables or disables the AHB Master interface fixed burst transfers
+                                                             This parameter can be a value of @ref ETH_Fixed_Burst */
+                       
+  uint32_t             ETH_RxDMABurstLength;            /*!< Indicates the maximum number of beats to be transferred in one Rx DMA transaction
+                                                             This parameter can be a value of @ref ETH_Rx_DMA_Burst_Length */ 
+
+  uint32_t             ETH_TxDMABurstLength;            /*!< Indicates the maximum number of beats to be transferred in one Tx DMA transaction
+                                                             This parameter can be a value of @ref ETH_Tx_DMA_Burst_Length */                                                   
+
+  uint32_t             ETH_DescriptorSkipLength;        /*!< Specifies the number of word to skip between two unchained descriptors (Ring mode) */                                                             
+
+  uint32_t             ETH_DMAArbitration;              /*!< Selects the DMA Tx/Rx arbitration
+                                                             This parameter can be a value of @ref ETH_DMA_Arbitration */  
+}ETH_InitTypeDef;
+
+/**--------------------------------------------------------------------------**/
+/** 
+  * @brief                           DMA descriptors types
+  */ 
+/**--------------------------------------------------------------------------**/
+
+/** 
+  * @brief  ETH DMA Descriptors data structure definition
+  */ 
+typedef struct  {
+  __IO uint32_t   Status;                /*!< Status */
+  uint32_t   ControlBufferSize;     /*!< Control and Buffer1, Buffer2 lengths */
+  uint32_t   Buffer1Addr;           /*!< Buffer1 address pointer */
+  uint32_t   Buffer2NextDescAddr;   /*!< Buffer2 or next descriptor address pointer */
+/* Enhanced ETHERNET DMA PTP Descriptors */
+#ifdef USE_ENHANCED_DMA_DESCRIPTORS
+  uint32_t   ExtendedStatus;        /* Extended status for PTP receive descriptor */
+  uint32_t   Reserved1;             /* Reserved */
+  uint32_t   TimeStampLow;          /* Time Stamp Low value for transmit and receive */
+  uint32_t   TimeStampHigh;         /* Time Stamp High value for transmit and receive */
+#endif /* USE_ENHANCED_DMA_DESCRIPTORS */
+} ETH_DMADESCTypeDef;
+
+
+typedef struct{
+  u32 length;
+  u32 buffer;
+  __IO ETH_DMADESCTypeDef *descriptor;
+}FrameTypeDef;
+
+
+typedef struct  {
+  __IO ETH_DMADESCTypeDef *FS_Rx_Desc;          /*!< First Segment Rx Desc */
+  __IO ETH_DMADESCTypeDef *LS_Rx_Desc;          /*!< Last Segment Rx Desc */
+  __IO uint32_t  Seg_Count;                     /*!< Segment count */
+} ETH_DMA_Rx_Frame_infos;
+  
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Exported_Constants
+  * @{
+  */ 
+ 
+/**--------------------------------------------------------------------------**/
+/** 
+  * @brief                          ETH Frames defines
+  */ 
+/**--------------------------------------------------------------------------**/
+
+/** @defgroup ENET_Buffers_setting 
+  * @{
+  */ 
+#define ETH_MAX_PACKET_SIZE    1524    /*!< ETH_HEADER + ETH_EXTRA + VLAN_TAG + MAX_ETH_PAYLOAD + ETH_CRC */
+#define ETH_HEADER               14    /*!< 6 byte Dest addr, 6 byte Src addr, 2 byte length/type */
+#define ETH_CRC                   4    /*!< Ethernet CRC */
+#define ETH_EXTRA                 2    /*!< Extra bytes in some cases */   
+#define VLAN_TAG                  4    /*!< optional 802.1q VLAN Tag */
+#define MIN_ETH_PAYLOAD          46    /*!< Minimum Ethernet payload size */
+#define MAX_ETH_PAYLOAD        1500    /*!< Maximum Ethernet payload size */
+#define JUMBO_FRAME_PAYLOAD    9000    /*!< Jumbo frame payload size */      
+
+ /* Ethernet driver receive buffers are organized in a chained linked-list, when
+    an ethernet packet is received, the Rx-DMA will transfer the packet from RxFIFO
+    to the driver receive buffers memory.
+    
+    Depending on the size of the received ethernet packet and the size of 
+    each ethernet driver receive buffer, the received packet can take one or more
+    ethernet driver receive buffer. 
+    
+    In below are defined the size of one ethernet driver receive buffer ETH_RX_BUF_SIZE 
+    and the total count of the driver receive buffers ETH_RXBUFNB.
+    
+    The configured value for ETH_RX_BUF_SIZE and ETH_RXBUFNB are only provided as 
+    example, they can be reconfigured in the application layer to fit the application 
+    needs */ 
+   
+/* Here we configure each Ethernet driver receive buffer to fit the Max size Ethernet
+   packet */    
+#ifndef ETH_RX_BUF_SIZE
+ #define ETH_RX_BUF_SIZE         ETH_MAX_PACKET_SIZE 
+#endif
+
+/* 5 Ethernet driver receive buffers are used (in a chained linked list)*/ 
+#ifndef ETH_RXBUFNB
+ #define ETH_RXBUFNB             5     /*  5 Rx buffers of size ETH_RX_BUF_SIZE */
+#endif
+
+
+ /* Ethernet driver transmit buffers are organized in a chained linked-list, when
+    an ethernet packet is transmitted, Tx-DMA will transfer the packet from the 
+    driver transmit buffers memory to the TxFIFO.
+    
+    Depending on the size of the Ethernet packet to be transmitted and the size of 
+    each ethernet driver transmit buffer, the packet to be transmitted can take 
+    one or more ethernet driver transmit buffer. 
+    
+    In below are defined the size of one ethernet driver transmit buffer ETH_TX_BUF_SIZE 
+    and the total count of the driver transmit buffers ETH_TXBUFNB.
+    
+    The configured value for ETH_TX_BUF_SIZE and ETH_TXBUFNB are only provided as 
+    example, they can be reconfigured in the application layer to fit the application 
+    needs */ 
+   
+/* Here we configure each Ethernet driver transmit buffer to fit the Max size Ethernet
+   packet */  
+#ifndef ETH_TX_BUF_SIZE 
+ #define ETH_TX_BUF_SIZE         ETH_MAX_PACKET_SIZE
+#endif
+
+/* 5 ethernet driver transmit buffers are used (in a chained linked list)*/ 
+#ifndef ETH_TXBUFNB
+ #define ETH_TXBUFNB             5      /* 5  Tx buffers of size ETH_TX_BUF_SIZE */
+#endif
+
+#define  ETH_DMARxDesc_FrameLengthShift           16
+
+/**--------------------------------------------------------------------------**/
+/** 
+  * @brief                 Ethernet DMA descriptors registers bits definition
+  */ 
+/**--------------------------------------------------------------------------**/
+
+/**
+@code 
+   DMA Tx Desciptor
+  -----------------------------------------------------------------------------------------------
+  TDES0 | OWN(31) | CTRL[30:26] | Reserved[25:24] | CTRL[23:20] | Reserved[19:17] | Status[16:0] |
+  -----------------------------------------------------------------------------------------------
+  TDES1 | Reserved[31:29] | Buffer2 ByteCount[28:16] | Reserved[15:13] | Buffer1 ByteCount[12:0] |
+  -----------------------------------------------------------------------------------------------
+  TDES2 |                         Buffer1 Address [31:0]                                         |
+  -----------------------------------------------------------------------------------------------
+  TDES3 |                   Buffer2 Address [31:0] / Next Descriptor Address [31:0]              |
+  -----------------------------------------------------------------------------------------------
+@endcode
+*/
+
+/** 
+  * @brief  Bit definition of TDES0 register: DMA Tx descriptor status register
+  */ 
+#define ETH_DMATxDesc_OWN                     ((uint32_t)0x80000000)  /*!< OWN bit: descriptor is owned by DMA engine */
+#define ETH_DMATxDesc_IC                      ((uint32_t)0x40000000)  /*!< Interrupt on Completion */
+#define ETH_DMATxDesc_LS                      ((uint32_t)0x20000000)  /*!< Last Segment */
+#define ETH_DMATxDesc_FS                      ((uint32_t)0x10000000)  /*!< First Segment */
+#define ETH_DMATxDesc_DC                      ((uint32_t)0x08000000)  /*!< Disable CRC */
+#define ETH_DMATxDesc_DP                      ((uint32_t)0x04000000)  /*!< Disable Padding */
+#define ETH_DMATxDesc_TTSE                    ((uint32_t)0x02000000)  /*!< Transmit Time Stamp Enable */
+#define ETH_DMATxDesc_CIC                     ((uint32_t)0x00C00000)  /*!< Checksum Insertion Control: 4 cases */
+#define ETH_DMATxDesc_CIC_ByPass              ((uint32_t)0x00000000)  /*!< Do Nothing: Checksum Engine is bypassed */ 
+#define ETH_DMATxDesc_CIC_IPV4Header          ((uint32_t)0x00400000)  /*!< IPV4 header Checksum Insertion */ 
+#define ETH_DMATxDesc_CIC_TCPUDPICMP_Segment  ((uint32_t)0x00800000)  /*!< TCP/UDP/ICMP Checksum Insertion calculated over segment only */ 
+#define ETH_DMATxDesc_CIC_TCPUDPICMP_Full     ((uint32_t)0x00C00000)  /*!< TCP/UDP/ICMP Checksum Insertion fully calculated */ 
+#define ETH_DMATxDesc_TER                     ((uint32_t)0x00200000)  /*!< Transmit End of Ring */
+#define ETH_DMATxDesc_TCH                     ((uint32_t)0x00100000)  /*!< Second Address Chained */
+#define ETH_DMATxDesc_TTSS                    ((uint32_t)0x00020000)  /*!< Tx Time Stamp Status */
+#define ETH_DMATxDesc_IHE                     ((uint32_t)0x00010000)  /*!< IP Header Error */
+#define ETH_DMATxDesc_ES                      ((uint32_t)0x00008000)  /*!< Error summary: OR of the following bits: UE || ED || EC || LCO || NC || LCA || FF || JT */
+#define ETH_DMATxDesc_JT                      ((uint32_t)0x00004000)  /*!< Jabber Timeout */
+#define ETH_DMATxDesc_FF                      ((uint32_t)0x00002000)  /*!< Frame Flushed: DMA/MTL flushed the frame due to SW flush */
+#define ETH_DMATxDesc_PCE                     ((uint32_t)0x00001000)  /*!< Payload Checksum Error */
+#define ETH_DMATxDesc_LCA                     ((uint32_t)0x00000800)  /*!< Loss of Carrier: carrier lost during transmission */
+#define ETH_DMATxDesc_NC                      ((uint32_t)0x00000400)  /*!< No Carrier: no carrier signal from the transceiver */
+#define ETH_DMATxDesc_LCO                     ((uint32_t)0x00000200)  /*!< Late Collision: transmission aborted due to collision */
+#define ETH_DMATxDesc_EC                      ((uint32_t)0x00000100)  /*!< Excessive Collision: transmission aborted after 16 collisions */
+#define ETH_DMATxDesc_VF                      ((uint32_t)0x00000080)  /*!< VLAN Frame */
+#define ETH_DMATxDesc_CC                      ((uint32_t)0x00000078)  /*!< Collision Count */
+#define ETH_DMATxDesc_ED                      ((uint32_t)0x00000004)  /*!< Excessive Deferral */
+#define ETH_DMATxDesc_UF                      ((uint32_t)0x00000002)  /*!< Underflow Error: late data arrival from the memory */
+#define ETH_DMATxDesc_DB                      ((uint32_t)0x00000001)  /*!< Deferred Bit */
+
+/** 
+  * @brief  Bit definition of TDES1 register
+  */ 
+#define ETH_DMATxDesc_TBS2  ((uint32_t)0x1FFF0000)  /*!< Transmit Buffer2 Size */
+#define ETH_DMATxDesc_TBS1  ((uint32_t)0x00001FFF)  /*!< Transmit Buffer1 Size */
+
+/** 
+  * @brief  Bit definition of TDES2 register
+  */ 
+#define ETH_DMATxDesc_B1AP  ((uint32_t)0xFFFFFFFF)  /*!< Buffer1 Address Pointer */
+
+/** 
+  * @brief  Bit definition of TDES3 register
+  */ 
+#define ETH_DMATxDesc_B2AP  ((uint32_t)0xFFFFFFFF)  /*!< Buffer2 Address Pointer */
+
+  /*---------------------------------------------------------------------------------------------
+  TDES6 |                         Transmit Time Stamp Low [31:0]                                 |
+  -----------------------------------------------------------------------------------------------
+  TDES7 |                         Transmit Time Stamp High [31:0]                                |
+  ----------------------------------------------------------------------------------------------*/
+
+/* Bit definition of TDES6 register */
+ #define ETH_DMAPTPTxDesc_TTSL  ((uint32_t)0xFFFFFFFF)  /* Transmit Time Stamp Low */
+
+/* Bit definition of TDES7 register */
+ #define ETH_DMAPTPTxDesc_TTSH  ((uint32_t)0xFFFFFFFF)  /* Transmit Time Stamp High */
+
+/**
+  * @}
+  */ 
+
+
+/** @defgroup DMA_Rx_descriptor 
+  * @{
+  */
+
+/**
+@code 
+  DMA Rx Descriptor
+  --------------------------------------------------------------------------------------------------------------------
+  RDES0 | OWN(31) |                                             Status [30:0]                                          |
+  ---------------------------------------------------------------------------------------------------------------------
+  RDES1 | CTRL(31) | Reserved[30:29] | Buffer2 ByteCount[28:16] | CTRL[15:14] | Reserved(13) | Buffer1 ByteCount[12:0] |
+  ---------------------------------------------------------------------------------------------------------------------
+  RDES2 |                                       Buffer1 Address [31:0]                                                 |
+  ---------------------------------------------------------------------------------------------------------------------
+  RDES3 |                          Buffer2 Address [31:0] / Next Descriptor Address [31:0]                             |
+  ---------------------------------------------------------------------------------------------------------------------
+@endcode
+*/
+
+/** 
+  * @brief  Bit definition of RDES0 register: DMA Rx descriptor status register
+  */ 
+#define ETH_DMARxDesc_OWN         ((uint32_t)0x80000000)  /*!< OWN bit: descriptor is owned by DMA engine  */
+#define ETH_DMARxDesc_AFM         ((uint32_t)0x40000000)  /*!< DA Filter Fail for the rx frame  */
+#define ETH_DMARxDesc_FL          ((uint32_t)0x3FFF0000)  /*!< Receive descriptor frame length  */
+#define ETH_DMARxDesc_ES          ((uint32_t)0x00008000)  /*!< Error summary: OR of the following bits: DE || OE || IPC || LC || RWT || RE || CE */
+#define ETH_DMARxDesc_DE          ((uint32_t)0x00004000)  /*!< Descriptor error: no more descriptors for receive frame  */
+#define ETH_DMARxDesc_SAF         ((uint32_t)0x00002000)  /*!< SA Filter Fail for the received frame */
+#define ETH_DMARxDesc_LE          ((uint32_t)0x00001000)  /*!< Frame size not matching with length field */
+#define ETH_DMARxDesc_OE          ((uint32_t)0x00000800)  /*!< Overflow Error: Frame was damaged due to buffer overflow */
+#define ETH_DMARxDesc_VLAN        ((uint32_t)0x00000400)  /*!< VLAN Tag: received frame is a VLAN frame */
+#define ETH_DMARxDesc_FS          ((uint32_t)0x00000200)  /*!< First descriptor of the frame  */
+#define ETH_DMARxDesc_LS          ((uint32_t)0x00000100)  /*!< Last descriptor of the frame  */ 
+#define ETH_DMARxDesc_IPV4HCE     ((uint32_t)0x00000080)  /*!< IPC Checksum Error: Rx Ipv4 header checksum error   */    
+#define ETH_DMARxDesc_LC          ((uint32_t)0x00000040)  /*!< Late collision occurred during reception   */
+#define ETH_DMARxDesc_FT          ((uint32_t)0x00000020)  /*!< Frame type - Ethernet, otherwise 802.3    */
+#define ETH_DMARxDesc_RWT         ((uint32_t)0x00000010)  /*!< Receive Watchdog Timeout: watchdog timer expired during reception    */
+#define ETH_DMARxDesc_RE          ((uint32_t)0x00000008)  /*!< Receive error: error reported by MII interface  */
+#define ETH_DMARxDesc_DBE         ((uint32_t)0x00000004)  /*!< Dribble bit error: frame contains non int multiple of 8 bits  */
+#define ETH_DMARxDesc_CE          ((uint32_t)0x00000002)  /*!< CRC error */
+#define ETH_DMARxDesc_MAMPCE      ((uint32_t)0x00000001)  /*!< Rx MAC Address/Payload Checksum Error: Rx MAC address matched/ Rx Payload Checksum Error */
+
+/** 
+  * @brief  Bit definition of RDES1 register
+  */ 
+#define ETH_DMARxDesc_DIC   ((uint32_t)0x80000000)  /*!< Disable Interrupt on Completion */
+#define ETH_DMARxDesc_RBS2  ((uint32_t)0x1FFF0000)  /*!< Receive Buffer2 Size */
+#define ETH_DMARxDesc_RER   ((uint32_t)0x00008000)  /*!< Receive End of Ring */
+#define ETH_DMARxDesc_RCH   ((uint32_t)0x00004000)  /*!< Second Address Chained */
+#define ETH_DMARxDesc_RBS1  ((uint32_t)0x00001FFF)  /*!< Receive Buffer1 Size */
+
+/** 
+  * @brief  Bit definition of RDES2 register  
+  */ 
+#define ETH_DMARxDesc_B1AP  ((uint32_t)0xFFFFFFFF)  /*!< Buffer1 Address Pointer */
+
+/** 
+  * @brief  Bit definition of RDES3 register  
+  */ 
+#define ETH_DMARxDesc_B2AP  ((uint32_t)0xFFFFFFFF)  /*!< Buffer2 Address Pointer */
+
+/*---------------------------------------------------------------------------------------------------------------------
+  RDES4 |                   Reserved[31:15]              |             Extended Status [14:0]                          |
+  ---------------------------------------------------------------------------------------------------------------------
+  RDES5 |                                            Reserved[31:0]                                                    |
+  ---------------------------------------------------------------------------------------------------------------------
+  RDES6 |                                       Receive Time Stamp Low [31:0]                                          |
+  ---------------------------------------------------------------------------------------------------------------------
+  RDES7 |                                       Receive Time Stamp High [31:0]                                         |
+  --------------------------------------------------------------------------------------------------------------------*/
+
+/* Bit definition of RDES4 register */
+#define ETH_DMAPTPRxDesc_PTPV     ((uint32_t)0x00002000)  /* PTP Version */
+#define ETH_DMAPTPRxDesc_PTPFT    ((uint32_t)0x00001000)  /* PTP Frame Type */
+#define ETH_DMAPTPRxDesc_PTPMT    ((uint32_t)0x00000F00)  /* PTP Message Type */
+  #define ETH_DMAPTPRxDesc_PTPMT_Sync                      ((uint32_t)0x00000100)  /* SYNC message (all clock types) */
+  #define ETH_DMAPTPRxDesc_PTPMT_FollowUp                  ((uint32_t)0x00000200)  /* FollowUp message (all clock types) */ 
+  #define ETH_DMAPTPRxDesc_PTPMT_DelayReq                  ((uint32_t)0x00000300)  /* DelayReq message (all clock types) */ 
+  #define ETH_DMAPTPRxDesc_PTPMT_DelayResp                 ((uint32_t)0x00000400)  /* DelayResp message (all clock types) */ 
+  #define ETH_DMAPTPRxDesc_PTPMT_PdelayReq_Announce        ((uint32_t)0x00000500)  /* PdelayReq message (peer-to-peer transparent clock) or Announce message (Ordinary or Boundary clock) */ 
+  #define ETH_DMAPTPRxDesc_PTPMT_PdelayResp_Manag          ((uint32_t)0x00000600)  /* PdelayResp message (peer-to-peer transparent clock) or Management message (Ordinary or Boundary clock)  */ 
+  #define ETH_DMAPTPRxDesc_PTPMT_PdelayRespFollowUp_Signal ((uint32_t)0x00000700)  /* PdelayRespFollowUp message (peer-to-peer transparent clock) or Signaling message (Ordinary or Boundary clock) */           
+#define ETH_DMAPTPRxDesc_IPV6PR   ((uint32_t)0x00000080)  /* IPv6 Packet Received */
+#define ETH_DMAPTPRxDesc_IPV4PR   ((uint32_t)0x00000040)  /* IPv4 Packet Received */
+#define ETH_DMAPTPRxDesc_IPCB  ((uint32_t)0x00000020)  /* IP Checksum Bypassed */
+#define ETH_DMAPTPRxDesc_IPPE  ((uint32_t)0x00000010)  /* IP Payload Error */
+#define ETH_DMAPTPRxDesc_IPHE  ((uint32_t)0x00000008)  /* IP Header Error */
+#define ETH_DMAPTPRxDesc_IPPT  ((uint32_t)0x00000007)  /* IP Payload Type */
+  #define ETH_DMAPTPRxDesc_IPPT_UDP                 ((uint32_t)0x00000001)  /* UDP payload encapsulated in the IP datagram */
+  #define ETH_DMAPTPRxDesc_IPPT_TCP                 ((uint32_t)0x00000002)  /* TCP payload encapsulated in the IP datagram */ 
+  #define ETH_DMAPTPRxDesc_IPPT_ICMP                ((uint32_t)0x00000003)  /* ICMP payload encapsulated in the IP datagram */
+
+/* Bit definition of RDES6 register */
+#define ETH_DMAPTPRxDesc_RTSL  ((uint32_t)0xFFFFFFFF)  /* Receive Time Stamp Low */
+
+/* Bit definition of RDES7 register */
+#define ETH_DMAPTPRxDesc_RTSH  ((uint32_t)0xFFFFFFFF)  /* Receive Time Stamp High */
+
+
+/**--------------------------------------------------------------------------**/
+/** 
+  * @brief                     Description of common PHY registers
+  */ 
+/**--------------------------------------------------------------------------**/
+
+/**
+  * @}
+  */
+
+/** @defgroup PHY_Read_write_Timeouts 
+  * @{
+  */ 
+#define PHY_READ_TO                     ((uint32_t)0x0004FFFF)
+#define PHY_WRITE_TO                    ((uint32_t)0x0004FFFF)
+
+/**
+  * @}
+  */
+
+/** @defgroup PHY_Register_address 
+  * @{
+  */ 
+#define PHY_BCR                          0          /*!< Transceiver Basic Control Register */
+#define PHY_BSR                          1          /*!< Transceiver Basic Status Register */
+
+#define IS_ETH_PHY_ADDRESS(ADDRESS) ((ADDRESS) <= 0x20)
+#define IS_ETH_PHY_REG(REG) (((REG) == PHY_BCR) || \
+                             ((REG) == PHY_BSR) || \
+                             ((REG) == PHY_SR))
+/**
+  * @}
+  */
+
+/** @defgroup PHY_basic_Control_register 
+  * @{
+  */ 
+#define PHY_Reset                       ((uint16_t)0x8000)      /*!< PHY Reset */
+#define PHY_Loopback                    ((uint16_t)0x4000)      /*!< Select loop-back mode */
+#define PHY_FULLDUPLEX_100M             ((uint16_t)0x2100)      /*!< Set the full-duplex mode at 100 Mb/s */
+#define PHY_HALFDUPLEX_100M             ((uint16_t)0x2000)      /*!< Set the half-duplex mode at 100 Mb/s */
+#define PHY_FULLDUPLEX_10M              ((uint16_t)0x0100)      /*!< Set the full-duplex mode at 10 Mb/s */
+#define PHY_HALFDUPLEX_10M              ((uint16_t)0x0000)      /*!< Set the half-duplex mode at 10 Mb/s */
+#define PHY_AutoNegotiation             ((uint16_t)0x1000)      /*!< Enable auto-negotiation function */
+#define PHY_Restart_AutoNegotiation     ((uint16_t)0x0200)      /*!< Restart auto-negotiation function */
+#define PHY_Powerdown                   ((uint16_t)0x0800)      /*!< Select the power down mode */
+#define PHY_Isolate                     ((uint16_t)0x0400)      /*!< Isolate PHY from MII */
+
+/**
+  * @}
+  */
+
+/** @defgroup PHY_basic_status_register 
+  * @{
+  */ 
+#define PHY_AutoNego_Complete           ((uint16_t)0x0020)      /*!< Auto-Negotiation process completed */
+#define PHY_Linked_Status               ((uint16_t)0x0004)      /*!< Valid link established */
+#define PHY_Jabber_detection            ((uint16_t)0x0002)      /*!< Jabber condition detected */
+
+/**
+  * @}
+  */
+
+/**--------------------------------------------------------------------------**/
+/** 
+  * @brief                                  MAC defines
+  */ 
+/**--------------------------------------------------------------------------**/
+
+/** @defgroup ETH_AutoNegotiation 
+  * @{
+  */ 
+#define ETH_AutoNegotiation_Enable     ((uint32_t)0x00000001)
+#define ETH_AutoNegotiation_Disable    ((uint32_t)0x00000000)
+#define IS_ETH_AUTONEGOTIATION(CMD) (((CMD) == ETH_AutoNegotiation_Enable) || \
+                                     ((CMD) == ETH_AutoNegotiation_Disable))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_watchdog 
+  * @{
+  */ 
+#define ETH_Watchdog_Enable       ((uint32_t)0x00000000)
+#define ETH_Watchdog_Disable      ((uint32_t)0x00800000)
+#define IS_ETH_WATCHDOG(CMD) (((CMD) == ETH_Watchdog_Enable) || \
+                              ((CMD) == ETH_Watchdog_Disable))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Jabber 
+  * @{
+  */ 
+#define ETH_Jabber_Enable    ((uint32_t)0x00000000)
+#define ETH_Jabber_Disable   ((uint32_t)0x00400000)
+#define IS_ETH_JABBER(CMD) (((CMD) == ETH_Jabber_Enable) || \
+                            ((CMD) == ETH_Jabber_Disable))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Inter_Frame_Gap 
+  * @{
+  */ 
+#define ETH_InterFrameGap_96Bit   ((uint32_t)0x00000000)  /*!< minimum IFG between frames during transmission is 96Bit */
+#define ETH_InterFrameGap_88Bit   ((uint32_t)0x00020000)  /*!< minimum IFG between frames during transmission is 88Bit */
+#define ETH_InterFrameGap_80Bit   ((uint32_t)0x00040000)  /*!< minimum IFG between frames during transmission is 80Bit */
+#define ETH_InterFrameGap_72Bit   ((uint32_t)0x00060000)  /*!< minimum IFG between frames during transmission is 72Bit */
+#define ETH_InterFrameGap_64Bit   ((uint32_t)0x00080000)  /*!< minimum IFG between frames during transmission is 64Bit */
+#define ETH_InterFrameGap_56Bit   ((uint32_t)0x000A0000)  /*!< minimum IFG between frames during transmission is 56Bit */
+#define ETH_InterFrameGap_48Bit   ((uint32_t)0x000C0000)  /*!< minimum IFG between frames during transmission is 48Bit */
+#define ETH_InterFrameGap_40Bit   ((uint32_t)0x000E0000)  /*!< minimum IFG between frames during transmission is 40Bit */
+#define IS_ETH_INTER_FRAME_GAP(GAP) (((GAP) == ETH_InterFrameGap_96Bit) || \
+                                     ((GAP) == ETH_InterFrameGap_88Bit) || \
+                                     ((GAP) == ETH_InterFrameGap_80Bit) || \
+                                     ((GAP) == ETH_InterFrameGap_72Bit) || \
+                                     ((GAP) == ETH_InterFrameGap_64Bit) || \
+                                     ((GAP) == ETH_InterFrameGap_56Bit) || \
+                                     ((GAP) == ETH_InterFrameGap_48Bit) || \
+                                     ((GAP) == ETH_InterFrameGap_40Bit))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Carrier_Sense 
+  * @{
+  */ 
+#define ETH_CarrierSense_Enable   ((uint32_t)0x00000000)
+#define ETH_CarrierSense_Disable  ((uint32_t)0x00010000)
+#define IS_ETH_CARRIER_SENSE(CMD) (((CMD) == ETH_CarrierSense_Enable) || \
+                                   ((CMD) == ETH_CarrierSense_Disable))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Speed 
+  * @{
+  */ 
+#define ETH_Speed_10M        ((uint32_t)0x00000000)
+#define ETH_Speed_100M       ((uint32_t)0x00004000)
+#define IS_ETH_SPEED(SPEED) (((SPEED) == ETH_Speed_10M) || \
+                             ((SPEED) == ETH_Speed_100M))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Receive_Own 
+  * @{
+  */ 
+#define ETH_ReceiveOwn_Enable     ((uint32_t)0x00000000)
+#define ETH_ReceiveOwn_Disable    ((uint32_t)0x00002000)
+#define IS_ETH_RECEIVE_OWN(CMD) (((CMD) == ETH_ReceiveOwn_Enable) || \
+                                 ((CMD) == ETH_ReceiveOwn_Disable))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Loop_Back_Mode 
+  * @{
+  */ 
+#define ETH_LoopbackMode_Enable        ((uint32_t)0x00001000)
+#define ETH_LoopbackMode_Disable       ((uint32_t)0x00000000)
+#define IS_ETH_LOOPBACK_MODE(CMD) (((CMD) == ETH_LoopbackMode_Enable) || \
+                                   ((CMD) == ETH_LoopbackMode_Disable))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Duplex_Mode 
+  * @{
+  */ 
+#define ETH_Mode_FullDuplex       ((uint32_t)0x00000800)
+#define ETH_Mode_HalfDuplex       ((uint32_t)0x00000000)
+#define IS_ETH_DUPLEX_MODE(MODE) (((MODE) == ETH_Mode_FullDuplex) || \
+                                  ((MODE) == ETH_Mode_HalfDuplex))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Checksum_Offload 
+  * @{
+  */ 
+#define ETH_ChecksumOffload_Enable     ((uint32_t)0x00000400)
+#define ETH_ChecksumOffload_Disable    ((uint32_t)0x00000000)
+#define IS_ETH_CHECKSUM_OFFLOAD(CMD) (((CMD) == ETH_ChecksumOffload_Enable) || \
+                                      ((CMD) == ETH_ChecksumOffload_Disable))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Retry_Transmission 
+  * @{
+  */ 
+#define ETH_RetryTransmission_Enable   ((uint32_t)0x00000000)
+#define ETH_RetryTransmission_Disable  ((uint32_t)0x00000200)
+#define IS_ETH_RETRY_TRANSMISSION(CMD) (((CMD) == ETH_RetryTransmission_Enable) || \
+                                        ((CMD) == ETH_RetryTransmission_Disable))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Automatic_Pad_CRC_Strip 
+  * @{
+  */ 
+#define ETH_AutomaticPadCRCStrip_Enable     ((uint32_t)0x00000080)
+#define ETH_AutomaticPadCRCStrip_Disable    ((uint32_t)0x00000000)
+#define IS_ETH_AUTOMATIC_PADCRC_STRIP(CMD) (((CMD) == ETH_AutomaticPadCRCStrip_Enable) || \
+                                            ((CMD) == ETH_AutomaticPadCRCStrip_Disable))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Back_Off_Limit 
+  * @{
+  */ 
+#define ETH_BackOffLimit_10  ((uint32_t)0x00000000)
+#define ETH_BackOffLimit_8   ((uint32_t)0x00000020)
+#define ETH_BackOffLimit_4   ((uint32_t)0x00000040)
+#define ETH_BackOffLimit_1   ((uint32_t)0x00000060)
+#define IS_ETH_BACKOFF_LIMIT(LIMIT) (((LIMIT) == ETH_BackOffLimit_10) || \
+                                     ((LIMIT) == ETH_BackOffLimit_8) || \
+                                     ((LIMIT) == ETH_BackOffLimit_4) || \
+                                     ((LIMIT) == ETH_BackOffLimit_1))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Deferral_Check 
+  * @{
+  */
+#define ETH_DeferralCheck_Enable       ((uint32_t)0x00000010)
+#define ETH_DeferralCheck_Disable      ((uint32_t)0x00000000)
+#define IS_ETH_DEFERRAL_CHECK(CMD) (((CMD) == ETH_DeferralCheck_Enable) || \
+                                    ((CMD) == ETH_DeferralCheck_Disable))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Receive_All 
+  * @{
+  */ 
+#define ETH_ReceiveAll_Enable     ((uint32_t)0x80000000)
+#define ETH_ReceiveAll_Disable    ((uint32_t)0x00000000)
+#define IS_ETH_RECEIVE_ALL(CMD) (((CMD) == ETH_ReceiveAll_Enable) || \
+                                 ((CMD) == ETH_ReceiveAll_Disable))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Source_Addr_Filter 
+  * @{
+  */ 
+#define ETH_SourceAddrFilter_Normal_Enable       ((uint32_t)0x00000200)
+#define ETH_SourceAddrFilter_Inverse_Enable      ((uint32_t)0x00000300)
+#define ETH_SourceAddrFilter_Disable             ((uint32_t)0x00000000)
+#define IS_ETH_SOURCE_ADDR_FILTER(CMD) (((CMD) == ETH_SourceAddrFilter_Normal_Enable) || \
+                                        ((CMD) == ETH_SourceAddrFilter_Inverse_Enable) || \
+                                        ((CMD) == ETH_SourceAddrFilter_Disable))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Pass_Control_Frames 
+  * @{
+  */ 
+#define ETH_PassControlFrames_BlockAll                ((uint32_t)0x00000040)  /*!< MAC filters all control frames from reaching the application */
+#define ETH_PassControlFrames_ForwardAll              ((uint32_t)0x00000080)  /*!< MAC forwards all control frames to application even if they fail the Address Filter */
+#define ETH_PassControlFrames_ForwardPassedAddrFilter ((uint32_t)0x000000C0)  /*!< MAC forwards control frames that pass the Address Filter. */ 
+#define IS_ETH_CONTROL_FRAMES(PASS) (((PASS) == ETH_PassControlFrames_BlockAll) || \
+                                     ((PASS) == ETH_PassControlFrames_ForwardAll) || \
+                                     ((PASS) == ETH_PassControlFrames_ForwardPassedAddrFilter))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Broadcast_Frames_Reception 
+  * @{
+  */ 
+#define ETH_BroadcastFramesReception_Enable      ((uint32_t)0x00000000)
+#define ETH_BroadcastFramesReception_Disable     ((uint32_t)0x00000020)
+#define IS_ETH_BROADCAST_FRAMES_RECEPTION(CMD) (((CMD) == ETH_BroadcastFramesReception_Enable) || \
+                                                ((CMD) == ETH_BroadcastFramesReception_Disable))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Destination_Addr_Filter 
+  * @{
+  */ 
+#define ETH_DestinationAddrFilter_Normal    ((uint32_t)0x00000000)
+#define ETH_DestinationAddrFilter_Inverse   ((uint32_t)0x00000008)
+#define IS_ETH_DESTINATION_ADDR_FILTER(FILTER) (((FILTER) == ETH_DestinationAddrFilter_Normal) || \
+                                                ((FILTER) == ETH_DestinationAddrFilter_Inverse))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Promiscuous_Mode 
+  * @{
+  */ 
+#define ETH_PromiscuousMode_Enable     ((uint32_t)0x00000001)
+#define ETH_PromiscuousMode_Disable    ((uint32_t)0x00000000)
+#define IS_ETH_PROMISCUOUS_MODE(CMD) (((CMD) == ETH_PromiscuousMode_Enable) || \
+                                      ((CMD) == ETH_PromiscuousMode_Disable))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Multicast_Frames_Filter 
+  * @{
+  */ 
+#define ETH_MulticastFramesFilter_PerfectHashTable    ((uint32_t)0x00000404)
+#define ETH_MulticastFramesFilter_HashTable           ((uint32_t)0x00000004)
+#define ETH_MulticastFramesFilter_Perfect             ((uint32_t)0x00000000)
+#define ETH_MulticastFramesFilter_None                ((uint32_t)0x00000010)
+#define IS_ETH_MULTICAST_FRAMES_FILTER(FILTER) (((FILTER) == ETH_MulticastFramesFilter_PerfectHashTable) || \
+                                                ((FILTER) == ETH_MulticastFramesFilter_HashTable) || \
+                                                ((FILTER) == ETH_MulticastFramesFilter_Perfect) || \
+                                                ((FILTER) == ETH_MulticastFramesFilter_None))
+                                                     
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Unicast_Frames_Filter 
+  * @{
+  */ 
+#define ETH_UnicastFramesFilter_PerfectHashTable ((uint32_t)0x00000402)
+#define ETH_UnicastFramesFilter_HashTable        ((uint32_t)0x00000002)
+#define ETH_UnicastFramesFilter_Perfect          ((uint32_t)0x00000000)
+#define IS_ETH_UNICAST_FRAMES_FILTER(FILTER) (((FILTER) == ETH_UnicastFramesFilter_PerfectHashTable) || \
+                                              ((FILTER) == ETH_UnicastFramesFilter_HashTable) || \
+                                              ((FILTER) == ETH_UnicastFramesFilter_Perfect))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Pause_Time 
+  * @{
+  */ 
+#define IS_ETH_PAUSE_TIME(TIME) ((TIME) <= 0xFFFF)
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Zero_Quanta_Pause 
+  * @{
+  */ 
+#define ETH_ZeroQuantaPause_Enable     ((uint32_t)0x00000000)
+#define ETH_ZeroQuantaPause_Disable    ((uint32_t)0x00000080)
+#define IS_ETH_ZEROQUANTA_PAUSE(CMD)   (((CMD) == ETH_ZeroQuantaPause_Enable) || \
+                                        ((CMD) == ETH_ZeroQuantaPause_Disable))
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Pause_Low_Threshold 
+  * @{
+  */ 
+#define ETH_PauseLowThreshold_Minus4        ((uint32_t)0x00000000)  /*!< Pause time minus 4 slot times */
+#define ETH_PauseLowThreshold_Minus28       ((uint32_t)0x00000010)  /*!< Pause time minus 28 slot times */
+#define ETH_PauseLowThreshold_Minus144      ((uint32_t)0x00000020)  /*!< Pause time minus 144 slot times */
+#define ETH_PauseLowThreshold_Minus256      ((uint32_t)0x00000030)  /*!< Pause time minus 256 slot times */
+#define IS_ETH_PAUSE_LOW_THRESHOLD(THRESHOLD) (((THRESHOLD) == ETH_PauseLowThreshold_Minus4) || \
+                                               ((THRESHOLD) == ETH_PauseLowThreshold_Minus28) || \
+                                               ((THRESHOLD) == ETH_PauseLowThreshold_Minus144) || \
+                                               ((THRESHOLD) == ETH_PauseLowThreshold_Minus256))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Unicast_Pause_Frame_Detect 
+  * @{
+  */ 
+#define ETH_UnicastPauseFrameDetect_Enable  ((uint32_t)0x00000008)
+#define ETH_UnicastPauseFrameDetect_Disable ((uint32_t)0x00000000)
+#define IS_ETH_UNICAST_PAUSE_FRAME_DETECT(CMD) (((CMD) == ETH_UnicastPauseFrameDetect_Enable) || \
+                                                ((CMD) == ETH_UnicastPauseFrameDetect_Disable))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Receive_Flow_Control 
+  * @{
+  */ 
+#define ETH_ReceiveFlowControl_Enable       ((uint32_t)0x00000004)
+#define ETH_ReceiveFlowControl_Disable      ((uint32_t)0x00000000)
+#define IS_ETH_RECEIVE_FLOWCONTROL(CMD) (((CMD) == ETH_ReceiveFlowControl_Enable) || \
+                                         ((CMD) == ETH_ReceiveFlowControl_Disable))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Transmit_Flow_Control 
+  * @{
+  */ 
+#define ETH_TransmitFlowControl_Enable      ((uint32_t)0x00000002)
+#define ETH_TransmitFlowControl_Disable     ((uint32_t)0x00000000)
+#define IS_ETH_TRANSMIT_FLOWCONTROL(CMD) (((CMD) == ETH_TransmitFlowControl_Enable) || \
+                                          ((CMD) == ETH_TransmitFlowControl_Disable))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_VLAN_Tag_Comparison 
+  * @{
+  */ 
+#define ETH_VLANTagComparison_12Bit    ((uint32_t)0x00010000)
+#define ETH_VLANTagComparison_16Bit    ((uint32_t)0x00000000)
+#define IS_ETH_VLAN_TAG_COMPARISON(COMPARISON) (((COMPARISON) == ETH_VLANTagComparison_12Bit) || \
+                                                ((COMPARISON) == ETH_VLANTagComparison_16Bit))
+#define IS_ETH_VLAN_TAG_IDENTIFIER(IDENTIFIER) ((IDENTIFIER) <= 0xFFFF)
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_MAC_Flags 
+  * @{
+  */ 
+#define ETH_MAC_FLAG_TST     ((uint32_t)0x00000200)  /*!< Time stamp trigger flag (on MAC) */
+#define ETH_MAC_FLAG_MMCT    ((uint32_t)0x00000040)  /*!< MMC transmit flag  */
+#define ETH_MAC_FLAG_MMCR    ((uint32_t)0x00000020)  /*!< MMC receive flag */
+#define ETH_MAC_FLAG_MMC     ((uint32_t)0x00000010)  /*!< MMC flag (on MAC) */
+#define ETH_MAC_FLAG_PMT     ((uint32_t)0x00000008)  /*!< PMT flag (on MAC) */
+#define IS_ETH_MAC_GET_FLAG(FLAG) (((FLAG) == ETH_MAC_FLAG_TST) || ((FLAG) == ETH_MAC_FLAG_MMCT) || \
+                                   ((FLAG) == ETH_MAC_FLAG_MMCR) || ((FLAG) == ETH_MAC_FLAG_MMC) || \
+                                   ((FLAG) == ETH_MAC_FLAG_PMT))
+/**
+  * @}
+  */
+
+/** @defgroup ETH_MAC_Interrupts 
+  * @{
+  */ 
+#define ETH_MAC_IT_TST       ((uint32_t)0x00000200)  /*!< Time stamp trigger interrupt (on MAC) */
+#define ETH_MAC_IT_MMCT      ((uint32_t)0x00000040)  /*!< MMC transmit interrupt */
+#define ETH_MAC_IT_MMCR      ((uint32_t)0x00000020)  /*!< MMC receive interrupt */
+#define ETH_MAC_IT_MMC       ((uint32_t)0x00000010)  /*!< MMC interrupt (on MAC) */
+#define ETH_MAC_IT_PMT       ((uint32_t)0x00000008)  /*!< PMT interrupt (on MAC) */
+#define IS_ETH_MAC_IT(IT) ((((IT) & (uint32_t)0xFFFFFDF7) == 0x00) && ((IT) != 0x00))
+#define IS_ETH_MAC_GET_IT(IT) (((IT) == ETH_MAC_IT_TST) || ((IT) == ETH_MAC_IT_MMCT) || \
+                               ((IT) == ETH_MAC_IT_MMCR) || ((IT) == ETH_MAC_IT_MMC) || \
+                               ((IT) == ETH_MAC_IT_PMT))
+/**
+  * @}
+  */
+
+/** @defgroup ETH_MAC_addresses 
+  * @{
+  */ 
+#define ETH_MAC_Address0     ((uint32_t)0x00000000)
+#define ETH_MAC_Address1     ((uint32_t)0x00000008)
+#define ETH_MAC_Address2     ((uint32_t)0x00000010)
+#define ETH_MAC_Address3     ((uint32_t)0x00000018)
+#define IS_ETH_MAC_ADDRESS0123(ADDRESS) (((ADDRESS) == ETH_MAC_Address0) || \
+                                         ((ADDRESS) == ETH_MAC_Address1) || \
+                                         ((ADDRESS) == ETH_MAC_Address2) || \
+                                         ((ADDRESS) == ETH_MAC_Address3))
+#define IS_ETH_MAC_ADDRESS123(ADDRESS) (((ADDRESS) == ETH_MAC_Address1) || \
+                                        ((ADDRESS) == ETH_MAC_Address2) || \
+                                        ((ADDRESS) == ETH_MAC_Address3))
+/**
+  * @}
+  */
+
+/** @defgroup ETH_MAC_addresses_filter_SA_DA_filed_of_received_frames 
+  * @{
+  */ 
+#define ETH_MAC_AddressFilter_SA       ((uint32_t)0x00000000)
+#define ETH_MAC_AddressFilter_DA       ((uint32_t)0x00000008)
+#define IS_ETH_MAC_ADDRESS_FILTER(FILTER) (((FILTER) == ETH_MAC_AddressFilter_SA) || \
+                                           ((FILTER) == ETH_MAC_AddressFilter_DA))
+/**
+  * @}
+  */
+
+/** @defgroup ETH_MAC_addresses_filter_Mask_bytes 
+  * @{
+  */ 
+#define ETH_MAC_AddressMask_Byte6      ((uint32_t)0x20000000)  /*!< Mask MAC Address high reg bits [15:8] */
+#define ETH_MAC_AddressMask_Byte5      ((uint32_t)0x10000000)  /*!< Mask MAC Address high reg bits [7:0] */
+#define ETH_MAC_AddressMask_Byte4      ((uint32_t)0x08000000)  /*!< Mask MAC Address low reg bits [31:24] */
+#define ETH_MAC_AddressMask_Byte3      ((uint32_t)0x04000000)  /*!< Mask MAC Address low reg bits [23:16] */
+#define ETH_MAC_AddressMask_Byte2      ((uint32_t)0x02000000)  /*!< Mask MAC Address low reg bits [15:8] */
+#define ETH_MAC_AddressMask_Byte1      ((uint32_t)0x01000000)  /*!< Mask MAC Address low reg bits [70] */
+#define IS_ETH_MAC_ADDRESS_MASK(MASK) (((MASK) == ETH_MAC_AddressMask_Byte6) || \
+                                       ((MASK) == ETH_MAC_AddressMask_Byte5) || \
+                                       ((MASK) == ETH_MAC_AddressMask_Byte4) || \
+                                       ((MASK) == ETH_MAC_AddressMask_Byte3) || \
+                                       ((MASK) == ETH_MAC_AddressMask_Byte2) || \
+                                       ((MASK) == ETH_MAC_AddressMask_Byte1))
+
+/**--------------------------------------------------------------------------**/
+/** 
+  * @brief                      Ethernet DMA Descriptors defines
+  */ 
+/**--------------------------------------------------------------------------**/
+/**
+  * @}
+  */
+
+/** @defgroup ETH_DMA_Tx_descriptor_flags
+  * @{
+  */ 
+#define IS_ETH_DMATxDESC_GET_FLAG(FLAG) (((FLAG) == ETH_DMATxDesc_OWN) || \
+                                         ((FLAG) == ETH_DMATxDesc_IC) || \
+                                         ((FLAG) == ETH_DMATxDesc_LS) || \
+                                         ((FLAG) == ETH_DMATxDesc_FS) || \
+                                         ((FLAG) == ETH_DMATxDesc_DC) || \
+                                         ((FLAG) == ETH_DMATxDesc_DP) || \
+                                         ((FLAG) == ETH_DMATxDesc_TTSE) || \
+                                         ((FLAG) == ETH_DMATxDesc_TER) || \
+                                         ((FLAG) == ETH_DMATxDesc_TCH) || \
+                                         ((FLAG) == ETH_DMATxDesc_TTSS) || \
+                                         ((FLAG) == ETH_DMATxDesc_IHE) || \
+                                         ((FLAG) == ETH_DMATxDesc_ES) || \
+                                         ((FLAG) == ETH_DMATxDesc_JT) || \
+                                         ((FLAG) == ETH_DMATxDesc_FF) || \
+                                         ((FLAG) == ETH_DMATxDesc_PCE) || \
+                                         ((FLAG) == ETH_DMATxDesc_LCA) || \
+                                         ((FLAG) == ETH_DMATxDesc_NC) || \
+                                         ((FLAG) == ETH_DMATxDesc_LCO) || \
+                                         ((FLAG) == ETH_DMATxDesc_EC) || \
+                                         ((FLAG) == ETH_DMATxDesc_VF) || \
+                                         ((FLAG) == ETH_DMATxDesc_CC) || \
+                                         ((FLAG) == ETH_DMATxDesc_ED) || \
+                                         ((FLAG) == ETH_DMATxDesc_UF) || \
+                                         ((FLAG) == ETH_DMATxDesc_DB))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_DMA_Tx_descriptor_segment 
+  * @{
+  */ 
+#define ETH_DMATxDesc_LastSegment      ((uint32_t)0x40000000)  /*!< Last Segment */
+#define ETH_DMATxDesc_FirstSegment     ((uint32_t)0x20000000)  /*!< First Segment */
+#define IS_ETH_DMA_TXDESC_SEGMENT(SEGMENT) (((SEGMENT) == ETH_DMATxDesc_LastSegment) || \
+                                            ((SEGMENT) == ETH_DMATxDesc_FirstSegment))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_DMA_Tx_descriptor_Checksum_Insertion_Control
+  * @{
+  */ 
+#define ETH_DMATxDesc_ChecksumByPass             ((uint32_t)0x00000000)   /*!< Checksum engine bypass */
+#define ETH_DMATxDesc_ChecksumIPV4Header         ((uint32_t)0x00400000)   /*!< IPv4 header checksum insertion  */
+#define ETH_DMATxDesc_ChecksumTCPUDPICMPSegment  ((uint32_t)0x00800000)   /*!< TCP/UDP/ICMP checksum insertion. Pseudo header checksum is assumed to be present */
+#define ETH_DMATxDesc_ChecksumTCPUDPICMPFull     ((uint32_t)0x00C00000)   /*!< TCP/UDP/ICMP checksum fully in hardware including pseudo header */
+#define IS_ETH_DMA_TXDESC_CHECKSUM(CHECKSUM) (((CHECKSUM) == ETH_DMATxDesc_ChecksumByPass) || \
+                                              ((CHECKSUM) == ETH_DMATxDesc_ChecksumIPV4Header) || \
+                                              ((CHECKSUM) == ETH_DMATxDesc_ChecksumTCPUDPICMPSegment) || \
+                                              ((CHECKSUM) == ETH_DMATxDesc_ChecksumTCPUDPICMPFull))
+/** 
+  * @brief  ETH DMA Tx Desciptor buffer size
+  */ 
+#define IS_ETH_DMATxDESC_BUFFER_SIZE(SIZE) ((SIZE) <= 0x1FFF)
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_DMA_Rx_descriptor_flags
+  * @{
+  */ 
+#define IS_ETH_DMARxDESC_GET_FLAG(FLAG) (((FLAG) == ETH_DMARxDesc_OWN) || \
+                                         ((FLAG) == ETH_DMARxDesc_AFM) || \
+                                         ((FLAG) == ETH_DMARxDesc_ES) || \
+                                         ((FLAG) == ETH_DMARxDesc_DE) || \
+                                         ((FLAG) == ETH_DMARxDesc_SAF) || \
+                                         ((FLAG) == ETH_DMARxDesc_LE) || \
+                                         ((FLAG) == ETH_DMARxDesc_OE) || \
+                                         ((FLAG) == ETH_DMARxDesc_VLAN) || \
+                                         ((FLAG) == ETH_DMARxDesc_FS) || \
+                                         ((FLAG) == ETH_DMARxDesc_LS) || \
+                                         ((FLAG) == ETH_DMARxDesc_IPV4HCE) || \
+                                         ((FLAG) == ETH_DMARxDesc_LC) || \
+                                         ((FLAG) == ETH_DMARxDesc_FT) || \
+                                         ((FLAG) == ETH_DMARxDesc_RWT) || \
+                                         ((FLAG) == ETH_DMARxDesc_RE) || \
+                                         ((FLAG) == ETH_DMARxDesc_DBE) || \
+                                         ((FLAG) == ETH_DMARxDesc_CE) || \
+                                         ((FLAG) == ETH_DMARxDesc_MAMPCE))
+
+/* ETHERNET DMA PTP Rx descriptor extended flags  --------------------------------*/
+#define IS_ETH_DMAPTPRxDESC_GET_EXTENDED_FLAG(FLAG) (((FLAG) == ETH_DMAPTPRxDesc_PTPV) || \
+                                                     ((FLAG) == ETH_DMAPTPRxDesc_PTPFT) || \
+                                                     ((FLAG) == ETH_DMAPTPRxDesc_PTPMT) || \
+                                                     ((FLAG) == ETH_DMAPTPRxDesc_IPV6PR) || \
+                                                     ((FLAG) == ETH_DMAPTPRxDesc_IPV4PR) || \
+                                                     ((FLAG) == ETH_DMAPTPRxDesc_IPCB) || \
+                                                     ((FLAG) == ETH_DMAPTPRxDesc_IPPE) || \
+                                                     ((FLAG) == ETH_DMAPTPRxDesc_IPHE) || \
+                                                     ((FLAG) == ETH_DMAPTPRxDesc_IPPT))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_DMA_Rx_descriptor_buffers_ 
+  * @{
+  */ 
+#define ETH_DMARxDesc_Buffer1     ((uint32_t)0x00000000)  /*!< DMA Rx Desc Buffer1 */
+#define ETH_DMARxDesc_Buffer2     ((uint32_t)0x00000001)  /*!< DMA Rx Desc Buffer2 */
+#define IS_ETH_DMA_RXDESC_BUFFER(BUFFER) (((BUFFER) == ETH_DMARxDesc_Buffer1) || \
+                                          ((BUFFER) == ETH_DMARxDesc_Buffer2))
+
+/**--------------------------------------------------------------------------**/
+/** 
+  * @brief                           Ethernet DMA defines
+  */ 
+/**--------------------------------------------------------------------------**/
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Drop_TCP_IP_Checksum_Error_Frame 
+  * @{
+  */ 
+#define ETH_DropTCPIPChecksumErrorFrame_Enable   ((uint32_t)0x00000000)
+#define ETH_DropTCPIPChecksumErrorFrame_Disable  ((uint32_t)0x04000000)
+#define IS_ETH_DROP_TCPIP_CHECKSUM_FRAME(CMD) (((CMD) == ETH_DropTCPIPChecksumErrorFrame_Enable) || \
+                                               ((CMD) == ETH_DropTCPIPChecksumErrorFrame_Disable))
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Receive_Store_Forward 
+  * @{
+  */ 
+#define ETH_ReceiveStoreForward_Enable      ((uint32_t)0x02000000)
+#define ETH_ReceiveStoreForward_Disable     ((uint32_t)0x00000000)
+#define IS_ETH_RECEIVE_STORE_FORWARD(CMD) (((CMD) == ETH_ReceiveStoreForward_Enable) || \
+                                           ((CMD) == ETH_ReceiveStoreForward_Disable))
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Flush_Received_Frame 
+  * @{
+  */ 
+#define ETH_FlushReceivedFrame_Enable       ((uint32_t)0x00000000)
+#define ETH_FlushReceivedFrame_Disable      ((uint32_t)0x01000000)
+#define IS_ETH_FLUSH_RECEIVE_FRAME(CMD) (((CMD) == ETH_FlushReceivedFrame_Enable) || \
+                                         ((CMD) == ETH_FlushReceivedFrame_Disable))
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Transmit_Store_Forward 
+  * @{
+  */ 
+#define ETH_TransmitStoreForward_Enable     ((uint32_t)0x00200000)
+#define ETH_TransmitStoreForward_Disable    ((uint32_t)0x00000000)
+#define IS_ETH_TRANSMIT_STORE_FORWARD(CMD) (((CMD) == ETH_TransmitStoreForward_Enable) || \
+                                            ((CMD) == ETH_TransmitStoreForward_Disable))
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Transmit_Threshold_Control 
+  * @{
+  */ 
+#define ETH_TransmitThresholdControl_64Bytes     ((uint32_t)0x00000000)  /*!< threshold level of the MTL Transmit FIFO is 64 Bytes */
+#define ETH_TransmitThresholdControl_128Bytes    ((uint32_t)0x00004000)  /*!< threshold level of the MTL Transmit FIFO is 128 Bytes */
+#define ETH_TransmitThresholdControl_192Bytes    ((uint32_t)0x00008000)  /*!< threshold level of the MTL Transmit FIFO is 192 Bytes */
+#define ETH_TransmitThresholdControl_256Bytes    ((uint32_t)0x0000C000)  /*!< threshold level of the MTL Transmit FIFO is 256 Bytes */
+#define ETH_TransmitThresholdControl_40Bytes     ((uint32_t)0x00010000)  /*!< threshold level of the MTL Transmit FIFO is 40 Bytes */
+#define ETH_TransmitThresholdControl_32Bytes     ((uint32_t)0x00014000)  /*!< threshold level of the MTL Transmit FIFO is 32 Bytes */
+#define ETH_TransmitThresholdControl_24Bytes     ((uint32_t)0x00018000)  /*!< threshold level of the MTL Transmit FIFO is 24 Bytes */
+#define ETH_TransmitThresholdControl_16Bytes     ((uint32_t)0x0001C000)  /*!< threshold level of the MTL Transmit FIFO is 16 Bytes */
+#define IS_ETH_TRANSMIT_THRESHOLD_CONTROL(THRESHOLD) (((THRESHOLD) == ETH_TransmitThresholdControl_64Bytes) || \
+                                                      ((THRESHOLD) == ETH_TransmitThresholdControl_128Bytes) || \
+                                                      ((THRESHOLD) == ETH_TransmitThresholdControl_192Bytes) || \
+                                                      ((THRESHOLD) == ETH_TransmitThresholdControl_256Bytes) || \
+                                                      ((THRESHOLD) == ETH_TransmitThresholdControl_40Bytes) || \
+                                                      ((THRESHOLD) == ETH_TransmitThresholdControl_32Bytes) || \
+                                                      ((THRESHOLD) == ETH_TransmitThresholdControl_24Bytes) || \
+                                                      ((THRESHOLD) == ETH_TransmitThresholdControl_16Bytes))
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Forward_Error_Frames 
+  * @{
+  */ 
+#define ETH_ForwardErrorFrames_Enable       ((uint32_t)0x00000080)
+#define ETH_ForwardErrorFrames_Disable      ((uint32_t)0x00000000)
+#define IS_ETH_FORWARD_ERROR_FRAMES(CMD) (((CMD) == ETH_ForwardErrorFrames_Enable) || \
+                                          ((CMD) == ETH_ForwardErrorFrames_Disable))
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Forward_Undersized_Good_Frames 
+  * @{
+  */ 
+#define ETH_ForwardUndersizedGoodFrames_Enable   ((uint32_t)0x00000040)
+#define ETH_ForwardUndersizedGoodFrames_Disable  ((uint32_t)0x00000000)     
+#define IS_ETH_FORWARD_UNDERSIZED_GOOD_FRAMES(CMD) (((CMD) == ETH_ForwardUndersizedGoodFrames_Enable) || \
+                                                    ((CMD) == ETH_ForwardUndersizedGoodFrames_Disable))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Receive_Threshold_Control 
+  * @{
+  */ 
+#define ETH_ReceiveThresholdControl_64Bytes      ((uint32_t)0x00000000)  /*!< threshold level of the MTL Receive FIFO is 64 Bytes */
+#define ETH_ReceiveThresholdControl_32Bytes      ((uint32_t)0x00000008)  /*!< threshold level of the MTL Receive FIFO is 32 Bytes */
+#define ETH_ReceiveThresholdControl_96Bytes      ((uint32_t)0x00000010)  /*!< threshold level of the MTL Receive FIFO is 96 Bytes */
+#define ETH_ReceiveThresholdControl_128Bytes     ((uint32_t)0x00000018)  /*!< threshold level of the MTL Receive FIFO is 128 Bytes */
+#define IS_ETH_RECEIVE_THRESHOLD_CONTROL(THRESHOLD) (((THRESHOLD) == ETH_ReceiveThresholdControl_64Bytes) || \
+                                                     ((THRESHOLD) == ETH_ReceiveThresholdControl_32Bytes) || \
+                                                     ((THRESHOLD) == ETH_ReceiveThresholdControl_96Bytes) || \
+                                                     ((THRESHOLD) == ETH_ReceiveThresholdControl_128Bytes))
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Second_Frame_Operate 
+  * @{
+  */ 
+#define ETH_SecondFrameOperate_Enable       ((uint32_t)0x00000004)
+#define ETH_SecondFrameOperate_Disable      ((uint32_t)0x00000000)  
+#define IS_ETH_SECOND_FRAME_OPERATE(CMD) (((CMD) == ETH_SecondFrameOperate_Enable) || \
+                                          ((CMD) == ETH_SecondFrameOperate_Disable))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Address_Aligned_Beats 
+  * @{
+  */ 
+#define ETH_AddressAlignedBeats_Enable      ((uint32_t)0x02000000)
+#define ETH_AddressAlignedBeats_Disable     ((uint32_t)0x00000000) 
+#define IS_ETH_ADDRESS_ALIGNED_BEATS(CMD) (((CMD) == ETH_AddressAlignedBeats_Enable) || \
+                                           ((CMD) == ETH_AddressAlignedBeats_Disable))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Fixed_Burst 
+  * @{
+  */ 
+#define ETH_FixedBurst_Enable     ((uint32_t)0x00010000)
+#define ETH_FixedBurst_Disable    ((uint32_t)0x00000000) 
+#define IS_ETH_FIXED_BURST(CMD) (((CMD) == ETH_FixedBurst_Enable) || \
+                                 ((CMD) == ETH_FixedBurst_Disable))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Rx_DMA_Burst_Length 
+  * @{
+  */ 
+#define ETH_RxDMABurstLength_1Beat          ((uint32_t)0x00020000)  /*!< maximum number of beats to be transferred in one RxDMA transaction is 1 */
+#define ETH_RxDMABurstLength_2Beat          ((uint32_t)0x00040000)  /*!< maximum number of beats to be transferred in one RxDMA transaction is 2 */
+#define ETH_RxDMABurstLength_4Beat          ((uint32_t)0x00080000)  /*!< maximum number of beats to be transferred in one RxDMA transaction is 4 */
+#define ETH_RxDMABurstLength_8Beat          ((uint32_t)0x00100000)  /*!< maximum number of beats to be transferred in one RxDMA transaction is 8 */
+#define ETH_RxDMABurstLength_16Beat         ((uint32_t)0x00200000)  /*!< maximum number of beats to be transferred in one RxDMA transaction is 16 */
+#define ETH_RxDMABurstLength_32Beat         ((uint32_t)0x00400000)  /*!< maximum number of beats to be transferred in one RxDMA transaction is 32 */                
+#define ETH_RxDMABurstLength_4xPBL_4Beat    ((uint32_t)0x01020000)  /*!< maximum number of beats to be transferred in one RxDMA transaction is 4 */
+#define ETH_RxDMABurstLength_4xPBL_8Beat    ((uint32_t)0x01040000)  /*!< maximum number of beats to be transferred in one RxDMA transaction is 8 */
+#define ETH_RxDMABurstLength_4xPBL_16Beat   ((uint32_t)0x01080000)  /*!< maximum number of beats to be transferred in one RxDMA transaction is 16 */
+#define ETH_RxDMABurstLength_4xPBL_32Beat   ((uint32_t)0x01100000)  /*!< maximum number of beats to be transferred in one RxDMA transaction is 32 */
+#define ETH_RxDMABurstLength_4xPBL_64Beat   ((uint32_t)0x01200000)  /*!< maximum number of beats to be transferred in one RxDMA transaction is 64 */
+#define ETH_RxDMABurstLength_4xPBL_128Beat  ((uint32_t)0x01400000)  /*!< maximum number of beats to be transferred in one RxDMA transaction is 128 */
+
+#define IS_ETH_RXDMA_BURST_LENGTH(LENGTH) (((LENGTH) == ETH_RxDMABurstLength_1Beat) || \
+                                           ((LENGTH) == ETH_RxDMABurstLength_2Beat) || \
+                                           ((LENGTH) == ETH_RxDMABurstLength_4Beat) || \
+                                           ((LENGTH) == ETH_RxDMABurstLength_8Beat) || \
+                                           ((LENGTH) == ETH_RxDMABurstLength_16Beat) || \
+                                           ((LENGTH) == ETH_RxDMABurstLength_32Beat) || \
+                                           ((LENGTH) == ETH_RxDMABurstLength_4xPBL_4Beat) || \
+                                           ((LENGTH) == ETH_RxDMABurstLength_4xPBL_8Beat) || \
+                                           ((LENGTH) == ETH_RxDMABurstLength_4xPBL_16Beat) || \
+                                           ((LENGTH) == ETH_RxDMABurstLength_4xPBL_32Beat) || \
+                                           ((LENGTH) == ETH_RxDMABurstLength_4xPBL_64Beat) || \
+                                           ((LENGTH) == ETH_RxDMABurstLength_4xPBL_128Beat))
+ 
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Tx_DMA_Burst_Length 
+  * @{
+  */ 
+#define ETH_TxDMABurstLength_1Beat          ((uint32_t)0x00000100)  /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 1 */
+#define ETH_TxDMABurstLength_2Beat          ((uint32_t)0x00000200)  /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 2 */
+#define ETH_TxDMABurstLength_4Beat          ((uint32_t)0x00000400)  /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 4 */
+#define ETH_TxDMABurstLength_8Beat          ((uint32_t)0x00000800)  /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 8 */
+#define ETH_TxDMABurstLength_16Beat         ((uint32_t)0x00001000)  /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 16 */
+#define ETH_TxDMABurstLength_32Beat         ((uint32_t)0x00002000)  /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 32 */                
+#define ETH_TxDMABurstLength_4xPBL_4Beat    ((uint32_t)0x01000100)  /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 4 */
+#define ETH_TxDMABurstLength_4xPBL_8Beat    ((uint32_t)0x01000200)  /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 8 */
+#define ETH_TxDMABurstLength_4xPBL_16Beat   ((uint32_t)0x01000400)  /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 16 */
+#define ETH_TxDMABurstLength_4xPBL_32Beat   ((uint32_t)0x01000800)  /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 32 */
+#define ETH_TxDMABurstLength_4xPBL_64Beat   ((uint32_t)0x01001000)  /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 64 */
+#define ETH_TxDMABurstLength_4xPBL_128Beat  ((uint32_t)0x01002000)  /*!< maximum number of beats to be transferred in one TxDMA (or both) transaction is 128 */
+
+#define IS_ETH_TXDMA_BURST_LENGTH(LENGTH) (((LENGTH) == ETH_TxDMABurstLength_1Beat) || \
+                                           ((LENGTH) == ETH_TxDMABurstLength_2Beat) || \
+                                           ((LENGTH) == ETH_TxDMABurstLength_4Beat) || \
+                                           ((LENGTH) == ETH_TxDMABurstLength_8Beat) || \
+                                           ((LENGTH) == ETH_TxDMABurstLength_16Beat) || \
+                                           ((LENGTH) == ETH_TxDMABurstLength_32Beat) || \
+                                           ((LENGTH) == ETH_TxDMABurstLength_4xPBL_4Beat) || \
+                                           ((LENGTH) == ETH_TxDMABurstLength_4xPBL_8Beat) || \
+                                           ((LENGTH) == ETH_TxDMABurstLength_4xPBL_16Beat) || \
+                                           ((LENGTH) == ETH_TxDMABurstLength_4xPBL_32Beat) || \
+                                           ((LENGTH) == ETH_TxDMABurstLength_4xPBL_64Beat) || \
+                                           ((LENGTH) == ETH_TxDMABurstLength_4xPBL_128Beat))
+/** 
+  * @brief  ETH DMA Descriptor SkipLength  
+  */ 
+#define IS_ETH_DMA_DESC_SKIP_LENGTH(LENGTH) ((LENGTH) <= 0x1F)
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_DMA_Arbitration 
+  * @{
+  */ 
+#define ETH_DMAArbitration_RoundRobin_RxTx_1_1   ((uint32_t)0x00000000)
+#define ETH_DMAArbitration_RoundRobin_RxTx_2_1   ((uint32_t)0x00004000)
+#define ETH_DMAArbitration_RoundRobin_RxTx_3_1   ((uint32_t)0x00008000)
+#define ETH_DMAArbitration_RoundRobin_RxTx_4_1   ((uint32_t)0x0000C000)
+#define ETH_DMAArbitration_RxPriorTx             ((uint32_t)0x00000002)
+#define IS_ETH_DMA_ARBITRATION_ROUNDROBIN_RXTX(RATIO) (((RATIO) == ETH_DMAArbitration_RoundRobin_RxTx_1_1) || \
+                                                       ((RATIO) == ETH_DMAArbitration_RoundRobin_RxTx_2_1) || \
+                                                       ((RATIO) == ETH_DMAArbitration_RoundRobin_RxTx_3_1) || \
+                                                       ((RATIO) == ETH_DMAArbitration_RoundRobin_RxTx_4_1) || \
+                                                       ((RATIO) == ETH_DMAArbitration_RxPriorTx))
+/**
+  * @}
+  */
+
+/** @defgroup ETH_DMA_Flags 
+  * @{
+  */ 
+#define ETH_DMA_FLAG_TST               ((uint32_t)0x20000000)  /*!< Time-stamp trigger interrupt (on DMA) */
+#define ETH_DMA_FLAG_PMT               ((uint32_t)0x10000000)  /*!< PMT interrupt (on DMA) */
+#define ETH_DMA_FLAG_MMC               ((uint32_t)0x08000000)  /*!< MMC interrupt (on DMA) */
+#define ETH_DMA_FLAG_DataTransferError ((uint32_t)0x00800000)  /*!< Error bits 0-Rx DMA, 1-Tx DMA */
+#define ETH_DMA_FLAG_ReadWriteError    ((uint32_t)0x01000000)  /*!< Error bits 0-write trnsf, 1-read transfr */
+#define ETH_DMA_FLAG_AccessError       ((uint32_t)0x02000000)  /*!< Error bits 0-data buffer, 1-desc. access */
+#define ETH_DMA_FLAG_NIS               ((uint32_t)0x00010000)  /*!< Normal interrupt summary flag */
+#define ETH_DMA_FLAG_AIS               ((uint32_t)0x00008000)  /*!< Abnormal interrupt summary flag */
+#define ETH_DMA_FLAG_ER                ((uint32_t)0x00004000)  /*!< Early receive flag */
+#define ETH_DMA_FLAG_FBE               ((uint32_t)0x00002000)  /*!< Fatal bus error flag */
+#define ETH_DMA_FLAG_ET                ((uint32_t)0x00000400)  /*!< Early transmit flag */
+#define ETH_DMA_FLAG_RWT               ((uint32_t)0x00000200)  /*!< Receive watchdog timeout flag */
+#define ETH_DMA_FLAG_RPS               ((uint32_t)0x00000100)  /*!< Receive process stopped flag */
+#define ETH_DMA_FLAG_RBU               ((uint32_t)0x00000080)  /*!< Receive buffer unavailable flag */
+#define ETH_DMA_FLAG_R                 ((uint32_t)0x00000040)  /*!< Receive flag */
+#define ETH_DMA_FLAG_TU                ((uint32_t)0x00000020)  /*!< Underflow flag */
+#define ETH_DMA_FLAG_RO                ((uint32_t)0x00000010)  /*!< Overflow flag */
+#define ETH_DMA_FLAG_TJT               ((uint32_t)0x00000008)  /*!< Transmit jabber timeout flag */
+#define ETH_DMA_FLAG_TBU               ((uint32_t)0x00000004)  /*!< Transmit buffer unavailable flag */
+#define ETH_DMA_FLAG_TPS               ((uint32_t)0x00000002)  /*!< Transmit process stopped flag */
+#define ETH_DMA_FLAG_T                 ((uint32_t)0x00000001)  /*!< Transmit flag */
+
+#define IS_ETH_DMA_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFFE1800) == 0x00) && ((FLAG) != 0x00)) 
+#define IS_ETH_DMA_GET_FLAG(FLAG) (((FLAG) == ETH_DMA_FLAG_TST) || ((FLAG) == ETH_DMA_FLAG_PMT) || \
+                                   ((FLAG) == ETH_DMA_FLAG_MMC) || ((FLAG) == ETH_DMA_FLAG_DataTransferError) || \
+                                   ((FLAG) == ETH_DMA_FLAG_ReadWriteError) || ((FLAG) == ETH_DMA_FLAG_AccessError) || \
+                                   ((FLAG) == ETH_DMA_FLAG_NIS) || ((FLAG) == ETH_DMA_FLAG_AIS) || \
+                                   ((FLAG) == ETH_DMA_FLAG_ER) || ((FLAG) == ETH_DMA_FLAG_FBE) || \
+                                   ((FLAG) == ETH_DMA_FLAG_ET) || ((FLAG) == ETH_DMA_FLAG_RWT) || \
+                                   ((FLAG) == ETH_DMA_FLAG_RPS) || ((FLAG) == ETH_DMA_FLAG_RBU) || \
+                                   ((FLAG) == ETH_DMA_FLAG_R) || ((FLAG) == ETH_DMA_FLAG_TU) || \
+                                   ((FLAG) == ETH_DMA_FLAG_RO) || ((FLAG) == ETH_DMA_FLAG_TJT) || \
+                                   ((FLAG) == ETH_DMA_FLAG_TBU) || ((FLAG) == ETH_DMA_FLAG_TPS) || \
+                                   ((FLAG) == ETH_DMA_FLAG_T))
+/**
+  * @}
+  */
+
+/** @defgroup ETH_DMA_Interrupts 
+  * @{
+  */ 
+#define ETH_DMA_IT_TST       ((uint32_t)0x20000000)  /*!< Time-stamp trigger interrupt (on DMA) */
+#define ETH_DMA_IT_PMT       ((uint32_t)0x10000000)  /*!< PMT interrupt (on DMA) */
+#define ETH_DMA_IT_MMC       ((uint32_t)0x08000000)  /*!< MMC interrupt (on DMA) */
+#define ETH_DMA_IT_NIS       ((uint32_t)0x00010000)  /*!< Normal interrupt summary */
+#define ETH_DMA_IT_AIS       ((uint32_t)0x00008000)  /*!< Abnormal interrupt summary */
+#define ETH_DMA_IT_ER        ((uint32_t)0x00004000)  /*!< Early receive interrupt */
+#define ETH_DMA_IT_FBE       ((uint32_t)0x00002000)  /*!< Fatal bus error interrupt */
+#define ETH_DMA_IT_ET        ((uint32_t)0x00000400)  /*!< Early transmit interrupt */
+#define ETH_DMA_IT_RWT       ((uint32_t)0x00000200)  /*!< Receive watchdog timeout interrupt */
+#define ETH_DMA_IT_RPS       ((uint32_t)0x00000100)  /*!< Receive process stopped interrupt */
+#define ETH_DMA_IT_RBU       ((uint32_t)0x00000080)  /*!< Receive buffer unavailable interrupt */
+#define ETH_DMA_IT_R         ((uint32_t)0x00000040)  /*!< Receive interrupt */
+#define ETH_DMA_IT_TU        ((uint32_t)0x00000020)  /*!< Underflow interrupt */
+#define ETH_DMA_IT_RO        ((uint32_t)0x00000010)  /*!< Overflow interrupt */
+#define ETH_DMA_IT_TJT       ((uint32_t)0x00000008)  /*!< Transmit jabber timeout interrupt */
+#define ETH_DMA_IT_TBU       ((uint32_t)0x00000004)  /*!< Transmit buffer unavailable interrupt */
+#define ETH_DMA_IT_TPS       ((uint32_t)0x00000002)  /*!< Transmit process stopped interrupt */
+#define ETH_DMA_IT_T         ((uint32_t)0x00000001)  /*!< Transmit interrupt */
+
+#define IS_ETH_DMA_IT(IT) ((((IT) & (uint32_t)0xFFFE1800) == 0x00) && ((IT) != 0x00))
+#define IS_ETH_DMA_GET_IT(IT) (((IT) == ETH_DMA_IT_TST) || ((IT) == ETH_DMA_IT_PMT) || \
+                               ((IT) == ETH_DMA_IT_MMC) || ((IT) == ETH_DMA_IT_NIS) || \
+                               ((IT) == ETH_DMA_IT_AIS) || ((IT) == ETH_DMA_IT_ER) || \
+                               ((IT) == ETH_DMA_IT_FBE) || ((IT) == ETH_DMA_IT_ET) || \
+                               ((IT) == ETH_DMA_IT_RWT) || ((IT) == ETH_DMA_IT_RPS) || \
+                               ((IT) == ETH_DMA_IT_RBU) || ((IT) == ETH_DMA_IT_R) || \
+                               ((IT) == ETH_DMA_IT_TU) || ((IT) == ETH_DMA_IT_RO) || \
+                               ((IT) == ETH_DMA_IT_TJT) || ((IT) == ETH_DMA_IT_TBU) || \
+                               ((IT) == ETH_DMA_IT_TPS) || ((IT) == ETH_DMA_IT_T))
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_DMA_transmit_process_state_ 
+  * @{
+  */ 
+#define ETH_DMA_TransmitProcess_Stopped     ((uint32_t)0x00000000)  /*!< Stopped - Reset or Stop Tx Command issued */
+#define ETH_DMA_TransmitProcess_Fetching    ((uint32_t)0x00100000)  /*!< Running - fetching the Tx descriptor */
+#define ETH_DMA_TransmitProcess_Waiting     ((uint32_t)0x00200000)  /*!< Running - waiting for status */
+#define ETH_DMA_TransmitProcess_Reading     ((uint32_t)0x00300000)  /*!< Running - reading the data from host memory */
+#define ETH_DMA_TransmitProcess_Suspended   ((uint32_t)0x00600000)  /*!< Suspended - Tx Descriptor unavailable */
+#define ETH_DMA_TransmitProcess_Closing     ((uint32_t)0x00700000)  /*!< Running - closing Rx descriptor */
+
+/**
+  * @}
+  */ 
+
+
+/** @defgroup ETH_DMA_receive_process_state_ 
+  * @{
+  */ 
+#define ETH_DMA_ReceiveProcess_Stopped      ((uint32_t)0x00000000)  /*!< Stopped - Reset or Stop Rx Command issued */
+#define ETH_DMA_ReceiveProcess_Fetching     ((uint32_t)0x00020000)  /*!< Running - fetching the Rx descriptor */
+#define ETH_DMA_ReceiveProcess_Waiting      ((uint32_t)0x00060000)  /*!< Running - waiting for packet */
+#define ETH_DMA_ReceiveProcess_Suspended    ((uint32_t)0x00080000)  /*!< Suspended - Rx Descriptor unavailable */
+#define ETH_DMA_ReceiveProcess_Closing      ((uint32_t)0x000A0000)  /*!< Running - closing descriptor */
+#define ETH_DMA_ReceiveProcess_Queuing      ((uint32_t)0x000E0000)  /*!< Running - queuing the receive frame into host memory */
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_DMA_overflow_ 
+  * @{
+  */ 
+#define ETH_DMA_Overflow_RxFIFOCounter      ((uint32_t)0x10000000)  /*!< Overflow bit for FIFO overflow counter */
+#define ETH_DMA_Overflow_MissedFrameCounter ((uint32_t)0x00010000)  /*!< Overflow bit for missed frame counter */
+#define IS_ETH_DMA_GET_OVERFLOW(OVERFLOW) (((OVERFLOW) == ETH_DMA_Overflow_RxFIFOCounter) || \
+                                           ((OVERFLOW) == ETH_DMA_Overflow_MissedFrameCounter))
+
+/**--------------------------------------------------------------------------**/
+/** 
+  * @brief                           Ethernet PMT defines
+  */ 
+/**--------------------------------------------------------------------------**/
+/**
+  * @}
+  */
+
+/** @defgroup ETH_PMT_Flags 
+  * @{
+  */ 
+#define ETH_PMT_FLAG_WUFFRPR      ((uint32_t)0x80000000)  /*!< Wake-Up Frame Filter Register Pointer Reset */
+#define ETH_PMT_FLAG_WUFR         ((uint32_t)0x00000040)  /*!< Wake-Up Frame Received */
+#define ETH_PMT_FLAG_MPR          ((uint32_t)0x00000020)  /*!< Magic Packet Received */
+#define IS_ETH_PMT_GET_FLAG(FLAG) (((FLAG) == ETH_PMT_FLAG_WUFR) || \
+                                   ((FLAG) == ETH_PMT_FLAG_MPR))
+
+/**--------------------------------------------------------------------------**/
+/** 
+  * @brief                           Ethernet MMC defines
+  */ 
+/**--------------------------------------------------------------------------**/
+/**
+  * @}
+  */
+
+/** @defgroup ETH_MMC_Tx_Interrupts 
+  * @{
+  */ 
+#define ETH_MMC_IT_TGF       ((uint32_t)0x00200000)  /*!< When Tx good frame counter reaches half the maximum value */
+#define ETH_MMC_IT_TGFMSC    ((uint32_t)0x00008000)  /*!< When Tx good multi col counter reaches half the maximum value */
+#define ETH_MMC_IT_TGFSC     ((uint32_t)0x00004000)  /*!< When Tx good single col counter reaches half the maximum value */
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_MMC_Rx_Interrupts 
+  * @{
+  */
+#define ETH_MMC_IT_RGUF      ((uint32_t)0x10020000)  /*!< When Rx good unicast frames counter reaches half the maximum value */
+#define ETH_MMC_IT_RFAE      ((uint32_t)0x10000040)  /*!< When Rx alignment error counter reaches half the maximum value */
+#define ETH_MMC_IT_RFCE      ((uint32_t)0x10000020)  /*!< When Rx crc error counter reaches half the maximum value */
+#define IS_ETH_MMC_IT(IT) (((((IT) & (uint32_t)0xFFDF3FFF) == 0x00) || (((IT) & (uint32_t)0xEFFDFF9F) == 0x00)) && \
+                           ((IT) != 0x00))
+#define IS_ETH_MMC_GET_IT(IT) (((IT) == ETH_MMC_IT_TGF) || ((IT) == ETH_MMC_IT_TGFMSC) || \
+                               ((IT) == ETH_MMC_IT_TGFSC) || ((IT) == ETH_MMC_IT_RGUF) || \
+                               ((IT) == ETH_MMC_IT_RFAE) || ((IT) == ETH_MMC_IT_RFCE))
+/**
+  * @}
+  */
+
+/** @defgroup ETH_MMC_Registers 
+  * @{
+  */ 
+#define ETH_MMCCR            ((uint32_t)0x00000100)  /*!< MMC CR register */
+#define ETH_MMCRIR           ((uint32_t)0x00000104)  /*!< MMC RIR register */
+#define ETH_MMCTIR           ((uint32_t)0x00000108)  /*!< MMC TIR register */
+#define ETH_MMCRIMR          ((uint32_t)0x0000010C)  /*!< MMC RIMR register */
+#define ETH_MMCTIMR          ((uint32_t)0x00000110)  /*!< MMC TIMR register */ 
+#define ETH_MMCTGFSCCR       ((uint32_t)0x0000014C)  /*!< MMC TGFSCCR register */
+#define ETH_MMCTGFMSCCR      ((uint32_t)0x00000150)  /*!< MMC TGFMSCCR register */ 
+#define ETH_MMCTGFCR         ((uint32_t)0x00000168)  /*!< MMC TGFCR register */
+#define ETH_MMCRFCECR        ((uint32_t)0x00000194)  /*!< MMC RFCECR register */
+#define ETH_MMCRFAECR        ((uint32_t)0x00000198)  /*!< MMC RFAECR register */
+#define ETH_MMCRGUFCR        ((uint32_t)0x000001C4)  /*!< MMC RGUFCR register */
+
+/** 
+  * @brief  ETH MMC registers  
+  */ 
+#define IS_ETH_MMC_REGISTER(REG) (((REG) == ETH_MMCCR)  || ((REG) == ETH_MMCRIR) || \
+                                  ((REG) == ETH_MMCTIR)  || ((REG) == ETH_MMCRIMR) || \
+                                  ((REG) == ETH_MMCTIMR) || ((REG) == ETH_MMCTGFSCCR) || \
+                                  ((REG) == ETH_MMCTGFMSCCR) || ((REG) == ETH_MMCTGFCR) || \
+                                  ((REG) == ETH_MMCRFCECR) || ((REG) == ETH_MMCRFAECR) || \
+                                  ((REG) == ETH_MMCRGUFCR)) 
+
+/**--------------------------------------------------------------------------**/
+/** 
+  * @brief                           Ethernet PTP defines
+  */ 
+/**--------------------------------------------------------------------------**/
+/**
+  * @}
+  */
+
+/** @defgroup ETH_PTP_time_update_method 
+  * @{
+  */ 
+#define ETH_PTP_FineUpdate        ((uint32_t)0x00000001)  /*!< Fine Update method */
+#define ETH_PTP_CoarseUpdate      ((uint32_t)0x00000000)  /*!< Coarse Update method */
+#define IS_ETH_PTP_UPDATE(UPDATE) (((UPDATE) == ETH_PTP_FineUpdate) || \
+                                   ((UPDATE) == ETH_PTP_CoarseUpdate))
+
+/**
+  * @}
+  */ 
+
+
+/** @defgroup ETH_PTP_Flags 
+  * @{
+  */ 
+#define ETH_PTP_FLAG_TSARU        ((uint32_t)0x00000020)  /*!< Addend Register Update */
+#define ETH_PTP_FLAG_TSITE        ((uint32_t)0x00000010)  /*!< Time Stamp Interrupt Trigger */
+#define ETH_PTP_FLAG_TSSTU        ((uint32_t)0x00000008)  /*!< Time Stamp Update */
+#define ETH_PTP_FLAG_TSSTI        ((uint32_t)0x00000004)  /*!< Time Stamp Initialize */
+
+#define ETH_PTP_FLAG_TSTTR        ((uint32_t)0x10000002)  /* Time stamp target time reached */
+#define ETH_PTP_FLAG_TSSO         ((uint32_t)0x10000001)  /* Time stamp seconds overflow */
+
+#define IS_ETH_PTP_GET_FLAG(FLAG) (((FLAG) == ETH_PTP_FLAG_TSARU) || \
+                                    ((FLAG) == ETH_PTP_FLAG_TSITE) || \
+                                    ((FLAG) == ETH_PTP_FLAG_TSSTU) || \
+                                    ((FLAG) == ETH_PTP_FLAG_TSSTI) || \
+                                    ((FLAG) == ETH_PTP_FLAG_TSTTR) || \
+                                    ((FLAG) == ETH_PTP_FLAG_TSSO)) 
+
+/** 
+  * @brief  ETH PTP subsecond increment  
+  */ 
+#define IS_ETH_PTP_SUBSECOND_INCREMENT(SUBSECOND) ((SUBSECOND) <= 0xFF)
+
+/**
+  * @}
+  */ 
+
+
+/** @defgroup ETH_PTP_time_sign 
+  * @{
+  */ 
+#define ETH_PTP_PositiveTime      ((uint32_t)0x00000000)  /*!< Positive time value */
+#define ETH_PTP_NegativeTime      ((uint32_t)0x80000000)  /*!< Negative time value */
+#define IS_ETH_PTP_TIME_SIGN(SIGN) (((SIGN) == ETH_PTP_PositiveTime) || \
+                                    ((SIGN) == ETH_PTP_NegativeTime))
+
+/** 
+  * @brief  ETH PTP time stamp low update  
+  */ 
+#define IS_ETH_PTP_TIME_STAMP_UPDATE_SUBSECOND(SUBSECOND) ((SUBSECOND) <= 0x7FFFFFFF)
+
+/** 
+  * @brief  ETH PTP registers  
+  */ 
+#define ETH_PTPTSCR     ((uint32_t)0x00000700)  /*!< PTP TSCR register */
+#define ETH_PTPSSIR     ((uint32_t)0x00000704)  /*!< PTP SSIR register */
+#define ETH_PTPTSHR     ((uint32_t)0x00000708)  /*!< PTP TSHR register */
+#define ETH_PTPTSLR     ((uint32_t)0x0000070C)  /*!< PTP TSLR register */
+#define ETH_PTPTSHUR    ((uint32_t)0x00000710)  /*!< PTP TSHUR register */
+#define ETH_PTPTSLUR    ((uint32_t)0x00000714)  /*!< PTP TSLUR register */
+#define ETH_PTPTSAR     ((uint32_t)0x00000718)  /*!< PTP TSAR register */
+#define ETH_PTPTTHR     ((uint32_t)0x0000071C)  /*!< PTP TTHR register */
+#define ETH_PTPTTLR     ((uint32_t)0x00000720)  /* PTP TTLR register */
+
+#define ETH_PTPTSSR     ((uint32_t)0x00000728)  /* PTP TSSR register */
+
+#define IS_ETH_PTP_REGISTER(REG) (((REG) == ETH_PTPTSCR) || ((REG) == ETH_PTPSSIR) || \
+                                   ((REG) == ETH_PTPTSHR) || ((REG) == ETH_PTPTSLR) || \
+                                   ((REG) == ETH_PTPTSHUR) || ((REG) == ETH_PTPTSLUR) || \
+                                   ((REG) == ETH_PTPTSAR) || ((REG) == ETH_PTPTTHR) || \
+                                   ((REG) == ETH_PTPTTLR) || ((REG) == ETH_PTPTSSR)) 
+
+/** 
+  * @brief  ETHERNET PTP clock  
+  */ 
+#define ETH_PTP_OrdinaryClock               ((uint32_t)0x00000000)  /* Ordinary Clock */
+#define ETH_PTP_BoundaryClock               ((uint32_t)0x00010000)  /* Boundary Clock */
+#define ETH_PTP_EndToEndTransparentClock    ((uint32_t)0x00020000)  /* End To End Transparent Clock */
+#define ETH_PTP_PeerToPeerTransparentClock  ((uint32_t)0x00030000)  /* Peer To Peer Transparent Clock */
+
+#define IS_ETH_PTP_TYPE_CLOCK(CLOCK) (((CLOCK) == ETH_PTP_OrdinaryClock) || \
+                          ((CLOCK) == ETH_PTP_BoundaryClock) || \
+                          ((CLOCK) == ETH_PTP_EndToEndTransparentClock) || \
+                                      ((CLOCK) == ETH_PTP_PeerToPeerTransparentClock))
+/** 
+  * @brief  ETHERNET snapshot
+  */
+#define ETH_PTP_SnapshotMasterMessage          ((uint32_t)0x00008000)  /* Time stamp snapshot for message relevant to master enable */
+#define ETH_PTP_SnapshotEventMessage           ((uint32_t)0x00004000)  /* Time stamp snapshot for event message enable */
+#define ETH_PTP_SnapshotIPV4Frames             ((uint32_t)0x00002000)  /* Time stamp snapshot for IPv4 frames enable */
+#define ETH_PTP_SnapshotIPV6Frames             ((uint32_t)0x00001000)  /* Time stamp snapshot for IPv6 frames enable */
+#define ETH_PTP_SnapshotPTPOverEthernetFrames  ((uint32_t)0x00000800)  /* Time stamp snapshot for PTP over ethernet frames enable */
+#define ETH_PTP_SnapshotAllReceivedFrames      ((uint32_t)0x00000100)  /* Time stamp snapshot for all received frames enable */
+
+#define IS_ETH_PTP_SNAPSHOT(SNAPSHOT) (((SNAPSHOT) == ETH_PTP_SnapshotMasterMessage) || \
+                           ((SNAPSHOT) == ETH_PTP_SnapshotEventMessage) || \
+                           ((SNAPSHOT) == ETH_PTP_SnapshotIPV4Frames) || \
+                           ((SNAPSHOT) == ETH_PTP_SnapshotIPV6Frames) || \
+                           ((SNAPSHOT) == ETH_PTP_SnapshotPTPOverEthernetFrames) || \
+                           ((SNAPSHOT) == ETH_PTP_SnapshotAllReceivedFrames))
+
+/**
+  * @}
+  */ 
+/* ETHERNET MAC address offsets */
+#define ETH_MAC_ADDR_HBASE   (ETH_MAC_BASE + 0x40)  /* ETHERNET MAC address high offset */
+#define ETH_MAC_ADDR_LBASE    (ETH_MAC_BASE + 0x44)  /* ETHERNET MAC address low offset */
+
+/* ETHERNET MACMIIAR register Mask */
+#define MACMIIAR_CR_MASK    ((uint32_t)0xFFFFFFE3)
+
+/* ETHERNET MACCR register Mask */
+#define MACCR_CLEAR_MASK    ((uint32_t)0xFF20810F)  
+
+/* ETHERNET MACFCR register Mask */
+#define MACFCR_CLEAR_MASK   ((uint32_t)0x0000FF41)
+
+
+/* ETHERNET DMAOMR register Mask */
+#define DMAOMR_CLEAR_MASK   ((uint32_t)0xF8DE3F23)
+
+
+/* ETHERNET Remote Wake-up frame register length */
+#define ETH_WAKEUP_REGISTER_LENGTH      8
+
+/* ETHERNET Missed frames counter Shift */
+#define  ETH_DMA_RX_OVERFLOW_MISSEDFRAMES_COUNTERSHIFT     17
+
+/* ETHERNET DMA Tx descriptors Collision Count Shift */
+#define  ETH_DMATXDESC_COLLISION_COUNTSHIFT        3
+
+/* ETHERNET DMA Tx descriptors Buffer2 Size Shift */
+#define  ETH_DMATXDESC_BUFFER2_SIZESHIFT           16
+
+/* ETHERNET DMA Rx descriptors Frame Length Shift */
+#define  ETH_DMARXDESC_FRAME_LENGTHSHIFT           16
+
+/* ETHERNET DMA Rx descriptors Buffer2 Size Shift */
+#define  ETH_DMARXDESC_BUFFER2_SIZESHIFT           16
+
+/* ETHERNET errors */
+#define  ETH_ERROR              ((uint32_t)0)
+#define  ETH_SUCCESS            ((uint32_t)1)
+
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Exported_Macros
+  * @{
+  */ 
+/**
+  * @}
+  */
+
+/** @defgroup ETH_Exported_Functions
+  * @{
+  */ 
+void ETH_DeInit(void);
+uint32_t ETH_Init(ETH_InitTypeDef* ETH_InitStruct, uint16_t PHYAddress);
+void ETH_StructInit(ETH_InitTypeDef* ETH_InitStruct);
+void ETH_SoftwareReset(void);
+FlagStatus ETH_GetSoftwareResetStatus(void);
+void  ETH_Start(void);
+uint32_t ETH_GetRxPktSize(ETH_DMADESCTypeDef *DMARxDesc);
+
+
+#ifdef USE_ENHANCED_DMA_DESCRIPTORS
+ void ETH_EnhancedDescriptorCmd(FunctionalState NewState);
+#endif /* USE_ENHANCED_DMA_DESCRIPTORS */
+
+/** 
+  * @brief  PHY  
+  */ 
+uint16_t ETH_ReadPHYRegister(uint16_t PHYAddress, uint16_t PHYReg);
+uint32_t ETH_WritePHYRegister(uint16_t PHYAddress, uint16_t PHYReg, uint16_t PHYValue);
+uint32_t ETH_PHYLoopBackCmd(uint16_t PHYAddress, FunctionalState NewState);
+
+/** 
+  * @brief  MAC  
+  */ 
+void ETH_MACTransmissionCmd(FunctionalState NewState);
+void ETH_MACReceptionCmd(FunctionalState NewState);
+FlagStatus ETH_GetFlowControlBusyStatus(void);
+void ETH_InitiatePauseControlFrame(void);  
+void ETH_BackPressureActivationCmd(FunctionalState NewState); 
+FlagStatus ETH_GetMACFlagStatus(uint32_t ETH_MAC_FLAG);  
+ITStatus ETH_GetMACITStatus(uint32_t ETH_MAC_IT);
+void ETH_MACITConfig(uint32_t ETH_MAC_IT, FunctionalState NewState);
+void ETH_MACAddressConfig(uint32_t MacAddr, uint8_t *Addr);
+void ETH_GetMACAddress(uint32_t MacAddr, uint8_t *Addr);
+void ETH_MACAddressPerfectFilterCmd(uint32_t MacAddr, FunctionalState NewState);
+void ETH_MACAddressFilterConfig(uint32_t MacAddr, uint32_t Filter);
+void ETH_MACAddressMaskBytesFilterConfig(uint32_t MacAddr, uint32_t MaskByte);
+
+/** 
+  * @brief  DMA Tx/Rx descriptors  
+  */ 
+void ETH_DMARxDescChainInit(ETH_DMADESCTypeDef *DMARxDescTab, uint8_t *RxBuff, uint32_t RxBuffCount);
+void ETH_DMATxDescChainInit(ETH_DMADESCTypeDef *DMATxDescTab, uint8_t* TxBuff, uint32_t TxBuffCount);
+uint32_t ETH_CheckFrameReceived(void);
+uint32_t ETH_Prepare_Transmit_Descriptors(u16 FrameLength);
+FrameTypeDef ETH_Get_Received_Frame(void);
+FlagStatus ETH_GetDMATxDescFlagStatus(ETH_DMADESCTypeDef *DMATxDesc, uint32_t ETH_DMATxDescFlag);
+uint32_t ETH_GetDMATxDescCollisionCount(ETH_DMADESCTypeDef *DMATxDesc);
+void ETH_SetDMATxDescOwnBit(ETH_DMADESCTypeDef *DMATxDesc);
+void ETH_DMATxDescTransmitITConfig(ETH_DMADESCTypeDef *DMATxDesc, FunctionalState NewState);
+void ETH_DMATxDescFrameSegmentConfig(ETH_DMADESCTypeDef *DMATxDesc, uint32_t DMATxDesc_FrameSegment);
+void ETH_DMATxDescChecksumInsertionConfig(ETH_DMADESCTypeDef *DMATxDesc, uint32_t DMATxDesc_Checksum);
+void ETH_DMATxDescCRCCmd(ETH_DMADESCTypeDef *DMATxDesc, FunctionalState NewState);
+void ETH_DMATxDescSecondAddressChainedCmd(ETH_DMADESCTypeDef *DMATxDesc, FunctionalState NewState);
+void ETH_DMATxDescShortFramePaddingCmd(ETH_DMADESCTypeDef *DMATxDesc, FunctionalState NewState);
+void ETH_DMATxDescBufferSizeConfig(ETH_DMADESCTypeDef *DMATxDesc, uint32_t BufferSize1, uint32_t BufferSize2);
+FlagStatus ETH_GetDMARxDescFlagStatus(ETH_DMADESCTypeDef *DMARxDesc, uint32_t ETH_DMARxDescFlag);
+#ifdef USE_ENHANCED_DMA_DESCRIPTORS
+ FlagStatus ETH_GetDMAPTPRxDescExtendedFlagStatus(ETH_DMADESCTypeDef *DMAPTPRxDesc, uint32_t ETH_DMAPTPRxDescExtendedFlag);
+#endif /* USE_ENHANCED_DMA_DESCRIPTORS */
+void ETH_SetDMARxDescOwnBit(ETH_DMADESCTypeDef *DMARxDesc);
+uint32_t ETH_GetDMARxDescFrameLength(ETH_DMADESCTypeDef *DMARxDesc);
+void ETH_DMARxDescReceiveITConfig(ETH_DMADESCTypeDef *DMARxDesc, FunctionalState NewState);
+void ETH_DMARxDescSecondAddressChainedCmd(ETH_DMADESCTypeDef *DMARxDesc, FunctionalState NewState);
+uint32_t ETH_GetDMARxDescBufferSize(ETH_DMADESCTypeDef *DMARxDesc, uint32_t DMARxDesc_Buffer);
+FrameTypeDef ETH_Get_Received_Frame_interrupt(void);
+/** 
+  * @brief  DMA
+  */ 
+FlagStatus ETH_GetDMAFlagStatus(uint32_t ETH_DMA_FLAG);
+void ETH_DMAClearFlag(uint32_t ETH_DMA_FLAG);
+ITStatus ETH_GetDMAITStatus(uint32_t ETH_DMA_IT);
+void ETH_DMAClearITPendingBit(uint32_t ETH_DMA_IT);
+uint32_t ETH_GetTransmitProcessState(void);
+uint32_t ETH_GetReceiveProcessState(void);
+void ETH_FlushTransmitFIFO(void);
+FlagStatus ETH_GetFlushTransmitFIFOStatus(void);
+void ETH_DMATransmissionCmd(FunctionalState NewState);
+void ETH_DMAReceptionCmd(FunctionalState NewState);
+void ETH_DMAITConfig(uint32_t ETH_DMA_IT, FunctionalState NewState);
+FlagStatus ETH_GetDMAOverflowStatus(uint32_t ETH_DMA_Overflow);
+uint32_t ETH_GetRxOverflowMissedFrameCounter(void);
+uint32_t ETH_GetBufferUnavailableMissedFrameCounter(void);
+uint32_t ETH_GetCurrentTxDescStartAddress(void);
+uint32_t ETH_GetCurrentRxDescStartAddress(void);
+uint32_t ETH_GetCurrentTxBufferAddress(void);
+uint32_t ETH_GetCurrentRxBufferAddress(void);
+void ETH_ResumeDMATransmission(void);
+void ETH_ResumeDMAReception(void);
+void ETH_SetReceiveWatchdogTimer(uint8_t Value);
+
+
+/** 
+  * @brief  PMT  
+  */ 
+void ETH_ResetWakeUpFrameFilterRegisterPointer(void);
+void ETH_SetWakeUpFrameFilterRegister(uint32_t *Buffer);
+void ETH_GlobalUnicastWakeUpCmd(FunctionalState NewState);
+FlagStatus ETH_GetPMTFlagStatus(uint32_t ETH_PMT_FLAG);
+void ETH_WakeUpFrameDetectionCmd(FunctionalState NewState);
+void ETH_MagicPacketDetectionCmd(FunctionalState NewState);
+void ETH_PowerDownCmd(FunctionalState NewState);
+
+/** 
+  * @brief  MMC  
+  */ 
+void ETH_MMCCounterFullPreset(void);
+void ETH_MMCCounterHalfPreset(void);
+void ETH_MMCCounterFreezeCmd(FunctionalState NewState);
+void ETH_MMCResetOnReadCmd(FunctionalState NewState);
+void ETH_MMCCounterRolloverCmd(FunctionalState NewState);
+void ETH_MMCCountersReset(void);
+void ETH_MMCITConfig(uint32_t ETH_MMC_IT, FunctionalState NewState);
+ITStatus ETH_GetMMCITStatus(uint32_t ETH_MMC_IT);
+uint32_t ETH_GetMMCRegister(uint32_t ETH_MMCReg);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32F4x7_ETH_H */
+/**
+  * @}
+  */ 
+
+
+/**
+  * @}
+  */ 
+
+/*********** Portions COPYRIGHT 2012 Embest Tech. Co., Ltd.*****END OF FILE****/

+ 261 - 0
modules/STM32F4x7_ETH_Driver/stm32f4x7_eth_bsp.c

@@ -0,0 +1,261 @@
+/**
+  ******************************************************************************
+  * @file    stm32f4x7_eth_bsp.c
+  * @author  MCD Application Team
+  * @version V1.0.0
+  * @date    31-October-2011 
+  * @brief   STM32F4x7 Ethernet hardware configuration.
+  ******************************************************************************
+  * @attention
+  *
+  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
+  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
+  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
+  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
+  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+  *
+  * <h2><center>&copy; Portions COPYRIGHT 2011 STMicroelectronics</center></h2>
+  ******************************************************************************
+  */
+/**
+  ******************************************************************************
+  * <h2><center>&copy; Portions COPYRIGHT 2012 Embest Tech. Co., Ltd.</center></h2>
+  * @file    stm32f4x7_eth_bsp.c
+  * @author  CMP Team
+  * @version V1.0.0
+  * @date    28-December-2012
+  * @brief   STM32F4x7 Ethernet hardware configuration.      
+  *          Modified to support the STM32F4DISCOVERY, STM32F4DIS-BB and
+  *          STM32F4DIS-LCD modules. 
+  ******************************************************************************
+  * @attention
+  *
+  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
+  * TIME. AS A RESULT, Embest SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
+  * OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
+  * OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
+  * CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+  ******************************************************************************
+  */
+/* Includes ------------------------------------------------------------------*/
+#include "stm32f4x7_eth.h"
+#include "stm32f4x7_eth_bsp.h"
+//#include "main.h"
+
+/* Private typedef -----------------------------------------------------------*/
+/* Private define ------------------------------------------------------------*/
+/* Private macro -------------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+__IO uint32_t  EthInitStatus = 0;
+
+/* Private function prototypes -----------------------------------------------*/
+static void ETH_GPIO_Config(void);
+static void ETH_MACDMA_Config(void);
+static void ETH_NVIC_Config(void);
+
+/* Private functions ---------------------------------------------------------*/
+
+/**
+  * @brief  ETH_BSP_Config
+  * @param  None
+  * @retval None
+  */
+void ETH_BSP_Config(void)
+{
+  /* Configure the GPIO ports for ethernet pins */
+  ETH_GPIO_Config();
+
+  /* Config NVIC for Ethernet */
+  /* TODO remove if tested: ETH_NVIC_Config moved after ETH_MACDMA_Config *
+   * to avoid ETH IRQ to stuck the system */
+  //ETH_NVIC_Config();
+
+  /* Configure the Ethernet MAC/DMA */
+  ETH_MACDMA_Config();
+
+  /* Config NVIC for Ethernet */
+  ETH_NVIC_Config();
+
+  if (EthInitStatus == 0) {
+    // LCD_SetTextColor(LCD_COLOR_RED);
+    // LCD_DisplayStringLine(Line5, (uint8_t*)"   Ethernet Init   ");
+    // LCD_DisplayStringLine(Line6, (uint8_t*)"      failed      ");
+    // STM_EVAL_LEDOn(LED5);
+    while(1);
+  }
+}
+
+/**
+  * @brief  Configures the Ethernet Interface
+  * @param  None
+  * @retval None
+  */
+static void ETH_MACDMA_Config(void)
+{
+  ETH_InitTypeDef ETH_InitStructure;
+
+  /* Enable ETHERNET clock  */
+  RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_ETH_MAC | RCC_AHB1Periph_ETH_MAC_Tx |
+                         RCC_AHB1Periph_ETH_MAC_Rx, ENABLE);                                             
+
+  /* Reset ETHERNET on AHB Bus */
+  ETH_DeInit();
+
+  /* Software reset */
+  ETH_SoftwareReset();
+
+  /* Wait for software reset */
+  while (ETH_GetSoftwareResetStatus() == SET);
+
+  /* ETHERNET Configuration --------------------------------------------------*/
+  /* Call ETH_StructInit if you don't like to configure all ETH_InitStructure parameter */
+  ETH_StructInit(&ETH_InitStructure);
+
+  /* Fill ETH_InitStructure parametrs */
+  /*------------------------   MAC   -----------------------------------*/
+  ETH_InitStructure.ETH_AutoNegotiation = ETH_AutoNegotiation_Enable;
+  //ETH_InitStructure.ETH_AutoNegotiation = ETH_AutoNegotiation_Disable; 
+  //  ETH_InitStructure.ETH_Speed = ETH_Speed_10M;
+  //  ETH_InitStructure.ETH_Mode = ETH_Mode_FullDuplex;   
+
+  ETH_InitStructure.ETH_LoopbackMode = ETH_LoopbackMode_Disable;
+  ETH_InitStructure.ETH_RetryTransmission = ETH_RetryTransmission_Disable;
+  ETH_InitStructure.ETH_AutomaticPadCRCStrip = ETH_AutomaticPadCRCStrip_Disable;
+  ETH_InitStructure.ETH_ReceiveAll = ETH_ReceiveAll_Disable;
+  ETH_InitStructure.ETH_BroadcastFramesReception = ETH_BroadcastFramesReception_Enable;
+  ETH_InitStructure.ETH_PromiscuousMode = ETH_PromiscuousMode_Disable;
+  ETH_InitStructure.ETH_MulticastFramesFilter = ETH_MulticastFramesFilter_Perfect;
+  ETH_InitStructure.ETH_UnicastFramesFilter = ETH_UnicastFramesFilter_Perfect;
+#ifdef CHECKSUM_BY_HARDWARE
+  ETH_InitStructure.ETH_ChecksumOffload = ETH_ChecksumOffload_Enable;
+#endif
+
+  /*------------------------   DMA   -----------------------------------*/  
+  
+  /* When we use the Checksum offload feature, we need to enable the Store and Forward mode: 
+  the store and forward guarantee that a whole frame is stored in the FIFO, so the MAC can insert/verify the checksum, 
+  if the checksum is OK the DMA can handle the frame otherwise the frame is dropped */
+  ETH_InitStructure.ETH_DropTCPIPChecksumErrorFrame = ETH_DropTCPIPChecksumErrorFrame_Enable; 
+  ETH_InitStructure.ETH_ReceiveStoreForward = ETH_ReceiveStoreForward_Enable;         
+  ETH_InitStructure.ETH_TransmitStoreForward = ETH_TransmitStoreForward_Enable;     
+ 
+  ETH_InitStructure.ETH_ForwardErrorFrames = ETH_ForwardErrorFrames_Disable;       
+  ETH_InitStructure.ETH_ForwardUndersizedGoodFrames = ETH_ForwardUndersizedGoodFrames_Disable;   
+  ETH_InitStructure.ETH_SecondFrameOperate = ETH_SecondFrameOperate_Enable;
+  ETH_InitStructure.ETH_AddressAlignedBeats = ETH_AddressAlignedBeats_Enable;      
+  ETH_InitStructure.ETH_FixedBurst = ETH_FixedBurst_Enable;                
+  ETH_InitStructure.ETH_RxDMABurstLength = ETH_RxDMABurstLength_32Beat;          
+  ETH_InitStructure.ETH_TxDMABurstLength = ETH_TxDMABurstLength_32Beat;
+  ETH_InitStructure.ETH_DMAArbitration = ETH_DMAArbitration_RoundRobin_RxTx_2_1;
+
+  /* Configure Ethernet */
+  EthInitStatus = ETH_Init(&ETH_InitStructure, LAN8720_PHY_ADDRESS);
+
+  /* Enable the Ethernet Rx Interrupt */
+  ETH_DMAITConfig(ETH_DMA_IT_NIS | ETH_DMA_IT_R, ENABLE);
+}
+
+
+/**
+  * @brief  Configures the different GPIO ports.
+  * @param  None
+  * @retval None
+  */
+void ETH_GPIO_Config(void)
+{
+  volatile uint32_t i;
+  GPIO_InitTypeDef GPIO_InitStructure;
+  
+  /* Enable GPIOs clocks */
+  RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB
+	                       | RCC_AHB1Periph_GPIOC, ENABLE);
+
+  /* Enable SYSCFG clock */
+  RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);  
+  
+  /* MII/RMII Media interface selection --------------------------------------*/
+  SYSCFG_ETH_MediaInterfaceConfig(SYSCFG_ETH_MediaInterface_RMII);
+
+
+/* Ethernet pins configuration ************************************************/
+   /*
+        ETH_MDIO --------------> PA2 +
+        ETH_MDC ---------------> PC1 +
+    
+        ETH_RMII_REF_CLK-------> PA1 +
+
+        ETH_RMII_CRS_DV -------> PA7 +
+	ETH_MII_RX_ER   -------> PB10 -
+        ETH_RMII_RXD0   -------> PC4 +
+        ETH_RMII_RXD1   -------> PC5 +
+        ETH_RMII_TX_EN  -------> PB11 + 
+        ETH_RMII_TXD0   -------> PB12 +
+        ETH_RMII_TXD1   -------> PB13 +
+
+        ETH_RST_PIN     -------> PE2  - замена на PE13
+  
+   */
+
+  /* Configure PA1,PA2 and PA7 */
+  GPIO_InitStructure.GPIO_Pin   = GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_7;
+  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
+  GPIO_InitStructure.GPIO_Mode  = GPIO_Mode_AF;
+  GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
+  GPIO_InitStructure.GPIO_PuPd  = GPIO_PuPd_NOPULL ;
+  GPIO_Init(GPIOA, &GPIO_InitStructure);
+  GPIO_PinAFConfig(GPIOA, GPIO_PinSource1, GPIO_AF_ETH);
+  GPIO_PinAFConfig(GPIOA, GPIO_PinSource2, GPIO_AF_ETH);
+  GPIO_PinAFConfig(GPIOA, GPIO_PinSource7, GPIO_AF_ETH);
+
+  /* Configure PB10,PB11,PB12 and PB13 */
+  GPIO_InitStructure.GPIO_Pin = /* GPIO_Pin_10 | */ GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_13;
+  GPIO_Init(GPIOB, &GPIO_InitStructure);
+  //GPIO_PinAFConfig(GPIOB, GPIO_PinSource10, GPIO_AF_ETH);	
+  GPIO_PinAFConfig(GPIOB, GPIO_PinSource11, GPIO_AF_ETH);
+  GPIO_PinAFConfig(GPIOB, GPIO_PinSource12, GPIO_AF_ETH);
+  GPIO_PinAFConfig(GPIOB, GPIO_PinSource13, GPIO_AF_ETH);
+
+  /* Configure PC1, PC4 and PC5 */
+  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_4 | GPIO_Pin_5;
+  GPIO_Init(GPIOC, &GPIO_InitStructure);
+  GPIO_PinAFConfig(GPIOC, GPIO_PinSource1, GPIO_AF_ETH);
+  GPIO_PinAFConfig(GPIOC, GPIO_PinSource4, GPIO_AF_ETH);
+  GPIO_PinAFConfig(GPIOC, GPIO_PinSource5, GPIO_AF_ETH);
+
+  /* Configure the PHY RST  pin */
+  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;
+  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
+  GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
+  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
+  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
+  GPIO_Init(GPIOE, &GPIO_InitStructure);
+
+  GPIO_ResetBits(GPIOE, GPIO_Pin_13);	
+  for (i = 0; i < 20000; i++);
+  GPIO_SetBits(GPIOE, GPIO_Pin_13);
+  for (i = 0; i < 20000; i++);
+}
+
+/**
+  * @brief  Configures and enable the Ethernet global interrupt.
+  * @param  None
+  * @retval None
+  */
+void ETH_NVIC_Config(void)
+{
+  NVIC_InitTypeDef   NVIC_InitStructure;
+
+  /* 2 bit for pre-emption priority, 2 bits for subpriority */
+  NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4); 
+  
+  /* Enable the Ethernet global Interrupt */
+  NVIC_InitStructure.NVIC_IRQChannel = ETH_IRQn;
+  NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 5;
+  NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
+  NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
+  NVIC_Init(&NVIC_InitStructure);    
+}
+
+/*********** Portions COPYRIGHT 2012 Embest Tech. Co., Ltd.*****END OF FILE****/

+ 70 - 0
modules/STM32F4x7_ETH_Driver/stm32f4x7_eth_bsp.h

@@ -0,0 +1,70 @@
+/**
+  ******************************************************************************
+  * @file    stm32f4x7_eth_bsp.h
+  * @author  MCD Application Team
+  * @version V1.0.0
+  * @date    31-October-2011 
+  * @brief   Header for stm32f4x7_eth_bsp.c file.
+  ******************************************************************************
+  * @attention
+  *
+  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
+  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
+  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
+  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
+  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+  *
+  * <h2><center>&copy; Portions COPYRIGHT 2011 STMicroelectronics</center></h2>
+  ******************************************************************************
+  */
+/**
+  ******************************************************************************
+  * <h2><center>&copy; Portions COPYRIGHT 2012 Embest Tech. Co., Ltd.</center></h2>
+  * @file    stm32f4x7_eth_bsp.h
+  * @author  CMP Team
+  * @version V1.0.0
+  * @date    28-December-2012
+  * @brief   Header for stm32f4x7_eth_bsp.c file.       
+  *          Modified to support the STM32F4DISCOVERY, STM32F4DIS-BB and
+  *          STM32F4DIS-LCD modules. 
+  ******************************************************************************
+  * @attention
+  *
+  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
+  * TIME. AS A RESULT, Embest SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
+  * OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
+  * OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
+  * CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+  ******************************************************************************
+  */
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32F4x7_ETH_BSP_H
+#define __STM32F4x7_ETH_BSP_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32f4xx.h"
+//#include "stm32f4_discovery.h"
+//#include "stm32f4_discovery_lcd.h"
+
+/* Exported types ------------------------------------------------------------*/
+/* Exported constants --------------------------------------------------------*/
+#define LAN8720_PHY_ADDRESS       0x01 /* Relative to STM324xG-EVAL Board */
+
+/* Exported macro ------------------------------------------------------------*/
+/* Exported functions ------------------------------------------------------- */
+void  ETH_BSP_Config(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32F4x7_ETH_BSP_H */
+
+
+/*********** Portions COPYRIGHT 2012 Embest Tech. Co., Ltd.*****END OF FILE****/

+ 113 - 0
modules/STM32F4x7_ETH_Driver/stm32f4x7_eth_conf.h

@@ -0,0 +1,113 @@
+/**
+  ******************************************************************************
+  * @file    stm32f4x7_eth_conf.h
+  * @author  MCD Application Team
+  * @version V1.0.0
+  * @date    31-October-2011
+  * @brief   Configuration file for the STM32F4x7 Ethernet driver. 
+  ******************************************************************************
+  * @attention
+  *
+  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
+  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
+  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
+  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
+  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+  *
+  * <h2><center>&copy; Portions COPYRIGHT 2011 STMicroelectronics</center></h2>
+  ******************************************************************************
+  */
+/**
+  ******************************************************************************
+  * <h2><center>&copy; Portions COPYRIGHT 2012 Embest Tech. Co., Ltd.</center></h2>
+  * @file    stm32f4x7_eth_conf.h
+  * @author  CMP Team
+  * @version V1.0.0
+  * @date    28-December-2012
+  * @brief   Configuration file for the STM32F4x7 Ethernet driver.       
+  *          Modified to support the STM32F4DISCOVERY, STM32F4DIS-BB and
+  *          STM32F4DIS-LCD modules. 
+  ******************************************************************************
+  * @attention
+  *
+  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
+  * TIME. AS A RESULT, Embest SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT
+  * OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
+  * OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
+  * CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+  ******************************************************************************
+  */
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32F4x7_ETH_CONF_H
+#define __STM32F4x7_ETH_CONF_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32f4xx.h"
+
+/* Exported types ------------------------------------------------------------*/
+/* Exported constants --------------------------------------------------------*/
+
+/* Uncomment the line below when using time stamping and/or IPv4 checksum offload */
+#define USE_ENHANCED_DMA_DESCRIPTORS
+
+/* Uncomment the line below if you want to use user defined Delay function
+   (for precise timing), otherwise default _eth_delay_ function defined within
+   the Ethernet driver is used (less precise timing) */
+//#define USE_Delay
+
+#ifdef USE_Delay
+  #include "main.h"                /* Header file where the Delay function prototype is exported */  
+  #define _eth_delay_    Delay     /* User can provide more timing precise _eth_delay_ function */
+#else
+  #define _eth_delay_    ETH_Delay /* Default _eth_delay_ function with less precise timing */
+#endif
+
+
+/* Uncomment the line below to allow custom configuration of the Ethernet driver buffers */    
+//#define CUSTOM_DRIVER_BUFFERS_CONFIG   
+
+#ifdef  CUSTOM_DRIVER_BUFFERS_CONFIG
+/* Redefinition of the Ethernet driver buffers size and count */   
+ #define ETH_RX_BUF_SIZE    ETH_MAX_PACKET_SIZE /* buffer size for receive */
+ #define ETH_TX_BUF_SIZE    ETH_MAX_PACKET_SIZE /* buffer size for transmit */
+ #define ETH_RXBUFNB        20                  /* 20 Rx buffers of size ETH_RX_BUF_SIZE */
+ #define ETH_TXBUFNB        5                   /* 5  Tx buffers of size ETH_TX_BUF_SIZE */
+#endif
+
+
+/* PHY configuration section **************************************************/
+/* PHY Reset delay */ 
+#define PHY_RESET_DELAY    ((uint32_t)0x000FFFFF) 
+/* PHY Configuration delay */ 
+#define PHY_CONFIG_DELAY   ((uint32_t)0x00FFFFFF)
+
+/* The PHY status register value change from a PHY to another, so the user have 
+   to update this value depending on the used external PHY */
+#define PHY_SR    ((uint16_t)31) /* Value for DP83848 PHY */
+
+/* The Speed and Duplex mask values change from a PHY to another, so the user
+   have to update this value depending on the used external PHY */
+#define PHY_DUPLEX_SPEED_STATUS_MASK  ((uint16_t)0x001C)
+#define PHY_100BTX_FULL               (18)
+#define PHY_100BTX_HALF								(8)
+#define PHY_10M_FULL									(14)
+#define PHY_10M_HALF									(4)
+   
+/* Exported macro ------------------------------------------------------------*/
+/* Exported functions ------------------------------------------------------- */  
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32F4x7_ETH_CONF_H */
+
+
+/*********** Portions COPYRIGHT 2012 Embest Tech. Co., Ltd.*****END OF FILE****/
+

+ 92 - 0
modules/STM32F4x7_ETH_Driver/stm32f4x7_eth_conf_template.h

@@ -0,0 +1,92 @@
+/**
+  ******************************************************************************
+  * @file    stm32f4x7_eth_conf_template.h
+  * @author  MCD Application Team
+  * @version V1.0.0
+  * @date    14-October-2011
+  * @brief   Configuration file for the STM32F407xx/417xx Ethernet driver.
+  *          This file should be copied to the application folder and renamed to
+  *          stm32f4x7_eth_conf.h    
+  ******************************************************************************
+  * @attention
+  *
+  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
+  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
+  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
+  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
+  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+  *
+  * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
+  ******************************************************************************
+  */ 
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32F4x7_ETH_CONF_H
+#define __STM32F4x7_ETH_CONF_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32f4xx.h"
+
+/* Exported types ------------------------------------------------------------*/
+/* Exported constants --------------------------------------------------------*/
+
+/* Uncomment the line below when using time stamping and/or IPv4 checksum offload */
+#define USE_ENHANCED_DMA_DESCRIPTORS
+
+/* Uncomment the line below if you want to use user defined Delay function
+   (for precise timing), otherwise default _eth_delay_ function defined within
+   the Ethernet driver is used (less precise timing) */
+//#define USE_Delay
+
+#ifdef USE_Delay
+  #include "main.h"                /* Header file where the Delay function prototype is exported */  
+  #define _eth_delay_    Delay     /* User can provide more timing precise _eth_delay_ function */
+#else
+  #define _eth_delay_    ETH_Delay /* Default _eth_delay_ function with less precise timing */
+#endif
+
+/* Uncomment the line below to allow custom configuration of the Ethernet driver buffers */    
+//#define CUSTOM_DRIVER_BUFFERS_CONFIG   
+
+#ifdef  CUSTOM_DRIVER_BUFFERS_CONFIG
+/* Redefinition of the Ethernet driver buffers size and count */   
+ #define ETH_RX_BUF_SIZE    ETH_MAX_PACKET_SIZE /* buffer size for receive */
+ #define ETH_TX_BUF_SIZE    ETH_MAX_PACKET_SIZE /* buffer size for transmit */
+ #define ETH_RXBUFNB        20                  /* 20 Rx buffers of size ETH_RX_BUF_SIZE */
+ #define ETH_TXBUFNB        5                   /* 5  Tx buffers of size ETH_TX_BUF_SIZE */
+#endif
+
+
+/* PHY configuration section **************************************************/
+/* PHY Reset delay */ 
+#define PHY_RESET_DELAY    ((uint32_t)0x000FFFFF) 
+/* PHY Configuration delay */ 
+#define PHY_CONFIG_DELAY   ((uint32_t)0x00FFFFFF)
+
+/* The PHY status register value change from a PHY to another, so the user have 
+   to update this value depending on the used external PHY */
+#define PHY_SR    ((uint16_t)16) /* Value for DP83848 PHY */
+
+/* The Speed and Duplex mask values change from a PHY to another, so the user
+   have to update this value depending on the used external PHY */
+#define PHY_SPEED_STATUS            ((uint16_t)0x0002) /* Value for DP83848 PHY */
+#define PHY_DUPLEX_STATUS           ((uint16_t)0x0004) /* Value for DP83848 PHY */
+
+   
+/* Exported macro ------------------------------------------------------------*/
+/* Exported functions ------------------------------------------------------- */  
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32F4x7_ETH_CONF_H */
+
+
+/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
+

+ 156 - 0
modules/leds/led.c

@@ -0,0 +1,156 @@
+/********************************* (C) РОТЕК ***********************************
+ * @module  led
+ * @file    led.c
+ * @version 1.0.0
+ * @date    XX.XX.XXXX
+ * $brief   Template
+ *******************************************************************************
+ * @history     Version  Author         Comment
+ * XX.XX.XXXX   1.0.0    Telenkov D.A.  First release.
+ *******************************************************************************
+ */
+#include "gpio.h"
+#include "led.h"
+
+#include "FreeRTOS.h"
+#include "task.h"
+
+
+uint16_t statusLedFreq = 1000; // Определяет частоту мигания STATUS LED
+
+LED_t LED_GreenStatus;
+LED_t LED_RedStatus;
+
+LED_STATE_t sLedInt = {GREEN, TOGGLE_OFF};
+LED_STATE_t ledIntTemporary = {GREEN, TOGGLE_OFF};
+
+
+/**
+  * @brief  
+  * @retval 
+  */
+void LED_Init(void)
+{
+  LED_Off(GREEN_STATUS);
+  LED_Off(RED_STATUS);  
+}
+
+/**
+  * @brief  Задача простой мигалки
+  */
+void vTaskLedBlink(void *pvParameters) 
+{
+  for (;;) 
+  {
+	/* Просто отражает состояние контроллера - "живой" */
+    LED_Toggle(GREEN_STATUS);
+    
+    vTaskDelay(statusLedFreq);
+  }
+}
+
+/**
+  * @brief  
+  */
+void LED_AddStateInt(COLOR_t color, TOGGLE_t toggle)
+{
+  
+  //sLedInt.toggle = toggle;
+  
+  if ((sLedInt.color == GREEN) && (toggle == TOGGLE_ON))
+	sLedInt.toggle = toggle;
+  
+  switch (color)
+  {
+	/* Зеленый не перебивает никакой цвет */
+    case GREEN :
+	  
+	break;
+	
+	/* Красный перебивает все цвета и останавливет мигание*/
+	case RED :
+	  sLedInt.color = RED;
+	  sLedInt.toggle = TOGGLE_OFF;
+	break;
+	
+	/* Желтый перебивает только зеленый и останавливает мигание*/
+	case YELLOW :
+	  if (sLedInt.color != RED)
+	  {	
+		sLedInt.color = YELLOW;
+		sLedInt.toggle = TOGGLE_OFF;
+	  }
+	break;
+	
+    default :
+	break;
+  }
+  
+}
+
+/**
+  * @brief  
+  */
+void LED_On(LED_NAMES_t led)
+{
+  API_LED_On(LEDS[led].GPIOx, LEDS[led].GPIO_Pin, LEDS[led].revers);
+}
+
+/**
+  * @brief  
+  */
+void LED_Off(LED_NAMES_t led)
+{
+  API_LED_Off(LEDS[led].GPIOx, LEDS[led].GPIO_Pin, LEDS[led].revers);
+}
+
+/**
+  * @brief  Изменить состояние LED 
+  */
+void LED_Toggle(LED_NAMES_t led)
+{
+  LEDS[led].GPIOx->ODR ^= LEDS[led].GPIO_Pin;
+}
+
+/**
+  * @brief  Включить LED 
+  * @param  port
+  * @param  pin
+  * @param  revers: 0 - для включения LED нужно установить уровень
+  *                 1 - для включения LED нужно сбросить уровень
+  * @retval 
+  */
+void API_LED_On(GPIO_TypeDef* port, uint16_t pin, uint8_t revers)
+{
+  if (revers == 0)
+    port->BSRRL = pin;
+  else
+    port->BSRRH = pin;
+}
+
+/**
+  * @brief  Выключить LED 
+  * @param  port
+  * @param  pin
+  * @param  revers: 0 - для выключения LED нужно снять уровень
+  *                 1 - для выключения LED нужно установить уровень
+  * @retval 
+  */
+void API_LED_Off(GPIO_TypeDef* port, uint16_t pin, uint8_t revers)
+{
+  if (revers == 0)
+    port->BSRRH = pin;
+  else
+    port->BSRRL = pin;
+
+}
+
+/**
+  * @brief  
+  */
+void LED_SetStatusLedFreq(uint16_t freq)
+{
+  statusLedFreq = freq;
+}
+
+/********************************* (C) РОТЕК **********************************/

+ 90 - 0
modules/leds/led.h

@@ -0,0 +1,90 @@
+/********************************* (C) РОТЕК ***********************************
+ * @module  led
+ * @file    led.h
+ * @version 1.0.0
+ * @date    XX.XX.XXXX
+ * $brief   led
+ *******************************************************************************
+ * @history     Version  Author         Comment
+ * XX.XX.XXXX   1.0.0    Telenkov D.A.  First release.
+ *******************************************************************************
+ */
+
+/* Define to prevent recursive  ----------------------------------------------*/
+#ifndef LED_H
+#define LED_H
+   
+#include "stm32f4xx.h"
+
+typedef enum
+{
+  GREEN_STATUS,
+  RED_STATUS,
+  
+} LED_NAMES_t;
+
+typedef enum
+{
+  GREEN = 0,
+  RED,
+  YELLOW,
+  
+} COLOR_t;
+
+typedef enum
+{
+  TOGGLE_ON = 0,
+  TOGGLE_OFF,
+  
+} TOGGLE_t;
+
+typedef struct
+{
+  COLOR_t     color;
+  TOGGLE_t    toggle;
+  
+} LED_STATE_t;
+
+/**
+  * @brief  
+  */
+void LED_Init(void);
+
+/**
+  * @brief  Задача простой мигалки
+  */
+void vTaskLedBlink(void *pvParameters);
+
+/**
+  * @brief  
+  */
+void LED_On(LED_NAMES_t led);
+
+/**
+  * @brief  
+  */
+void LED_Off(LED_NAMES_t led);
+
+/**
+  * @brief  Изменить состояние LED 
+  */
+void LED_Toggle(LED_NAMES_t led);
+
+/**
+  * @brief  
+  */
+void API_LED_On(GPIO_TypeDef* port, uint16_t pin, uint8_t revers);
+
+/**
+  * @brief  
+  */
+void API_LED_Off(GPIO_TypeDef* port, uint16_t pin, uint8_t revers);
+
+/**
+  * @brief  
+  */
+void LED_SetStatusLedFreq(uint16_t freq);
+
+#endif /* #ifndef LED_H */
+
+/********************************* (C) РОТЕК **********************************/

+ 615 - 0
modules/parameters.c

@@ -0,0 +1,615 @@
+/********************************* (C) РОТЕК ***********************************
+ * @module  parameters
+ * @file    parameters.c
+ * @version 1.0.0
+ * @date    XX.XX.XXXX
+ * $brief   Template
+ *******************************************************************************
+ * @history     Version  Author         Comment
+ * XX.XX.XXXX   1.0.0    Telenkov D.A.  First release.
+ *******************************************************************************
+ */
+
+#include "stm32f4xx.h"  
+#include "parameters.h"
+
+#include "settings_api.h"
+#include "rtc.h"
+#include "snmp_api.h"
+#include "settings_api.h"
+#include "snmp.h"
+#include "common_config.h"
+//#include "ups_params.h"
+#if defined HARDWARE_BT6702
+#ifdef PRINTF_STDLIB
+#include <stdio.h>
+#endif
+#ifdef PRINTF_CUSTOM
+#include "tinystdio.h"
+#endif
+#include <string.h>
+#include <stdlib.h>
+#include <math.h>   
+#endif
+/**
+  * @brief  Структура для хранения состояний дискретных входов
+  */
+//extern GPIO_INPUTS_t sGpioInputs;
+
+/**
+  * @brief  Общая структура настроек
+  */
+extern SETTINGS_t sSettings;
+
+/**
+  * @brief  Структура для хранения временных сетевых настроек
+  */
+extern WEB_PARAMS_t sTempWebParams;
+
+/**
+  * @brief  Флаг подтверждения новых сетевых параметров пользователем
+  */  
+extern bool fConfirmWebParams;
+
+
+// ************************************************************************** //
+//                        Параметры UPS
+
+/**
+  * @brief  
+  */
+void GetLineFailBitStr(char *str, uint8_t *len)
+{
+  
+/*  if (upsParams.lineFailBit)
+    *str = '1';
+  else
+    *str = '0';*/
+  
+  *len = 1;
+}
+
+/**
+  * @brief  
+  */
+void GetLowBatteryBitStr(char *str, uint8_t *len)
+{
+  
+/*  if (upsParams.lowBatteryBit)
+    *str = '1';
+  else
+    *str = '0';
+  
+  *len = 1;*/
+}
+
+/**
+  * @brief  
+  */
+void GetInputFreqStr(char *str, uint8_t *len)
+{
+ /* sprintf(str, "%0.1f", upsParams.inputFrequency);
+  //strcpy(str, upsParamsStr.inputFrequency);*/
+  *len = strlen(str);
+}
+
+/**
+  * @brief  
+  */
+void GetOutputFreqStr(char *str, uint8_t *len)
+{
+//  sprintf(str, "%0.1f", upsParams.outputFrequency);
+  //strcpy(str, upsParamsStr.outputFrequency);
+  *len = strlen(str);
+}
+
+/**
+  * @brief  
+  */
+void GetInputVoltageStr(char *str, uint8_t *len)
+{
+//  sprintf(str, "%0.1f", upsParams.inputVoltage);
+  //strcpy(str, upsParamsStr.inputVoltage);
+  *len = strlen(str);
+}
+
+/**
+  * @brief  
+  */
+void GetOutputVoltageStr(char *str, uint8_t *len)
+{
+  //sprintf(str, "%0.1f", upsParams.outputVoltage);
+  //strcpy(str, upsParamsStr.outputVoltage);
+  *len = strlen(str);
+}
+
+/**
+  * @brief  
+  */
+void GetPowerStr(char *str, uint8_t *len)
+{
+ // sprintf(str, "%0.1f", upsParams.power);
+  //sprintf(str, upsParamsStr.power);
+  *len = strlen(str); 
+}
+
+/**
+  * @brief  
+  */
+void GetBatCapacityStr(char *str, uint8_t *len)
+{
+//  sprintf(str, "%0.1f", upsParams.batteryCapacity);
+  //strcpy(str, upsParamsStr.batteryCapacity);
+  *len = strlen(str);
+}
+
+/**
+  * @brief  
+  */
+void GetRuntimeStr(char *str, uint8_t *len)
+{
+ // sprintf(str, "%d", upsParams.runtime);
+  //strcpy(str, upsParamsStr.runtime);
+  *len = strlen(str);
+}
+
+/**
+  * @brief  
+  */
+void GetInternalTempStr(char *str, uint8_t *len)
+{
+//  sprintf(str, "%0.1f", upsParams.temperature);
+  //strcpy(str, upsParamsStr.temperature);
+  *len = strlen(str);
+}
+
+/**
+  * @brief  
+  */
+void GetLoadMonitorStr(char *str, uint8_t *len)
+{
+/* // if (upsParams.monitor_power)
+    *str = '1';
+  else
+    *str = '0';*/
+  
+  *len = 1;
+}
+
+/**
+  * @brief  
+  */
+void GetTempMonitorStr(char *str, uint8_t *len)
+{
+ /*// if (upsParams.monitor_temperature)
+    *str = '1';
+  else
+    *str = '0';*/
+    
+  *len = 1;
+}
+
+/**
+  * @brief  
+  */
+void GetConnectMonitorStr(char *str, uint8_t *len)
+{
+  // В WEB флаг коннекта инвернысный!!!
+  // 0 - коннект есть, 1 - нет
+/*  if (upsParams.connect)
+    *str = '0';
+  else
+    *str = '1';*/
+    
+  *len = 1;
+}
+
+
+// ************************************************************************** //
+//                             Alarms
+
+/**
+  * @brief  Индикация аварийных ситуаций
+  */
+void GetAlarmStr(char *str, uint8_t *len)
+{
+  strncpy(str, 0, 1);
+  *len = 1;
+  
+  //strncpy(str, (char*)&sAlarm, sizeof(sAlarm));
+  //*len = sizeof(sAlarm);
+}
+
+// ************************************************************************** //
+//                             Информация
+
+/**
+  * @brief  Время работы устройства
+  */
+void GetWorkTimeStr(char *str, uint8_t *len)
+{
+  u32_t    tick;
+  uint16_t day;
+  uint8_t  hour;
+  uint8_t  min;
+  
+  snmp_get_sysuptime(&tick);
+  
+  day = tick/8640000;
+  
+  tick = tick%8640000;
+  hour = tick/360000;
+  
+  tick = tick%360000;
+  min = tick/6000;
+  
+  sprintf(str, "%d дн. %d ч. %d мин.", day, hour, min);
+  *len = strlen(str);
+}
+
+/**
+  * @brief  Модель устройства
+  */
+void GetModelStr(char *str, uint8_t *len)
+{
+  *len = strlen(sSettings.sSnmp.sysName);
+  strncpy(str, sSettings.sSnmp.sysName, *len);
+}
+
+/**
+  * @brief  Дата производства
+  */
+void GetProductionDataStr(char *str, uint8_t *len)
+{
+  *len = strlen(sSettings.sInfo.productionData);
+  strncpy(str, sSettings.sInfo.productionData, *len);
+}
+
+/**
+  * @brief  Версия ПО
+  */
+void GetVersionStr(char *str, uint8_t *len) // +
+{
+  *len = strlen(VERSION);
+  strncpy(str, VERSION, *len);
+}
+
+/**
+  * @brief  MAC адрес устройства
+  */
+void GetMacStr(char *str, uint8_t *len)
+{
+  *len = strlen(sSettings.sInfo.mac);
+  strncpy(str, sSettings.sInfo.mac, *len);
+}
+
+/**
+  * @brief  Серийный номер устройства
+  */
+void GetSerialNumberStr(char *str, uint8_t *len)
+{
+  *len = strlen(sSettings.sInfo.serialNumber);
+  strncpy(str, sSettings.sInfo.serialNumber, *len);
+}
+
+/**
+  * @brief  Владелец устройства
+  */
+void GetOwnerStr(char *str, uint8_t *len)
+{
+  *len = strlen(sSettings.sSnmp.sysContact);
+  strncpy(str, sSettings.sSnmp.sysContact, *len);
+}
+
+/**
+  * @brief  Местоположение устройства
+  */
+void GetLocationStr(char *str, uint8_t *len)
+{
+  *len = strlen(sSettings.sSnmp.sysLocation);
+  strncpy(str, sSettings.sSnmp.sysLocation, *len);
+}
+
+/**
+  * @brief  Комментарии
+  */
+void GetCommentsStr(char *str, uint8_t *len)
+{
+  *len = strlen(sSettings.sInfo.comments);
+  strncpy(str, sSettings.sInfo.comments, *len);
+}
+
+// ************************************************************************** //
+//                             Параметры WEB
+
+/**
+  * @brief  Текущий IP адрес
+  */
+void GetIpStr(char *str, uint8_t *len)
+{
+  /* Если сейчас временные настройки */
+  if (sSettings.sFlags.netsettingsChanged)
+	sprintf(str, "%s", sSettings.sWebTempParams.ip);
+  else	
+    sprintf(str, "%s", sSettings.sWebParams.ip);
+  
+  *len = strlen(str);
+}
+
+/**
+  * @brief  Текущий шлюз
+  */
+void GetGatewayStr(char *str, uint8_t *len)
+{
+  /* Если сейчас временные настройки */
+  if (sSettings.sFlags.netsettingsChanged)
+	sprintf(str, "%s", sSettings.sWebTempParams.gate);
+  else
+	sprintf(str, "%s", sSettings.sWebParams.gate);
+  
+  *len = strlen(str);
+}
+
+/**
+  * @brief  Текущая маска подсети
+  */
+void GetMaskStr(char *str, uint8_t *len)
+{
+  /* Если сейчас временные настройки */
+  if (sSettings.sFlags.netsettingsChanged)
+    sprintf(str, "%s", sSettings.sWebTempParams.mask);
+  else	
+    sprintf(str, "%s", sSettings.sWebParams.mask);
+  
+  *len = strlen(str);
+}
+
+/**
+  * @brief  Настройка DHCP
+  */
+void GetDhcpStateStr(char *str, uint8_t *len)
+{
+  /* Если сейчас временные настройки */
+  if (sSettings.sFlags.netsettingsChanged)
+  {
+    if (sSettings.sWebTempParams.dhcpEnable)
+      *str = '1';
+    else
+      *str = '0';
+  }
+  else
+  {
+    if (sSettings.sWebParams.dhcpEnable)
+      *str = '1';
+    else
+      *str = '0';
+  }
+  
+  *len = 1;
+}
+
+// ************************************************************************** //
+//                             Параметры SNMP
+
+/**
+  * @brief  Текущее community для чтения
+  */
+void GetReadCommunity(char *str, uint8_t *len)
+{
+  sprintf(str, "%s", sSettings.sSnmp.readCommunity);
+  *len = strlen(str);
+}
+
+/**
+  * @brief  Текущее community для записи
+  */
+void GetWriteCommunity(char *str, uint8_t *len)
+{
+  sprintf(str, "%s", sSettings.sSnmp.writeCommunity);
+  *len = strlen(str);
+}
+
+/**
+  * @brief  IP SNMP менеджера
+  */
+void GetManagerIp(char *str, uint8_t *len)
+{
+  sprintf(str, "%s", sSettings.sSnmp.managerIP);
+  *len = strlen(str);
+}
+
+void GetManagerIp2(char *str, uint8_t *len)
+{
+  sprintf(str, "%s", sSettings.sSnmp.managerIP2);
+  *len = strlen(str);
+}
+
+void GetManagerIp3(char *str, uint8_t *len)
+{
+  sprintf(str, "%s", sSettings.sSnmp.managerIP3);
+  *len = strlen(str);
+}
+
+// ************************************************************************** //
+//                          Сброс настроек и перезагрузка
+
+/**
+  * @brief  Произошел сброс настроек
+  */
+void GetRestore(char *str, uint8_t *len) // +
+{
+  sprintf(str, "%s", "1");
+  *len = 1;
+}
+
+/**
+  * @brief  Произошла перезагрузка
+  */
+void GetReboot(char *str, uint8_t *len) // +
+{
+  sprintf(str, "%s", "1");
+  *len = 1;
+}
+
+// ************************************************************************** //
+//                          Флаги
+
+/**
+  * @brief  Вернуть признак изменения сетевых параметров
+  */
+void GetWebReinitFlag(char *str, uint8_t *len)
+{
+  if (sSettings.sFlags.netsettingsChanged)
+  {
+    sprintf(str, "%s", "true");
+    *len = strlen(str);
+  }
+  else
+  {
+    sprintf(str, "%s", "false");
+    *len = strlen(str);
+  }
+  
+}
+
+// ************************************************************************** //
+//                             Установка параметрв
+// ************************************************************************** //
+
+/**
+  * @brief  Установить признак обновления ПО. 
+  */
+void SetLoadMode(void)
+{
+  sSettings.bootParams.loadMode = 1;
+}
+
+/**
+  * @brief  Установить признак изменения сетевых параметров
+  */
+void SetWebReinitFlag(bool value)
+{
+  sSettings.sFlags.netsettingsChanged = value;
+}
+
+/**
+  * @brief  Установить флаг подтверждения сетевых настроек пользователем
+  */
+void SetConfirmWebParamsFlag(void)
+{
+  fConfirmWebParams = true;
+}
+
+
+// ************************************************************************** //
+//                             Сетевые параметры
+/**
+  * @brief  IP адрес
+  */
+void SetIPStr(char *str)
+{
+  //strcpy(sSettings.sWebParams.ip, str);
+  strcpy(sSettings.sWebTempParams.ip, str); 
+}
+
+/**
+  * @brief  Шлюз
+  */
+void SetGatewayStr(char *str)
+{
+  //strcpy(sSettings.sWebParams.gate, str);
+  strcpy(sSettings.sWebTempParams.gate, str);
+}
+
+/**
+  * @brief  Текущая маска подсети
+  */
+void SetMaskStr(char *str)
+{
+  //strcpy(sSettings.sWebParams.mask, str);
+  strcpy(sSettings.sWebTempParams.mask, str);
+}
+
+/**
+  * @brief  Настройка DHCP
+  */
+void SetDhcpStateStr(char *str)
+{
+  if (strncmp(str, "on", 2) == 0)
+	//sSettings.sWebParams.dhcpEnable = 1;
+    sSettings.sWebTempParams.dhcpEnable = 1;
+  else
+	//sSettings.sWebParams.dhcpEnable = 0;
+    sSettings.sWebTempParams.dhcpEnable = 0;
+}
+
+// ************************************************************************** //
+//                             Параметры SNMP
+
+/**
+  * @brief  Community для чтения
+  */
+void SetReadCommunity(char *str)
+{
+  strcpy(sSettings.sSnmp.readCommunity, str);
+}
+
+/**
+  * @brief  Community для записи
+  */
+void SetWriteCommunity(char *str)
+{
+  strcpy(sSettings.sSnmp.writeCommunity, str);
+}
+
+/**
+  * @brief  IP SNMP менеджера
+  */
+void SetManagerIp(char *str)
+{
+  strcpy(sSettings.sSnmp.managerIP, str);
+  SNMP_SetManagerIP(sSettings.sSnmp.managerIP);
+}
+
+void SetManagerIp2(char *str)
+{
+  strcpy(sSettings.sSnmp.managerIP2, str);
+  SNMP_SetManagerIP(sSettings.sSnmp.managerIP2);
+}
+
+void SetManagerIp3(char *str)
+{
+  strcpy(sSettings.sSnmp.managerIP3, str);
+  SNMP_SetManagerIP(sSettings.sSnmp.managerIP3);
+}
+
+/**
+  * @brief  Установить владельца
+  */
+void SetOwner(char *str)
+{
+  strcpy(sSettings.sSnmp.sysContact, str);
+  SNMP_SetSysContact(sSettings.sSnmp.sysContact);
+  SNMP_SetObjDescr();
+}
+
+/**
+  * @brief  Установить местоположение
+  */
+void SetLocation(char *str)
+{
+  strcpy(sSettings.sSnmp.sysLocation, str);
+  SNMP_SetSysLocation(sSettings.sSnmp.sysLocation);
+}
+
+/**
+  * @brief  Установить комментарий
+  */
+void SetComment(char *str)
+{
+  strcpy(sSettings.sInfo.comments, str);
+}
+
+
+
+/********************************* (C) РОТЕК **********************************/

+ 711 - 0
modules/parameters.h

@@ -0,0 +1,711 @@
+/********************************* (C) РОТЕК ***********************************
+ * @module  parameters
+ * @file    parameters.h
+ * @version 1.0.0
+ * @date    XX.XX.XXXX
+ * $brief   parameters
+ *******************************************************************************
+ * @history     Version  Author         Comment
+ * XX.XX.XXXX   1.0.0    Telenkov D.A.  First release.
+ *******************************************************************************
+ */
+
+/* Define to prevent recursive  ----------------------------------------------*/
+#ifndef PARAMETERS_H
+#define PARAMETERS_H
+
+#include <stdbool.h>
+
+// ************************************************************************** //
+//                        Параметры UPS
+
+void GetLineFailBitStr(char *str, uint8_t *len);
+void GetLowBatteryBitStr(char *str, uint8_t *len);
+void GetInputFreqStr(char *str, uint8_t *len);
+void GetOutputFreqStr(char *str, uint8_t *len);
+void GetInputVoltageStr(char *str, uint8_t *len);
+void GetOutputVoltageStr(char *str, uint8_t *len);
+void GetPowerStr(char *str, uint8_t *len);
+void GetBatCapacityStr(char *str, uint8_t *len);
+void GetRuntimeStr(char *str, uint8_t *len);
+void GetInternalTempStr(char *str, uint8_t *len);
+void GetLoadMonitorStr(char *str, uint8_t *len);
+void GetTempMonitorStr(char *str, uint8_t *len);
+void GetConnectMonitorStr(char *str, uint8_t *len);
+
+
+
+/**
+  * @brief  Контроль входного напряжения ИИП
+  *         0 - напряжение в норме;
+  *         1 - напряжение ниже нормы
+  *         2 - напряжение выше нормы
+  */
+void GetAcStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Контроль входного напряжения ИИП
+  */
+void GetAcInt(char *str, uint8_t *len);
+
+/**
+  * @brief  Напряжение на выходе ИИП
+  */
+void GetPpsVoltStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Выходной ток ИИП
+  */
+void GetPpsCurrStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Управление ИИП (отключен/подключен)
+  */
+void GetPpsControlStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Управление ИИП (отключен/подключен)
+  */
+void GetPpsControlInt(uint32_t *value);
+
+/**
+  * @brief  Качество АКБ
+  */
+void GetBatQualityStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Оставшееся время работы АКБ
+  */
+void GetBatTimeLeftStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Температура на АКБ
+  */
+void GetBatTempStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Температура на АКБ
+  */
+void GetBatTempStrEn(char *str, uint8_t *len);
+
+/**
+  * @brief  Напряжение на АКБ
+  */
+void GetBatVoltStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Напряжение на 1й батареи
+  */
+void GetBatVolt1Str(char *str, uint8_t *len);
+
+/**
+  * @brief  Напряжение на 2й батареи
+  */
+void GetBatVolt2Str(char *str, uint8_t *len);
+
+/**
+  * @brief  Напряжение на 3й батареи
+  */
+void GetBatVolt3Str(char *str, uint8_t *len);
+
+/**
+  * @brief  Напряжение на 4й батареи
+  */
+void GetBatVolt4Str(char *str, uint8_t *len);
+
+/**
+  * @brief  Ток заряда
+  */
+void GetBatCurrStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Симметрия АКБ
+  */
+void GetBatSymStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Симметрия АКБ
+  */
+void GetBatSymInt(char *str, uint8_t *len);
+
+/**
+  * @brief  Отключение питания от АКБ
+  */
+void GetBatToMcuKeyStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Отключение питания от АКБ
+  */
+void GetBatToMcuKeyInt(uint32_t *value);
+
+/**
+  * @brief  Отключение АКБ от зарядки
+  */
+void GetBatToSupKeyStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Отключение АКБ от зарядки
+  */
+void GetBatToSupKeyInt(uint32_t *value);
+
+/**
+  * @brief  Напряжение на нагрузке
+  */
+void GetLoadVoltStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Ток в нагрузку
+  */
+void GetLoadCurrStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Управление нагрузкой
+  */
+void GetLoadKeyStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Управление нагрузкой
+  */
+void GetLoadKeyInt(uint32_t *value);
+
+/**
+  * @brief  Температура за бортом
+  */
+void GetExtTempStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Температура в шкафу
+  */
+void GetExtTempStrEn(char *str, uint8_t *len);
+
+/**
+  * @brief  Режим работы
+  */
+void GetModeStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Режим работы
+  */
+void GetModeEn(char *str, uint8_t *len);
+
+/**
+  * @brief  Индикация аварийных ситуаций
+  * TODO добавить реальный параметр
+  */
+void GetAlarmStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Состояние двери
+  */
+void GetDoorStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Состояние двери
+  */
+void GetDoorInt(char *str, uint8_t *len);
+
+/**
+  * @brief  Текущее время ч/м/с
+  */
+void GetCurrentTimeStr(char *str, uint8_t *len);
+
+// ************************************************************************** //
+//                             Информация
+
+/**
+  * @brief  Время работы устройства
+  */
+void GetWorkTimeStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Модель устройства
+  */
+void GetModelStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Дата производства
+  */
+void GetProductionDataStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Версия ПО
+  */
+void GetVersionStr(char *str, uint8_t *len);
+
+/**
+  * @brief  MAC адрес устройства
+  */
+void GetMacStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Серийный номер устройства
+  */
+void GetSerialNumberStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Владелец устройства
+  */
+void GetOwnerStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Местоположение устройства
+  */
+void GetLocationStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Комментарии
+  */
+void GetCommentsStr(char *str, uint8_t *len);
+
+
+// ************************************************************************** //
+//                        Параметры температуры
+
+/**
+  * @brief  Нижняя граница рабочей температуры (в шкафу)
+  */
+void GetTempMinStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Верхняя граница рабочей температуры (в шкафу)
+  */
+void GetTempMaxStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Верхняя граница рабочей температуры (в шкафу)
+  */
+void GetTempHistMinStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Верхняя граница рабочей температуры (в шкафу)
+  */
+void GetTempHistMaxStr(char *str, uint8_t *len);
+
+// ************************************************************************** //
+//                   Параметры температуры батарей
+
+/**
+  * @brief  Состояние контроля температуры батарей (вкл/выкл)
+  */
+void GetBatTempStateStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Нижняя граница рабочей температуры (на батареях)
+  */
+void GetBatTempMinStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Верхняя граница рабочей температуры (на батареях)
+  */
+void GetBatTempMaxStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Гистерезис для нижней границы рабочей температуры (на батареях)
+  */
+void GetBatTempHistMinStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Гистерезис для врхней границы рабочей температуры (на батареях)
+  */
+void GetBatTempHistMaxStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Напряжение отклчения АКБ
+  */
+void GetBatVoltageMinStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Напряжение отклчения АКБ гистерезис
+  */
+void GetBatVoltageMinHistStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Емкость
+  */
+void GetBatCapasityStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Напряжение заряда АКБ
+  */
+void GetBatChargeVoltStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Вкл/выкл температурную компенсацию АКБ
+  */
+void GetBatTempCompensStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Коэффициент температурной коменсации в буферном режиме
+  */
+void GetBatCoefBufStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Коэффициент температурной коменсации в циклическом режиме
+  */
+void GetBatCoefCycleStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Вкл/выкл контроль симметрии АКБ
+  */
+void GetBatSymmetryStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Напряжение отключения нагрузки
+  */
+void GetLoadVoltMinStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Напряжение отключения нагрузки гистерезис
+  */
+void GetLoadVoltMinHistStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Максимальный ток
+  */
+void GetPpsCurrentMaxStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Максимальный ток гистерезис
+  */
+void GetPpsCurrentMaxHistStr(char *str, uint8_t *len);
+
+// ************************************************************************** //
+//                             Параметры WEB
+
+/**
+  * @brief  Текущий IP адрес
+  */
+void GetIpStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Текущий шлюз
+  */
+void GetGatewayStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Текущая маска подсети
+  */
+void GetMaskStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Настройка DHCP
+  */
+void GetDhcpStateStr(char *str, uint8_t *len);
+
+// ************************************************************************** //
+//                             Параметры SNMP
+/**
+  * @brief  Текущее TRAP community
+  */
+void GetTrapCommunity(char *str, uint8_t *len);
+
+/**
+  * @brief  Текущее community для чтения
+  */
+void GetReadCommunity(char *str, uint8_t *len);
+
+/**
+  * @brief  Текущее community для записи
+  */
+void GetWriteCommunity(char *str, uint8_t *len);
+
+/**
+  * @brief  IP SNMP менеджера
+  */
+void GetManagerIp(char *str, uint8_t *len);
+void GetManagerIp2(char *str, uint8_t *len);
+void GetManagerIp3(char *str, uint8_t *len);
+
+// ************************************************************************** //
+//                             Параметры SNTP
+/**
+  * @brief  Состояние SNTP
+  */
+void GetSntpStateStr(char *str, uint8_t *len);
+
+/**
+  * @brief  IP адрес SNTP сервера
+  */
+void GetSntpServerIpStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Часовой пояс контроллера
+  */
+void GetSntpTimeZoneStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Дата последней синхронизации SNTP
+  */
+void GetSntpLastDataStr(char *str, uint8_t *len);
+
+
+// ************************************************************************** //
+//                          Сброс настроек и перезагрузка
+
+/**
+  * @brief  Произошел сброс настроек
+  */
+void GetRestore(char *str, uint8_t *len);
+
+/**
+  * @brief  Произошла перезагрузка
+  */
+void GetReboot(char *str, uint8_t *len);
+
+// ************************************************************************** //
+//                                Флаги
+
+/**
+  * @brief  Установить признак изменения сетевых параметров
+  */
+void GetWebReinitFlag(char *str, uint8_t *len);
+
+/**
+  * @brief  Возвращает флаг необходимости профилактики сульфатации
+  */
+void GetProfilactionFlag(char *str, uint8_t *len);
+
+/**
+  * @brief  Возвращает флаг необходимости профилактики сульфатации
+  */
+void GetProfilactionFlagInt(uint32_t *value);
+
+/**
+  * @brief  Возвращает флаг необходимости профилактики сульфатации
+  */
+void GetProfilactionFlagSnmp(char* value, uint8_t *len);
+
+/**
+  * @brief  Возвращает частоту
+  */
+void GetFreqStr(char *str, uint8_t *len);
+
+/**
+  * @brief  Возвращает dutycycle
+  */
+void GetDutyStr(char *str, uint8_t *len);
+
+// ************************************************************************** //
+//                             Установка параметрв
+// ************************************************************************** //
+
+/**
+  * @brief  Установить признак обновления ПО. 
+  */
+void SetLoadMode(void);
+
+/**
+  * @brief  Установить признак изменения сетевых параметров
+  */
+void SetWebReinitFlag(bool value);
+
+/**
+  * @brief  Установить флаг подтверждения сетевых настроек пользователем
+  */
+void SetConfirmWebParamsFlag(void);
+
+// ************************************************************************** //
+//                 Параметры контроля температуры в шкафу
+/**
+  * @brief  Нижняя граница рабочей температуры (в шкафу)
+  */
+void SetTempMinStr(char *str);
+
+/**
+  * @brief  Верхняя граница рабочей температуры (в шкафу)
+  */
+void SetTempMaxStr(char *str);
+
+/**
+  * @brief  Верхняя граница рабочей температуры гистерезис (в шкафу)
+  */
+void SetTempHistMinStr(char *str);
+
+/**
+  * @brief  Верхняя граница рабочей температуры гистерезис (в шкафу)
+  */
+void SetTempHistMaxStr(char *str);
+
+// ************************************************************************** //
+//                Параметры контроля температуры на батареях
+
+/**
+  * @brief  Состояние контроля температуры батарей (вкл/выкл)
+  */
+void SetBatTempStateStr(char *str);
+
+/**
+  * @brief  Нижняя граница рабочей температуры (на батареях)
+  */
+void SetBatTempMinStr(char *str);
+
+/**
+  * @brief  Верхняя граница рабочей температуры (на батареях)
+  */
+void SetBatTempMaxStr(char *str);
+
+/**
+  * @brief  Гистерезис для нижней границы рабочей температуры (на батареях)
+  */
+void SetBatTempHistMinStr(char *str);
+
+/**
+  * @brief  Гистерезис для врхней границы рабочей температуры (на батареях)
+  */
+void SetBatTempHistMaxStr(char *str);
+
+// ************************************************************************** //
+//                             Параметры АКБ
+
+/**
+  * @brief  Напряжение отклчения АКБ
+  */
+void SetBatVoltageMinStr(char *str);
+
+/**
+  * @brief  Напряжение отклчения АКБ гистерезис
+  */
+void SetBatVoltageMinHistStr(char *str);
+
+/**
+  * @brief  Емкость АКБ
+  */
+void SetBatCapasityStr(char *str);
+
+/**
+  * @brief  Напряжение заряда АКБ
+  */
+void SetBatChargeVoltStr(char *str);
+
+/**
+  * @brief  Вкл/выкл температурную компенсацию АКБ
+  */
+void SetBatTempCompensStr(char *str);
+
+/**
+  * @brief  Коэффициент температурной коменсации в буферном режиме
+  */
+void SetBatCoefBufStr(char *str);
+
+/**
+  * @brief  Коэффициент температурной коменсации в циклическом режиме
+  */
+void SetBatCoefCycleStr(char *str);
+
+/**
+  * @brief  Вкл/выкл контроль симметрии АКБ
+  */
+void SetBatSymmetryStr(char *str);
+
+// ************************************************************************** //
+//                             Сетевые параметры
+
+/**
+  * @brief  IP адрес
+  */
+void SetIPStr(char *str);
+
+/**
+  * @brief  Шлюз
+  */
+void SetGatewayStr(char *str);
+
+
+/**
+  * @brief  Текущая маска подсети
+  */
+void SetMaskStr(char *str);
+
+/**
+  * @brief  Настройка DHCP
+  */
+void SetDhcpStateStr(char *str);
+
+// ************************************************************************** //
+//                             Параметры SNMP
+
+/**
+  * @brief  TRAP community
+  */
+void SetTrapCommunity(char *str);
+
+/**
+  * @brief  Community для чтения
+  */
+void SetReadCommunity(char *str);
+
+/**
+  * @brief  Community для записи
+  */
+void SetWriteCommunity(char *str);
+
+/**
+  * @brief  IP SNMP менеджера
+  */
+void SetManagerIp(char *str);
+void SetManagerIp2(char *str);
+void SetManagerIp3(char *str);
+
+/**
+  * @brief  Установить владельца
+  */
+void SetOwner(char *str);
+
+/**
+  * @brief  Установить местоположение
+  */
+void SetLocation(char *str);
+
+/**
+  * @brief  Установить комментарий
+  */
+void SetComment(char *str);
+
+
+// ************************************************************************** //
+//                             Параметры нагрузки
+
+/**
+  * @brief  Напряжение отключения нагрузки
+  */
+void SetLoadVoltMinStr(char *str);
+
+/**
+  * @brief  Напряжение отключения нагрузки гистерезис
+  */
+void SetLoadVoltMinHistStr(char *str);
+
+// ************************************************************************** //
+//                             Параметры ИИП
+/**
+  * @brief  Максимальный ток
+  */
+void SetPpsCurrentMaxStr(char *str);
+
+/**
+  * @brief  Максимальный ток гистерезис
+  */
+void SetPpsCurrentMaxHistStr(char *str);
+
+// ************************************************************************** //
+//                             Параметры SNTP
+
+/**
+  * @brief  Состояние SNTP
+  */
+void SetSntpStateStr(char *str);
+
+/**
+  * @brief  IP адрес SNTP сервера
+  */
+void SetSntpServerIpStr(char *str);
+
+/**
+  * @brief  Часовой пояс контроллера
+  */
+void SetSntpTimeZoneStr(char *str);
+
+
+#endif /* #ifndef PARAMETERS_H */
+
+/********************************* (C) РОТЕК **********************************/

+ 330 - 0
modules/settings_api.c

@@ -0,0 +1,330 @@
+/********************************* (C) ROTEK ***********************************
+ * @module  settings_api
+ * @file    settings_api.c
+ * @version 1.0.0
+ * @date    XX.XX.XXXX
+ * $brief   Settings
+ *******************************************************************************
+ * @history     Version  Author         Comment
+ * XX.XX.XXXX   1.0.0    Telenkov D.A.  First release.
+ *******************************************************************************
+ */
+
+#include "stm32f4xx.h"  
+#include "settings_api.h"
+#include "common_config.h"
+#include "snmp_api.h"
+#include "trap_api.h"
+
+#include "FreeRTOS.h"
+#include "task.h"
+
+#include <string.h>
+#include <stdlib.h>
+
+/**
+  * @brief  Флаг подтверждения новых сетевых параметров пользователем
+  */  
+bool fConfirmWebParams = false;
+   
+/**
+  * @brief  Общая структура настроек
+  */
+SETTINGS_t sSettings;
+
+/**
+  * @brief  Установить параметры обновления ПО по умолчанию
+  */
+void SETTINGS_SetBootParamsDef(void)
+{
+  sSettings.bootParams.loadMode = 0;
+  sSettings.bootParams.bootTry = 0;
+}
+
+/**
+  * @brief  Установить параметры сетевого подключения по умолчанию
+  */
+void SETTINGS_SetWebParamsDef(void)
+{
+	  strcpy(sSettings.sWebParams.ip, "192.168.1.2");
+	  strcpy(sSettings.sWebParams.gate, "192.168.1.1");
+	  strcpy(sSettings.sWebParams.mask, "255.255.255.0");
+	  sSettings.sWebParams.dhcpEnable = 1;
+}
+
+/**
+  * @brief  Установить временные параметры сетевого подключения по умолчанию
+  */
+void SETTINGS_SetTempWebParamsDef(void)
+{
+	  strcpy(sSettings.sWebParams.ip, "192.168.1.2");
+	  strcpy(sSettings.sWebParams.gate, "192.168.1.1");
+	  strcpy(sSettings.sWebParams.mask, "255.255.255.0");
+	  sSettings.sWebParams.dhcpEnable = 1;
+}
+
+/**
+  * @brief  Установить параметры SNMP по умолчанию
+  */
+void SETTINGS_SetSnmpDef(void)
+{
+  strcpy(sSettings.sSnmp.sysDescr, "");
+  strcpy(sSettings.sSnmp.readCommunity, "public");
+  strcpy(sSettings.sSnmp.writeCommunity, "public");
+  strcpy(sSettings.sSnmp.sysContact, "");
+  strcpy(sSettings.sSnmp.sysName, "BT-6701");
+  strcpy(sSettings.sSnmp.sysLocation, "");
+  strcpy(sSettings.sSnmp.managerIP, "0.0.0.0");
+  strcpy(sSettings.sSnmp.managerIP2, "0.0.0.0");
+  strcpy(sSettings.sSnmp.managerIP3, "0.0.0.0");
+}
+
+/**
+  * @brief  Установить Информацию об устройстве по умолчанию
+  */
+void SETTINGS_SetInfoDef(void)
+{
+  strcpy(sSettings.sInfo.productionData, "08.07.2016"); 
+  //strcpy(sSettings.sInfo.mac, "EC-4C-4D-00-90-01"); 
+  strcpy(sSettings.sInfo.mac, "EC-4C-4D-00-00-0A");
+  strcpy(sSettings.sInfo.serialNumber, "KN-03-00001"); 
+  strcpy(sSettings.sInfo.comments, ""); 
+}  
+
+/**
+  * @brief  Установить флаги по умолчанию
+  */
+void SETTINGS_SetFlagsDef(void)
+{
+  sSettings.sFlags.netsettingsChanged = false;
+}
+  
+/**
+  * @brief  Сброс настроек в значения по умолчанию
+  */
+void SETTINGS_SetDefault(void)
+{
+  SETTINGS_SetWebParamsDef();
+  SETTINGS_SetTempWebParamsDef();
+  SETTINGS_SetSnmpDef();
+}
+
+/**
+  * @brief  Сброс всех настроек в значения по умолчанию кроме сетевых настроек
+  */
+void SETTINGS_SetPartDefault(void)
+{
+  SETTINGS_SetBootParamsDef();
+  SETTINGS_SetSnmpDef();
+  SETTINGS_SetFlagsDef();
+  
+  sSettings.controlWorld = SETTINGS_CONTROL_WORD;
+}
+
+/**
+  * @brief  Сброс всех настроек в значения по умолчанию
+  */
+void SETTINGS_SetAllDefault(void)
+{
+  SETTINGS_SetBootParamsDef();
+  SETTINGS_SetWebParamsDef();
+  SETTINGS_SetTempWebParamsDef();
+  SETTINGS_SetSnmpDef();
+  SETTINGS_SetInfoDef();
+  SETTINGS_SetFlagsDef();
+  
+  sSettings.controlWorld = SETTINGS_CONTROL_WORD;
+}
+
+/**
+  * @brief  Установка настроек для отладки
+  */
+void SETTINGS_SetDefaultDebug(void)
+{
+  SETTINGS_SetWebParamsDef();
+  SETTINGS_SetTempWebParamsDef();
+  SETTINGS_SetSnmpDef();
+  SETTINGS_SetBootParamsDef();
+  SETTINGS_SetFlagsDef();
+  //SETTINGS_SetInfoDef();
+  
+  sSettings.controlWorld = SETTINGS_CONTROL_WORD;
+}
+  
+/**
+  * @brief  Запись структуры настроек во flesh
+  */
+void SETTINGS_Save(void)
+{
+  SETTINGS_WriteToFlash((uint8_t*)&sSettings, sizeof(sSettings));
+}
+
+/**
+  * @brief  Загрузка структуры настроек из flesh
+  */
+void SETTINGS_Load(void)
+{
+  uint32_t loadCRC;  // CRC из flash
+  uint32_t newCRC;   // CRC загруженной структуры настроек
+  
+  SETTINGS_ReadFromFlash((uint8_t*)&sSettings, sizeof(sSettings));
+  
+  /* Считываем CRC из флеш памяти */
+  loadCRC = (*(uint32_t*)CRC_ADDRESS);
+    
+  /* Рассчитываем CRC для структуры настроек */
+  newCRC = SETTINGS_GetCRC();
+  
+  /* Если CRC не совпадают нужно прошивать дефолтные настройки */
+  /*
+  if (loadCRC != newCRC)
+  {
+	SETTINGS_SetAllDefault();
+    SETTINGS_Save();
+  }
+  */
+  /* CRC совпала, проверяем контрольное слов если слово не совпадает
+     то это значит, что поплыла структура нстроек, прошиваем дефолт */
+  /*
+  else if (sSettings.controlWorld != SETTINGS_CONTROL_WORD)
+  {
+    SETTINGS_SetAllDefault();
+    SETTINGS_Save();
+  }	
+  */
+}
+
+/**
+  * @brief  
+  */
+void SETTINGS_WriteToFlash(uint8_t *data, uint32_t size)
+{
+  uint32_t baseAddress = SETTINGS_SECTOR;
+  uint32_t checkCrc = 0;
+  uint32_t crc = SETTINGS_GetCRC();
+  bool fAlarm = 0;	
+  
+  
+  FLASH_Unlock();
+  
+  for (uint8_t i = 0; i < 3; i++)
+  {	
+    SETTINGS_EraseFlashSector();
+
+    for (uint32_t i = 0; i < size; i++)
+      FLASH_ProgramByte(baseAddress++, *data++);
+  
+    FLASH_ProgramWord((uint32_t)CRC_ADDRESS, crc);
+
+	FLASH_Lock();
+    
+	/* Считываем что записали */
+	SETTINGS_ReadFromFlash((uint8_t*)&sSettings, sizeof(sSettings));
+	
+	checkCrc = SETTINGS_GetCRC();
+	
+	/* Проверяем  CRC того что было записано */	  
+	if (checkCrc == crc)
+	  break;
+	else 
+	  fAlarm = 1; // Авария
+  }	
+  
+  /* Произошел сбой при записи - висим */
+  if (fAlarm)
+	while (1)
+	{};
+}
+
+/**
+  * @brief  
+  */
+void SETTINGS_ReadFromFlash(uint8_t *data, uint32_t size)
+{
+  uint32_t baseAddress = SETTINGS_SECTOR;
+  
+  for (uint32_t i = 0; i < size; i++)
+	*data++ = (*(uint32_t*)baseAddress++);;
+}
+
+/**
+  * @brief  Очистка сектора настроек
+  * @retval 
+  */
+void SETTINGS_EraseFlashSector(void)
+{
+  FLASH_EraseSector(FLASH_Sector_4, VoltageRange_3); /* 128 Kbyte */
+}
+
+/**
+  * @brief  
+  * @retval 
+  */
+uint32_t SETTINGS_GetCRC(void)
+{
+  CRC_ResetDR();
+  return CRC_CalcBlockCRC((uint32_t*)&sSettings, sizeof(sSettings)/4);
+}
+
+/**
+  * @brief  Сброс флага boottry и сохранение структуры настроек
+  */
+void SETTINGS_ResetBootTry(void)
+{
+  if (sSettings.bootParams.bootTry != 0)
+  {
+    sSettings.bootParams.bootTry = 0;
+	
+	/* Отправка трапа об успешном обновлении ПО */
+	SNMP_SendUserTrap(FW_VERSION_UPDATED);
+	
+	//taskENTER_CRITICAL();
+    SETTINGS_Save();
+    //taskEXIT_CRITICAL();
+  }	
+}
+
+/**
+  * @brief  Преобразует mac адрес строкового формата в массив uint8_t
+  * @param  mac - буфер для вывода mac адреса
+  */
+void SETTINGS_GetMac(uint8_t *mac)
+{
+  char dummy[2];
+  char *macPtr = sSettings.sInfo.mac;	
+  
+  for (uint8_t i = 0; i < 6; i++)
+  {
+    strncpy(dummy, macPtr+i*3, 2);
+	mac[i] = (uint8_t)strtol(dummy, NULL, 16);
+  }
+}
+
+/**
+  * @brief  Установить дату производства
+  */
+void SETTINGS_SetProDate(char *proDate, uint8_t len)
+{
+  memset(sSettings.sInfo.productionData, 0, 40);
+  memcpy(sSettings.sInfo.productionData, proDate, len); 
+}
+
+/**
+  * @brief  Установить статус тестирования "T2OK"
+  */
+void SETTINGS_SetT2OK(void)
+{
+  memset(sSettings.sFlags.testState, 0, 16);
+  memcpy(sSettings.sFlags.testState, "T2OK", 4);
+}
+
+/**
+  * @brief  Включить DHCP
+  */
+void SETTINGS_SetDHCPOn(void)
+{
+  sSettings.sWebParams.dhcpEnable = 1;
+}
+
+
+/********************************* (C) ROTEK **********************************/

+ 204 - 0
modules/settings_api.h

@@ -0,0 +1,204 @@
+/********************************* (C) РОТЕК ***********************************
+ * @module  settings_api
+ * @file    settings_api.h
+ * @version 1.0.0
+ * @date    XX.XX.XXXX
+ * $brief   settings_api
+ *******************************************************************************
+ * @history     Version  Author         Comment
+ * XX.XX.XXXX   1.0.0    Telenkov D.A.  First release.
+ *******************************************************************************
+ */
+
+/* Define to prevent recursive  ----------------------------------------------*/
+#ifndef SETTINGS_API_H
+#define SETTINGS_API_H
+
+#include "stm32f4xx.h"
+#include <stdbool.h>
+
+/**
+* @brief  Параметры обновления ПО
+  */
+typedef struct
+{
+  uint8_t loadMode; // 0 - основная прошивка, 1 - режим обновления ПО
+  uint8_t bootTry;  // Признак 
+  
+} BOOT_PARAMS_t;
+
+/**
+  * @brief  Параметры сетевого подключения
+  */
+typedef struct
+{
+  char    ip[15];     
+  char    gate[15];
+  char    mask[15];
+  uint8_t dhcpEnable;  // 0 - DHCP отключен, 1 - включен
+	
+} WEB_PARAMS_t;
+
+/**
+  * @brief  Параметры SNMP
+  */
+typedef struct
+{
+  char sysDescr[160];
+  char readCommunity[20];
+  char writeCommunity[20];
+  char sysContact[50];
+  char sysName[20];
+  char sysLocation[110];
+  char managerIP[20];
+  char managerIP2[20];
+  char managerIP3[20];
+  
+} SNMP_t;
+
+/**
+  * @brief  Информация об устройстве
+  */
+typedef struct
+{
+  char  productionData[40];  // Дата производства
+  char  mac[18];             // MAC адрес
+  char  serialNumber[16];    // Серийный номер
+  char  comments[110];       // Комментарии
+  
+} DEVICE_INFO_t; 
+
+/**
+  * @brief  Флаги, ключи и т.д.
+  */
+typedef struct
+{
+  bool netsettingsChanged;   // Признак изменения сетевых настроек пользователем
+  char testState[16];        // Статус производственного тестирования
+} FLAGS_t;
+  
+/**
+  * @brief  Общая структура настроек
+  */
+typedef struct
+{
+  BOOT_PARAMS_t bootParams;
+  WEB_PARAMS_t  sWebParams;
+  WEB_PARAMS_t  sWebTempParams;
+  SNMP_t        sSnmp;
+  DEVICE_INFO_t sInfo;
+  FLAGS_t       sFlags;	
+  uint32_t      controlWorld;  // Слово для контроля целостности структуры настроек
+  
+} SETTINGS_t;
+
+
+/**
+  * @brief  Установить параметры обновления ПО по умолчанию
+  */
+void SETTINGS_SetBootParamsDef(void);
+
+/**
+  * @brief  Установить параметры сетевого подключения по умолчанию
+  */
+void SETTINGS_SetWebParamsDef(void);
+
+/**
+  * @brief  Установить временные параметры сетевого подключения по умолчанию
+  */
+void SETTINGS_SetTempWebParamsDef(void);
+
+/**
+  * @brief  Установить параметры SNMP по умолчанию
+  */
+void SETTINGS_SetSnmpDef(void);
+
+/**
+  * @brief  Установить Информацию об устройстве по умолчанию
+  */
+void SETTINGS_SetInfoDef(void);
+
+/**
+  * @brief  Установить флаги по умолчанию
+  */
+void SETTINGS_SetFlagsDef(void);
+
+/**
+  * @brief  Очистка сектора настроек
+  */
+void SETTINGS_EraseFlashSector(void);
+
+/**
+  * @brief  Сброс настроек в значения по умолчанию
+  */
+void SETTINGS_SetDefault(void);
+
+/**
+  * @brief  Сброс всех настроек в значения по умолчанию кроме сетевых настроек
+  */
+void SETTINGS_SetPartDefault(void);
+
+/**
+  * @brief  Сброс всех настроек в значения по умолчанию
+  */
+void SETTINGS_SetAllDefault(void);
+
+/**
+  * @brief  Установка настроек для отладки
+  */
+void SETTINGS_SetDefaultDebug(void);
+
+/**
+  * @brief  Запись структуры настроек во flesh
+  */
+void SETTINGS_Save(void);
+
+/**
+  * @brief  Загрузка структуры настроек из flesh
+  */
+void SETTINGS_Load(void);
+
+/**
+  * @brief  
+  */
+void SETTINGS_WriteToFlash(uint8_t *data, uint32_t size);
+
+/**
+  * @brief  
+  */
+void SETTINGS_ReadFromFlash(uint8_t *data, uint32_t size);
+
+/**
+  * @brief  
+  */
+uint32_t SETTINGS_GetCRC(void);
+
+/**
+  * @brief  Сброс флага boottry и сохранение структуры настроек
+  */
+void SETTINGS_ResetBootTry(void);
+
+/**
+  * @brief  Преобразует mac адрес строкового формата в массив uint8_t
+  * @param  mac - буфер для вывода mac адреса
+  */
+void SETTINGS_GetMac(uint8_t *mac);
+
+/**
+  * @brief  Установить дату производства
+  */
+void SETTINGS_SetProDate(char *proDate, uint8_t len);
+
+/**
+  * @brief  Установить статус тестирования "T2OK"
+  */
+void SETTINGS_SetT2OK(void);
+
+/**
+  * @brief  Включить DHCP
+  */
+void SETTINGS_SetDHCPOn(void);
+
+#endif /* #ifndef SETTINGS_API_H */
+
+/********************************* (C) РОТЕК **********************************/

+ 512 - 0
modules/startup/startup_stm32f4xx.s

@@ -0,0 +1,512 @@
+/**
+  ******************************************************************************
+  * @file      startup_stm32f4xx.s
+  * @author    MCD Application Team
+  * @version   V1.0.0
+  * @date      30-September-2011
+  * @brief     STM32F4xx Devices vector table for Atollic TrueSTUDIO toolchain. 
+  *            This module performs:
+  *                - Set the initial SP
+  *                - Set the initial PC == Reset_Handler,
+  *                - Set the vector table entries with the exceptions ISR address
+  *                - Configure the clock system and the external SRAM mounted on 
+  *                  STM324xG-EVAL board to be used as data memory (optional, 
+  *                  to be enabled by user)
+  *                - Branches to main in the C library (which eventually
+  *                  calls main()).
+  *            After Reset the Cortex-M4 processor is in Thread mode,
+  *            priority is Privileged, and the Stack is set to Main.
+  ******************************************************************************
+  * @attention
+  *
+  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
+  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
+  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
+  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
+  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+  *
+  * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
+  ******************************************************************************
+  */
+    
+  .syntax unified
+  .cpu cortex-m3
+  .fpu softvfp
+  .thumb
+
+.global  g_pfnVectors
+.global  Default_Handler
+
+/* start address for the initialization values of the .data section. 
+defined in linker script */
+.word  _sidata
+/* start address for the .data section. defined in linker script */  
+.word  _sdata
+/* end address for the .data section. defined in linker script */
+.word  _edata
+/* start address for the .bss section. defined in linker script */
+.word  _sbss
+/* end address for the .bss section. defined in linker script */
+.word  _ebss
+/* stack used for SystemInit_ExtMemCtl; always internal RAM used */
+
+/**
+ * @brief  This is the code that gets called when the processor first
+ *          starts execution following a reset event. Only the absolutely
+ *          necessary set is performed, after which the application
+ *          supplied main() routine is called. 
+ * @param  None
+ * @retval : None
+*/
+
+    .section  .text.Reset_Handler
+  .weak  Reset_Handler
+  .type  Reset_Handler, %function
+Reset_Handler:  
+
+/* Copy the data segment initializers from flash to SRAM */  
+  movs  r1, #0
+  b  LoopCopyDataInit
+
+CopyDataInit:
+  ldr  r3, =_sidata
+  ldr  r3, [r3, r1]
+  str  r3, [r0, r1]
+  adds  r1, r1, #4
+    
+LoopCopyDataInit:
+  ldr  r0, =_sdata
+  ldr  r3, =_edata
+  adds  r2, r0, r1
+  cmp  r2, r3
+  bcc  CopyDataInit
+  ldr  r2, =_sbss
+  b  LoopFillZerobss
+/* Zero fill the bss segment. */  
+FillZerobss:
+  movs  r3, #0
+  str  r3, [r2], #4
+    
+LoopFillZerobss:
+  ldr  r3, = _ebss
+  cmp  r2, r3
+  bcc  FillZerobss
+
+/* Call the clock system intitialization function.*/
+  bl  SystemInit   
+/* Call static constructors */
+    bl __libc_init_array
+/* Call the application's entry point.*/
+  bl  main
+  bx  lr    
+.size  Reset_Handler, .-Reset_Handler
+
+/**
+ * @brief  This is the code that gets called when the processor receives an 
+ *         unexpected interrupt.  This simply enters an infinite loop, preserving
+ *         the system state for examination by a debugger.
+ * @param  None     
+ * @retval None       
+*/
+    .section  .text.Default_Handler,"ax",%progbits
+Default_Handler:
+Infinite_Loop:
+  b  Infinite_Loop
+  .size  Default_Handler, .-Default_Handler
+/******************************************************************************
+*
+* The minimal vector table for a Cortex M3. Note that the proper constructs
+* must be placed on this to ensure that it ends up at physical address
+* 0x0000.0000.
+* 
+*******************************************************************************/
+   .section  .isr_vector,"a",%progbits
+  .type  g_pfnVectors, %object
+  .size  g_pfnVectors, .-g_pfnVectors
+    
+    
+g_pfnVectors:
+  .word  _estack
+  .word  Reset_Handler
+  .word  NMI_Handler
+  .word  HardFault_Handler
+  .word  MemManage_Handler
+  .word  BusFault_Handler
+  .word  UsageFault_Handler
+  .word  0
+  .word  0
+  .word  0
+  .word  0
+  .word  SVC_Handler
+  .word  DebugMon_Handler
+  .word  0
+  .word  PendSV_Handler
+  .word  SysTick_Handler
+  
+  /* External Interrupts */
+  .word     WWDG_IRQHandler                   /* Window WatchDog              */                                        
+  .word     PVD_IRQHandler                    /* PVD through EXTI Line detection */                        
+  .word     TAMP_STAMP_IRQHandler             /* Tamper and TimeStamps through the EXTI line */            
+  .word     RTC_WKUP_IRQHandler               /* RTC Wakeup through the EXTI line */                      
+  .word     FLASH_IRQHandler                  /* FLASH                        */                                          
+  .word     RCC_IRQHandler                    /* RCC                          */                                            
+  .word     EXTI_IRQHandler                  /* EXTI Line0                   */
+  .word     EXTI_IRQHandler                  /* EXTI Line1                   */
+  .word     EXTI_IRQHandler                  /* EXTI Line2                   */
+  .word     EXTI_IRQHandler                  /* EXTI Line3                   */
+  .word     EXTI_IRQHandler                  /* EXTI Line4                   */
+  .word     DMA1_Stream0_IRQHandler           /* DMA1 Stream 0                */                  
+  .word     DMA1_Stream1_IRQHandler           /* DMA1 Stream 1                */                   
+  .word     DMA1_Stream2_IRQHandler           /* DMA1 Stream 2                */                   
+  .word     DMA1_Stream3_IRQHandler           /* DMA1 Stream 3                */                   
+  .word     DMA1_Stream4_IRQHandler           /* DMA1 Stream 4                */                   
+  .word     DMA1_Stream5_IRQHandler           /* DMA1 Stream 5                */                   
+  .word     DMA1_Stream6_IRQHandler           /* DMA1 Stream 6                */                   
+  .word     ADC_IRQHandler                    /* ADC1, ADC2 and ADC3s         */                   
+  .word     CAN1_TX_IRQHandler                /* CAN1 TX                      */                         
+  .word     CAN1_RX0_IRQHandler               /* CAN1 RX0                     */                          
+  .word     CAN1_RX1_IRQHandler               /* CAN1 RX1                     */                          
+  .word     CAN1_SCE_IRQHandler               /* CAN1 SCE                     */                          
+  .word     EXTI_IRQHandler                /* External Line[9:5]s          */
+  .word     TIM1_BRK_TIM9_IRQHandler          /* TIM1 Break and TIM9          */         
+  .word     TIM1_UP_TIM10_IRQHandler          /* TIM1 Update and TIM10        */         
+  .word     TIM1_TRG_COM_TIM11_IRQHandler     /* TIM1 Trigger and Commutation and TIM11 */
+  .word     TIM1_CC_IRQHandler                /* TIM1 Capture Compare         */                          
+  .word     TIM2_IRQHandler                   /* TIM2                         */                   
+  .word     TIM3_IRQHandler                   /* TIM3                         */                   
+  .word     TIM4_IRQHandler                   /* TIM4                         */                   
+  .word     I2C1_EV_IRQHandler                /* I2C1 Event                   */                          
+  .word     I2C1_ER_IRQHandler                /* I2C1 Error                   */                          
+  .word     I2C2_EV_IRQHandler                /* I2C2 Event                   */                          
+  .word     I2C2_ER_IRQHandler                /* I2C2 Error                   */                            
+  .word     SPI1_IRQHandler                   /* SPI1                         */                   
+  .word     SPI2_IRQHandler                   /* SPI2                         */                   
+  .word     USART1_IRQHandler                 /* USART1                       */                   
+  .word     USART2_IRQHandler                 /* USART2                       */                   
+  .word     USART3_IRQHandler                 /* USART3                       */                   
+  .word     EXTI_IRQHandler              /* External Line[15:10]s        */
+  .word     RTC_Alarm_IRQHandler              /* RTC Alarm (A and B) through EXTI Line */                 
+  .word     OTG_FS_WKUP_IRQHandler            /* USB OTG FS Wakeup through EXTI line */                       
+  .word     TIM8_BRK_TIM12_IRQHandler         /* TIM8 Break and TIM12         */         
+  .word     TIM8_UP_TIM13_IRQHandler          /* TIM8 Update and TIM13        */         
+  .word     TIM8_TRG_COM_TIM14_IRQHandler     /* TIM8 Trigger and Commutation and TIM14 */
+  .word     TIM8_CC_IRQHandler                /* TIM8 Capture Compare         */                          
+  .word     DMA1_Stream7_IRQHandler           /* DMA1 Stream7                 */                          
+  .word     FSMC_IRQHandler                   /* FSMC                         */                   
+  .word     SDIO_IRQHandler                   /* SDIO                         */                   
+  .word     TIM5_IRQHandler                   /* TIM5                         */                   
+  .word     SPI3_IRQHandler                   /* SPI3                         */                   
+  .word     UART4_IRQHandler                  /* UART4                        */                   
+  .word     UART5_IRQHandler                  /* UART5                        */                   
+  .word     TIM6_DAC_IRQHandler               /* TIM6 and DAC1&2 underrun errors */                   
+  .word     TIM7_IRQHandler                   /* TIM7                         */
+  .word     DMA2_Stream0_IRQHandler           /* DMA2 Stream 0                */                   
+  .word     DMA2_Stream1_IRQHandler           /* DMA2 Stream 1                */                   
+  .word     DMA2_Stream2_IRQHandler           /* DMA2 Stream 2                */                   
+  .word     DMA2_Stream3_IRQHandler           /* DMA2 Stream 3                */                   
+  .word     DMA2_Stream4_IRQHandler           /* DMA2 Stream 4                */                   
+  .word     ETH_IRQHandler                    /* Ethernet                     */                   
+  .word     ETH_WKUP_IRQHandler               /* Ethernet Wakeup through EXTI line */                     
+  .word     CAN2_TX_IRQHandler                /* CAN2 TX                      */                          
+  .word     CAN2_RX0_IRQHandler               /* CAN2 RX0                     */                          
+  .word     CAN2_RX1_IRQHandler               /* CAN2 RX1                     */                          
+  .word     CAN2_SCE_IRQHandler               /* CAN2 SCE                     */                          
+  .word     OTG_FS_IRQHandler                 /* USB OTG FS                   */                   
+  .word     DMA2_Stream5_IRQHandler           /* DMA2 Stream 5                */                   
+  .word     DMA2_Stream6_IRQHandler           /* DMA2 Stream 6                */                   
+  .word     DMA2_Stream7_IRQHandler           /* DMA2 Stream 7                */                   
+  .word     USART6_IRQHandler                 /* USART6                       */                    
+  .word     I2C3_EV_IRQHandler                /* I2C3 event                   */                          
+  .word     I2C3_ER_IRQHandler                /* I2C3 error                   */                          
+  .word     OTG_HS_EP1_OUT_IRQHandler         /* USB OTG HS End Point 1 Out   */                   
+  .word     OTG_HS_EP1_IN_IRQHandler          /* USB OTG HS End Point 1 In    */                   
+  .word     OTG_HS_WKUP_IRQHandler            /* USB OTG HS Wakeup through EXTI */                         
+  .word     OTG_HS_IRQHandler                 /* USB OTG HS                   */                   
+  .word     DCMI_IRQHandler                   /* DCMI                         */                   
+  .word     CRYP_IRQHandler                   /* CRYP crypto                  */                   
+  .word     HASH_RNG_IRQHandler               /* Hash and Rng                 */
+  .word     FPU_IRQHandler                    /* FPU                          */
+                         
+                         
+/*******************************************************************************
+*
+* Provide weak aliases for each Exception handler to the Default_Handler. 
+* As they are weak aliases, any function with the same name will override 
+* this definition.
+* 
+*******************************************************************************/
+   .weak      NMI_Handler
+   .thumb_set NMI_Handler,Default_Handler
+  
+   .weak      HardFault_Handler
+   .thumb_set HardFault_Handler,Default_Handler
+  
+   .weak      MemManage_Handler
+   .thumb_set MemManage_Handler,Default_Handler
+  
+   .weak      BusFault_Handler
+   .thumb_set BusFault_Handler,Default_Handler
+
+   .weak      UsageFault_Handler
+   .thumb_set UsageFault_Handler,Default_Handler
+
+   .weak      SVC_Handler
+   .thumb_set SVC_Handler,Default_Handler
+
+   .weak      DebugMon_Handler
+   .thumb_set DebugMon_Handler,Default_Handler
+
+   .weak      PendSV_Handler
+   .thumb_set PendSV_Handler,Default_Handler
+
+   .weak      SysTick_Handler
+   .thumb_set SysTick_Handler,Default_Handler              
+  
+   .weak      WWDG_IRQHandler                   
+   .thumb_set WWDG_IRQHandler,Default_Handler      
+                  
+   .weak      PVD_IRQHandler      
+   .thumb_set PVD_IRQHandler,Default_Handler
+               
+   .weak      TAMP_STAMP_IRQHandler            
+   .thumb_set TAMP_STAMP_IRQHandler,Default_Handler
+            
+   .weak      RTC_WKUP_IRQHandler                  
+   .thumb_set RTC_WKUP_IRQHandler,Default_Handler
+            
+   .weak      FLASH_IRQHandler         
+   .thumb_set FLASH_IRQHandler,Default_Handler
+                  
+   .weak      RCC_IRQHandler      
+   .thumb_set RCC_IRQHandler,Default_Handler
+                  
+   .weak      EXTI_IRQHandler
+   .thumb_set EXTI_IRQHandler,Default_Handler
+                  
+   .weak      EXTI_IRQHandler
+   .thumb_set EXTI_IRQHandler,Default_Handler
+                     
+   .weak      EXTI_IRQHandler
+   .thumb_set EXTI_IRQHandler,Default_Handler
+                 
+   .weak      EXTI_IRQHandler
+   .thumb_set EXTI_IRQHandler,Default_Handler
+                        
+   .weak      EXTI_IRQHandler
+   .thumb_set EXTI_IRQHandler,Default_Handler
+                  
+   .weak      DMA1_Stream0_IRQHandler               
+   .thumb_set DMA1_Stream0_IRQHandler,Default_Handler
+         
+   .weak      DMA1_Stream1_IRQHandler               
+   .thumb_set DMA1_Stream1_IRQHandler,Default_Handler
+                  
+   .weak      DMA1_Stream2_IRQHandler               
+   .thumb_set DMA1_Stream2_IRQHandler,Default_Handler
+                  
+   .weak      DMA1_Stream3_IRQHandler               
+   .thumb_set DMA1_Stream3_IRQHandler,Default_Handler 
+                 
+   .weak      DMA1_Stream4_IRQHandler              
+   .thumb_set DMA1_Stream4_IRQHandler,Default_Handler
+                  
+   .weak      DMA1_Stream5_IRQHandler               
+   .thumb_set DMA1_Stream5_IRQHandler,Default_Handler
+                  
+   .weak      DMA1_Stream6_IRQHandler               
+   .thumb_set DMA1_Stream6_IRQHandler,Default_Handler
+                  
+   .weak      ADC_IRQHandler      
+   .thumb_set ADC_IRQHandler,Default_Handler
+               
+   .weak      CAN1_TX_IRQHandler   
+   .thumb_set CAN1_TX_IRQHandler,Default_Handler
+            
+   .weak      CAN1_RX0_IRQHandler                  
+   .thumb_set CAN1_RX0_IRQHandler,Default_Handler
+                           
+   .weak      CAN1_RX1_IRQHandler                  
+   .thumb_set CAN1_RX1_IRQHandler,Default_Handler
+            
+   .weak      CAN1_SCE_IRQHandler                  
+   .thumb_set CAN1_SCE_IRQHandler,Default_Handler
+            
+   .weak      EXTI9_5_IRQHandler   
+   .thumb_set EXTI9_5_IRQHandler,Default_Handler
+            
+   .weak      TIM1_BRK_TIM9_IRQHandler            
+   .thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler
+            
+   .weak      TIM1_UP_TIM10_IRQHandler            
+   .thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler
+      
+   .weak      TIM1_TRG_COM_TIM11_IRQHandler      
+   .thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler
+      
+   .weak      TIM1_CC_IRQHandler   
+   .thumb_set TIM1_CC_IRQHandler,Default_Handler
+                  
+   .weak      TIM2_IRQHandler            
+   .thumb_set TIM2_IRQHandler,Default_Handler
+                  
+   .weak      TIM3_IRQHandler            
+   .thumb_set TIM3_IRQHandler,Default_Handler
+                  
+   .weak      TIM4_IRQHandler            
+   .thumb_set TIM4_IRQHandler,Default_Handler
+                  
+   .weak      I2C1_EV_IRQHandler   
+   .thumb_set I2C1_EV_IRQHandler,Default_Handler
+                     
+   .weak      I2C1_ER_IRQHandler   
+   .thumb_set I2C1_ER_IRQHandler,Default_Handler
+                     
+   .weak      I2C2_EV_IRQHandler   
+   .thumb_set I2C2_EV_IRQHandler,Default_Handler
+                  
+   .weak      I2C2_ER_IRQHandler   
+   .thumb_set I2C2_ER_IRQHandler,Default_Handler
+                           
+   .weak      SPI1_IRQHandler            
+   .thumb_set SPI1_IRQHandler,Default_Handler
+                        
+   .weak      SPI2_IRQHandler            
+   .thumb_set SPI2_IRQHandler,Default_Handler
+                  
+   .weak      USART1_IRQHandler      
+   .thumb_set USART1_IRQHandler,Default_Handler
+                     
+   .weak      USART2_IRQHandler      
+   .thumb_set USART2_IRQHandler,Default_Handler
+                     
+   .weak      USART3_IRQHandler      
+   .thumb_set USART3_IRQHandler,Default_Handler
+                  
+   .weak      EXTI15_10_IRQHandler               
+   .thumb_set EXTI15_10_IRQHandler,Default_Handler
+               
+   .weak      RTC_Alarm_IRQHandler               
+   .thumb_set RTC_Alarm_IRQHandler,Default_Handler
+            
+   .weak      OTG_FS_WKUP_IRQHandler         
+   .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler
+            
+   .weak      TIM8_BRK_TIM12_IRQHandler         
+   .thumb_set TIM8_BRK_TIM12_IRQHandler,Default_Handler
+         
+   .weak      TIM8_UP_TIM13_IRQHandler            
+   .thumb_set TIM8_UP_TIM13_IRQHandler,Default_Handler
+         
+   .weak      TIM8_TRG_COM_TIM14_IRQHandler      
+   .thumb_set TIM8_TRG_COM_TIM14_IRQHandler,Default_Handler
+      
+   .weak      TIM8_CC_IRQHandler   
+   .thumb_set TIM8_CC_IRQHandler,Default_Handler
+                  
+   .weak      DMA1_Stream7_IRQHandler               
+   .thumb_set DMA1_Stream7_IRQHandler,Default_Handler
+                     
+   .weak      FSMC_IRQHandler            
+   .thumb_set FSMC_IRQHandler,Default_Handler
+                     
+   .weak      SDIO_IRQHandler            
+   .thumb_set SDIO_IRQHandler,Default_Handler
+                     
+   .weak      TIM5_IRQHandler            
+   .thumb_set TIM5_IRQHandler,Default_Handler
+                     
+   .weak      SPI3_IRQHandler            
+   .thumb_set SPI3_IRQHandler,Default_Handler
+                     
+   .weak      UART4_IRQHandler         
+   .thumb_set UART4_IRQHandler,Default_Handler
+                  
+   .weak      UART5_IRQHandler         
+   .thumb_set UART5_IRQHandler,Default_Handler
+                  
+   .weak      TIM6_DAC_IRQHandler                  
+   .thumb_set TIM6_DAC_IRQHandler,Default_Handler
+               
+   .weak      TIM7_IRQHandler            
+   .thumb_set TIM7_IRQHandler,Default_Handler
+         
+   .weak      DMA2_Stream0_IRQHandler               
+   .thumb_set DMA2_Stream0_IRQHandler,Default_Handler
+               
+   .weak      DMA2_Stream1_IRQHandler               
+   .thumb_set DMA2_Stream1_IRQHandler,Default_Handler
+                  
+   .weak      DMA2_Stream2_IRQHandler               
+   .thumb_set DMA2_Stream2_IRQHandler,Default_Handler
+            
+   .weak      DMA2_Stream3_IRQHandler               
+   .thumb_set DMA2_Stream3_IRQHandler,Default_Handler
+            
+   .weak      DMA2_Stream4_IRQHandler               
+   .thumb_set DMA2_Stream4_IRQHandler,Default_Handler
+            
+   .weak      ETH_IRQHandler      
+   .thumb_set ETH_IRQHandler,Default_Handler
+                  
+   .weak      ETH_WKUP_IRQHandler                  
+   .thumb_set ETH_WKUP_IRQHandler,Default_Handler
+            
+   .weak      CAN2_TX_IRQHandler   
+   .thumb_set CAN2_TX_IRQHandler,Default_Handler
+                           
+   .weak      CAN2_RX0_IRQHandler                  
+   .thumb_set CAN2_RX0_IRQHandler,Default_Handler
+                           
+   .weak      CAN2_RX1_IRQHandler                  
+   .thumb_set CAN2_RX1_IRQHandler,Default_Handler
+                           
+   .weak      CAN2_SCE_IRQHandler                  
+   .thumb_set CAN2_SCE_IRQHandler,Default_Handler
+                           
+   .weak      OTG_FS_IRQHandler      
+   .thumb_set OTG_FS_IRQHandler,Default_Handler
+                     
+   .weak      DMA2_Stream5_IRQHandler               
+   .thumb_set DMA2_Stream5_IRQHandler,Default_Handler
+                  
+   .weak      DMA2_Stream6_IRQHandler               
+   .thumb_set DMA2_Stream6_IRQHandler,Default_Handler
+                  
+   .weak      DMA2_Stream7_IRQHandler               
+   .thumb_set DMA2_Stream7_IRQHandler,Default_Handler
+                  
+   .weak      USART6_IRQHandler      
+   .thumb_set USART6_IRQHandler,Default_Handler
+                        
+   .weak      I2C3_EV_IRQHandler   
+   .thumb_set I2C3_EV_IRQHandler,Default_Handler
+                        
+   .weak      I2C3_ER_IRQHandler   
+   .thumb_set I2C3_ER_IRQHandler,Default_Handler
+                        
+   .weak      OTG_HS_EP1_OUT_IRQHandler         
+   .thumb_set OTG_HS_EP1_OUT_IRQHandler,Default_Handler
+               
+   .weak      OTG_HS_EP1_IN_IRQHandler            
+   .thumb_set OTG_HS_EP1_IN_IRQHandler,Default_Handler
+               
+   .weak      OTG_HS_WKUP_IRQHandler         
+   .thumb_set OTG_HS_WKUP_IRQHandler,Default_Handler
+            
+   .weak      OTG_HS_IRQHandler      
+   .thumb_set OTG_HS_IRQHandler,Default_Handler
+                  
+   .weak      DCMI_IRQHandler            
+   .thumb_set DCMI_IRQHandler,Default_Handler
+                     
+   .weak      CRYP_IRQHandler            
+   .thumb_set CRYP_IRQHandler,Default_Handler
+               
+   .weak      HASH_RNG_IRQHandler                  
+   .thumb_set HASH_RNG_IRQHandler,Default_Handler   
+
+   .weak      FPU_IRQHandler                  
+   .thumb_set FPU_IRQHandler,Default_Handler  
+
+/*******************   (C)   COPYRIGHT   2011   STMicroelectronics   *****END   OF   FILE****/

+ 191 - 0
modules/startup/stm32_flash.ld

@@ -0,0 +1,191 @@
+/*
+*****************************************************************************
+**
+**  File        : stm32_flash.ld
+**
+**  Abstract    : Linker script for STM32F407VG Device with
+**                512KByte FLASH, 192KByte RAM
+**
+**                Set heap size, stack size and stack location according
+**                to application requirements.
+**
+**                Set memory bank area and size if external memory is used.
+**
+**  Target      : STMicroelectronics STM32
+**
+**  Environment : Atollic TrueSTUDIO(R)
+**
+**  Distribution: The file is distributed �as is,� without any warranty
+**                of any kind.
+**
+**  (c)Copyright Atollic AB.
+**  You may use this file as-is or modify it according to the needs of your
+**  project. Distribution of this file (unmodified or modified) is not
+**  permitted. Atollic AB permit registered Atollic TrueSTUDIO(R) users the
+**  rights to distribute the assembled, compiled & linked contents of this
+**  file as part of an application binary file, provided that it is built
+**  using the Atollic TrueSTUDIO(R) toolchain.
+**
+*****************************************************************************
+*/
+
+/* Entry Point */
+ENTRY(Reset_Handler)
+
+/* Highest address of the user mode stack */
+_estack = 0x2001ffff;    /* end of 128K RAM on AHB bus*/
+
+/* Generate a link error if heap and stack don't fit into RAM */
+_Min_Heap_Size = 0x100;      /* required amount of heap  */
+_Min_Stack_Size = 0x100; /* required amount of stack */
+
+/* Specify the memory areas */
+MEMORY
+{
+  BOOTLOADER_P1 (rx) : ORIGIN = 0x08000000, LENGTH = 16K
+  SETTINGS      (rx) : ORIGIN = 0x08004000, LENGTH = 16K
+  BOOTLOADER    (rx) : ORIGIN = 0x08008000, LENGTH = 96K
+  FLASH         (rx) : ORIGIN = 0x08020000, LENGTH = 640K
+  CRC           (rx) : ORIGIN = 0x080BFFFC, LENGTH = 4
+  RAM           (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
+  MEMORY_B1     (rx) : ORIGIN = 0x10000000, LENGTH = 64K
+}
+
+/* Define output sections */
+SECTIONS
+{
+  /* The startup code goes first into FLASH */
+  .isr_vector :
+  {
+    . = ALIGN(4);
+    KEEP(*(.isr_vector)) /* Startup code */
+    . = ALIGN(4);
+  } >FLASH
+
+  /* The program code and other data goes into FLASH */
+  .text :
+  {
+    . = ALIGN(4);
+    *(.text)           /* .text sections (code) */
+    *(.text*)          /* .text* sections (code) */
+    *(.rodata)         /* .rodata sections (constants, strings, etc.) */
+    *(.rodata*)        /* .rodata* sections (constants, strings, etc.) */
+    *(.glue_7)         /* glue arm to thumb code */
+    *(.glue_7t)        /* glue thumb to arm code */
+    *(.eh_frame)
+
+    KEEP (*(.init))
+    KEEP (*(.fini))
+
+    . = ALIGN(4);
+    _etext = .;        /* define a global symbols at end of code */
+    _exit = .;
+  } >FLASH
+
+
+   .ARM.extab   : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
+    .ARM : {
+    __exidx_start = .;
+      *(.ARM.exidx*)
+      __exidx_end = .;
+    } >FLASH
+
+  .preinit_array     :
+  {
+    PROVIDE_HIDDEN (__preinit_array_start = .);
+    KEEP (*(.preinit_array*))
+    PROVIDE_HIDDEN (__preinit_array_end = .);
+  } >FLASH
+  .init_array :
+  {
+    PROVIDE_HIDDEN (__init_array_start = .);
+    KEEP (*(SORT(.init_array.*)))
+    KEEP (*(.init_array*))
+    PROVIDE_HIDDEN (__init_array_end = .);
+  } >FLASH
+  .fini_array :
+  {
+    PROVIDE_HIDDEN (__fini_array_start = .);
+    /* _fini = .;  */
+    KEEP (*(.fini_array*))
+    KEEP (*(SORT(.fini_array.*)))
+    PROVIDE_HIDDEN (__fini_array_end = .);
+  } >FLASH 
+ 
+  /* used by the startup to initialize data */
+  _sidata = .;
+
+  /* Initialized data sections goes into RAM, load LMA copy after code */
+  .data : AT ( _sidata )
+  {
+    . = ALIGN(4);
+    _sdata = .;        /* create a global symbol at data start */
+    *(.data)           /* .data sections */
+    *(.data*)          /* .data* sections */
+
+    . = ALIGN(4);
+    _edata = .;        /* define a global symbol at data end */
+  } >RAM
+  
+   .fill LOADADDR(.data) + SIZEOF(.data) :
+  {
+    FILL(0xFFFFFFFF);
+    /* . = ORIGIN(FLASH) + LENGTH(FLASH) - 4 - 1; */
+    . = ORIGIN(CRC) - 1;
+    BYTE(0xFF)
+    /* PROVIDE_HIDDEN (__fini_array_end = .); */
+  } > FLASH
+  .crc :
+  {
+   . = ALIGN(4);
+   KEEP(*(.crc))
+   . = ALIGN(4);
+  }>CRC
+
+  /* Uninitialized data section */
+  . = ALIGN(4);
+  .bss :
+  {
+    /* This is used by the startup in order to initialize the .bss secion */
+    _sbss = .;         /* define a global symbol at bss start */
+    __bss_start__ = _sbss;
+    *(.bss)
+    *(.bss*)
+    *(COMMON)
+
+    . = ALIGN(4);
+    _ebss = .;         /* define a global symbol at bss end */
+    __bss_end__ = _ebss;
+  } >RAM
+
+  /* User_heap_stack section, used to check that there is enough RAM left */
+  ._user_heap_stack :
+  {
+    . = ALIGN(4);
+    PROVIDE ( end = . );
+    PROVIDE ( _end = . );
+    . = . + _Min_Heap_Size;
+    . = . + _Min_Stack_Size;
+    . = ALIGN(4);
+  } >RAM
+  
+  /* MEMORY_bank1 section, code must be located here explicitly            */
+  /* Example: extern int foo(void) __attribute__ ((section (".mb1text"))); */
+  .memory_b1_text (NOLOAD) :
+  {
+    *(.mb1text)        /* .mb1text sections (code) */
+    *(.mb1text*)       /* .mb1text* sections (code)  */
+    *(.mb1rodata)      /* read-only data (constants) */
+    *(.mb1rodata*)
+  } >MEMORY_B1
+
+  /* Remove information from the standard libraries */
+  /DISCARD/ :
+  {
+    libc.a ( * )
+    libm.a ( * )
+    libgcc.a ( * )
+  }
+
+  .ARM.attributes 0 : { *(.ARM.attributes) }
+}