Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3cf8fe4
driver/winc1500: Added the Atmel's original driver in /pkg/
kbumsik Oct 8, 2017
6502c01
driver/winc1500: Added basic Wi-Fi connectivity driver using WINC1500…
kbumsik Oct 9, 2017
d28ea6a
driver/winc1500: Initial port to gnrc_netdev
kbumsik Oct 9, 2017
ab4873e
driver/winc1500: Added parameters for Arduino MKR1000, SAMD/R21-XPRO
kbumsik Oct 9, 2017
725ca89
fixup! winc1500: typo and documenting issue fixed.
kbumsik Oct 10, 2017
e75c374
fixup! Fixed #ifdef blocks to only work with NETDEV_ETH
kbumsik Oct 11, 2017
4033723
fixup! removed double space
kbumsik Oct 12, 2017
2ec4347
fixup! Now WINC1500 sends correct packet
kbumsik Oct 13, 2017
acb0b75
fixup! WINC1500 now receives correct packet
kbumsik Oct 13, 2017
2107759
fixup! Fix compilation error after rebase
kbumsik Aug 15, 2018
66d72ca
fixup! Fix module names to conform the lastest build system
kbumsik Aug 16, 2018
53b49c6
fixup! Fix CRLF and whitespaces
kbumsik Aug 16, 2018
58acf1e
fixup! Moved driver code to pkg
kbumsik Aug 16, 2018
4777571
fixup! arduino-mkr1000: Added WINC1500 as gnrc_netdev_default
kbumsik Aug 16, 2018
8aa1a83
fixup! winc1500-pkg: Deleted Makefile patches
kbumsik Aug 16, 2018
0ae243c
fixup! Minor typo and comment fix
kbumsik Oct 11, 2018
ef4a806
fixup! pkg/winc1500: updated Makefiles
kbumsik Oct 11, 2018
e2a8913
fixup! added winc1500_internal_types.h
kbumsik Oct 14, 2018
443da7e
fixup! Redesign: Add multiple instance support, removed the global va…
kbumsik Oct 15, 2018
b37201d
Partial Revert "fixup! Minor typo and comment fix"
kbumsik Oct 16, 2018
f5ee246
fixup! _recv: Added packet drop condition
kbumsik Oct 16, 2018
dc9862b
fixup! unified the parameters macro to WINC1500_PARAMS
kbumsik Oct 16, 2018
440afe1
fixup! updated README.md for the testing program
kbumsik Oct 17, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions boards/arduino-mkr1000/Makefile.dep
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
ifneq (,$(filter gnrc_netdev_default netdev_default,$(USEMODULE)))
USEPKG += winc1500
endif

include $(RIOTBOARD)/common/arduino-mkr/Makefile.dep
11 changes: 11 additions & 0 deletions boards/arduino-mkr1000/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@
extern "C" {
#endif

/**
* @brief winc1500 configuration
*/
#define WINC1500_PARAMS {.spi = SPI_DEV(1), \
.cs_pin = GPIO_PIN(PA, 14), \
.int_pin = GPIO_PIN(PB, 9), \
.reset_pin = GPIO_PIN(PA, 27), /* Internally pulled-down */ \
.en_pin = GPIO_PIN(PA, 28), /* Internally pulled-down */ \
.wake_pin = GPIO_PIN(PB, 8), \
.spi_clk = WINC1500_SPI_CLOCK}

/**
* @brief The on-board LED is connected to pin 6 on this board
*/
Expand Down
48 changes: 48 additions & 0 deletions boards/samd21-xpro/include/winc1500_params.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright (C) 2017 Bumsik Kim <[email protected]>
*
* 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 boards_samd21-xpro
* @{
*
* @file
* @brief WINC1500 Xplained Pro configuration for SAMD21-XPRO board
* @author Bumsik Kim <[email protected]>
*/

#ifndef WINC1500_PARAMS_H
#define WINC1500_PARAMS_H

#include "winc1500.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief Board specific WINC1500 configuration
*/
static const winc1500_params_t winc1500_params[] =
{
{
.spi = SPI_DEV(0),
.cs_pin = GPIO_PIN(PA, 5),
.int_pin = GPIO_PIN(PB, 4),
.reset_pin = GPIO_PIN(PB, 6),
.en_pin = GPIO_PIN(PB, 5),
.wake_pin = GPIO_PIN(PB, 7),
.spi_clk = SPI_CLK_10MHZ
}
};

#ifdef __cplusplus
}
#endif

