-/* This source file is part of the ATMEL FREERTOS-0.9.0 Release */\r
-\r
/*This file has been prepared for Doxygen automatic documentation generation.*/\r
/*! \file *********************************************************************\r
*\r
* - AppNote:\r
*\r
* \author Atmel Corporation: http://www.atmel.com \n\r
- * Support email: avr32@atmel.com\r
+ * Support and FAQ: http://support.atmel.no/\r
*\r
*****************************************************************************/\r
\r
\r
/* ethernet includes */\r
#include "ethernet.h"\r
-#include "AVR32_EMAC.h"\r
+#include "conf_eth.h"\r
+#include "macb.h"\r
+#include "gpio.h"\r
\r
#if (HTTP_USED == 1)\r
#include "BasicWEB.h"\r
//_____ D E F I N I T I O N S ______________________________________________\r
\r
/* global variable containing MAC Config (hw addr, IP, GW, ...) */\r
-struct netif EMAC_if;\r
+struct netif MACB_if;\r
\r
//_____ D E C L A R A T I O N S ____________________________________________\r
\r
*/\r
void vStartEthernetTask( unsigned portBASE_TYPE uxPriority )\r
{\r
+static const gpio_map_t MACB_GPIO_MAP =\r
+{\r
+ {AVR32_MACB_MDC_0_PIN, AVR32_MACB_MDC_0_FUNCTION },\r
+ {AVR32_MACB_MDIO_0_PIN, AVR32_MACB_MDIO_0_FUNCTION },\r
+ {AVR32_MACB_RXD_0_PIN, AVR32_MACB_RXD_0_FUNCTION },\r
+ {AVR32_MACB_TXD_0_PIN, AVR32_MACB_TXD_0_FUNCTION },\r
+ {AVR32_MACB_RXD_1_PIN, AVR32_MACB_RXD_1_FUNCTION },\r
+ {AVR32_MACB_TXD_1_PIN, AVR32_MACB_TXD_1_FUNCTION },\r
+ {AVR32_MACB_TX_EN_0_PIN, AVR32_MACB_TX_EN_0_FUNCTION },\r
+ {AVR32_MACB_RX_ER_0_PIN, AVR32_MACB_RX_ER_0_FUNCTION },\r
+ {AVR32_MACB_RX_DV_0_PIN, AVR32_MACB_RX_DV_0_FUNCTION },\r
+ {AVR32_MACB_TX_CLK_0_PIN, AVR32_MACB_TX_CLK_0_FUNCTION}\r
+};\r
+\r
+ // Assign GPIO to MACB\r
+ gpio_enable_module(MACB_GPIO_MAP, sizeof(MACB_GPIO_MAP) / sizeof(MACB_GPIO_MAP[0]));\r
+\r
/* Setup lwIP. */\r
prvlwIPInit();\r
\r
#endif\r
\r
#if (SMTP_USED == 1)\r
- /* Create the SMTP Host task. This uses the lwIP RTOS abstraction layer.*/\r
- sys_thread_new( vBasicSMTPHost, ( void * ) NULL, ethSMTPHOST_PRIORITY );\r
+ /* Create the SMTP Client task. This uses the lwIP RTOS abstraction layer.*/\r
+ sys_thread_new( vBasicSMTPClient, ( void * ) NULL, ethSMTPCLIENT_PRIORITY );\r
#endif\r
\r
}\r
portCHAR MacAddress[6];\r
\r
/* Default MAC addr. */\r
- MacAddress[0] = emacETHADDR0;\r
- MacAddress[1] = emacETHADDR1;\r
- MacAddress[2] = emacETHADDR2;\r
- MacAddress[3] = emacETHADDR3;\r
- MacAddress[4] = emacETHADDR4;\r
- MacAddress[5] = emacETHADDR5;\r
+ MacAddress[0] = ETHERNET_CONF_ETHADDR0;\r
+ MacAddress[1] = ETHERNET_CONF_ETHADDR1;\r
+ MacAddress[2] = ETHERNET_CONF_ETHADDR2;\r
+ MacAddress[3] = ETHERNET_CONF_ETHADDR3;\r
+ MacAddress[4] = ETHERNET_CONF_ETHADDR4;\r
+ MacAddress[5] = ETHERNET_CONF_ETHADDR5;\r
\r
- /* pass the EMAC address to AVR32_EMAC module */\r
- vEMACSetMACAddress( MacAddress );\r
+ /* pass the MAC address to MACB module */\r
+ vMACBSetMACAddress( MacAddress );\r
\r
/* set MAC hardware address length to be used by lwIP */\r
- EMAC_if.hwaddr_len = 6;\r
+ MACB_if.hwaddr_len = 6;\r
\r
/* set MAC hardware address to be used by lwIP */\r
- memcpy( EMAC_if.hwaddr, MacAddress, EMAC_if.hwaddr_len );\r
+ memcpy( MACB_if.hwaddr, MacAddress, MACB_if.hwaddr_len );\r
\r
/* Default ip addr. */\r
- IP4_ADDR( &xIpAddr,emacIPADDR0,emacIPADDR1,emacIPADDR2,emacIPADDR3 );\r
+ IP4_ADDR( &xIpAddr,ETHERNET_CONF_IPADDR0,ETHERNET_CONF_IPADDR1,ETHERNET_CONF_IPADDR2,ETHERNET_CONF_IPADDR3 );\r
\r
/* Default Subnet mask. */\r
- IP4_ADDR( &xNetMask,emacNET_MASK0,emacNET_MASK1,emacNET_MASK2,emacNET_MASK3 );\r
+ IP4_ADDR( &xNetMask,ETHERNET_CONF_NET_MASK0,ETHERNET_CONF_NET_MASK1,ETHERNET_CONF_NET_MASK2,ETHERNET_CONF_NET_MASK3 );\r
\r
/* Default Gw addr. */\r
- IP4_ADDR( &xGateway,emacGATEWAY_ADDR0,emacGATEWAY_ADDR1,emacGATEWAY_ADDR2,emacGATEWAY_ADDR3 );\r
+ IP4_ADDR( &xGateway,ETHERNET_CONF_GATEWAY_ADDR0,ETHERNET_CONF_GATEWAY_ADDR1,ETHERNET_CONF_GATEWAY_ADDR2,ETHERNET_CONF_GATEWAY_ADDR3 );\r
\r
/* add data to netif */\r
- netif_add( &EMAC_if, &xIpAddr, &xNetMask, &xGateway, NULL, ethernetif_init, tcpip_input );\r
+ netif_add( &MACB_if, &xIpAddr, &xNetMask, &xGateway, NULL, ethernetif_init, tcpip_input );\r
\r
/* make it the default interface */\r
- netif_set_default( &EMAC_if );\r
+ netif_set_default( &MACB_if );\r
\r
/* bring it up */\r
- netif_set_up( &EMAC_if );\r
+ netif_set_up( &MACB_if );\r
}\r
\r
\r