Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 65 additions & 66 deletions variants/grand_central_m4/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ extern "C"
// #define digitalPinToTimer(P)

// LEDs
#define PIN_LED_13 (13u)
#define PIN_LED_RXL (75u)
#define PIN_LED_TXL (76u)
#define PIN_LED_13 (13)
#define PIN_LED_RXL (75)
#define PIN_LED_TXL (76)
#define PIN_LED PIN_LED_13
#define PIN_LED2 PIN_LED_RXL
#define PIN_LED3 PIN_LED_TXL
Expand All @@ -93,7 +93,7 @@ extern "C"
/*
* Analog pins
*/
#define PIN_A0 (67ul)
#define PIN_A0 (67)
#define PIN_A1 (PIN_A0 + 1)
#define PIN_A2 (PIN_A0 + 2)
#define PIN_A3 (PIN_A0 + 3)
Expand All @@ -102,7 +102,7 @@ extern "C"
#define PIN_A6 (PIN_A0 + 6)
#define PIN_A7 (PIN_A0 + 7)

#define PIN_A8 (54ul)
#define PIN_A8 (54)
#define PIN_A9 (PIN_A8 + 1)
#define PIN_A10 (PIN_A8 + 2)
#define PIN_A11 (PIN_A8 + 3)
Expand All @@ -120,8 +120,8 @@ static const uint8_t A2 = PIN_A2;
static const uint8_t A3 = PIN_A3;
static const uint8_t A4 = PIN_A4;
static const uint8_t A5 = PIN_A5;
static const uint8_t A6 = PIN_A6 ;
static const uint8_t A7 = PIN_A7 ;
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;
Expand All @@ -138,36 +138,36 @@ static const uint8_t DAC1 = PIN_DAC1;
#define ADC_RESOLUTION 12

// Other pins
#define PIN_ATN (39ul)
#define PIN_ATN (39)
static const uint8_t ATN = PIN_ATN;

/*
* Serial interfaces
*/

// Serial1
#define PIN_SERIAL1_RX (0ul)
#define PIN_SERIAL1_TX (1ul)
#define PIN_SERIAL1_RX (0)
#define PIN_SERIAL1_TX (1)
#define PAD_SERIAL1_TX (UART_TX_PAD_0)
#define PAD_SERIAL1_RX (SERCOM_RX_PAD_1)

// Serial2
#define PIN_SERIAL2_RX (19ul)
#define PIN_SERIAL2_TX (18ul)
#define PIN_SERIAL2_RX (19)
#define PIN_SERIAL2_TX (18)
#define PAD_SERIAL2_TX (UART_TX_PAD_0)
#define PAD_SERIAL2_RX (SERCOM_RX_PAD_1)
#define SERCOM_SERIAL2 sercom4

// Serial3
#define PIN_SERIAL3_RX (17ul)
#define PIN_SERIAL3_TX (16ul)
#define PIN_SERIAL3_RX (17)
#define PIN_SERIAL3_TX (16)
#define PAD_SERIAL3_TX (UART_TX_PAD_0)
#define PAD_SERIAL3_RX (SERCOM_RX_PAD_1)
#define SERCOM_SERIAL3 sercom1

// Serial4
#define PIN_SERIAL4_RX (15ul)
#define PIN_SERIAL4_TX (14ul)
#define PIN_SERIAL4_RX (15)
#define PIN_SERIAL4_TX (14)
#define PAD_SERIAL4_TX (UART_TX_PAD_0)
#define PAD_SERIAL4_RX (SERCOM_RX_PAD_1)
#define SERCOM_SERIAL4 sercom5
Expand All @@ -176,30 +176,30 @@ static const uint8_t ATN = PIN_ATN;
*/
#define SPI_INTERFACES_COUNT 2

#define PIN_SPI_MISO (64u)
#define PIN_SPI_MOSI (66u)
#define PIN_SPI_SCK (65u)
#define PIN_SPI_MISO (64)
#define PIN_SPI_MOSI (66)
#define PIN_SPI_SCK (65)
#define PERIPH_SPI sercom7
#define PAD_SPI_TX SPI_PAD_0_SCK_1
#define PAD_SPI_RX SERCOM_RX_PAD_3

static const uint8_t SS = (53u) ;
static const uint8_t MOSI = PIN_SPI_MOSI ;
static const uint8_t MISO = PIN_SPI_MISO ;
static const uint8_t SCK = PIN_SPI_SCK ;
static const uint8_t SS = (53);
static const uint8_t MOSI = PIN_SPI_MOSI;
static const uint8_t MISO = PIN_SPI_MISO;
static const uint8_t SCK = PIN_SPI_SCK;

#define PIN_SPI1_MISO (80u)
#define PIN_SPI1_MOSI (82u)
#define PIN_SPI1_SCK (81u)
#define PIN_SPI1_SS (83u)
#define PIN_SPI1_MISO (80)
#define PIN_SPI1_MOSI (82)
#define PIN_SPI1_SCK (81)
#define PIN_SPI1_SS (83)
#define PERIPH_SPI1 sercom2
#define PAD_SPI1_TX SPI_PAD_0_SCK_1
#define PAD_SPI1_RX SERCOM_RX_PAD_3

