diff --git a/boards.txt b/boards.txt index 7feb07f6..0d8e3806 100644 --- a/boards.txt +++ b/boards.txt @@ -208,13 +208,21 @@ adafruit_trinket_m0.build.pid=0x801E adafruit_trinket_m0.bootloader.tool=openocd adafruit_trinket_m0.bootloader.file=trinket/samd21_sam_ba.bin -# Adafruit Metro M4 (SAMD51) +# Adafruit Metro M4 # ------------------------------ -adafruit_metro_m4.name=Adafruit Metro M4 (SAMD51) -adafruit_metro_m4.vid.0=0x239A -adafruit_metro_m4.pid.0=0x8020 -adafruit_metro_m4.vid.1=0x239A -adafruit_metro_m4.pid.1=0x0020 +adafruit_metro_m4.name=Adafruit Metro M4 +adafruit_metro_m4.vid.0=0x2341 +adafruit_metro_m4.pid.0=0x804d +adafruit_metro_m4.vid.1=0x2341 +adafruit_metro_m4.pid.1=0x004d + +adafruit_metro_m4.vid.2=0x2341 +adafruit_metro_m4.pid.2=0x824d +# If the board is a 2341:824d use 2341:824d for build and set other parameters as well +adafruit_metro_m4.vid.2.build.vid=0x2341 +adafruit_metro_m4.vid.2.build.pid=0x824d +adafruit_metro_m4.vid.2.build.usb_product="Adafruit Metro M4" +adafruit_metro_m4.vid.2.bootloader.file=metroM4/samdx1_sam_ba.bin adafruit_metro_m4.upload.tool=bossac adafruit_metro_m4.upload.protocol=sam-ba @@ -227,14 +235,14 @@ adafruit_metro_m4.build.mcu=cortex-m4 adafruit_metro_m4.build.f_cpu=48000000L adafruit_metro_m4.build.usb_product="Adafruit Metro M4" adafruit_metro_m4.build.usb_manufacturer="Adafruit LLC" -adafruit_metro_m4.build.board=SAMD_51 +adafruit_metro_m4.build.board=SAMD_METRO_M4 adafruit_metro_m4.build.core=arduino adafruit_metro_m4.build.extra_flags=-D__SAMD51J20A__ -D__SAMD51__ {build.usb_flags} adafruit_metro_m4.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld adafruit_metro_m4.build.openocdscript=openocd_scripts/arduino_zero.cfg adafruit_metro_m4.build.variant=metro_m4 adafruit_metro_m4.build.variant_system_lib= -adafruit_metro_m4.build.vid=0x239A -adafruit_metro_m4.build.pid=0x8020 +adafruit_metro_m4.build.vid=0x2341 +adafruit_metro_m4.build.pid=0x804d adafruit_metro_m4.bootloader.tool=openocd -adafruit_metro_m4.bootloader.file=x1/samdx1_sam_ba.bin +adafruit_metro_m4.bootloader.file=metroM4/samdx1_sam_ba.bin diff --git a/bootloaders/metroM4/.vs/samdx1_sam_ba/v14/.atsuo b/bootloaders/metroM4/.vs/samdx1_sam_ba/v14/.atsuo new file mode 100644 index 00000000..2995c0e0 Binary files /dev/null and b/bootloaders/metroM4/.vs/samdx1_sam_ba/v14/.atsuo differ diff --git a/bootloaders/x1/Makefile b/bootloaders/metroM4/Makefile similarity index 99% rename from bootloaders/x1/Makefile rename to bootloaders/metroM4/Makefile index 1dca35ec..27a40034 100644 --- a/bootloaders/x1/Makefile +++ b/bootloaders/metroM4/Makefile @@ -57,7 +57,7 @@ SIZE=$(ARM_GCC_PATH)size # ----------------------------------------------------------------------------- # Boards definitions -BOARD_ID?=arduino_x1 +BOARD_ID?=METRO_M4 # ----------------------------------------------------------------------------- # Compiler options diff --git a/bootloaders/x1/README.md b/bootloaders/metroM4/README.md similarity index 94% rename from bootloaders/x1/README.md rename to bootloaders/metroM4/README.md index a29ae3b4..98b045e1 100644 --- a/bootloaders/x1/README.md +++ b/bootloaders/metroM4/README.md @@ -1,4 +1,4 @@ -# Arduino x1 Bootloader +# Metro M4 Bootloader ## 1- Prerequisites @@ -55,9 +55,8 @@ The following pins are used by the program : PA25 : input/output (USB DP) PA24 : input/output (USB DM) -### TODO: not correct -PA11 : input (USART RX) -PA10 : output (USART TX) +PA23 : input (USART RX) +PA22 : output (USART TX) The application board shall avoid driving the PA25, PA24, PB23 and PB22 signals while the boot program is running (after a POR for example). @@ -79,7 +78,7 @@ Before jumping to the application, the bootloader changes the VTOR register to u ## 5- How to build -If not specified the makefile builds for **Arduino x1**: +If not specified the makefile builds for **Metro M4**: ``` make diff --git a/bootloaders/x1/board_definitions.h b/bootloaders/metroM4/board_definitions.h similarity index 93% rename from bootloaders/x1/board_definitions.h rename to bootloaders/metroM4/board_definitions.h index 1c119cc2..6b23ee08 100644 --- a/bootloaders/x1/board_definitions.h +++ b/bootloaders/metroM4/board_definitions.h @@ -17,8 +17,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#if defined(BOARD_ID_arduino_x1) - #include "board_definitions_arduino_x1.h" +#if defined(BOARD_ID_METRO_M4) + #include "board_definitions_metro_m4.h" #else #error You must define a BOARD_ID and add the corresponding definitions in board_definitions.h #endif diff --git a/bootloaders/x1/board_definitions_arduino_x1.h b/bootloaders/metroM4/board_definitions_metro_m4.h similarity index 98% rename from bootloaders/x1/board_definitions_arduino_x1.h rename to bootloaders/metroM4/board_definitions_metro_m4.h index e9cd090b..66e5dd95 100644 --- a/bootloaders/x1/board_definitions_arduino_x1.h +++ b/bootloaders/metroM4/board_definitions_metro_m4.h @@ -23,7 +23,7 @@ /* * USB device definitions */ -#define STRING_PRODUCT "Arduino x1" +#define STRING_PRODUCT "Metro M4" #define USB_VID_HIGH 0x23 #define USB_VID_LOW 0x41 #define USB_PID_HIGH 0x00 diff --git a/bootloaders/x1/board_driver_led.c b/bootloaders/metroM4/board_driver_led.c similarity index 100% rename from bootloaders/x1/board_driver_led.c rename to bootloaders/metroM4/board_driver_led.c diff --git a/bootloaders/x1/board_driver_led.h b/bootloaders/metroM4/board_driver_led.h similarity index 100% rename from bootloaders/x1/board_driver_led.h rename to bootloaders/metroM4/board_driver_led.h diff --git a/bootloaders/x1/board_driver_serial.c b/bootloaders/metroM4/board_driver_serial.c similarity index 100% rename from bootloaders/x1/board_driver_serial.c rename to bootloaders/metroM4/board_driver_serial.c diff --git a/bootloaders/x1/board_driver_serial.h b/bootloaders/metroM4/board_driver_serial.h similarity index 100% rename from bootloaders/x1/board_driver_serial.h rename to bootloaders/metroM4/board_driver_serial.h diff --git a/bootloaders/x1/board_driver_usb.c b/bootloaders/metroM4/board_driver_usb.c similarity index 100% rename from bootloaders/x1/board_driver_usb.c rename to bootloaders/metroM4/board_driver_usb.c diff --git a/bootloaders/x1/board_driver_usb.h b/bootloaders/metroM4/board_driver_usb.h similarity index 100% rename from bootloaders/x1/board_driver_usb.h rename to bootloaders/metroM4/board_driver_usb.h diff --git a/bootloaders/x1/board_init.c b/bootloaders/metroM4/board_init.c similarity index 100% rename from bootloaders/x1/board_init.c rename to bootloaders/metroM4/board_init.c diff --git a/bootloaders/x1/board_startup.c b/bootloaders/metroM4/board_startup.c similarity index 100% rename from bootloaders/x1/board_startup.c rename to bootloaders/metroM4/board_startup.c diff --git a/bootloaders/x1/bootloader_samdx1.ld b/bootloaders/metroM4/bootloader_samdx1.ld similarity index 100% rename from bootloaders/x1/bootloader_samdx1.ld rename to bootloaders/metroM4/bootloader_samdx1.ld diff --git a/bootloaders/x1/build_all_bootloaders.sh b/bootloaders/metroM4/build_all_bootloaders.sh similarity index 100% rename from bootloaders/x1/build_all_bootloaders.sh rename to bootloaders/metroM4/build_all_bootloaders.sh diff --git a/bootloaders/x1/main.c b/bootloaders/metroM4/main.c similarity index 100% rename from bootloaders/x1/main.c rename to bootloaders/metroM4/main.c diff --git a/bootloaders/x1/sam_ba_cdc.c b/bootloaders/metroM4/sam_ba_cdc.c similarity index 100% rename from bootloaders/x1/sam_ba_cdc.c rename to bootloaders/metroM4/sam_ba_cdc.c diff --git a/bootloaders/x1/sam_ba_cdc.h b/bootloaders/metroM4/sam_ba_cdc.h similarity index 100% rename from bootloaders/x1/sam_ba_cdc.h rename to bootloaders/metroM4/sam_ba_cdc.h diff --git a/bootloaders/x1/sam_ba_monitor.c b/bootloaders/metroM4/sam_ba_monitor.c similarity index 100% rename from bootloaders/x1/sam_ba_monitor.c rename to bootloaders/metroM4/sam_ba_monitor.c diff --git a/bootloaders/x1/sam_ba_monitor.h b/bootloaders/metroM4/sam_ba_monitor.h similarity index 100% rename from bootloaders/x1/sam_ba_monitor.h rename to bootloaders/metroM4/sam_ba_monitor.h diff --git a/bootloaders/x1/sam_ba_serial.c b/bootloaders/metroM4/sam_ba_serial.c similarity index 100% rename from bootloaders/x1/sam_ba_serial.c rename to bootloaders/metroM4/sam_ba_serial.c diff --git a/bootloaders/x1/sam_ba_serial.h b/bootloaders/metroM4/sam_ba_serial.h similarity index 100% rename from bootloaders/x1/sam_ba_serial.h rename to bootloaders/metroM4/sam_ba_serial.h diff --git a/bootloaders/x1/sam_ba_usb.c b/bootloaders/metroM4/sam_ba_usb.c similarity index 100% rename from bootloaders/x1/sam_ba_usb.c rename to bootloaders/metroM4/sam_ba_usb.c diff --git a/bootloaders/x1/sam_ba_usb.h b/bootloaders/metroM4/sam_ba_usb.h similarity index 100% rename from bootloaders/x1/sam_ba_usb.h rename to bootloaders/metroM4/sam_ba_usb.h diff --git a/bootloaders/x1/samd51_sam_ba.elf b/bootloaders/metroM4/samd51_sam_ba.elf similarity index 100% rename from bootloaders/x1/samd51_sam_ba.elf rename to bootloaders/metroM4/samd51_sam_ba.elf diff --git a/bootloaders/x1/samdx1_sam_ba.atsln b/bootloaders/metroM4/samdx1_sam_ba.atsln similarity index 100% rename from bootloaders/x1/samdx1_sam_ba.atsln rename to bootloaders/metroM4/samdx1_sam_ba.atsln diff --git a/bootloaders/x1/samdx1_sam_ba.bin b/bootloaders/metroM4/samdx1_sam_ba.bin similarity index 100% rename from bootloaders/x1/samdx1_sam_ba.bin rename to bootloaders/metroM4/samdx1_sam_ba.bin diff --git a/bootloaders/x1/samdx1_sam_ba.componentinfo.xml b/bootloaders/metroM4/samdx1_sam_ba.componentinfo.xml similarity index 100% rename from bootloaders/x1/samdx1_sam_ba.componentinfo.xml rename to bootloaders/metroM4/samdx1_sam_ba.componentinfo.xml diff --git a/bootloaders/x1/samdx1_sam_ba.cproj b/bootloaders/metroM4/samdx1_sam_ba.cproj similarity index 100% rename from bootloaders/x1/samdx1_sam_ba.cproj rename to bootloaders/metroM4/samdx1_sam_ba.cproj diff --git a/bootloaders/x1/samdx1_sam_ba.elf b/bootloaders/metroM4/samdx1_sam_ba.elf similarity index 100% rename from bootloaders/x1/samdx1_sam_ba.elf rename to bootloaders/metroM4/samdx1_sam_ba.elf diff --git a/bootloaders/x1/samdx1_sam_ba.hex b/bootloaders/metroM4/samdx1_sam_ba.hex similarity index 100% rename from bootloaders/x1/samdx1_sam_ba.hex rename to bootloaders/metroM4/samdx1_sam_ba.hex diff --git a/bootloaders/x1/.vs/samdx1_sam_ba/v14/.atsuo b/bootloaders/x1/.vs/samdx1_sam_ba/v14/.atsuo deleted file mode 100644 index 1cd1e7ec..00000000 Binary files a/bootloaders/x1/.vs/samdx1_sam_ba/v14/.atsuo and /dev/null differ diff --git a/bootloaders/x1/board_definitions_arduino_mkr1000.h b/bootloaders/x1/board_definitions_arduino_mkr1000.h deleted file mode 100644 index 4e71e4d5..00000000 --- a/bootloaders/x1/board_definitions_arduino_mkr1000.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - Copyright (c) 2015 Arduino LLC. All right reserved. - Copyright (c) 2015 Atmel Corporation/Thibaut VIARD. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef _BOARD_DEFINITIONS_H_ -#define _BOARD_DEFINITIONS_H_ - -/* - * USB device definitions - */ -#define STRING_PRODUCT "Arduino MKR1000" -#define USB_VID_HIGH 0x23 -#define USB_VID_LOW 0x41 -#define USB_PID_HIGH 0x00 -#define USB_PID_LOW 0x4E - -/* - * If BOOT_DOUBLE_TAP_ADDRESS is defined the bootloader is started by - * quickly tapping two times on the reset button. - * BOOT_DOUBLE_TAP_ADDRESS must point to a free SRAM cell that must not - * be touched from the loaded application. - */ -#define BOOT_DOUBLE_TAP_ADDRESS (0x20007FFCul) -#define BOOT_DOUBLE_TAP_DATA (*((volatile uint32_t *) BOOT_DOUBLE_TAP_ADDRESS)) - -/* - * If BOOT_LOAD_PIN is defined the bootloader is started if the selected - * pin is tied LOW. - */ -//#define BOOT_LOAD_PIN PIN_PA21 // Pin 7 -//#define BOOT_LOAD_PIN PIN_PA15 // Pin 5 - -#define BOOT_USART_MODULE SERCOM0 -#define BOOT_USART_BUS_CLOCK_INDEX PM_APBCMASK_SERCOM0 -#define BOOT_USART_PER_CLOCK_INDEX GCLK_CLKCTRL_ID_SERCOM0_CORE_Val -#define BOOT_USART_PAD_SETTINGS UART_RX_PAD3_TX_PAD2 -#define BOOT_USART_PAD3 PINMUX_PA11C_SERCOM0_PAD3 -#define BOOT_USART_PAD2 PINMUX_PA10C_SERCOM0_PAD2 -#define BOOT_USART_PAD1 PINMUX_UNUSED -#define BOOT_USART_PAD0 PINMUX_UNUSED - -/* Master clock frequency */ -#define CPU_FREQUENCY (48000000ul) -#define VARIANT_MCK CPU_FREQUENCY - -/* Frequency of the board main oscillator */ -#define VARIANT_MAINOSC (32768ul) - -/* Calibration values for DFLL48 pll */ -#define NVM_SW_CALIB_DFLL48M_COARSE_VAL (58) -#define NVM_SW_CALIB_DFLL48M_FINE_VAL (64) - -/* - * LEDs definitions - */ -// PA20 (digital pin 6) -#define BOARD_LED_PORT (0) -#define BOARD_LED_PIN (20) - -// No RX/TX led -//#define BOARD_LEDRX_PORT -//#define BOARD_LEDRX_PIN - -//#define BOARD_LEDTX_PORT -//#define BOARD_LEDTX_PIN - -#endif // _BOARD_DEFINITIONS_H_ diff --git a/bootloaders/x1/board_definitions_arduino_mkrfox1200.h b/bootloaders/x1/board_definitions_arduino_mkrfox1200.h deleted file mode 100644 index e5568477..00000000 --- a/bootloaders/x1/board_definitions_arduino_mkrfox1200.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - Copyright (c) 2016 Arduino LLC. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef _BOARD_DEFINITIONS_H_ -#define _BOARD_DEFINITIONS_H_ - -/* - * USB device definitions - */ -#define STRING_PRODUCT "Arduino MKRFox1200" -#define USB_VID_HIGH 0x23 -#define USB_VID_LOW 0x41 -#define USB_PID_HIGH 0x00 -#define USB_PID_LOW 0x50 - -/* - * If BOOT_DOUBLE_TAP_ADDRESS is defined the bootloader is started by - * quickly tapping two times on the reset button. - * BOOT_DOUBLE_TAP_ADDRESS must point to a free SRAM cell that must not - * be touched from the loaded application. - */ -#define BOOT_DOUBLE_TAP_ADDRESS (0x20007FFCul) -#define BOOT_DOUBLE_TAP_DATA (*((volatile uint32_t *) BOOT_DOUBLE_TAP_ADDRESS)) - -/* - * If BOOT_LOAD_PIN is defined the bootloader is started if the selected - * pin is tied LOW. - */ -//#define BOOT_LOAD_PIN PIN_PA21 -//#define BOOT_LOAD_PIN PIN_PA15 - -#define BOOT_USART_MODULE SERCOM5 -#define BOOT_USART_BUS_CLOCK_INDEX PM_APBCMASK_SERCOM5 -#define BOOT_USART_PER_CLOCK_INDEX GCLK_CLKCTRL_ID_SERCOM5_CORE_Val -#define BOOT_USART_PAD_SETTINGS UART_RX_PAD3_TX_PAD2 -#define BOOT_USART_PAD3 PINMUX_PB23D_SERCOM5_PAD3 -#define BOOT_USART_PAD2 PINMUX_PB22D_SERCOM5_PAD2 -#define BOOT_USART_PAD1 PINMUX_UNUSED -#define BOOT_USART_PAD0 PINMUX_UNUSED - -/* Master clock frequency */ -#define CPU_FREQUENCY (48000000ul) -#define VARIANT_MCK CPU_FREQUENCY - -/* Frequency of the board main oscillator */ -#define VARIANT_MAINOSC (32768ul) - -/* Calibration values for DFLL48 pll */ -#define NVM_SW_CALIB_DFLL48M_COARSE_VAL (58) -#define NVM_SW_CALIB_DFLL48M_FINE_VAL (64) - -/* - * LEDs definitions - */ -// PA20 (digital pin 6) -#define BOARD_LED_PORT (0) -#define BOARD_LED_PIN (20) - -// No RX/TX led -//#define BOARD_LEDRX_PORT -//#define BOARD_LEDRX_PIN - -//#define BOARD_LEDTX_PORT -//#define BOARD_LEDTX_PIN - -#endif // _BOARD_DEFINITIONS_H_ diff --git a/bootloaders/x1/board_definitions_arduino_mkrzero.h b/bootloaders/x1/board_definitions_arduino_mkrzero.h deleted file mode 100644 index 0adfeb67..00000000 --- a/bootloaders/x1/board_definitions_arduino_mkrzero.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - Copyright (c) 2016 Arduino LLC. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef _BOARD_DEFINITIONS_H_ -#define _BOARD_DEFINITIONS_H_ - -/* - * USB device definitions - */ -#define STRING_PRODUCT "Arduino MKRZero" -#define USB_VID_HIGH 0x23 -#define USB_VID_LOW 0x41 -#define USB_PID_HIGH 0x00 -#define USB_PID_LOW 0x4F - -/* - * If BOOT_DOUBLE_TAP_ADDRESS is defined the bootloader is started by - * quickly tapping two times on the reset button. - * BOOT_DOUBLE_TAP_ADDRESS must point to a free SRAM cell that must not - * be touched from the loaded application. - */ -#define BOOT_DOUBLE_TAP_ADDRESS (0x20007FFCul) -#define BOOT_DOUBLE_TAP_DATA (*((volatile uint32_t *) BOOT_DOUBLE_TAP_ADDRESS)) - -/* - * If BOOT_LOAD_PIN is defined the bootloader is started if the selected - * pin is tied LOW. - */ -//#define BOOT_LOAD_PIN PIN_PA21 -//#define BOOT_LOAD_PIN PIN_PA15 - -#define BOOT_USART_MODULE SERCOM5 -#define BOOT_USART_BUS_CLOCK_INDEX PM_APBCMASK_SERCOM5 -#define BOOT_USART_PER_CLOCK_INDEX GCLK_CLKCTRL_ID_SERCOM5_CORE_Val -#define BOOT_USART_PAD_SETTINGS UART_RX_PAD3_TX_PAD2 -#define BOOT_USART_PAD3 PINMUX_PB23D_SERCOM5_PAD3 -#define BOOT_USART_PAD2 PINMUX_PB22D_SERCOM5_PAD2 -#define BOOT_USART_PAD1 PINMUX_UNUSED -#define BOOT_USART_PAD0 PINMUX_UNUSED - -/* Master clock frequency */ -#define CPU_FREQUENCY (48000000ul) -#define VARIANT_MCK CPU_FREQUENCY - -/* Frequency of the board main oscillator */ -#define VARIANT_MAINOSC (32768ul) - -/* Calibration values for DFLL48 pll */ -#define NVM_SW_CALIB_DFLL48M_COARSE_VAL (58) -#define NVM_SW_CALIB_DFLL48M_FINE_VAL (64) - -/* - * LEDs definitions - */ -// PB08 (digital pin 32) -#define BOARD_LED_PORT (1) -#define BOARD_LED_PIN (8) - -// No RX/TX led -//#define BOARD_LEDRX_PORT -//#define BOARD_LEDRX_PIN - -//#define BOARD_LEDTX_PORT -//#define BOARD_LEDTX_PIN - -#endif // _BOARD_DEFINITIONS_H_ diff --git a/bootloaders/x1/board_definitions_arduino_zero.h b/bootloaders/x1/board_definitions_arduino_zero.h deleted file mode 100644 index eac27b73..00000000 --- a/bootloaders/x1/board_definitions_arduino_zero.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - Copyright (c) 2015 Arduino LLC. All right reserved. - Copyright (c) 2015 Atmel Corporation/Thibaut VIARD. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef _BOARD_DEFINITIONS_H_ -#define _BOARD_DEFINITIONS_H_ - -/* - * USB device definitions - */ -#define STRING_PRODUCT "Arduino Zero" -#define USB_VID_HIGH 0x23 -#define USB_VID_LOW 0x41 -#define USB_PID_HIGH 0x00 -#define USB_PID_LOW 0x4D - -/* - * If BOOT_DOUBLE_TAP_ADDRESS is defined the bootloader is started by - * quickly tapping two times on the reset button. - * BOOT_DOUBLE_TAP_ADDRESS must point to a free SRAM cell that must not - * be touched from the loaded application. - */ -#define BOOT_DOUBLE_TAP_ADDRESS (0x20007FFCul) -#define BOOT_DOUBLE_TAP_DATA (*((volatile uint32_t *) BOOT_DOUBLE_TAP_ADDRESS)) - -/* - * If BOOT_LOAD_PIN is defined the bootloader is started if the selected - * pin is tied LOW. - */ -//#define BOOT_LOAD_PIN PIN_PA21 // Pin 7 -//#define BOOT_LOAD_PIN PIN_PA15 // Pin 5 - -#define BOOT_USART_MODULE SERCOM0 -#define BOOT_USART_BUS_CLOCK_INDEX PM_APBCMASK_SERCOM0 -#define BOOT_USART_PER_CLOCK_INDEX GCLK_CLKCTRL_ID_SERCOM0_CORE_Val -#define BOOT_USART_PAD_SETTINGS UART_RX_PAD3_TX_PAD2 -#define BOOT_USART_PAD3 PINMUX_PA11C_SERCOM0_PAD3 -#define BOOT_USART_PAD2 PINMUX_PA10C_SERCOM0_PAD2 -#define BOOT_USART_PAD1 PINMUX_UNUSED -#define BOOT_USART_PAD0 PINMUX_UNUSED - - -/* Master clock frequency */ -#define CPU_FREQUENCY (48000000ul) -#define VARIANT_MCK CPU_FREQUENCY - -/* Frequency of the board main oscillator */ -#define VARIANT_MAINOSC (32768ul) - -/* Calibration values for DFLL48 pll */ -#define NVM_SW_CALIB_DFLL48M_COARSE_VAL (58) -#define NVM_SW_CALIB_DFLL48M_FINE_VAL (64) - -/* - * LEDs definitions - */ -#define BOARD_LED_PORT (0) -#define BOARD_LED_PIN (17) - -#define BOARD_LEDRX_PORT (1) -#define BOARD_LEDRX_PIN (3) - -#define BOARD_LEDTX_PORT (0) -#define BOARD_LEDTX_PIN (27) - -#endif // _BOARD_DEFINITIONS_H_ diff --git a/bootloaders/x1/board_definitions_genuino_mkr1000.h b/bootloaders/x1/board_definitions_genuino_mkr1000.h deleted file mode 100644 index d97163d4..00000000 --- a/bootloaders/x1/board_definitions_genuino_mkr1000.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - Copyright (c) 2015 Arduino LLC. All right reserved. - Copyright (c) 2015 Atmel Corporation/Thibaut VIARD. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef _BOARD_DEFINITIONS_H_ -#define _BOARD_DEFINITIONS_H_ - -/* - * USB device definitions - */ -#define STRING_PRODUCT "Genuino MKR1000" -#define USB_VID_HIGH 0x23 -#define USB_VID_LOW 0x41 -#define USB_PID_HIGH 0x02 -#define USB_PID_LOW 0x4E - -/* - * If BOOT_DOUBLE_TAP_ADDRESS is defined the bootloader is started by - * quickly tapping two times on the reset button. - * BOOT_DOUBLE_TAP_ADDRESS must point to a free SRAM cell that must not - * be touched from the loaded application. - */ -#define BOOT_DOUBLE_TAP_ADDRESS (0x20007FFCul) -#define BOOT_DOUBLE_TAP_DATA (*((volatile uint32_t *) BOOT_DOUBLE_TAP_ADDRESS)) - -/* - * If BOOT_LOAD_PIN is defined the bootloader is started if the selected - * pin is tied LOW. - */ -//#define BOOT_LOAD_PIN PIN_PA21 // Pin 7 -//#define BOOT_LOAD_PIN PIN_PA15 // Pin 5 - -#define BOOT_USART_MODULE SERCOM0 -#define BOOT_USART_BUS_CLOCK_INDEX PM_APBCMASK_SERCOM0 -#define BOOT_USART_PER_CLOCK_INDEX GCLK_CLKCTRL_ID_SERCOM0_CORE_Val -#define BOOT_USART_PAD_SETTINGS UART_RX_PAD3_TX_PAD2 -#define BOOT_USART_PAD3 PINMUX_PA11C_SERCOM0_PAD3 -#define BOOT_USART_PAD2 PINMUX_PA10C_SERCOM0_PAD2 -#define BOOT_USART_PAD1 PINMUX_UNUSED -#define BOOT_USART_PAD0 PINMUX_UNUSED - - -/* Master clock frequency */ -#define CPU_FREQUENCY (48000000ul) -#define VARIANT_MCK CPU_FREQUENCY - -/* Frequency of the board main oscillator */ -#define VARIANT_MAINOSC (32768ul) - -/* Calibration values for DFLL48 pll */ -#define NVM_SW_CALIB_DFLL48M_COARSE_VAL (58) -#define NVM_SW_CALIB_DFLL48M_FINE_VAL (64) - -/* - * LEDs definitions - */ -// PA20 (digital pin 6) -#define BOARD_LED_PORT (0) -#define BOARD_LED_PIN (20) - -// No RX/TX led -//#define BOARD_LEDRX_PORT -//#define BOARD_LEDRX_PIN - -//#define BOARD_LEDTX_PORT -//#define BOARD_LEDTX_PIN - -#endif // _BOARD_DEFINITIONS_H_ diff --git a/bootloaders/x1/board_definitions_genuino_zero.h b/bootloaders/x1/board_definitions_genuino_zero.h deleted file mode 100644 index a4e27d83..00000000 --- a/bootloaders/x1/board_definitions_genuino_zero.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - Copyright (c) 2015 Arduino LLC. All right reserved. - Copyright (c) 2015 Atmel Corporation/Thibaut VIARD. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef _BOARD_DEFINITIONS_H_ -#define _BOARD_DEFINITIONS_H_ - -/* - * USB device definitions - */ -#define STRING_PRODUCT "Genuino Zero" -#define USB_VID_HIGH 0x23 -#define USB_VID_LOW 0x41 -#define USB_PID_HIGH 0x02 -#define USB_PID_LOW 0x4D - -/* - * If BOOT_DOUBLE_TAP_ADDRESS is defined the bootloader is started by - * quickly tapping two times on the reset button. - * BOOT_DOUBLE_TAP_ADDRESS must point to a free SRAM cell that must not - * be touched from the loaded application. - */ -#define BOOT_DOUBLE_TAP_ADDRESS (0x20007FFCul) -#define BOOT_DOUBLE_TAP_DATA (*((volatile uint32_t *) BOOT_DOUBLE_TAP_ADDRESS)) - -/* - * If BOOT_LOAD_PIN is defined the bootloader is started if the selected - * pin is tied LOW. - */ -//#define BOOT_LOAD_PIN PIN_PA21 // Pin 7 -//#define BOOT_LOAD_PIN PIN_PA15 // Pin 5 - -#define BOOT_USART_MODULE SERCOM0 -#define BOOT_USART_BUS_CLOCK_INDEX PM_APBCMASK_SERCOM0 -#define BOOT_USART_PER_CLOCK_INDEX GCLK_CLKCTRL_ID_SERCOM0_CORE_Val -#define BOOT_USART_PAD_SETTINGS UART_RX_PAD3_TX_PAD2 -#define BOOT_USART_PAD3 PINMUX_PA11C_SERCOM0_PAD3 -#define BOOT_USART_PAD2 PINMUX_PA10C_SERCOM0_PAD2 -#define BOOT_USART_PAD1 PINMUX_UNUSED -#define BOOT_USART_PAD0 PINMUX_UNUSED - - -/* Master clock frequency */ -#define CPU_FREQUENCY (48000000ul) -#define VARIANT_MCK CPU_FREQUENCY - -/* Frequency of the board main oscillator */ -#define VARIANT_MAINOSC (32768ul) - -/* Calibration values for DFLL48 pll */ -#define NVM_SW_CALIB_DFLL48M_COARSE_VAL (58) -#define NVM_SW_CALIB_DFLL48M_FINE_VAL (64) - -/* - * LEDs definitions - */ -#define BOARD_LED_PORT (0) -#define BOARD_LED_PIN (17) - -#define BOARD_LEDRX_PORT (1) -#define BOARD_LEDRX_PIN (3) - -#define BOARD_LEDTX_PORT (0) -#define BOARD_LEDTX_PIN (27) - -#endif // _BOARD_DEFINITIONS_H_ diff --git a/cores/arduino/WVariant.h b/cores/arduino/WVariant.h index f86e9d07..a82b67b3 100644 --- a/cores/arduino/WVariant.h +++ b/cores/arduino/WVariant.h @@ -37,13 +37,13 @@ typedef enum _EAnalogChannel ADC_Channel5=5, ADC_Channel6=6, ADC_Channel7=7, -#if defined __SAMD21J18A__ +#if defined __SAMD21J18A__ || defined(__SAMD51__) ADC_Channel8=8, ADC_Channel9=9, #endif // __SAMD21J18A__ ADC_Channel10=10, ADC_Channel11=11, -#if defined __SAMD21J18A__ +#if defined __SAMD21J18A__ || defined(__SAMD51__) ADC_Channel12=12, ADC_Channel13=13, ADC_Channel14=14, @@ -54,6 +54,7 @@ typedef enum _EAnalogChannel ADC_Channel18=18, ADC_Channel19=19, DAC_Channel0, + DAC_Channel1, } EAnalogChannel ; // Definitions for TC channels @@ -72,26 +73,35 @@ typedef enum _ETCChannel TCC1_CH1 = (1<<8)|(1), TCC1_CH2 = (1<<8)|(0), // Channel 2 is 0! TCC1_CH3 = (1<<8)|(1), // Channel 3 is 1! +#if defined(__SAMD51J20A__) + TCC1_CH4 = (1<<8)|(2), + TCC1_CH5 = (1<<8)|(3), + TCC1_CH6 = (1<<8)|(4), + TCC1_CH7 = (1<<8)|(5), +#endif //__SAMD51J20A__ TCC2_CH0 = (2<<8)|(0), TCC2_CH1 = (2<<8)|(1), TCC2_CH2 = (2<<8)|(0), // Channel 2 is 0! TCC2_CH3 = (2<<8)|(1), // Channel 3 is 1! +#if defined(__SAMD51J20A__) //TODO: fix some of these PWM channels + TCC3_CH0 = (2<<8)|(0), + TCC3_CH1 = (2<<8)|(1), + TCC3_CH2 = (2<<8)|(0), // Channel 2 is 0! + TCC3_CH3 = (2<<8)|(1), // Channel 3 is 1! + TCC4_CH0 = (2<<8)|(0), + TCC4_CH1 = (2<<8)|(1), + TCC4_CH2 = (2<<8)|(0), // Channel 2 is 0! + TCC4_CH3 = (2<<8)|(1), // Channel 3 is 1 + TC5_CH0 = (5<<8)|(0), + TC5_CH1 = (5<<8)|(1), +#else //end __SAMD51J20A__ TC3_CH0 = (3<<8)|(0), TC3_CH1 = (3<<8)|(1), TC4_CH0 = (4<<8)|(0), TC4_CH1 = (4<<8)|(1), TC5_CH0 = (5<<8)|(0), TC5_CH1 = (5<<8)|(1), -#if defined __SAMD21J18A__ - TC6_CH0 = (6<<8)|(0), - TC6_CH1 = (6<<8)|(1), - TC7_CH0 = (7<<8)|(0), - TC7_CH1 = (7<<8)|(1), -#endif // __SAMD21J18A__ -#if defined(__SAMD51__) //TODO: these - TCC1_CH4 = (1<<8)|(2), - TCC1_CH5 = (1<<8)|(3), -#endif +#endif //__SAMD51J20A__ } ETCChannel ; extern const void* g_apTCInstances[TCC_INST_NUM+TC_INST_NUM] ; @@ -100,43 +110,77 @@ extern const void* g_apTCInstances[TCC_INST_NUM+TC_INST_NUM] ; #define GetTCChannelNumber( x ) ( (x) & 0xff ) #define GetTC( x ) ( g_apTCInstances[(x) >> 8] ) -// Definitions for PWM channels -typedef enum _EPWMChannel -{ - NOT_ON_PWM=-1, - PWM0_CH0=TCC0_CH0, - PWM0_CH1=TCC0_CH1, - PWM0_CH2=TCC0_CH2, - PWM0_CH3=TCC0_CH3, - PWM0_CH4=TCC0_CH4, - PWM0_CH5=TCC0_CH5, - PWM0_CH6=TCC0_CH6, - PWM0_CH7=TCC0_CH7, - PWM1_CH0=TCC1_CH0, - PWM1_CH1=TCC1_CH1, - PWM1_CH2=TCC1_CH2, - PWM1_CH3=TCC1_CH3, - PWM2_CH0=TCC2_CH0, - PWM2_CH1=TCC2_CH1, - PWM2_CH2=TCC2_CH2, - PWM2_CH3=TCC2_CH3, - PWM3_CH0=TC3_CH0, - PWM3_CH1=TC3_CH1, - PWM4_CH0=TC4_CH0, - PWM4_CH1=TC4_CH1, - PWM5_CH0=TC5_CH0, - PWM5_CH1=TC5_CH1, -#if defined __SAMD21J18A__ - PWM6_CH0=TC6_CH0, - PWM6_CH1=TC6_CH1, - PWM7_CH0=TC7_CH0, - PWM7_CH1=TC7_CH1, -#endif // __SAMD21J18A__ -#if defined(__SAMD51__) - PWM1_CH4=TCC1_CH4, - PWM1_CH5=TCC1_CH5, + +#if defined(__SAMD51J20A__) + + typedef enum _EPWMChannel + { + NOT_ON_PWM=-1, + PWM0_CH0=TCC0_CH0, + PWM0_CH1=TCC0_CH1, + PWM0_CH2=TCC0_CH2, + PWM0_CH3=TCC0_CH3, + PWM0_CH4=TCC0_CH4, + PWM0_CH5=TCC0_CH5, + PWM0_CH6=TCC0_CH6, + PWM0_CH7=TCC0_CH7, + PWM1_CH0=TCC1_CH0, + PWM1_CH1=TCC1_CH1, + PWM1_CH2=TCC1_CH2, + PWM1_CH3=TCC1_CH3, + PWM1_CH4=TCC1_CH4, + PWM1_CH5=TCC1_CH5, + PWM1_CH6=TCC1_CH6, + PWM1_CH7=TCC1_CH7, + PWM2_CH0=TCC2_CH0, + PWM2_CH1=TCC2_CH1, + PWM2_CH2=TCC2_CH2, + PWM2_CH3=TCC2_CH3, + PWM3_CH0=TCC3_CH0, + PWM3_CH1=TCC3_CH1, + PWM4_CH0=TCC4_CH0, + PWM4_CH1=TCC4_CH1, + PWM5_CH0=TC5_CH0, + PWM5_CH1=TC5_CH1, + } EPWMChannel ; + +#else //end __SAMD51J20A__ + // Definitions for PWM channels + typedef enum _EPWMChannel + { + NOT_ON_PWM=-1, + PWM0_CH0=TCC0_CH0, + PWM0_CH1=TCC0_CH1, + PWM0_CH2=TCC0_CH2, + PWM0_CH3=TCC0_CH3, + PWM0_CH4=TCC0_CH4, + PWM0_CH5=TCC0_CH5, + PWM0_CH6=TCC0_CH6, + PWM0_CH7=TCC0_CH7, + PWM1_CH0=TCC1_CH0, + PWM1_CH1=TCC1_CH1, + PWM1_CH2=TCC1_CH2, + PWM1_CH3=TCC1_CH3, + PWM2_CH0=TCC2_CH0, + PWM2_CH1=TCC2_CH1, + PWM2_CH2=TCC2_CH2, + PWM2_CH3=TCC2_CH3, + PWM3_CH0=TC3_CH0, + PWM3_CH1=TC3_CH1, + PWM4_CH0=TC4_CH0, + PWM4_CH1=TC4_CH1, + PWM5_CH0=TC5_CH0, + PWM5_CH1=TC5_CH1, + #if defined(__SAMD21J18A__) + PWM6_CH0=TC6_CH0, + PWM6_CH1=TC6_CH1, + PWM7_CH0=TC7_CH0, + PWM7_CH1=TC7_CH1, + #endif // __SAMD21J18A__ + } EPWMChannel ; + #endif -} EPWMChannel ; + typedef enum _EPortType { diff --git a/cores/arduino/wiring_analog.c b/cores/arduino/wiring_analog.c index df5d972a..5ea2763e 100644 --- a/cores/arduino/wiring_analog.c +++ b/cores/arduino/wiring_analog.c @@ -434,7 +434,9 @@ void analogWrite(uint32_t pin, uint32_t value) TCC0_GCLK_ID, TCC1_GCLK_ID, TCC2_GCLK_ID, - TC3_GCLK_ID + TCC3_GCLK_ID, + TCC4_GCLK_ID, + TC5_GCLK_ID, }; GCLK->PCHCTRL[GCLK_CLKCTRL_IDs[tcNum]].reg = GCLK_PCHCTRL_GEN_GCLK0_Val | (1 << GCLK_PCHCTRL_CHEN_Pos); //use clock generator 0 diff --git a/variants/metro_m4/debug_scripts/variant.gdb~DM b/variants/metro_m4/debug_scripts/variant.gdb~DM new file mode 100644 index 00000000..e69de29b diff --git a/variants/metro_m4/debug_scripts/variant.gdb~HEAD b/variants/metro_m4/debug_scripts/variant.gdb~HEAD new file mode 100644 index 00000000..3c37ffde --- /dev/null +++ b/variants/metro_m4/debug_scripts/variant.gdb~HEAD @@ -0,0 +1,31 @@ +# +# Arduino Zero OpenOCD script. +# +# Copyright (c) 2014-2015 Arduino LLC. All right reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +# Define 'reset' command +define reset + +info reg + +break main + +# End of 'reset' command +end + +target remote | openocd -c "interface cmsis-dap" -c "set CHIPNAME at91samd21g18" -f target/at91samdXX.cfg -c "gdb_port pipe; log_output openocd.log" diff --git a/variants/metro_m4/linker_scripts/gcc/flash_with_bootloader.ld b/variants/metro_m4/linker_scripts/gcc/flash_with_bootloader.ld index 0b9145aa..d9fa424a 100644 --- a/variants/metro_m4/linker_scripts/gcc/flash_with_bootloader.ld +++ b/variants/metro_m4/linker_scripts/gcc/flash_with_bootloader.ld @@ -25,8 +25,8 @@ */ MEMORY { - FLASH (rx) : ORIGIN = 0x00000000+0x2000, LENGTH = 0x00080000-0x2000 /* First 8KB used by bootloader */ - RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00030000 + FLASH (rx) : ORIGIN = 0x00000000+0x2000, LENGTH = 0x00100000-0x2000 /* First 8KB used by bootloader */ + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00040000 } /* Linker script to place sections and symbol values. Should be used together diff --git a/variants/metro_m4/linker_scripts/gcc/flash_without_bootloader.ld b/variants/metro_m4/linker_scripts/gcc/flash_without_bootloader.ld index 9c0c4e06..522b4b4d 100644 --- a/variants/metro_m4/linker_scripts/gcc/flash_without_bootloader.ld +++ b/variants/metro_m4/linker_scripts/gcc/flash_without_bootloader.ld @@ -25,8 +25,8 @@ */ MEMORY { - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00080000 - RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00030000 + FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00100000 + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00040000 } /* Linker script to place sections and symbol values. Should be used together diff --git a/variants/metro_m4/openocd_scripts/arduino_zero.cfg~DM b/variants/metro_m4/openocd_scripts/arduino_zero.cfg~DM new file mode 100644 index 00000000..e69de29b diff --git a/variants/metro_m4/openocd_scripts/arduino_zero.cfg~HEAD b/variants/metro_m4/openocd_scripts/arduino_zero.cfg~HEAD new file mode 100644 index 00000000..36c65c32 --- /dev/null +++ b/variants/metro_m4/openocd_scripts/arduino_zero.cfg~HEAD @@ -0,0 +1,30 @@ +# +# Arduino Zero OpenOCD script. +# +# Copyright (c) 2014-2015 Arduino LLC. All right reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +source [find interface/cmsis-dap.cfg] + +# chip name +set CHIPNAME at91samd21g18 +set ENDIAN little + +# choose a port here +set telnet_port 0 + +source [find target/at91samdXX.cfg] diff --git a/variants/metro_m4/pins_arduino.h~DM b/variants/metro_m4/pins_arduino.h~DM new file mode 100644 index 00000000..e69de29b diff --git a/variants/metro_m4/pins_arduino.h~HEAD b/variants/metro_m4/pins_arduino.h~HEAD new file mode 100644 index 00000000..db0e40c3 --- /dev/null +++ b/variants/metro_m4/pins_arduino.h~HEAD @@ -0,0 +1,21 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// API compatibility +#include "variant.h" + diff --git a/variants/metro_m4/variant.h b/variants/metro_m4/variant.h index d41a61fd..afdf52c0 100644 --- a/variants/metro_m4/variant.h +++ b/variants/metro_m4/variant.h @@ -16,8 +16,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _VARIANT_ARDUINO_ZERO_ -#define _VARIANT_ARDUINO_ZERO_ +#ifndef _VARIANT_MERTO_M4_ +#define _VARIANT_MERTO_M4_ // The definitions here needs a SAMD core >=1.6.10 #define ARDUINO_SAMD_VARIANT_COMPLIANCE 10610 @@ -78,8 +78,8 @@ extern "C" // LEDs #define PIN_LED_13 (13u) -#define PIN_LED_RXL (31u) -#define PIN_LED_TXL (32u) +#define PIN_LED_RXL (29u) +#define PIN_LED_TXL (30u) #define PIN_LED PIN_LED_13 #define PIN_LED2 PIN_LED_RXL #define PIN_LED3 PIN_LED_TXL @@ -98,9 +98,8 @@ extern "C" #define PIN_A7 (PIN_A0 + 7) #define PIN_A8 (PIN_A0 + 8) #define PIN_A9 (PIN_A0 + 9) -#define PIN_A10 (PIN_A0 + 10) -#define PIN_A11 (PIN_A0 + 11) #define PIN_DAC0 (14ul) +#define PIN_DAC1 PIN_A1 static const uint8_t A0 = PIN_A0; static const uint8_t A1 = PIN_A1; @@ -112,10 +111,9 @@ static const uint8_t A6 = PIN_A6 ; static const uint8_t A7 = PIN_A7 ; static const uint8_t A8 = PIN_A8 ; static const uint8_t A9 = PIN_A9 ; -static const uint8_t A10 = PIN_A10 ; -static const uint8_t A11 = PIN_A11 ; static const uint8_t DAC0 = PIN_DAC0; +static const uint8_t DAC1 = PIN_DAC1; #define ADC_RESOLUTION 12 @@ -130,8 +128,8 @@ static const uint8_t ATN = PIN_ATN; // Serial1 #define PIN_SERIAL1_RX (0ul) #define PIN_SERIAL1_TX (1ul) -#define PAD_SERIAL1_TX (UART_TX_PAD_2) -#define PAD_SERIAL1_RX (SERCOM_RX_PAD_3) +#define PAD_SERIAL1_TX (UART_TX_PAD_0) +#define PAD_SERIAL1_RX (SERCOM_RX_PAD_1) /* * SPI Interfaces @@ -191,6 +189,8 @@ static const uint8_t SCL = PIN_WIRE_SCL; #define I2S_DEVICE 0 #define I2S_CLOCK_GENERATOR 3 + +//TODO: these #define PIN_I2S_SD (9u) #define PIN_I2S_SCK (1u) #define PIN_I2S_FS (0u) @@ -241,5 +241,5 @@ extern Uart Serial1; #define SERIAL_PORT_HARDWARE Serial1 #define SERIAL_PORT_HARDWARE_OPEN Serial1 -#endif /* _VARIANT_ARDUINO_ZERO_ */ +#endif /* _VARIANT_MERTO_M4_ */