From 6396890fb960796213d1aab88a3edab80da4b6b7 Mon Sep 17 00:00:00 2001 From: Luc Date: Tue, 3 Dec 2019 16:02:16 +0100 Subject: [PATCH] Add Kinetica code base --- .cproject | 112 +++++++++++++++++++++++++++++++++++++ .gitignore | 1 + variants/sam4s/variant.cpp | 14 ++++- variants/sam4s/variant.h | 12 ++++ 4 files changed, 138 insertions(+), 1 deletion(-) diff --git a/.cproject b/.cproject index 53369534..98f39cbc 100644 --- a/.cproject +++ b/.cproject @@ -891,6 +891,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.gitignore b/.gitignore index b59b750a..b366eaa3 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,4 @@ Temporary Items /SAME70/ /SAME70_DUET3V03 /SAME70XPLD/ +/SAM4S_PDBOARD/ diff --git a/variants/sam4s/variant.cpp b/variants/sam4s/variant.cpp index 94462921..5f711305 100644 --- a/variants/sam4s/variant.cpp +++ b/variants/sam4s/variant.cpp @@ -36,7 +36,11 @@ extern const PinDescription g_APinDescription[]= // Pins 0-25 are PA0-PA25 // 0-2 +#ifndef PDBOARD { PIOA, PIO_PA0, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // PS_ON +#else + { PIOA, PIO_PA0, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // ESP PD/EN +#endif //PDBOARD { PIOA, PIO_PA1, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // ENN to all stepper drivers { PIOA, PIO_PA2B_SCK0, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // SCK0 (daughter boards, external SD card) @@ -72,11 +76,19 @@ extern const PinDescription g_APinDescription[]= // 21-23 SPI bus 1 { PIOA, PIO_PA21A_RXD1, ID_PIOA, PIO_PERIPH_A, PIO_PULLUP, PIN_ATTR_ANALOG, ADC8, NOT_ON_PWM, NOT_ON_TIMER }, // Analogue, digital or UART expansion +#ifndef PDBOARD { PIOA, PIO_PA22A_TXD1, ID_PIOA, PIO_PERIPH_A, PIO_PULLUP, PIN_ATTR_ANALOG, ADC9, NOT_ON_PWM, NOT_ON_TIMER }, // Analogue, digital or UART expansion +#else + { PIOA, PIO_PA22, ID_PIOA, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // ESP data ready +#endif //PDBOARD #ifdef PCCB { PIOA, PIO_PA23A_SCK1, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // USART 1 SCLK (DotStar LED) #else - { PIOA, PIO_PA23, ID_PIOA, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // W5500 interrupt +#ifndef PDBOARD + { PIOA, PIO_PA23, ID_PIOA, PIO_INPUT, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // W5500 interrupt +#else + { PIOA, PIO_PA23, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // SAM transfer Ready +#endif //PDBOARD #endif // 24-25 diff --git a/variants/sam4s/variant.h b/variants/sam4s/variant.h index a48d7ff7..1a50e02b 100644 --- a/variants/sam4s/variant.h +++ b/variants/sam4s/variant.h @@ -100,6 +100,18 @@ constexpr Pin APIN_W5500_SPI_MISO = 12; constexpr Pin APIN_W5500_SPI_SCK = 14; constexpr Pin APIN_W5500_SPI_SS0 = 11; +#ifdef PDBOARD +#define ESP_SPI SPI +#define ESP_SPI_INTERFACE_ID ID_SPI +#define ESP_SPI_IRQn SPI_IRQn +#define ESP_SPI_HANDLER SPI_Handler + +constexpr Pin APIN_ESP_SPI_MOSI = 13; +constexpr Pin APIN_ESP_SPI_MISO = 12; +constexpr Pin APIN_ESP_SPI_SCK = 14; +constexpr Pin APIN_ESP_SPI_SS0 = 11; +#endif + constexpr Pin APIN_USART_SSPI_MOSI = 6; constexpr Pin APIN_USART_SSPI_MISO = 5; constexpr Pin APIN_USART_SSPI_SCK = 2;