static const uint8_t SS1 = PIN_SPI1_SS ;
static const uint8_t MOSI1 = PIN_SPI1_MOSI ;
static const uint8_t MISO1 = PIN_SPI1_MISO ;
static const uint8_t SCK1 = PIN_SPI1_SCK ;
static const uint8_t SS1 = PIN_SPI1_SS;
static const uint8_t MOSI1 = PIN_SPI1_MOSI;
static const uint8_t MISO1 = PIN_SPI1_MISO;
static const uint8_t SCK1 = PIN_SPI1_SCK;

// Needed for SD library
#define SDCARD_SPI SPI1
Expand All @@ -213,16 +213,16 @@ static const uint8_t SCK1 = PIN_SPI1_SCK ;
*/
#define WIRE_INTERFACES_COUNT 2

#define PIN_WIRE_SDA (62u)
#define PIN_WIRE_SCL (63u)
#define PIN_WIRE_SDA (62)
#define PIN_WIRE_SCL (63)
#define PERIPH_WIRE sercom3
#define WIRE_IT_HANDLER SERCOM3_Handler

static const uint8_t SDA = PIN_WIRE_SDA;
static const uint8_t SCL = PIN_WIRE_SCL;

#define PIN_WIRE1_SDA (25u)
#define PIN_WIRE1_SCL (24u)
#define PIN_WIRE1_SDA (25)
#define PIN_WIRE1_SCL (24)
#define PERIPH_WIRE1 sercom6
#define WIRE1_IT_HANDLER SERCOM6_Handler

Expand All @@ -232,9 +232,9 @@ static const uint8_t SCL1 = PIN_WIRE1_SCL;
/*
* USB
*/
#define PIN_USB_HOST_ENABLE (77ul)
#define PIN_USB_DM (78ul)
#define PIN_USB_DP (79ul)
#define PIN_USB_HOST_ENABLE (77)
#define PIN_USB_DM (78)
#define PIN_USB_DP (79)

/*
* I2S Interfaces
Expand All @@ -244,39 +244,39 @@ static const uint8_t SCL1 = PIN_WIRE1_SCL;
#define I2S_DEVICE 0
#define I2S_CLOCK_GENERATOR 3

#define PIN_I2S_SDO (32u)
#define PIN_I2S_SDI (31u)
#define PIN_I2S_SDO (32)
#define PIN_I2S_SDI (31)
#define PIN_I2S_SCK PIN_SERIAL4_TX
#define PIN_I2S_FS (33u)
#define PIN_I2S_FS (33)
#define PIN_I2S_MCK PIN_SERIAL4_RX

//QSPI Pins
#define PIN_QSPI_SCK (89u)
#define PIN_QSPI_CS (90u)
#define PIN_QSPI_IO0 (91u)
#define PIN_QSPI_IO1 (92u)
#define PIN_QSPI_IO2 (93u)
#define PIN_QSPI_IO3 (94u)
#define PIN_QSPI_SCK (89)
#define PIN_QSPI_CS (90)
#define PIN_QSPI_IO0 (91)
#define PIN_QSPI_IO1 (92)
#define PIN_QSPI_IO2 (93)
#define PIN_QSPI_IO3 (94)

//PCC Pins
#define PIN_PCC_DEN1 (26u)
#define PIN_PCC_DEN2 (27u)
#define PIN_PCC_CLK (28u)
#define PIN_PCC_XCLK (29u)
#define PIN_PCC_D0 (37u)
#define PIN_PCC_D1 (36u)
#define PIN_PCC_D2 (35u)
#define PIN_PCC_D3 (34u)
#define PIN_PCC_D4 (33u)
#define PIN_PCC_D5 (32u)
#define PIN_PCC_D6 (31u)
#define PIN_PCC_D7 (30u)
#define PIN_PCC_D8 (39u)
#define PIN_PCC_D9 (38u)
#define PIN_PCC_D10 (41u)
#define PIN_PCC_D11 (40u)
#define PIN_PCC_D12 (43u)
#define PIN_PCC_D13 (42u)
#define PIN_PCC_DEN1 (26)
#define PIN_PCC_DEN2 (27)
#define PIN_PCC_CLK (28)
#define PIN_PCC_XCLK (29)
#define PIN_PCC_D0 (37)
#define PIN_PCC_D1 (36)
#define PIN_PCC_D2 (35)
#define PIN_PCC_D3 (34)
#define PIN_PCC_D4 (33)
#define PIN_PCC_D5 (32)
#define PIN_PCC_D6 (31)
#define PIN_PCC_D7 (30)
#define PIN_PCC_D8 (39)
#define PIN_PCC_D9 (38)
#define PIN_PCC_D10 (41)
#define PIN_PCC_D11 (40)
#define PIN_PCC_D12 (43)
#define PIN_PCC_D13 (42)

#if !defined(VARIANT_QSPI_BAUD_DEFAULT)
// TODO: meaningful value for this
Expand Down Expand Up @@ -332,4 +332,3 @@ extern Uart Serial1;
#define SERIAL_PORT_HARDWARE_OPEN Serial1

#endif /* _VARIANT_METRO_M4_ */