diff --git a/boards/feather-m0-lora/Kconfig b/boards/feather-m0-lora/Kconfig new file mode 100644 index 0000000000..9792f83790 --- /dev/null +++ b/boards/feather-m0-lora/Kconfig @@ -0,0 +1,23 @@ +# Copyright (c) 2020 HAW Hamburg +# +# 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. + +config BOARD + default "feather-m0-lora" if BOARD_FEATHER_M0_LORA + +config BOARD_FEATHER_M0_LORA + bool + default y + select CPU_MODEL_SAMD21G18A + select HAS_PERIPH_ADC + select HAS_PERIPH_I2C + select HAS_PERIPH_PWM + select HAS_PERIPH_RTC + select HAS_PERIPH_RTT + select HAS_PERIPH_SPI + select HAS_PERIPH_TIMER + select HAS_PERIPH_UART + select HAS_PERIPH_USBDEV + select HAS_HIGHLEVEL_STDIO diff --git a/boards/feather-m0-lora/Makefile b/boards/feather-m0-lora/Makefile new file mode 100644 index 0000000000..51876a27a6 --- /dev/null +++ b/boards/feather-m0-lora/Makefile @@ -0,0 +1,2 @@ +DIRS = $(RIOTBOARD)/feather-m0 +include $(RIOTBASE)/Makefile.base diff --git a/boards/feather-m0-lora/Makefile.dep b/boards/feather-m0-lora/Makefile.dep new file mode 100644 index 0000000000..614f7babc1 --- /dev/null +++ b/boards/feather-m0-lora/Makefile.dep @@ -0,0 +1,5 @@ +ifneq (,$(filter netdev_default,$(USEMODULE))) + USEMODULE += sx1276 +endif + +include $(RIOTBOARD)/feather-m0/Makefile.dep diff --git a/boards/feather-m0-lora/Makefile.features b/boards/feather-m0-lora/Makefile.features new file mode 100644 index 0000000000..2e0a07b7b0 --- /dev/null +++ b/boards/feather-m0-lora/Makefile.features @@ -0,0 +1 @@ +include $(RIOTBOARD)/feather-m0/Makefile.features diff --git a/boards/feather-m0-lora/Makefile.include b/boards/feather-m0-lora/Makefile.include new file mode 100644 index 0000000000..ab30cac05f --- /dev/null +++ b/boards/feather-m0-lora/Makefile.include @@ -0,0 +1,2 @@ +INCLUDES += -I$(RIOTBOARD)/feather-m0/include +include $(RIOTBOARD)/feather-m0/Makefile.include diff --git a/boards/feather-m0-lora/doc.txt b/boards/feather-m0-lora/doc.txt new file mode 100644 index 0000000000..309b7aca04 --- /dev/null +++ b/boards/feather-m0-lora/doc.txt @@ -0,0 +1,12 @@ +/** +@defgroup boards_feather-m0-lora Adafruit Feather M0 LoRa +@ingroup boards +@brief Support for the Adafruit Feather M0 LoRa. + +### General information + +The board is a variant of the @ref boards_feather-m0 board with +a LoRa module on board. Please see @ref boards_feather-m0 for detailed +information about the board and how to flash it. + +*/ diff --git a/boards/feather-m0/doc.txt b/boards/feather-m0/doc.txt index db3c74d116..f6b0a122df 100644 --- a/boards/feather-m0/doc.txt +++ b/boards/feather-m0/doc.txt @@ -65,6 +65,20 @@ and define the required WiFi parameters, for example: For detailed information about the parameters, see section @ref drivers_atwinc15x0. +### Using with LoRa module + +To enable the LoRa module available on the +[Feather M0 LoRa](https://learn.adafruit.com/adafruit-feather-m0-radio-with-lora-radio-module) +variant of the board automatically for LoRa applications, +use `feather-m0-lora` as board: + +``` +make BOARD=feather-m0-lora -C examples/gnrc_lorawan +``` + +For detailed information about the parameters, see section +@ref drivers_sx127x. + ### 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 6ecff1b58d..0f89ef0b52 100644 --- a/boards/feather-m0/include/board.h +++ b/boards/feather-m0/include/board.h @@ -54,6 +54,20 @@ extern "C" { #define ATWINC15X0_PARAM_WAKE_PIN GPIO_UNDEF /** @} */ +/** + * @name Configuration for Feather M0 LoRa and the SX1276 module + * @{ + **/ +#define SX127X_PARAM_SPI SPI_DEV(0) +#define SX127X_PARAM_SPI_NSS GPIO_PIN(PA, 6) +#define SX127X_PARAM_RESET GPIO_PIN(PA, 8) +#define SX127X_PARAM_DIO0 GPIO_PIN(PA, 9) +#define SX127X_PARAM_DIO1 GPIO_UNDEF +#define SX127X_PARAM_DIO2 GPIO_UNDEF +#define SX127X_PARAM_DIO3 GPIO_UNDEF +#define SX127X_PARAM_PASELECT (SX127X_PA_BOOST) +/** @} */ + /** * @brief Initialize board specific hardware, including clock, LEDs and std-IO */