2021-08-14 17:45:28 +02:00
|
|
|
/*
|
|
|
|
* 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)
|
|
|
|
|
2021-10-08 18:59:32 +02:00
|
|
|
static lwip_netif_t netif[NETIF_ATWINC_NUMOF];
|
2021-08-14 17:45:28 +02:00
|
|
|
static atwinc15x0_t atwinc15x0_devs[NETIF_ATWINC_NUMOF];
|
|
|
|
|
2021-08-20 14:48:41 +02:00
|
|
|
static void auto_init_atwinc15x0(void)
|
2021-08-14 17:45:28 +02:00
|
|
|
{
|
|
|
|
for (unsigned i = 0; i < NETIF_ATWINC_NUMOF; i++) {
|
2022-03-30 16:07:29 +02:00
|
|
|
atwinc15x0_setup(&atwinc15x0_devs[i], &atwinc15x0_params[i], i);
|
2021-08-14 17:45:28 +02:00
|
|
|
if (lwip_add_ethernet(&netif[i], &atwinc15x0_devs[i].netdev) == NULL) {
|
|
|
|
DEBUG("Could not add atwinc15x0 device\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-08-20 14:48:41 +02:00
|
|
|
|
|
|
|
LWIP_INIT_ETH_NETIF(auto_init_atwinc15x0);
|
2021-08-14 17:45:28 +02:00
|
|
|
/** @} */
|