Skip to content

Adds standard DONT_CARE pin name for specifying that any pin will work #447

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
merged 3 commits into from
Aug 19, 2014

Conversation

webbbn
Copy link
Contributor

@webbbn webbbn commented Aug 16, 2014

This patch dds a standard DONT_CARE pin name that allows specifying that any pin will work in a pin map. This is currently used in the nRF51822 serial API to allow specifying any pins as a UART.

On a chip like the nRF51822 that supports mapping functions to any arbitrary pin, it seems overly restrictive to limit a user to only use a set of pin mappings.

In my case I built a custom board that has a USB to UART and another port that could either be a UART or a number of other functions. I need to be able to map the UART to one of two different pin sets. This isn't supported by the PinMap in the nRF51822 serial_api.c.

I"m open to suggestions if someone has a better way of implementing this.

…n will

work in a pin map.  This is currently used in the NRF51822 serial API to allow
specifying any pins as a UART.
@janekm
Copy link
Contributor

janekm commented Aug 17, 2014

That is better... In the long run it might be worth considering more general pin-mapping cases though; In the NRF51 case for example it's only the digital functions that are mappable to any pin whereas the analog functions are only available on a smaller set of pins. Other uCs have other limitations, I wonder if we could find a more generic representation?

@Sissors
Copy link
Contributor

Sissors commented Aug 17, 2014

I think it is easier to simply not use the pinmap functions for peripherals which can be mapped to an arbitrary pin. That is also done for example on the LPC81X, which also has this feature (granted I think the code there could be nicer, with possibly common code for the switch matrix, and I think currently it doesn't notice when a new serial object is made on the same pins as another one, so it uses another uart for that). See: https://github.com/mbedmicro/mbed/blob/master/libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC81X/serial_api.c

@webbbn
Copy link
Contributor Author

webbbn commented Aug 17, 2014

You're right, of course. It was much easier to just not check the pins.

I reverted the previous patch and made a much simpler one.

Also, I noticed that there is no support for hardware flow control for the nRF51822. I'll probably take a look at that when I get setup to test it.

@bogdanm
Copy link
Contributor

bogdanm commented Aug 18, 2014

Hello,

Thanks for the pull request. Before I can merge this, could you please sign the mbed contributor agreement at https://mbed.org/contributor_agreement/ ? It's a required step for all mbed contributors.

Thanks,
Bogdan

@webbbn
Copy link
Contributor Author

webbbn commented Aug 19, 2014

Done.

bogdanm added a commit that referenced this pull request Aug 19, 2014
Adds standard DONT_CARE pin name for specifying that any pin will work
@bogdanm bogdanm merged commit 0cb4ae6 into ARMmbed:master Aug 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants