Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.
The interrupt triggering on both edges is a remnant from the old
Quark SE which has a customized DesignWare GPIO block. So remove
the support for both edges as the board is no longer supported.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The MCUX GPIO peripheral must be configured as either input or output.
Reject attempts to configure disconnected or bidirectional.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
A large number of sensor drivers specify GPIO_INT_DEBOUNCE to request
a debounced signal; in practice the debounce may be performed by
external components on the board. Historically this flag was ignored
on the many GPIO peripherals that do not support hardware debouncing.
Document that this flag is an exception to the normal rule that
unsupported features should be rejected by gpio_pin_configure.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
A disconnected GPIO is one that is neither an input nor an output.
This is represented by a zero-valued all-default configuration. Call
this configuration GPIO_DISCONNECTED so the intent is clear.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
The pull test assumed it was possible to configure the GPIO to be
disconnected. Some peripherals don't support a disconnected GPIO pin,
so if disconnected is not supported emit a note and attempt to
configure the output pin as an input.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Switch to gpio_pin_interrupt_configure() and the new interrupt flags.
Use logical level pin set operations. Test all standard interrupt
configurations including double edge.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Switch to gpio_pin_interrupt_configure() and the new interrupt flags.
Use logical level pin set operations.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Test that the new port API functions all behave as expected, including
physical vs logical level for input and output as well as masked and
set-based output operations. Also tests the new pin API functions.
For running on real hardware this test now uses a local test-specific
devicetree binding. For build-only tests any platform with a GPIO
alias should be tested.
The new code increases flash requirements so add a filter to exclude
platforms that won't link.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
External GPIO drivers may not be supported from interrupt context
because they involve blocking bus transactions. Describe the return
value for this situation, and add the I/O error to operations where it
was missing.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
The comments identifying replacement API were inadvertently removed
along with the flag that triggers deprecation warnings.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Remove handling for GPIO_INT_LEVELS_LOGICAL in driver now that we do
that in gpio_pin_interrupt_configure and gpio_pin_configure.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Remove handling for GPIO_INT_LEVELS_LOGICAL in driver now that we do
that in gpio_pin_interrupt_configure and gpio_pin_configure.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Remove handling for GPIO_INT_LEVELS_LOGICAL in driver now that we do
that in gpio_pin_interrupt_configure and gpio_pin_configure.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Remove handling for GPIO_INT_LEVELS_LOGICAL in driver now that we do
that in gpio_pin_interrupt_configure and gpio_pin_configure.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Move handling of logical flag support into gpio_pin_configure and
gpio_pin_interrupt_configure. This way drivers don't need to know
anything about logical levels.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
Move z_impl_gpio_pin_interrupt_configure before gpio_pin_configure so we
can utilize z_impl_gpio_pin_interrupt_configure in gpio_pin_configure in
the future.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Change when we clear interrupt status to happen before we handle the
callbacks. As the callbacks might manipluate the GPIO state and cause
a GPIO interrupt. If we clear interrupt status after than we might
miss an interrupt.
Also only clear interrupts for interrupts that are we have enabled and
that were reported when we read from the interrupt status.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Update gpio_pin_configure() to take into account GPIO flags defined by
the devicetree. Use gpio_pin_get/gpio_pin_set to verify reading/writing
of logical pin values. Use gpio_pin_interrupt_configure() to configure
interrupts.
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.
Tested on frdm_k64f board.
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.
Tested on nrf52840_pca10056 board.
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.
Tested on sam_e70_xplained board.
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
Update driver code and board files to use new GPIO configuration flags
such as GPIO_ACTIVE_LOW. Also add implementation of new port_* driver
API as well as gpio_pin_interrupt_configure function.
Tested on efr32_slwstk6061a board.
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
gpio_api_1pin testcase verifies following new GPIO API functionality:
- pin active level flags
- input/output configuration flags
- pin drive flags
- gpio_port_*, gpio_pin_* functions
- pin interrupts
The test is using only 1 GPIO pin (defined in DTS as LED0) and relies on
the ability of the driver to configure pin simultanously as in/out.
Drivers that do not allow to configure pins in in/out mode should still
pass the test, however, most of the testcases will be skipped.
The test does not require any modifications to board hardware.
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
Both pin sets and values encoding pin values are ultimately represented
by 32-bit unsigned integers. Provide typedefs that make the role of a
parameter explicit.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
This commit moves interrupt configuration for a single pin from
gpio_pin_configure to gpio_pin_interrupt_configure function.
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>