-
Notifications
You must be signed in to change notification settings - Fork 516
Add support for Arduino MKRFox1200 #370
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
Conversation
Boards.h
Outdated
#elif defined(ARDUINO_SAMD_MKRFox1200) | ||
#define TOTAL_ANALOG_PINS 7 | ||
#define TOTAL_PINS 33 // 8 digital + 3 spi + 2 i2c + 2 uart + 7 analog + 3 usb + 1 aref + 5 sd + 1 bottom pad + 1 battery adc | ||
#define IS_PIN_DIGITAL(p) ((((p) >= 0 && (p) <= 21)) && !IS_PIN_SERIAL(p)) |
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.
Are pins 13 and 14 also used for the primary serial transport (Serial
instead of Serial1
, Serial1
, etc) or are they otherwise special UART pins that cannot be used as GPIO?
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.
Pins 13 and 14 are used for Serial1
. Serial
is a native USB port.
We might have to correct the MKR1000 and MKRZero info. that this was based on ...
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.
But is there any reason these pins cannot be used for digital I/O? It has not been an issue with other boards (since Serial1.begin()
is only called if the user sends a SERIAL_CONFIG message). Only pins tied to Serial
cannot be used for digital I/O on other boards.
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.
Ah I see now, I must have overlooked that !IS_PIN_SERIAL(p)
was used for the MKR1000 and MKRZero as well. Yeah I don't think that is necessary.
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.
Ok, i'll push a commit to correct this for all of those boards.
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.
Removed this check in d4a9ba9.
Boards.h
Outdated
#define TOTAL_ANALOG_PINS 7 | ||
#define TOTAL_PINS 33 // 8 digital + 3 spi + 2 i2c + 2 uart + 7 analog + 3 usb + 1 aref + 5 sd + 1 bottom pad + 1 battery adc | ||
#define IS_PIN_DIGITAL(p) ((((p) >= 0 && (p) <= 21)) && !IS_PIN_SERIAL(p)) | ||
#define IS_PIN_ANALOG(p) (((p) >= 15 && (p) < 15 + TOTAL_ANALOG_PINS) || (p) == 32) |
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.
Are pins 22 - 31 unused?
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.
or otherwise not able to be set as analog or digital I/O?
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.
They are not broken out or useable from the user's perspective:
- 23 - 24 are for USB
- 25 is for AREF
- 26 - 31 are connected to the built-in SigFox module (SPI + reset + power on)
https://github.com/arduino/ArduinoCore-samd/blob/master/variants/mkrfox1200/variant.cpp#L105-L137
c374295
to
d4a9ba9
Compare
LGTM. Thanks!! |
This adds support for the new Arduino MKRFox1200 board.
Please note that this board is only available in Europe for now, see: https://blog.arduino.cc/2017/04/18/introducing-the-arduino-mkrfox1200/
@agdl has briefly tested this change on with a MKRFox1200 and Johny-Five.