ProjetoBB

Dependencies:   F7_Ethernet WebSocketClient mbed mcp3008

Fork of Nucleo_F746ZG_Ethernet by Dieter Graef

Committer:
DieterGraef
Date:
Sat Jun 18 10:49:12 2016 +0000
Revision:
0:f9b6112278fe
Ethernet for the NUCLEO STM32F746 Board Testprogram uses DHCP and NTP to set the clock

Who changed what in which revision?

UserRevisionLine numberNew contents of line
DieterGraef 0:f9b6112278fe 1 /*
DieterGraef 0:f9b6112278fe 2 * Copyright (c) 2001-2003 Swedish Institute of Computer Science.
DieterGraef 0:f9b6112278fe 3 * All rights reserved.
DieterGraef 0:f9b6112278fe 4 *
DieterGraef 0:f9b6112278fe 5 * Redistribution and use in source and binary forms, with or without modification,
DieterGraef 0:f9b6112278fe 6 * are permitted provided that the following conditions are met:
DieterGraef 0:f9b6112278fe 7 *
DieterGraef 0:f9b6112278fe 8 * 1. Redistributions of source code must retain the above copyright notice,
DieterGraef 0:f9b6112278fe 9 * this list of conditions and the following disclaimer.
DieterGraef 0:f9b6112278fe 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
DieterGraef 0:f9b6112278fe 11 * this list of conditions and the following disclaimer in the documentation
DieterGraef 0:f9b6112278fe 12 * and/or other materials provided with the distribution.
DieterGraef 0:f9b6112278fe 13 * 3. The name of the author may not be used to endorse or promote products
DieterGraef 0:f9b6112278fe 14 * derived from this software without specific prior written permission.
DieterGraef 0:f9b6112278fe 15 *
DieterGraef 0:f9b6112278fe 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
DieterGraef 0:f9b6112278fe 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
DieterGraef 0:f9b6112278fe 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
DieterGraef 0:f9b6112278fe 19 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
DieterGraef 0:f9b6112278fe 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
DieterGraef 0:f9b6112278fe 21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
DieterGraef 0:f9b6112278fe 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
DieterGraef 0:f9b6112278fe 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
DieterGraef 0:f9b6112278fe 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
DieterGraef 0:f9b6112278fe 25 * OF SUCH DAMAGE.
DieterGraef 0:f9b6112278fe 26 *
DieterGraef 0:f9b6112278fe 27 * This file is part of the lwIP TCP/IP stack.
DieterGraef 0:f9b6112278fe 28 *
DieterGraef 0:f9b6112278fe 29 * Author: Adam Dunkels <adam@sics.se>
DieterGraef 0:f9b6112278fe 30 *
DieterGraef 0:f9b6112278fe 31 */
DieterGraef 0:f9b6112278fe 32 #ifndef __CC_H__
DieterGraef 0:f9b6112278fe 33 #define __CC_H__
DieterGraef 0:f9b6112278fe 34
DieterGraef 0:f9b6112278fe 35 #include <stdint.h>
DieterGraef 0:f9b6112278fe 36 #include <stddef.h>
DieterGraef 0:f9b6112278fe 37 /* Types based on stdint.h */
DieterGraef 0:f9b6112278fe 38 typedef uint8_t u8_t;
DieterGraef 0:f9b6112278fe 39 typedef int8_t s8_t;
DieterGraef 0:f9b6112278fe 40 typedef uint16_t u16_t;
DieterGraef 0:f9b6112278fe 41 typedef int16_t s16_t;
DieterGraef 0:f9b6112278fe 42 typedef uint32_t u32_t;
DieterGraef 0:f9b6112278fe 43 typedef int32_t s32_t;
DieterGraef 0:f9b6112278fe 44 typedef uintptr_t mem_ptr_t;
DieterGraef 0:f9b6112278fe 45
DieterGraef 0:f9b6112278fe 46 /* Define (sn)printf formatters for these lwIP types */
DieterGraef 0:f9b6112278fe 47 #define U16_F "hu"
DieterGraef 0:f9b6112278fe 48 #define S16_F "hd"
DieterGraef 0:f9b6112278fe 49 #define X16_F "hx"
DieterGraef 0:f9b6112278fe 50 #define U32_F "lu"
DieterGraef 0:f9b6112278fe 51 #define S32_F "ld"
DieterGraef 0:f9b6112278fe 52 #define X32_F "lx"
DieterGraef 0:f9b6112278fe 53 #define SZT_F "uz"
DieterGraef 0:f9b6112278fe 54
DieterGraef 0:f9b6112278fe 55 /* ARM/LPC17xx is little endian only */
DieterGraef 0:f9b6112278fe 56 #define BYTE_ORDER LITTLE_ENDIAN
DieterGraef 0:f9b6112278fe 57
DieterGraef 0:f9b6112278fe 58 /* Use LWIP error codes */
DieterGraef 0:f9b6112278fe 59 #define LWIP_PROVIDE_ERRNO
DieterGraef 0:f9b6112278fe 60
DieterGraef 0:f9b6112278fe 61 #if defined(__arm__) && defined(__ARMCC_VERSION)
DieterGraef 0:f9b6112278fe 62 /* Keil uVision4 tools */
DieterGraef 0:f9b6112278fe 63 #define PACK_STRUCT_BEGIN __packed
DieterGraef 0:f9b6112278fe 64 #define PACK_STRUCT_STRUCT
DieterGraef 0:f9b6112278fe 65 #define PACK_STRUCT_END
DieterGraef 0:f9b6112278fe 66 #define PACK_STRUCT_FIELD(fld) fld
DieterGraef 0:f9b6112278fe 67 #define ALIGNED(n) __align(n)
DieterGraef 0:f9b6112278fe 68 #elif defined (__IAR_SYSTEMS_ICC__)
DieterGraef 0:f9b6112278fe 69 /* IAR Embedded Workbench tools */
DieterGraef 0:f9b6112278fe 70 #define PACK_STRUCT_BEGIN __packed
DieterGraef 0:f9b6112278fe 71 #define PACK_STRUCT_STRUCT
DieterGraef 0:f9b6112278fe 72 #define PACK_STRUCT_END
DieterGraef 0:f9b6112278fe 73 #define PACK_STRUCT_FIELD(fld) fld
DieterGraef 0:f9b6112278fe 74 #define IAR_STR(a) #a
DieterGraef 0:f9b6112278fe 75 #define ALIGNED(n) _Pragma(IAR_STR(data_alignment= ## n ##))
DieterGraef 0:f9b6112278fe 76 #else
DieterGraef 0:f9b6112278fe 77 /* GCC tools (CodeSourcery) */
DieterGraef 0:f9b6112278fe 78 #define PACK_STRUCT_BEGIN
DieterGraef 0:f9b6112278fe 79 #define PACK_STRUCT_STRUCT __attribute__ ((__packed__))
DieterGraef 0:f9b6112278fe 80 #define PACK_STRUCT_END
DieterGraef 0:f9b6112278fe 81 #define PACK_STRUCT_FIELD(fld) fld
DieterGraef 0:f9b6112278fe 82 #define ALIGNED(n) __attribute__((aligned (n)))
DieterGraef 0:f9b6112278fe 83 #endif
DieterGraef 0:f9b6112278fe 84
DieterGraef 0:f9b6112278fe 85 /* Provide Thumb-2 routines for GCC to improve performance */
DieterGraef 0:f9b6112278fe 86 #if defined(TOOLCHAIN_GCC) && defined(__thumb2__)
DieterGraef 0:f9b6112278fe 87 #define MEMCPY(dst,src,len) thumb2_memcpy(dst,src,len)
DieterGraef 0:f9b6112278fe 88 #define LWIP_CHKSUM thumb2_checksum
DieterGraef 0:f9b6112278fe 89 /* Set algorithm to 0 so that unused lwip_standard_chksum function
DieterGraef 0:f9b6112278fe 90 doesn't generate compiler warning */
DieterGraef 0:f9b6112278fe 91 #define LWIP_CHKSUM_ALGORITHM 0
DieterGraef 0:f9b6112278fe 92
DieterGraef 0:f9b6112278fe 93 void* thumb2_memcpy(void* pDest, const void* pSource, size_t length);
DieterGraef 0:f9b6112278fe 94 u16_t thumb2_checksum(void* pData, int length);
DieterGraef 0:f9b6112278fe 95 #else
DieterGraef 0:f9b6112278fe 96 /* Used with IP headers only */
DieterGraef 0:f9b6112278fe 97 #define LWIP_CHKSUM_ALGORITHM 1
DieterGraef 0:f9b6112278fe 98 #endif
DieterGraef 0:f9b6112278fe 99
DieterGraef 0:f9b6112278fe 100
DieterGraef 0:f9b6112278fe 101 #ifdef LWIP_DEBUG
DieterGraef 0:f9b6112278fe 102
DieterGraef 0:f9b6112278fe 103 #include "stdio.h"
DieterGraef 0:f9b6112278fe 104
DieterGraef 0:f9b6112278fe 105 void assert_printf(char *msg, int line, char *file);
DieterGraef 0:f9b6112278fe 106
DieterGraef 0:f9b6112278fe 107 /* Plaform specific diagnostic output */
DieterGraef 0:f9b6112278fe 108 #define LWIP_PLATFORM_DIAG(vars) printf vars
DieterGraef 0:f9b6112278fe 109 #define LWIP_PLATFORM_ASSERT(flag) { assert_printf((flag), __LINE__, __FILE__); }
DieterGraef 0:f9b6112278fe 110 #else
DieterGraef 0:f9b6112278fe 111 #define LWIP_PLATFORM_DIAG(msg) { ; }
DieterGraef 0:f9b6112278fe 112 #define LWIP_PLATFORM_ASSERT(flag) { ; }
DieterGraef 0:f9b6112278fe 113 #endif
DieterGraef 0:f9b6112278fe 114
DieterGraef 0:f9b6112278fe 115 #include "cmsis.h"
DieterGraef 0:f9b6112278fe 116 #define LWIP_PLATFORM_HTONS(x) __REV16(x)
DieterGraef 0:f9b6112278fe 117 #define LWIP_PLATFORM_HTONL(x) __REV(x)
DieterGraef 0:f9b6112278fe 118
DieterGraef 0:f9b6112278fe 119 #endif /* __CC_H__ */