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

drivers: ublox-sara-r4: Add support for pin polarity #23692

Closed
sslupsky opened this issue Mar 23, 2020 · 1 comment · Fixed by #24042
Closed

drivers: ublox-sara-r4: Add support for pin polarity #23692

sslupsky opened this issue Mar 23, 2020 · 1 comment · Fixed by #24042
Assignees
Labels
area: Modem Enhancement Changes/Updates/Additions to existing features

Comments

@sslupsky
Copy link
Contributor

The current ublox sara r4 driver assumes polarity of the POWER, RESET and VINT pins. Presently, the Arduino MKR NB 1500 inverts the polarity of the POWER and RESET pins (it does not have a VINT pin). This is a result of a level translator (N-channel FET) between the mcu pin and the SARA-R4 pin.

Describe the solution you'd like
To support the Arduino board, it is necessary to implement a polarity inversion function. The SAMD21 soc does not support hardware pin inversion so setting the gpio flags will not address this problem.

Suggested changes:

modem_context.h:
Add a polarity member to struct modem_pin.
Add polarity to MODEM_PIN macro

modem_pin.c:
Add polarity to modem_pin_read(), modem_pin_write(), modem_pin_config() and modem_pin_init().

ublox-sara-r4.c:
Add polarity to initialization of modem_pins[]

ublox,sara-r4.yaml:
Add polarity settings mdm-power-pol, mdm-reset-pol, mdm-vint-pol

I can create a PR for this but before I do I would like to seek some feedback on my proposed change to the modem drivers and the SARA R4 driver.

@sslupsky
Copy link
Contributor Author

sslupsky commented Apr 2, 2020

The new GPIO API fixes this issue. Though, for some reason, the driver reverted to using the "raw" pin. My PR sets this back to using gpio_pin_set() which will enable logical pin setting (Active High or Active Low).
#24042

@nashif nashif added Enhancement Changes/Updates/Additions to existing features and removed Enhancement Changes/Updates/Additions to existing features labels Apr 7, 2020
@carlescufi carlescufi added Enhancement Changes/Updates/Additions to existing features and removed Feature Request A request for a new feature labels Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Modem Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants