1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/pkg/lwip/init_devs/auto_init_atwinc15x0.c
Martine Lenders aa5a18f833
Merge pull request #16974 from yarrick/lwip_netif
pkg/lwip: Add netif_t struct, register all netifs
2022-04-26 23:49:49 +02:00

46 lines
1.1 KiB
C

/*
* Copyright (C) Gunar Schorcht
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup sys_auto_init_lwip_netif
* @{
*
* @file
* @brief Auto initialization for atwinc15x0 network interfaces
*
* @author Gunar Schorcht <gunar@schorcht.net>
* @author Erik Ekman <eekman@google.com>
*/
#include "atwinc15x0.h"
#include "atwinc15x0_params.h"
#include "lwip_init_devs.h"
#define ENABLE_DEBUG 0
#include "debug.h"
#define NETIF_ATWINC_NUMOF ARRAY_SIZE(atwinc15x0_params)
static lwip_netif_t netif[NETIF_ATWINC_NUMOF];
static atwinc15x0_t atwinc15x0_devs[NETIF_ATWINC_NUMOF];
static void auto_init_atwinc15x0(void)
{
for (unsigned i = 0; i < NETIF_ATWINC_NUMOF; i++) {
atwinc15x0_setup(&atwinc15x0_devs[i], &atwinc15x0_params[i], i);
if (lwip_add_ethernet(&netif[i], &atwinc15x0_devs[i].netdev) == NULL) {
DEBUG("Could not add atwinc15x0 device\n");
return;
}
}
}
LWIP_INIT_ETH_NETIF(auto_init_atwinc15x0);
/** @} */