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>
This commit adds following functions which work with pin logical levels
(take into account GPIO_ACTIVE_LOW flag):
- gpio_port_get, gpio_port_set_masked, gpio_port_set_bits,
gpio_port_clear_bits, gpio_port_set_clr_bits
- gpio_pin_get, gpio_pin_set
Functions which work with pin physical levels:
- gpio_port_get_raw, gpio_port_set_masked_raw, gpio_port_set_bits_raw,
gpio_port_clear_bits_raw, gpio_port_set_clr_bits_raw
- gpio_pin_get_raw, gpio_pin_set_raw
As well as functions:
- gpio_port_toggle_bits, gpio_pin_toggle_bits
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
This commit makes following changes to GPIO dt-bindings flags:
- Added GPIO_ACTIVE_LOW, GPIO_ACTIVE_HIGH to indicate pin active state.
- Added GPIO_OPEN_DRAIN, GPIO_OPEN_SOURCE to configure single ended pin
driving mode.
- Added GPIO_PULL_UP, GPIO_PULL_DOWN flags.
- GPIO_INPUT, GPIO_OUTPUT to configure pin as input or output.
- Added GPIO_OUTPUT_LOW, GPIO_OUTPUT_HIGH flags to initialize output
in low or high state.
- reworked GPIO_INT_* flags to configure pin interrupts.
- following flags were deprecated: GPIO_DIR_*, GPIO_DS_DISCONNECT_*,
GPIO_PUD_*, GPIO_INT_ACTIVE_*, GPIO_INT_DOUBLE_EDGE, GPIO_POL_*.
To be aligned with Linux DTS standard any GPIO flags that should not be
used in DTS files are moved from include/dt-bindings/gpio/gpio.h file to
include/drivers/gpio.h with an exception of several old flags which
removal would cause DTS compilation errors. Those remaining old flags
will be removed from include/dt-bindings/gpio/gpio.h at a later stage.
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
Added new LE Feature Support bit mask as documented in
Bluetooth Spec. v5.2 Vol 6, Part B, Section 4.6 Feature
Support.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Eliminates CI build warnings such as this which breaks the build:
warning: NET_SOCKETS_POSIX_NAMES
(defined at subsys/net/lib/sockets/Kconfig:13) was assigned the value
'n' but got the value 'y'.
The testcase involves no offloading, which means it does not apply to
cc32xx.
Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
This PR eliminates the Kconfig warnings seen in build by setting the
options to the appropriate values for cc32xx platforms. They were
causing CI failures.
Fixes#22388
Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
Add missing and new HCI Error code values as defined in
Bluetooth Core Specification v5.2.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>