From 1cd2d5cf369dbdb945b431d04a855df275befea7 Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 16 Sep 2013 16:38:46 +0700 Subject: [PATCH] able to build with newly added lwip folder --- demos/bsp/boards/board.c | 11 + .../boards/embedded_artists/board_ea4357.h | 65 ++ demos/host/host_freertos/.cproject | 7 +- demos/host/host_freertos/.project | 5 + demos/host/host_freertos/lwipopts.h | 151 +++ demos/host/host_os_none/.cproject | 13 +- demos/host/host_os_none/.project | 7 +- demos/host/host_os_none/lwipopts.h | 135 +++ vendor/lwip/lpclwip/arch/cc.h | 33 +- vendor/lwip/lpclwip/arch/lpc17xx_40xx_emac.c | 882 ---------------- vendor/lwip/lpclwip/arch/lpc17xx_40xx_emac.h | 128 --- .../lpclwip/arch/lpc17xx_40xx_systick_arch.c | 142 --- vendor/lwip/lpclwip/arch/lpc18xx_43xx_emac.c | 971 ++++++++++-------- vendor/lwip/lpclwip/arch/lpc18xx_43xx_emac.h | 139 +-- .../lwip/lpclwip/arch/lpc18xx_43xx_mac_regs.h | 359 +++++++ .../lpclwip/arch/lpc18xx_43xx_systick_arch.c | 173 +--- vendor/lwip/lpclwip/arch/lpc_arch.h | 115 +-- vendor/lwip/lpclwip/arch/lpc_debug.c | 101 +- vendor/lwip/lpclwip/arch/sys_arch_freertos.c | 9 +- vendor/lwip/lpclwip/lpc_phy.h | 151 +++ vendor/lwip/lpclwip/lpc_phy_lan8720.c | 300 ++++++ 21 files changed, 1944 insertions(+), 1953 deletions(-) create mode 100644 demos/host/host_freertos/lwipopts.h create mode 100644 demos/host/host_os_none/lwipopts.h delete mode 100644 vendor/lwip/lpclwip/arch/lpc17xx_40xx_emac.c delete mode 100644 vendor/lwip/lpclwip/arch/lpc17xx_40xx_emac.h delete mode 100644 vendor/lwip/lpclwip/arch/lpc17xx_40xx_systick_arch.c create mode 100644 vendor/lwip/lpclwip/arch/lpc18xx_43xx_mac_regs.h create mode 100644 vendor/lwip/lpclwip/lpc_phy.h create mode 100644 vendor/lwip/lpclwip/lpc_phy_lan8720.c diff --git a/demos/bsp/boards/board.c b/demos/bsp/boards/board.c index 31186c35a..99497400d 100644 --- a/demos/bsp/boards/board.c +++ b/demos/bsp/boards/board.c @@ -48,6 +48,17 @@ void SysTick_Handler (void) } #endif +// FIXME refractor +void boardGetMACaddr(uint8_t *macaddr) +{ + macaddr[0] = BOARD_MAC_ADDR0; + macaddr[1] = BOARD_MAC_ADDR1; + macaddr[2] = BOARD_MAC_ADDR2; + macaddr[3] = BOARD_MAC_ADDR3; + macaddr[4] = BOARD_MAC_ADDR4; + macaddr[5] = BOARD_MAC_ADDR5; +} + void check_failed(uint8_t *file, uint32_t line) { (void) file; diff --git a/demos/bsp/boards/embedded_artists/board_ea4357.h b/demos/bsp/boards/embedded_artists/board_ea4357.h index 56a82cb00..138e6e199 100644 --- a/demos/bsp/boards/embedded_artists/board_ea4357.h +++ b/demos/bsp/boards/embedded_artists/board_ea4357.h @@ -63,11 +63,76 @@ #include "lpc43xx_uart.h" #include "lpc43xx_i2c.h" + #include "oem_base_board/pca9532.h" // LEDs #define CFG_PRINTF_TARGET PRINTF_TARGET_SWO //#define CFG_PRINTF_TARGET PRINTF_TARGET_UART +/*========================================================================= + HARDWARE MAC ADDRESS + -----------------------------------------------------------------------*/ + #define BOARD_MAC_ADDR0 0x00 + #define BOARD_MAC_ADDR1 0x10 + #define BOARD_MAC_ADDR2 0x20 + #define BOARD_MAC_ADDR3 0x30 + #define BOARD_MAC_ADDR4 0x40 + #define BOARD_MAC_ADDR5 0x50 +/*=========================================================================*/ + +/*========================================================================= + EMAC CONFIGURATION + -----------------------------------------------------------------------*/ + /* The PHY address connected the to MII/RMII */ + #define LPC_PHYDEF_PHYADDR 1 /**< The PHY address on the PHY device. */ + + /* Enable autonegotiation mode. + * If this is enabled, the PHY will attempt to auto-negotiate the + * best link mode if the PHY supports it. If this is not enabled, + * the PHY_USE_FULL_DUPLEX and PHY_USE_100MBS defines will be + * used to select the link mode. Note that auto-negotiation may + * take a few seconds to complete. + */ + #define PHY_USE_AUTONEG 1 /**< Enables auto-negotiation mode. */ + + /* Sets up the PHY interface to either full duplex operation or + * half duplex operation if PHY_USE_AUTONEG is not enabled. + */ + #define PHY_USE_FULL_DUPLEX 1 /**< Sets duplex mode to full. */ + + /* Sets up the PHY interface to either 100MBS operation or 10MBS + * operation if PHY_USE_AUTONEG is not enabled. + */ + #define PHY_USE_100MBS 1 /**< Sets data rate to 100Mbps. */ + + /* Selects RMII or MII connection type in the EMAC peripheral */ + #define LPC_EMAC_RMII 1 /**< Use the RMII or MII driver variant */ + + /* Defines the number of descriptors used for RX */ + #define LPC_NUM_BUFF_RXDESCS 20 + + /* Defines the number of descriptors used for TX */ + #define LPC_NUM_BUFF_TXDESCS 20 + + /* Enables slow speed memory buffering + * Enable this define if you expect to transfer packets directly + * from SPI FLASH or any slower memory. This will add a check + * before queueing up the transfer pbuf to make sure the packet + * is not in slow memoey (defined by the LPC_SLOWMEM_ARRAY). If + * the packet does exists in slow memory, a pbuf will be created + * in the PBUF_RAM pool, copied to it, and sent from there. + */ + #define LPC_CHECK_SLOWMEM 0 + + /* Array of slow memory addresses for LPC_CHECK_SLOWMEM + * Define the array - start and ending address - for the slow + * memory regions in the system that need pbuf copies. + * + * Not defined since LPC_CHECK_SLOWMEM = 0. + */ + #define LPC_SLOWMEM_ARRAY +/*=========================================================================*/ + #ifdef __cplusplus } #endif diff --git a/demos/host/host_freertos/.cproject b/demos/host/host_freertos/.cproject index c1340183a..68cd0b2e8 100644 --- a/demos/host/host_freertos/.cproject +++ b/demos/host/host_freertos/.cproject @@ -90,7 +90,7 @@ - + @@ -708,6 +708,9 @@