Commit graph

6 commits

Author SHA1 Message Date
Purdea Andrei 38f554ef4f drivers: gpio_rpi_pico.c: add support for single-ended IO
Note: RP2040 can support single-ended IO, by setting the GPIO_OUT
register to a constant value, and then changing the GPIO_OE register
instead, when the output has to change. To do this, the output-setting
functions need to know which pins have been configured as single-ended,
and for that reason the data structure has been extended to include
this information.

Another change is the PR, is that setting of the pull-ups/pull-downs
now applies to both inputs and outputs as well. Previous solution was
wrong, because if the user wanted to set up an input with a pull
resistor enabled, and then reconfigure it to an output without any
pulls, then the pulls remained in place for the output. Now pulls
are correctly set based on the gpio flags for outputs too, and this
is especially useful for single-ended outputs too.

Signed-off-by: Purdea Andrei <andrei@purdea.ro>
2023-02-26 18:38:08 -05:00
Balaji Kulkarni 7f1a5cce12 drivers: gpio: expose gpio_utils.h to external GPIO drivers
Expose "gpio_utils.h" header for external GPIO drivers.

Fixes #48609.

Signed-off-by: Balaji Kulkarni <balaji.kulkarni92@gmail.com>
2022-10-27 15:38:51 +02:00
Gerard Marull-Paretas acc8cb4bc8 include: add missing irq.h include
Some modules use the IRQ API without including the necessary headers.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-10-11 18:05:17 +02:00
Gerard Marull-Paretas fb60aab245 drivers: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all drivers to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 19:58:21 +02:00
Peter Johanson 562e79780a drivers: gpio_rpi_pico: fix pull ups and disabling interrupts
Properly set both pull up and down flags explicitly when
making changes.

Properly implement disabling interrupts on a given pin.

Signed-off-by: Peter Johanson <peter@peterjohanson.com>
2022-02-24 08:44:19 -06:00
Yonatan Schachter a2aa02dbc8 drivers: gpio: Added support for raspberry pi
Added GPIO support for the RP2040 SoC. Only one
core is supported.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2022-02-02 16:23:35 +01:00