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
fluff_m0: add pin aliases #3209
Conversation
Add aliases for SDI, SDO and EN, so that pin names match the text on the PCB to avoid confusion. Also disable all pins from port B, because that package of SAMD21 doesn't have port B.
|
||
// There is no port B | ||
#define IGNORE_PIN_PB00 1 | ||
#define IGNORE_PIN_PB01 1 | ||
#define IGNORE_PIN_PB02 1 | ||
#define IGNORE_PIN_PB03 1 | ||
#define IGNORE_PIN_PB04 1 | ||
#define IGNORE_PIN_PB05 1 | ||
#define IGNORE_PIN_PB06 1 | ||
#define IGNORE_PIN_PB07 1 | ||
#define IGNORE_PIN_PB08 1 | ||
#define IGNORE_PIN_PB09 1 | ||
#define IGNORE_PIN_PB10 1 | ||
#define IGNORE_PIN_PB11 1 | ||
#define IGNORE_PIN_PB12 1 | ||
#define IGNORE_PIN_PB13 1 | ||
#define IGNORE_PIN_PB14 1 | ||
#define IGNORE_PIN_PB15 1 | ||
#define IGNORE_PIN_PB16 1 | ||
#define IGNORE_PIN_PB17 1 | ||
#define IGNORE_PIN_PB22 1 | ||
#define IGNORE_PIN_PB23 1 | ||
#define IGNORE_PIN_PB30 1 | ||
#define IGNORE_PIN_PB31 1 |
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 turns out this is not necessary, because ports/atmel-samd/asf4/samd21/include/pio/samd21e18a.h
does not even #define
the PBnn
pins. The checks in ports/atmel-samd/peripherals/samd/samd21/pins.c
are of the form:
#if defined(PIN_PXnn) && !defined(IGNORE_PIN_PXnn)
so if the ASF4 include files don't even define a pin, you don't need to explicitly ignore it. (It doesn't hurt, of course.)
I discovered this by coincidence because I'm defining a new board also with SAMD21E18A, and wondered if I had to ignore non-existent pins. The answer is no. I checked by looking at the image size, which doesn't change whether or not the IGNORE...
lines are there. (Note that it's a little bit tricky to compare the sizes, because the version string will change length depending on the last commit. and whether you've made changes since the last commit.)
I'll go back and clean up the other SAMD21E18A boards sooner or later. I plan to add a comment like:
// PBnn pins do not need to be ignored because they are not defined for this chip package.
Add aliases for SDI, SDO and EN, so that pin names match the text on the
PCB to avoid confusion.
Also disable all pins from port B, because that package of SAMD21
doesn't have port B.