问答 店铺
热搜: ZYNQ FPGA discuz

QQ登录

只需一步,快速开始

微信登录

微信扫码,快速开始

微信扫一扫 分享朋友圈

已有 8079 人浏览分享

开启左侧

关于zynq的lwip初始化的疑问

[复制链接]
8079 4
F:\TIM图片20191009124135.png
我现在的打开的是sdk自带的lwip echo例程,如图,添加网络接口这个函数里面的宏定义都是灰的,那这个函数岂不是什么都没做?另外,我还找不到对硬件初始化的地方,哪个好心朋友能给我解答下

评论 4

樊yj  新手上路  发表于 2019-10-9 12:47:15 | 显示全部楼层
图片怎么上传啊
樊yj  新手上路  发表于 2019-10-9 12:49:27 | 显示全部楼层
这个函数switch里面的宏定义都是灰的
struct netif *
xemac_add(struct netif *netif,
        struct ip_addr *ipaddr, struct ip_addr *netmask, struct ip_addr *gw,
        unsigned char *mac_ethernet_address,
        unsigned mac_baseaddr)
{
        int i;

        /* set mac address */
        netif->hwaddr_len = 6;
        for (i = 0; i < 6; i++)
                netif->hwaddr[i] = mac_ethernet_address[i];

        /* initialize based on MAC type */
                switch (find_mac_type(mac_baseaddr)) {
                        case xemac_type_xps_emaclite:
#ifdef XLWIP_CONFIG_INCLUDE_EMACLITE
                                return netif_add(netif, ipaddr, netmask, gw,
                                        (void*)(UINTPTR)mac_baseaddr,
                                        xemacliteif_init,
#if NO_SYS
                                        ethernet_input
#else
                                        tcpip_input
#endif
                                        );
#else
                                return NULL;
#endif
                        case xemac_type_axi_ethernet:
#ifdef XLWIP_CONFIG_INCLUDE_AXI_ETHERNET
                                return netif_add(netif, ipaddr, netmask, gw,
                                        (void*)(UINTPTR)mac_baseaddr,
                                        xaxiemacif_init,
#if NO_SYS
                                        ethernet_input
#else
                                        tcpip_input
#endif
                                        );
#else
                                return NULL;
#endif
#if defined (__arm__) || defined (__aarch64__)
                        case xemac_type_emacps:
#ifdef XLWIP_CONFIG_INCLUDE_GEM
                                return netif_add(netif, ipaddr, netmask, gw,
                                                (void*)(UINTPTR)mac_baseaddr,
                                                xemacpsif_init,
#if NO_SYS
                                                ethernet_input
#else
                                                tcpip_input
#endif

                                                );
#endif
#endif
                        default:
                                xil_printf("unable to determine type of EMAC with baseaddress 0x%08x\r\n",
                                                mac_baseaddr);
                                return NULL;
        }
}
樊yj  新手上路  发表于 2019-10-9 12:56:39 | 显示全部楼层
xemac_add

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

举报 使用道具

回复
uisrc  管理员  发表于 2019-10-9 16:12:54 | 显示全部楼层
因为没有用到,灰色的部分,是其他功能的,通过宏定义可以切换功能。比如EMIO模式扩展以太网,AXI-ETH方式扩展以太网
越努力越幸运!加油!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

0

关注

1

粉丝

1

主题
精彩推荐
热门资讯
网友晒图
图文推荐

  • 微信公众平台

  • 扫描访问手机版