arduino / arduino/ArduinoCore-mbed
Request: Pin Remapping For MKR I/O's To Use Alternate Pin Functions
- Dominant language
- C
- Stars
- 411
- Forks
- 225
- PR merge metrics
- No merged PRs in 30d
Description
Hello All,
The [STM32H747XIH6](https://www.st.com/en/microcontrollers-microprocessors/stm32h747xi.html) has many different alternate functions for the pins that have been assigned to the MKR I/O interface.
Maybe initially the most useful (lib) could be just using some pins as GPIO's that have been assigned to another function, such as
SPI2 (i.e., M3, M4). Of course, some pins are GPIO_Analog inputs only (i.e., R1 and R2 pin type AN A) - but this can be useful even using the [Portenta carrier](https://www.arduino.cc/pro/hardware/product/portenta-carrier). The H7 processor is so feature rich that I think building a capability like this in the foundation of the Portenta project makes a lot of sense. Maybe somethings already available that I've missed - but I just wanted to float this out there and see what the responses are.
There are certainly a lot of available libraries available for some of the other boards which manipulate GPIO pins.
I guess the starting point would be to look at some of the lower level files that set up the pins and see if all possible GPIO functions have been mapped - and if not - enable that - then a lib that is compatible with the arduino tool chain would have to be developed - maybe this has been done already.
If this already exists - I'd like to give it a try and please point me to the lib if so.
For the GPIO's - will pinMode() override that if in the lower level code that's not enabled (GPIO mode, that is)?
And, pinPeripheral() isn't defined or available yet, correct?
(#28 Added WIP)
Thanks In Advance,
John W.
Reference:
Pin mapping files:
[PeripheralPins.c](https://github.com/arduino/mbed-os/blob/portenta-mbed-6.2.0/targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_PORTENTA_H7/PeripheralPins.c)
[PeripheralNames.h](https://github.com/arduino/mbed-os/blob/portenta-mbed-6.2.0/targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_PORTENTA_H7/PeripheralNames.h)
[PinNames.h](https://github.com/arduino/mbed-os/blob/portenta-mbed-6.2.0/targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_PORTENTA_H7/PinNames.h)
[system_clock_override.c](https://github.com/arduino/mbed-os/blob/portenta-mbed-6.2.0/targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_PORTENTA_H7/system_clock_override.c)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading PeripheralPins.c, PeripheralNames.h, PinNames.h, and system_clock_override.c for the Portenta H7 pin and peripheral mappings. Compare the existing mappings with the STM32H747 alternate-function documentation, then determine the intended GPIO and pinPeripheral API scope. Done requires an agreed, tested design for alternate MKR I/O pin functions; the issue does not define that scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100