Skip to content

Commit 8d27b0a

Browse files
committed
[sam] adding CAN0/1 pins defs
1 parent 2c10779 commit 8d27b0a

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

hardware/arduino/sam/variants/arduino_due_x/variant.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,12 @@ extern const PinDescription g_APinDescription[]=
281281
{ PIOB, PIO_PB15A_CANRX1, ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // CANRX1
282282
{ PIOB, PIO_PB14A_CANTX1, ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT, PIN_ATTR_DIGITAL, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }, // CANTX1
283283

284+
// 90 .. 91 - "All CAN pins" masks
285+
// 90 - CAN0 all pins
286+
{ PIOA, PIO_PA1A_CANRX0|PIO_PA0A_CANTX0, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT, (PIN_ATTR_DIGITAL|PIN_ATTR_COMBO), NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER },
287+
// 91 - CAN1 all pins
288+
{ PIOB, PIO_PB15A_CANRX1|PIO_PB14A_CANTX1, ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT, (PIN_ATTR_DIGITAL|PIN_ATTR_COMBO), NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER },
289+
284290
// END
285291
{ NULL, 0, 0, PIO_NOT_A_PIN, PIO_DEFAULT, 0, NO_ADC, NO_ADC, NOT_ON_PWM, NOT_ON_TIMER }
286292
} ;

hardware/arduino/sam/variants/arduino_due_x/variant.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,18 @@ static const uint8_t CANRX = 68;
165165
static const uint8_t CANTX = 69;
166166
#define ADC_RESOLUTION 12
167167

168+
/*
169+
* Complementary CAN pins
170+
*/
171+
static const uint8_t CAN1RX = 88;
172+
static const uint8_t CAN1TX = 89;
173+
174+
// CAN0
175+
#define PINS_CAN0 (90u)
176+
// CAN1
177+
#define PINS_CAN1 (91u)
178+
179+
168180
/*
169181
* DACC
170182
*/

0 commit comments

Comments
 (0)