pkg/lwip: support of ATWINC15x0 WiFi netdev

This commit is contained in:
Gunar Schorcht 2020-03-31 01:30:21 +02:00
parent b51ac69d0a
commit f92d2acb0a

View File

@ -33,6 +33,11 @@
#include "at86rf2xx_params.h"
#endif
#ifdef MODULE_ATWINC15X0
#include "atwinc15x0.h"
#include "atwinc15x0_params.h"
#endif
#ifdef MODULE_ENC28J60
#include "enc28j60.h"
#include "enc28j60_params.h"
@ -77,6 +82,10 @@
#define LWIP_NETIF_NUMOF ARRAY_SIZE(at86rf2xx_params)
#endif
#ifdef MODULE_ATWINC15X0 /* is mutual exclusive with above ifdef */
#define LWIP_NETIF_NUMOF ARRAY_SIZE(atwinc15x0_params)
#endif
#ifdef MODULE_ENC28J60 /* is mutual exclusive with above ifdef */
#define LWIP_NETIF_NUMOF ARRAY_SIZE(enc28j60_params)
#endif
@ -117,6 +126,10 @@ static netdev_tap_t netdev_taps[LWIP_NETIF_NUMOF];
static at86rf2xx_t at86rf2xx_devs[LWIP_NETIF_NUMOF];
#endif
#ifdef MODULE_ATWINC15X0
static atwinc15x0_t atwinc15x0_devs[LWIP_NETIF_NUMOF];
#endif
#ifdef MODULE_ENC28J60
static enc28j60_t enc28j60_devs[LWIP_NETIF_NUMOF];
#endif
@ -194,6 +207,23 @@ void lwip_bootstrap(void)
return;
}
}
#elif defined(MODULE_ATWINC15X0)
for (unsigned i = 0; i < LWIP_NETIF_NUMOF; i++) {
atwinc15x0_setup(&atwinc15x0_devs[i], &atwinc15x0_params[i]);
#ifdef MODULE_LWIP_IPV4
if (netif_add(&netif[0], IP4_ADDR_ANY, IP4_ADDR_ANY, IP4_ADDR_ANY,
&atwinc15x0_devs[i], lwip_netdev_init, tcpip_input) == NULL) {
DEBUG("Could not add atwinc15x0 device\n");
return;
}
#else /* MODULE_LWIP_IPV4 */
if (netif_add(&netif[0], &atwinc15x0_devs[i], lwip_netdev_init,
tcpip_input) == NULL) {
DEBUG("Could not add atwinc15x0 device\n");
return;
}
#endif /* MODULE_LWIP_IPV4 */
}
#elif defined(MODULE_ENC28J60)
for (unsigned i = 0; i < LWIP_NETIF_NUMOF; i++) {
enc28j60_setup(&enc28j60_devs[i], &enc28j60_params[i]);