-
Notifications
You must be signed in to change notification settings - Fork 3k
K64F: Fix pin names and migrate to Arduino Uno form factor #14837
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
In the Standard Pin Names porting guide, pinvalidate.py is run without prefixing the "python" command. But to make it possible, a shebang needs to exist.
Fix pin names of K64F with the following from the latest guidelines: * LEDs and buttons are defined as macros, digital and analog pins as enums. * No duplicated pin names with the same value. * The Arduino form factor is deprecated in favour of Arduino Uno. Note: The pins `SPI_xxx` are for SD card only, but the names are kept for backward compatibility (i.e. no breaking change until the next Mbed OS major version). The general purpose Arduino Uno SPI pins (`ARDUINO_UNO_SPI_xxx`) are different and also available.
@LDong-Arm, thank you for your changes. |
// (ARDUINO_UNO_SPI_xxx) for general purpose uses. | ||
// By default, Mbed OS maps those alias to Arduino Uno pins, but | ||
// for backward compatibility we map them to the SD card SPI. | ||
#define SPI_MOSI PTE3 |
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.
This is also part of the migration, couldn't it stay in PinName enum and just add a comment or?
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.
The SPI pins need to be #define
d:
mbed-os/hal/include/hal/PinNameAliases.h
Lines 170 to 173 in 81aaef4
// Legacy SPI aliases | |
#ifndef SPI_CS | |
#define SPI_CS ARDUINO_UNO_SPI_CS | |
#endif |
If they were enums, the macro checks would not work.
Jenkins CI Test : ✔️ SUCCESSBuild Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
Summary of changes
Fix pin names of K64F with the following from the latest guidelines:
Note: The pins
SPI_xxx
are for SD card only, but the names are kept for backward compatibility (i.e. no breaking change until the next Mbed OS major version). The general purpose Arduino Uno SPI pins (ARDUINO_UNO_SPI_xxx
) are different and also available.Impact of changes
Migration actions required
This change is non-breaking because PinNameAliases.h maps generic pin names (e.g.
A0
) <--> Arduino Uno pin names (e.g.ARDUINO_UNO_A0
) unless otherwise defined. Nonetheless, projects can take advantage of Arduino Uno pin names when available.Documentation
None.
Pull request type
Test results
pinvalidate.py
tests and Greentea tests (*-pin_names*-
) pass.*-COMPONENT_SD-*
) pass with an SD card inserted, to validate SD card SPI pin maps.Reviewers
@ARMmbed/mbed-os-hal @ARMmbed/mbed-os-core @ARMmbed/team-nxp