diff options
author | Vince <balbinus@users.noreply.github.com> | 2018-11-21 23:13:22 +0300 |
---|---|---|
committer | Daniel Garcia <danielgarcia@gmail.com> | 2018-11-21 23:13:22 +0300 |
commit | 8f2e86434b2bfa4d6178622ca3745a68303f8b00 (patch) | |
tree | 9368da316a3c02bee65ab4c728d5e0c8779c3217 | |
parent | a3c70f59acd36b21f613ecad9b3a79fa5656a4a3 (diff) |
Add basic support for SAMD51, used in M4 line from Adafruit (#662)
* Add basic support for SAMD51, used in M4 line from Adafruit. Support is only based on Adafruit ItsyBitsy M4 Express, since it’s the only M4 board I have.
* Pin verification from ItsyBitsy's variant.h + mixup between I2C and SPI
-rw-r--r-- | led_sysdefs.h | 2 | ||||
-rw-r--r-- | platforms.h | 2 | ||||
-rw-r--r-- | platforms/arm/d21/fastpin_arm_d21.h | 21 |
3 files changed, 23 insertions, 2 deletions
diff --git a/led_sysdefs.h b/led_sysdefs.h index 4b9aedc8..13fbf4c3 100644 --- a/led_sysdefs.h +++ b/led_sysdefs.h @@ -21,7 +21,7 @@ #include "platforms/arm/sam/led_sysdefs_arm_sam.h" #elif defined(STM32F10X_MD) || defined(__STM32F1__) #include "platforms/arm/stm32/led_sysdefs_arm_stm32.h" -#elif defined(__SAMD21G18A__) || defined(__SAMD21J18A__) || defined(__SAMD21E17A__) || defined(__SAMD21E18A__) +#elif defined(__SAMD21G18A__) || defined(__SAMD21J18A__) || defined(__SAMD21E17A__) || defined(__SAMD21E18A__) || defined(__SAMD51G19A__) #include "platforms/arm/d21/led_sysdefs_arm_d21.h" #elif defined(ESP8266) #include "platforms/esp/8266/led_sysdefs_esp8266.h" diff --git a/platforms.h b/platforms.h index ccf53521..0ca7749c 100644 --- a/platforms.h +++ b/platforms.h @@ -21,7 +21,7 @@ #include "platforms/arm/sam/fastled_arm_sam.h" #elif defined(STM32F10X_MD) || defined(__STM32F1__) #include "platforms/arm/stm32/fastled_arm_stm32.h" -#elif defined(__SAMD21G18A__) || defined(__SAMD21J18A__) || defined(__SAMD21E17A__) || defined(__SAMD21E18A__) +#elif defined(__SAMD21G18A__) || defined(__SAMD21J18A__) || defined(__SAMD21E17A__) || defined(__SAMD21E18A__) || defined(__SAMD51G19A__) #include "platforms/arm/d21/fastled_arm_d21.h" #elif defined(ESP8266) #include "platforms/esp/8266/fastled_esp8266.h" diff --git a/platforms/arm/d21/fastpin_arm_d21.h b/platforms/arm/d21/fastpin_arm_d21.h index ccb6f0da..0d857891 100644 --- a/platforms/arm/d21/fastpin_arm_d21.h +++ b/platforms/arm/d21/fastpin_arm_d21.h @@ -189,6 +189,27 @@ _DEFPIN_ARM( 3, 0, 7); _DEFPIN_ARM( 4, 0, 6); #define HAS_HARDWARE_PIN_SUPPORT 1 +#elif defined(ADAFRUIT_ITSYBITSY_M4_EXPRESS) + +#define MAX_PIN 19 +// D0-D13, including D6+D8 (DotStar CLK + DATA) +_DEFPIN_ARM( 0, 0, 16); _DEFPIN_ARM( 1, 0, 17); _DEFPIN_ARM( 2, 0, 7); _DEFPIN_ARM( 3, 1, 22); +_DEFPIN_ARM( 4, 0, 14); _DEFPIN_ARM( 5, 0, 15); _DEFPIN_ARM( 6, 1, 2); _DEFPIN_ARM( 7, 0, 18); +_DEFPIN_ARM( 8, 1, 3); _DEFPIN_ARM( 9, 0, 19); _DEFPIN_ARM(10, 0, 20); _DEFPIN_ARM(11, 0, 21); +_DEFPIN_ARM(12, 0, 23); _DEFPIN_ARM(13, 0, 22); +// A0-A5 +_DEFPIN_ARM(14, 0, 2); _DEFPIN_ARM(15, 0, 5); _DEFPIN_ARM(16, 1, 8); _DEFPIN_ARM(17, 1, 9); +_DEFPIN_ARM(18, 0, 4); _DEFPIN_ARM(19, 0, 6); /* A6 is present in variant.h but couldn't find it on the schematic */ +// SDA/SCL +_DEFPIN_ARM(21, 0, 12); _DEFPIN_ARM(22, 0, 13); +// MISO/SCK/MOSI +_DEFPIN_ARM(23, 1, 23); _DEFPIN_ARM(24, 0, 1); _DEFPIN_ARM(25, 0, 0); + +#define SPI_DATA 25 +#define SPI_CLOCK 24 + +#define HAS_HARDWARE_PIN_SUPPORT 1 + #endif |