From 81eb131634a5ba0e608852e8f3b385867e432f7d Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Sat, 20 May 2017 18:43:48 +0200 Subject: [PATCH] boards/arduino-mkr1200: add initial support --- boards/arduino-mkrfox1200/Makefile | 5 ++ boards/arduino-mkrfox1200/Makefile.dep | 1 + boards/arduino-mkrfox1200/Makefile.features | 3 ++ boards/arduino-mkrfox1200/Makefile.include | 10 ++++ boards/arduino-mkrfox1200/doc.txt | 34 +++++++++++++ boards/arduino-mkrfox1200/include/board.h | 56 +++++++++++++++++++++ 6 files changed, 109 insertions(+) create mode 100644 boards/arduino-mkrfox1200/Makefile create mode 100644 boards/arduino-mkrfox1200/Makefile.dep create mode 100644 boards/arduino-mkrfox1200/Makefile.features create mode 100644 boards/arduino-mkrfox1200/Makefile.include create mode 100644 boards/arduino-mkrfox1200/doc.txt create mode 100644 boards/arduino-mkrfox1200/include/board.h diff --git a/boards/arduino-mkrfox1200/Makefile b/boards/arduino-mkrfox1200/Makefile new file mode 100644 index 0000000000..392f7d5c56 --- /dev/null +++ b/boards/arduino-mkrfox1200/Makefile @@ -0,0 +1,5 @@ +MODULE = board + +DIRS = $(RIOTBOARD)/common/arduino-mkr + +include $(RIOTBASE)/Makefile.base diff --git a/boards/arduino-mkrfox1200/Makefile.dep b/boards/arduino-mkrfox1200/Makefile.dep new file mode 100644 index 0000000000..698c09c572 --- /dev/null +++ b/boards/arduino-mkrfox1200/Makefile.dep @@ -0,0 +1 @@ +include $(RIOTBOARD)/common/arduino-mkr/Makefile.dep diff --git a/boards/arduino-mkrfox1200/Makefile.features b/boards/arduino-mkrfox1200/Makefile.features new file mode 100644 index 0000000000..bc8c9ae857 --- /dev/null +++ b/boards/arduino-mkrfox1200/Makefile.features @@ -0,0 +1,3 @@ +include $(RIOTBOARD)/common/arduino-mkr/Makefile.features + +-include $(RIOTCPU)/samd21/Makefile.features diff --git a/boards/arduino-mkrfox1200/Makefile.include b/boards/arduino-mkrfox1200/Makefile.include new file mode 100644 index 0000000000..6cdeddbe11 --- /dev/null +++ b/boards/arduino-mkrfox1200/Makefile.include @@ -0,0 +1,10 @@ +USEMODULE += boards_common_arduino-mkr + +ifeq ($(PROGRAMMER),jlink) + export MKR_JLINK_DEVICE = atsamd21 +endif + +include $(RIOTBOARD)/common/arduino-mkr/Makefile.include + +# add arduino-mkrfox1200 include path +INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include diff --git a/boards/arduino-mkrfox1200/doc.txt b/boards/arduino-mkrfox1200/doc.txt new file mode 100644 index 0000000000..700ef82e88 --- /dev/null +++ b/boards/arduino-mkrfox1200/doc.txt @@ -0,0 +1,34 @@ +/** + * @defgroup boards_arduino-mkrfox1200 Arduino MKRFOX1200 + * @ingroup boards + * @brief Support for the Arduino MKRFOX1200 board. + * + * ### General information + * + * The [Arduino MKRFOX1200](https://www.arduino.cc/en/Main.ArduinoBoardMKRFox1200) board is + * a learning and development board that provides Sigfox connectivity and is + * powered by an Atmel SAMD21 microcontroller. + * + * ### Pinout + * + * Arduino MKRFOX1200 pinout + * + * ### Flash the board + * + * 1. Put the board in bootloader mode by double tapping the reset button.
+ * When the board is in bootloader mode, the user led (green) oscillates + * smoothly. + * + * + * 2. Use `BOARD=arduino-mkrfox1200` with the `make` command.
+ * Example with `hello-world` application: + * ``` + * make BOARD=arduino-mkrfox1200 -C examples/hello-world flash + * ``` + * + * ### Accessing STDIO via UART + * + * To access the STDIO of RIOT, a FTDI to USB converter needs to be plugged to + * the RX/TX pins on the board. + */ \ No newline at end of file diff --git a/boards/arduino-mkrfox1200/include/board.h b/boards/arduino-mkrfox1200/include/board.h new file mode 100644 index 0000000000..1adf6f1859 --- /dev/null +++ b/boards/arduino-mkrfox1200/include/board.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2017 Inria + * + * 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_arduino-mkrfox1200 + * @{ + * + * @file + * @brief Board specific definitions for the Arduino MKRFOX1200 + * board + * + * @author Alexandre Abadie + */ + +#ifndef BOARD_H +#define BOARD_H + +#include "cpu.h" +#include "periph_conf.h" +#include "board_common.h" +#include "arduino_pinmap.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief The on-board LED is connected to pin 6 on this board + */ +#define ARDUINO_LED (6U) + +/** + * @name LED pin definitions and handlers + * @{ + */ +#define LED0_PIN GPIO_PIN(PA, 20) + +#define LED_PORT PORT->Group[PA] +#define LED0_MASK (1 << 20) + +#define LED0_ON (LED_PORT.OUTSET.reg = LED0_MASK) +#define LED0_OFF (LED_PORT.OUTCLR.reg = LED0_MASK) +#define LED0_TOGGLE (LED_PORT.OUTTGL.reg = LED0_MASK) +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* BOARD_H */ +/** @} */