Skip to content
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

test the nrf52840 HAL using defmt-test #291

Merged
merged 8 commits into from
Mar 12, 2021
Merged

Conversation

japaric
Copy link
Contributor

@japaric japaric commented Feb 10, 2021

this PR adds tests that exercise the GPIO API
3 connections are required:

  • P0.03 <-> GND
  • P0.04 <-> VDD
  • P0.28 <-> P0.29

the first two are used to test the Input API against reference voltages
the short-circuit connection is used to test the Input and Output API using the input API that was
previously tested

I tried testing the Uarte API but ran into #289. It seems to me that we can't test TX/RX loopback or overrun errors with the existing read API

this commit adds tests that exercise the GPIO API
3 connections are required:
- P0.03 <-> GND
- P0.04 <-> VDD
- P0.28 <-> P0.29
the first two are used to test the Input API against reference voltages
the short-circuit connection is used to test the Input and Output API using the input API that was
previously tested
@@ -1,8 +1,2 @@
[alias]
xtask = "run -p xtask --"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved these into examples/.cargo/config because rustflags in .cargo/config compose and w/o the move I ran into knurling-rs/probe-run#143

@jonas-schievink
Copy link
Contributor

the first two are used to test the Input API against reference voltages

Would it be possible to use the internal pull-up/down resistors to create reference voltages instead? That way it keeps the external wiring to a minimum.

@japaric
Copy link
Contributor Author

japaric commented Feb 15, 2021

Would it be possible to use the internal pull-up/down resistors to create reference voltages instead? That way it keeps the external wiring to a minimum.

that's a different test in my opinion (and it's already there in the pulldown_is_low and pullup_is_high).

if we do that and remove vdd_is_high and gnd_is_low then we would have less test coverage because we would not be testing the floating input mode independently. (we have the set_low_is_low and set_high_is_high tests but those are testing GPIO output against a GPIO input API that's known to work)

@jonas-schievink
Copy link
Contributor

bors r+

@bors
Copy link
Contributor

bors bot commented Mar 12, 2021

Build succeeded:

@bors bors bot merged commit 04e3fcb into nrf-rs:master Mar 12, 2021
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.

2 participants