#endif /* WINC1500_PARAMS_H */
/** @} */
48 changes: 48 additions & 0 deletions boards/samr21-xpro/include/winc1500_params.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright (C) 2017 Bumsik Kim <[email protected]>
*
* 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 boards_samr21-xpro
* @{
*
* @file
* @brief WINC1500 Xplained Pro configuration for SAMR21-XPRO board
* @author Bumsik Kim <[email protected]>
*/

#ifndef WINC1500_PARAMS_H
#define WINC1500_PARAMS_H

#include "winc1500.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief Board specific WINC1500 configuration
*/
static const winc1500_params_t winc1500_params[] =
{
{
.spi = SPI_DEV(1),
.cs_pin = GPIO_PIN(PB, 3),
.int_pin = GPIO_PIN(PA, 22),
.reset_pin = GPIO_PIN(PA, 13),
.en_pin = GPIO_PIN(PA, 23),
.wake_pin = GPIO_PIN(PA, 28),
.spi_clk = SPI_CLK_10MHZ
}
};

#ifdef __cplusplus
}
#endif

#endif /* WINC1500_PARAMS_H */
/** @} */
23 changes: 23 additions & 0 deletions pkg/winc1500/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
PKG_NAME=winc1500
PKG_URL=https://github.com/kbumsik/winc1500-projects
PKG_VERSION=396ea0cb3d10ef7099a15f352a3a6d792b16b48b
PKG_LICENSE=BSD-3-Clause-Atmel

VCS_DIR=$(PKG_BUILDDIR)/winc1500
MODULE_MAKEFILE := $(CURDIR)/Makefile.module

.PHONY: all

all: git-download
# Copy Makefiles for each modules
@cp Makefile.common $(VCS_DIR)/common/source/Makefile
@cp Makefile.bsp $(VCS_DIR)/bsp/source/Makefile
@cp Makefile.bus_wrapper $(VCS_DIR)/bus_wrapper/source/Makefile
@cp Makefile.driver $(VCS_DIR)/driver/source/Makefile
@cp Makefile.socket $(VCS_DIR)/socket/source/Makefile
@cp Makefile.spi_flash $(VCS_DIR)/spi_flash/source/Makefile

# Lastly, call Makefile
"$(MAKE)" -C $(PKG_BUILDDIR) -f $(CURDIR)/Makefile.winc1500

include $(RIOTBASE)/pkg/pkg.mk
3 changes: 3 additions & 0 deletions pkg/winc1500/Makefile.bsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MODULE = winc1500_pkg_bsp

include $(RIOTBASE)/Makefile.base
3 changes: 3 additions & 0 deletions pkg/winc1500/Makefile.bus_wrapper
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MODULE = winc1500_pkg_bus_wrapper

include $(RIOTBASE)/Makefile.base
3 changes: 3 additions & 0 deletions pkg/winc1500/Makefile.common
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MODULE = winc1500_pkg_common

include $(RIOTBASE)/Makefile.base
22 changes: 22 additions & 0 deletions pkg/winc1500/Makefile.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ifneq (,$(filter winc1500,$(USEPKG)))
# Modules inside of this package
USEMODULE += winc1500_driver
USEMODULE += winc1500_pkg_common
USEMODULE += winc1500_pkg_bsp
USEMODULE += winc1500_pkg_bus_wrapper
USEMODULE += winc1500_pkg_driver
USEMODULE += winc1500_pkg_socket
USEMODULE += winc1500_pkg_spi_flash

# Dependancies
FEATURES_REQUIRED += periph_gpio
FEATURES_REQUIRED += periph_spi
USEMODULE += xtimer
USEMODULE += core_mbox
# This Wi-Fi driver can be used without GNRC, so NETDEV_ETH is optional
ifneq (,$(filter gnrc,$(USEMODULE)))
# TODO: Test if it works without luid
USEMODULE += luid
USEMODULE += netdev_eth
endif
endif
3 changes: 3 additions & 0 deletions pkg/winc1500/Makefile.driver
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MODULE = winc1500_pkg_driver

