Skip to content

gpio_api.h: Clarify desired behaviour for NC #10489

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 8 commits into from
May 21, 2019

Conversation

kjbracey
Copy link
Contributor

@kjbracey kjbracey commented Apr 26, 2019

Description

Documentation clarified, and platforms that don't conform brought into line. Simple test added.

Clarification needed as shown by #7862, #10191, #9469 and #10482.

Pull request type

[ ] Fix
[ ] Refactor
[X] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

@ciarmcom ciarmcom requested review from a team April 26, 2019 11:00
@ciarmcom
Copy link
Member

@kjbracey-arm, thank you for your changes.
@ARMmbed/mbed-os-hal @ARMmbed/mbed-os-maintainers please review.

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 29, 2019

Updated description looks good.

How many targets follow this? As stated, test would be good and have target code updated to this. Will this be few steps update?

This would be good to target for 5.13 (considering all targets will require update).

@kjbracey
Copy link
Contributor Author

Most, but not all, implement it. As SPI now relies on it (its original constructors now construct a DigitalOut(NC) for an unused software SSEL), any that don't are going to need patching.

So I would say this and target updates and test should go for patch release.

I can look at tests and target updates later this week.

@stevew817
Copy link
Contributor

stevew817 commented Apr 29, 2019

IMO this definitely needs to go to patch release (together with #10482) since SPI on the current release is broken for Silicon Labs targets.

See #9469 for more details as to why it broke.

@kjbracey
Copy link
Contributor Author

Created a test, and waiting for its results, but by inspection, ARM SSG/FM, Atmel, RTL8195A, EFM32, TT, Wiznet and Ublox HI2110 do not handle NC as specified here.

The rest do.

(It's worth noting that gpio_irq_api does not incorporate this behaviour, and does not have a gpio_irq_is_connected call, so we are inconsistent here. I'd be inclined to bring that in line at some point.)

I've got commits for a test + changing targets (https://github.com/kjbracey-arm/mbed-os/commits/gpio_api_nc_test). Can incorporate those into this PR, or as one or more follow-ups.

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 29, 2019

I've got commits for a test + changing targets (https://github.com/kjbracey-arm/mbed-os/commits/gpio_api_nc_test). Can incorporate those into this PR, or as one or more follow-ups.

👍 Lets add it here.

kjbracey added 7 commits May 2, 2019 12:16
It would probably be worth adding tests for the ability to initialise NC
pins and check `is_connected`. Some platforms are assert failing the
init, and can't be 100% sure `is_connected` is working on those
platforms either.
@kjbracey
Copy link
Contributor Author

kjbracey commented May 2, 2019

Added the extra commits for testing and correcting NC handling on platforms (other than EFM32 covered by #10482).

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just SPDX identifier, LGTM otherwise

Check two items of defined behaviour - that you can initialise a
gpio_t with NC, and you can detect that state with gpio_is_connected().
@kjbracey
Copy link
Contributor Author

kjbracey commented May 3, 2019

Should get reviews from each of the vendors though - not least for confirmation I haven't broken anything. (Not all of those are in CI, and I don't have them).

@0xc0170
Copy link
Contributor

0xc0170 commented May 3, 2019

@ThunderSoft123 @ARMmbed/team-wiznet @ARMmbed/team-realtek @jamesbeyond Please review gpio files for your targets changed here

@0xc0170
Copy link
Contributor

0xc0170 commented May 13, 2019

@ThunderSoft123 @ARMmbed/team-wiznet @ARMmbed/team-realtek @jamesbeyond Please review gpio files for your targets changed here

We would like to proceed with this pull request, please review

cc @maclobdell @MarceloSalazar

@0xc0170
Copy link
Contributor

0xc0170 commented May 13, 2019

I started CI job meanwhile

@mbed-ci
Copy link

mbed-ci commented May 13, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@adbridge
Copy link
Contributor

@maclobdell @MarceloSalazar could you help get this reviewed by partners please ?

@ThunderSoft123
Copy link
Contributor

@0xc0170 No problem with revision.

@0xc0170 0xc0170 merged commit f859289 into ARMmbed:master May 21, 2019
@kjbracey kjbracey deleted the gpio_api_nc branch May 21, 2019 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants