-
Notifications
You must be signed in to change notification settings - Fork 516
Add support for Arduino MKR WAN 1300 and MKR GSM 1400 #385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
soundanalogous
merged 1 commit into
firmata:master
from
sandeepmistry:mkrwan1300-mkrgsm1400
Apr 15, 2018
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -292,6 +292,37 @@ writePort(port, value, bitmask): Write an 8 bit port. | |
#define PIN_TO_PWM(p) PIN_TO_DIGITAL(p) | ||
#define PIN_TO_SERVO(p) (p) // deprecated since v2.4 | ||
|
||
// Arduino MKR WAN 1300 | ||
#elif defined(ARDUINO_SAMD_MKRWAN1300) | ||
#define TOTAL_ANALOG_PINS 7 | ||
#define TOTAL_PINS 33 | ||
#define IS_PIN_DIGITAL(p) (((p) >= 0 && (p) <= 21)) | ||
#define IS_PIN_ANALOG(p) (((p) >= 15 && (p) < 15 + TOTAL_ANALOG_PINS) || (p) == 32) | ||
#define IS_PIN_PWM(p) digitalPinHasPWM(p) | ||
#define IS_PIN_SERVO(p) (IS_PIN_DIGITAL(p) && (p) < MAX_SERVOS) // deprecated since v2.4 | ||
#define IS_PIN_I2C(p) ((p) == 11 || (p) == 12) // SDA = 11, SCL = 12 | ||
#define IS_PIN_SPI(p) ((p) == SS || (p) == MOSI || (p) == MISO || (p) == SCK) | ||
#define IS_PIN_SERIAL(p) ((p) == PIN_SERIAL1_RX || (p) == PIN_SERIAL1_TX) //defined in variant.h RX = 13, TX = 14 | ||
#define PIN_TO_DIGITAL(p) (p) | ||
#define PIN_TO_ANALOG(p) ((p) - 15) | ||
#define PIN_TO_PWM(p) PIN_TO_DIGITAL(p) | ||
#define PIN_TO_SERVO(p) (p) // deprecated since v2.4 | ||
|
||
// Arduino MKR GSM 1400 | ||
#elif defined(ARDUINO_SAMD_MKRGSM1400) | ||
#define TOTAL_ANALOG_PINS 7 | ||
#define TOTAL_PINS 33 | ||
#define IS_PIN_DIGITAL(p) (((p) >= 0 && (p) <= 21)) | ||
#define IS_PIN_ANALOG(p) (((p) >= 15 && (p) < 15 + TOTAL_ANALOG_PINS) || (p) == 32) | ||
#define IS_PIN_PWM(p) digitalPinHasPWM(p) | ||
#define IS_PIN_SERVO(p) (IS_PIN_DIGITAL(p) && (p) < MAX_SERVOS) // deprecated since v2.4 | ||
#define IS_PIN_I2C(p) ((p) == 11 || (p) == 12) // SDA = 11, SCL = 12 | ||
#define IS_PIN_SPI(p) ((p) == SS || (p) == MOSI || (p) == MISO || (p) == SCK) | ||
#define IS_PIN_SERIAL(p) ((p) == PIN_SERIAL1_RX || (p) == PIN_SERIAL1_TX) //defined in variant.h RX = 13, TX = 14 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like each of these variants also defines PIN_SERIAL2_RX and PIN_SERIAL2_TX. Please also include those here (and for the other board definition above) if they are user accessible. |
||
#define PIN_TO_DIGITAL(p) (p) | ||
#define PIN_TO_ANALOG(p) ((p) - 15) | ||
#define PIN_TO_PWM(p) PIN_TO_DIGITAL(p) | ||
#define PIN_TO_SERVO(p) (p) // deprecated since v2.4 | ||
|
||
// Arduino Zero | ||
// Note this will work with an Arduino Zero Pro, but not with an Arduino M0 Pro | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like the definitions for each of these variants is identical. In that case can they be combined:
#elif defined(ARDUINO_SAMD_MKRWAN1300) || defined(ARDUINO_SAMD_MKRGSM1400)