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

nRF52840 Firmware: add ability to query which pin is the "connected" #8

Open
chipaudette opened this issue May 15, 2024 · 1 comment

Comments

@chipaudette
Copy link
Member

chipaudette commented May 15, 2024

Problem: Currently, I have to hard-code which Teensy pin # is being used by the nRF unit to communicate the "isConnected" state.

Option 1: Since I need to know the Teensy pin number, and since the Teensy pin number is defined by the Tympan hardware design, this piece of information would normally be placed in the TympanPins class for the RevF variant.

Option 2: The Tympan RevF has many GPIO lines connecting between the Teensy and the nRF52840 bluetooth module. It's the nRF firmware that (currently, V0.2.4) chooses which of these pins is used to convey the isConnected() state. Since it is set by the nRF firmware, it seems like the Teensy ought to be able to query the nRF to ask it which pin to use. The nRF would then tell the Teensy which of its pins to use to read isConnected().

Option 3: Clearly, both the Tympan hardware design and the nRF firmware affect which Teensy pin is being used. Therefore, the most robust, general solution would be for the nRF firmware to report some sort of name for the connection that it has selected for conveying isConnected(). Then, the TympanPins class would hold a mapping between all of the GPIO names and the Teensy pin #. This is a lot of work, though, with lots of options for failing.

Because of the risk of introducing more problems than I'm fixing, I think that I will not start with Option 3 and simply stick with Option 2.

@biomurph
Copy link
Member

Interesting problem. I would offer another option
Option 4: The Tympan RefF can tell the nRF radio which pin to use for isConnected. This would give the most control over the pins, I think?

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

No branches or pull requests

2 participants