Skip to content

Commit e6876e7

Browse files
committed
Added MKR1000 entry to Boards.h
1 parent 4529ae1 commit e6876e7

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Boards.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,23 @@ writePort(port, value, bitmask): Write an 8 bit port.
243243
#define PIN_TO_SERVO(p) ((p) - 2)
244244

245245

246+
// Arduino/Genuino MKR1000
247+
#elif defined(ARDUINO_SAMD_MKR1000)
248+
#define TOTAL_ANALOG_PINS 7
249+
#define TOTAL_PINS 22 // 8 digital + 3 spi + 2 i2c + 2 uart + 7 analog
250+
#define IS_PIN_DIGITAL(p) (((p) >= 0 && (p) <= 21) && !IS_PIN_SERIAL(p))
251+
#define IS_PIN_ANALOG(p) ((p) >= 15 && (p) < 15 + TOTAL_ANALOG_PINS)
252+
#define IS_PIN_PWM(p) digitalPinHasPWM(p)
253+
#define IS_PIN_SERVO(p) (IS_PIN_DIGITAL(p) && (p) < MAX_SERVOS) // deprecated since v2.4
254+
#define IS_PIN_I2C(p) ((p) == 11 || (p) == 12) // SDA = 20, SCL = 21
255+
#define IS_PIN_SPI(p) ((p) == SS || (p) == MOSI || (p) == MISO || (p) == SCK) // SS = A2
256+
#define IS_PIN_SERIAL(p) ((p) == PIN_SERIAL1_RX || (p) == PIN_SERIAL1_TX)
257+
#define PIN_TO_DIGITAL(p) (p)
258+
#define PIN_TO_ANALOG(p) ((p) - 15)
259+
#define PIN_TO_PWM(p) PIN_TO_DIGITAL(p)
260+
#define PIN_TO_SERVO(p) (p) // deprecated since v2.4
261+
262+
246263
// Arduino Zero
247264
// Note this will work with an Arduino Zero Pro, but not with an Arduino M0 Pro
248265
// Arduino M0 Pro does not properly map pins to the board labeled pin numbers

0 commit comments

Comments
 (0)