Skip to content

saul/gpio: add handling of active-low signals + state initialization#7151

Closed
haukepetersen wants to merge 2 commits intoRIOT-OS:masterfrom
haukepetersen:opt_saul_gpioinvinitstate
Closed

saul/gpio: add handling of active-low signals + state initialization#7151
haukepetersen wants to merge 2 commits intoRIOT-OS:masterfrom
haukepetersen:opt_saul_gpioinvinitstate

Conversation

@haukepetersen
Copy link
Copy Markdown
Contributor

motivated by #7148

The SAUL GPIO driver can now handle inverted logic (active-low pins) and the initial state can be configured on a per-pin basis.

This costs us on the samr21-xpro with two configured SAUL GPIOs ~100 byte, so it doesn't come cheap...

I have not yet adapted other boards than the samr21-xpro, wanted to get opinions first.

- added two additional SAUL GPIO drivers, that can cope with inverted
  pin logic (e.g. low-active LEDs and buttons...)
- initial pin level after (auto)initialization (set/clear/skip) is now
  configurable
@haukepetersen haukepetersen added Area: drivers Area: Device drivers Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation labels Jun 7, 2017
@haukepetersen haukepetersen added this to the Release 2017.07 milestone Jun 7, 2017
@jnohlgard
Copy link
Copy Markdown
Member

I don't think this belongs in SAUL. If anywhere it should be placed in the periph gpio driver. Some MCUs have hardware support for inverted GPIOs, which would give this feature almost for free on those platforms.

@smlng
Copy link
Copy Markdown
Member

smlng commented Jun 7, 2017

to be frank: I don't like it - considering the cost (you said it yourself) and the added complexity.

[edit:] referring to @haukepetersen, not @gebart

@haukepetersen
Copy link
Copy Markdown
Contributor Author

Some MCUs have hardware support for inverted GPIOs

Good to know, I have never seen this...

I am not too big of a fan to this approach myself, but this would be the clean way in terms of concepts...

@haukepetersen
Copy link
Copy Markdown
Contributor Author

closed in favor of #7586

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: drivers Area: Device drivers Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants