diff --git a/boards/feather-m0/Makefile.dep b/boards/feather-m0/Makefile.dep index d5a09e2469..dac6def12c 100644 --- a/boards/feather-m0/Makefile.dep +++ b/boards/feather-m0/Makefile.dep @@ -2,6 +2,12 @@ ifneq (,$(filter saul_default,$(USEMODULE))) USEMODULE += saul_gpio endif +ifneq (,$(filter feather-m0-wifi,$(USEMODULE))) + ifneq (,$(filter gnrc_netdev_default netdev_default,$(USEMODULE))) + USEMODULE += atwinc15x0 + endif +endif + # use arduino-bootloader only if no other stdio_% other than stdio_cdc_acm # is requested ifeq (,$(filter-out stdio_cdc_acm,$(filter stdio_% slipdev_stdio,$(USEMODULE)))) diff --git a/boards/feather-m0/Makefile.include b/boards/feather-m0/Makefile.include index 4a1da523b4..18be002e22 100644 --- a/boards/feather-m0/Makefile.include +++ b/boards/feather-m0/Makefile.include @@ -1,3 +1,5 @@ +PSEUDOMODULES += feather-m0-wifi + PORT_LINUX ?= /dev/ttyACM0 PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) diff --git a/boards/feather-m0/doc.txt b/boards/feather-m0/doc.txt index 5ecc3898fa..c83c8d5c30 100644 --- a/boards/feather-m0/doc.txt +++ b/boards/feather-m0/doc.txt @@ -12,10 +12,10 @@ All the feather M0 boards are built based on the same Atmel SAMD21G18A microcontroller. See @ref cpu_samd21. Several types of Feather M0 boards exist: -* [Feather M0 WiFi](https://learn.adafruit.com/adafruit-feather-m0-wifi-atwinc1500/) -* [Feather M0 BLE](https://learn.adafruit.com/adafruit-feather-m0-bluefruit-le/overview) -* [Feather M0 Adalogger](https://learn.adafruit.com/adafruit-feather-m0-adalogger/) -* [Feather M0 LoRa](https://learn.adafruit.com/adafruit-feather-m0-radio-with-lora-radio-module) +- [Feather M0 WiFi](https://learn.adafruit.com/adafruit-feather-m0-wifi-atwinc1500/) +- [Feather M0 BLE](https://learn.adafruit.com/adafruit-feather-m0-bluefruit-le/overview) +- [Feather M0 Adalogger](https://learn.adafruit.com/adafruit-feather-m0-adalogger/) +- [Feather M0 LoRa](https://learn.adafruit.com/adafruit-feather-m0-radio-with-lora-radio-module) The different modules used to differentiate the boards (ATWINC1500 WiFi, Bluefruit LE, SD card, LoRa) are connected via SPI (SPI_DEV(0)) to the @@ -52,6 +52,20 @@ Example with `hello-world` application: bootloader mode by double tapping the reset button before running the flash command. +### Using the WiFi interface + +To enable the WiFi interface of the Feather M0 WiFi variant of the board +automatically for networking applications, add `USEMODULE=atwin1x0` to +the `make` command and define the required parameters, for example: +``` + USEMODULE='feather-m0-wifi' \ + CFLAGS='-DWIFI_SSID=\"\" -DWIFI_PASS=\"\"' \ + make BOARD=feather-m0 -C examples/gnrc_networking +``` + +For detailed information about the parameters, see section +@ref drivers_atwinc15x0. + ### Accessing STDIO via UART STDIO of RIOT is directly available over the USB port. diff --git a/boards/feather-m0/include/board.h b/boards/feather-m0/include/board.h index 3f9c74f555..6ecff1b58d 100644 --- a/boards/feather-m0/include/board.h +++ b/boards/feather-m0/include/board.h @@ -42,6 +42,18 @@ extern "C" { #define LED0_TOGGLE (LED_PORT.OUTTGL.reg = LED0_MASK) /** @} */ +/** + * @name Configuration for Feather M0 WiFi and the ATWINC15x0 WiFi netdev + * @{ + */ +#define ATWINC15X0_PARAM_SPI SPI_DEV(0) +#define ATWINC15X0_PARAM_SSN_PIN GPIO_PIN(0, 6) +#define ATWINC15X0_PARAM_RESET_PIN GPIO_PIN(0, 8) +#define ATWINC15X0_PARAM_CHIP_EN_PIN GPIO_PIN(0, 14) +#define ATWINC15X0_PARAM_IRQ_PIN GPIO_PIN(0, 21) +#define ATWINC15X0_PARAM_WAKE_PIN GPIO_UNDEF +/** @} */ + /** * @brief Initialize board specific hardware, including clock, LEDs and std-IO */