include $(RIOTBASE)/Makefile.base
3 changes: 3 additions & 0 deletions pkg/winc1500/Makefile.include
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
INCLUDES += -I$(PKGDIRBASE)/winc1500/winc1500
INCLUDES += -I$(RIOTBASE)/pkg/winc1500/include
INCLUDES += -I$(RIOTBASE)/pkg/winc1500/driver/include
1 change: 1 addition & 0 deletions pkg/winc1500/Makefile.module
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(RIOTBASE)/Makefile.base
3 changes: 3 additions & 0 deletions pkg/winc1500/Makefile.socket
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MODULE = winc1500_pkg_socket

include $(RIOTBASE)/Makefile.base
3 changes: 3 additions & 0 deletions pkg/winc1500/Makefile.spi_flash
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MODULE = winc1500_pkg_spi_flash

include $(RIOTBASE)/Makefile.base
15 changes: 15 additions & 0 deletions pkg/winc1500/Makefile.winc1500
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
WINC1500_SUBDIR = common bsp bus_wrapper driver socket spi_flash

# Include source files from VCS
DIRS += $(addprefix winc1500/, $(addsuffix /source, $(WINC1500_SUBDIR)))
# Driver
DIRS += $(RIOTBASE)/pkg/winc1500/driver

CFLAGS += -I$(CURDIR)/winc1500

ifneq (,$(filter netdev_eth,$(USEMODULE)))
# In case we use GNRC the ethernet bypass mode should be enabled.
CFLAGS += -DETH_MODE
endif

include $(RIOTBASE)/Makefile.base
8 changes: 8 additions & 0 deletions pkg/winc1500/doc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* @defgroup pkg_winc1500 Atmel WINC1500 Wi-Fi module API and adapter layer
* @ingroup pkg
* @ingroup net
* @brief This package includes original driver API from Atmel, along with
patches for adapter layer to @ref drivers_winc1500 .
* @see https://github.com/kbumsik/winc1500-projects
*/
3 changes: 3 additions & 0 deletions pkg/winc1500/driver/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MODULE = winc1500_driver

include $(RIOTBASE)/Makefile.base
63 changes: 63 additions & 0 deletions pkg/winc1500/driver/auto_init_winc1500.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* Copyright (C) 2017 Bumsik Kim <[email protected]>
*
* 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 auto_init_gnrc_netif
* @{
*
* @file
* @brief Auto initialization for WINC1500 Wi-Fi devices
*
* @author Bumsik Kim <[email protected]>
*/

#if defined(MODULE_WINC1500) && defined(MODULE_NETDEV_ETH)

#include "log.h"
#include "debug.h"
#include "winc1500.h"
#include "winc1500_params.h"
#include "net/gnrc/netif/ethernet.h"

/**
* @name Define stack parameters for the MAC layer thread
* @{
*/
#define WINC1500_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT + \
DEBUG_EXTRA_STACKSIZE + 2048 * 2)
#ifndef WINC1500_MAC_PRIO
#define WINC1500_MAC_PRIO (GNRC_NETIF_PRIO)
#endif
/** @} */

#define WINC1500_NUM (sizeof(winc1500_params) / sizeof(winc1500_params[0]))

winc1500_t winc1500_devs[WINC1500_NUM];
static char _netdev_eth_stack[WINC1500_NUM][WINC1500_MAC_STACKSIZE];

void auto_init_winc1500(void)
{
for (unsigned i = 0; i < WINC1500_NUM; i++) {
LOG_DEBUG("[auto_init_netif] initializing winc1500 #0\n");

/* setup netdev device */
winc1500_setup(&winc1500_devs[i], &winc1500_params[i]);

/* start gnrc netdev thread */
gnrc_netif_ethernet_create(_netdev_eth_stack[i],
WINC1500_MAC_STACKSIZE,
WINC1500_MAC_PRIO, "winc1500",
(netdev_t*)&winc1500_devs[i]);
}
}

#else
typedef int dont_be_pedantic;
#endif /* defined(MODULE_WINC1500) && defined(MODULE_NETDEV_ETH) */
/** @} */
Loading