Skip to content
1 change: 1 addition & 0 deletions samples/bluetooth/central_otc/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=8192
CONFIG_LOG=y
CONFIG_ASSERT=y
CONFIG_BT_L2CAP_TX_BUF_COUNT=8
CONFIG_GPIO=y
1 change: 0 additions & 1 deletion samples/bluetooth/central_past/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <zephyr/bluetooth/gap.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/conn.h>
#include <zephyr/bluetooth/hci.h>
Expand Down
6 changes: 6 additions & 0 deletions samples/bluetooth/iso_receive/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ config ISO_ALIGN_PRINT_INTERVALS
Align interval-counter with packet number from incoming ISO packets.
This may be needed if report printouts are to be synchronized between
the iso_broadcast sample and the iso_receive sample.

config ISO_BLINK_LED0
bool "Blink led0"
depends on $(dt_alias_enabled,led0)
select GPIO
default y
15 changes: 7 additions & 8 deletions samples/bluetooth/iso_receive/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ static K_SEM_DEFINE(sem_big_sync_lost, 0, BIS_ISO_CHAN_COUNT);
/* The devicetree node identifier for the "led0" alias. */
#define LED0_NODE DT_ALIAS(led0)

#if DT_NODE_HAS_STATUS_OKAY(LED0_NODE)
#ifdef CONFIG_ISO_BLINK_LED0
static const struct gpio_dt_spec led_gpio = GPIO_DT_SPEC_GET(LED0_NODE, gpios);
#define HAS_LED 1
#define BLINK_ONOFF K_MSEC(500)

static struct k_work_delayable blink_work;
Expand Down Expand Up @@ -303,7 +302,7 @@ int main(void)

printk("Starting Synchronized Receiver Demo\n");

#if defined(HAS_LED)
#ifdef CONFIG_ISO_BLINK_LED0
printk("Get reference to LED device...");

if (!gpio_is_ready_dt(&led_gpio)) {
Expand All @@ -320,7 +319,7 @@ int main(void)
printk("done.\n");

k_work_init_delayable(&blink_work, blink_timeout);
#endif /* HAS_LED */
#endif /* CONFIG_ISO_BLINK_LED0 */

/* Initialize the Bluetooth Subsystem */
err = bt_enable(NULL);
Expand Down Expand Up @@ -349,13 +348,13 @@ int main(void)
}
printk("success.\n");

#if defined(HAS_LED)
#ifdef CONFIG_ISO_BLINK_LED0
printk("Start blinking LED...\n");
led_is_on = false;
blink = true;
gpio_pin_set_dt(&led_gpio, (int)led_is_on);
k_work_reschedule(&blink_work, BLINK_ONOFF);
#endif /* HAS_LED */
#endif /* CONFIG_ISO_BLINK_LED0 */

printk("Waiting for periodic advertising...\n");
per_adv_found = false;
Expand Down Expand Up @@ -456,7 +455,7 @@ int main(void)
}
printk("BIG sync established.\n");

#if defined(HAS_LED)
#ifdef CONFIG_ISO_BLINK_LED0
printk("Stop blinking LED.\n");
blink = false;
/* If this fails, we'll exit early in the handler because blink
Expand All @@ -467,7 +466,7 @@ int main(void)
/* Keep LED on */
led_is_on = true;
gpio_pin_set_dt(&led_gpio, (int)led_is_on);
#endif /* HAS_LED */
#endif /* CONFIG_ISO_BLINK_LED0 */

for (uint8_t chan = 0U; chan < BIS_ISO_CHAN_COUNT; chan++) {
printk("Waiting for BIG sync lost chan %u...\n", chan);
Expand Down
1 change: 0 additions & 1 deletion samples/bluetooth/mesh/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <zephyr/settings/settings.h>
#include <zephyr/devicetree.h>
#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/hwinfo.h>
#include <zephyr/sys/byteorder.h>

Expand Down
1 change: 0 additions & 1 deletion samples/bluetooth/mesh_demo/src/microbit.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/drivers/gpio.h>
#include <soc.h>
#include <zephyr/sys/printk.h>
#include <ctype.h>
Expand Down
12 changes: 12 additions & 0 deletions samples/bluetooth/mesh_provisioner/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

source "Kconfig.zephyr"

mainmenu "Bluetooth: Mesh Provisioner"

config MESH_PROVISIONER_USE_SW0
bool "Use sw0 button to provision"
depends on $(dt_alias_enabled,sw0)
select GPIO
default y
8 changes: 4 additions & 4 deletions samples/bluetooth/mesh_provisioner/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static uint8_t node_uuid[16];

K_SEM_DEFINE(sem_unprov_beacon, 0, 1);
K_SEM_DEFINE(sem_node_added, 0, 1);
#if DT_NODE_HAS_STATUS_OKAY(SW0_NODE)
#ifdef CONFIG_MESH_PROVISIONER_USE_SW0
K_SEM_DEFINE(sem_button_pressed, 0, 1);
#endif

Expand Down Expand Up @@ -315,7 +315,7 @@ static uint8_t check_unconfigured(struct bt_mesh_cdb_node *node, void *data)
return BT_MESH_CDB_ITER_CONTINUE;
}

#if DT_NODE_HAS_STATUS_OKAY(SW0_NODE)
#ifdef CONFIG_MESH_PROVISIONER_USE_SW0
static const struct gpio_dt_spec button = GPIO_DT_SPEC_GET_OR(SW0_NODE, gpios, {0});
static struct gpio_callback button_cb_data;

Expand Down Expand Up @@ -366,7 +366,7 @@ int main(void)
printk("Bluetooth initialized\n");
bt_ready();

#if DT_NODE_HAS_STATUS_OKAY(SW0_NODE)
#ifdef CONFIG_MESH_PROVISIONER_USE_SW0
button_init();
#endif

Expand All @@ -383,7 +383,7 @@ int main(void)

bin2hex(node_uuid, 16, uuid_hex_str, sizeof(uuid_hex_str));

#if DT_NODE_HAS_STATUS_OKAY(SW0_NODE)
#ifdef CONFIG_MESH_PROVISIONER_USE_SW0
k_sem_reset(&sem_button_pressed);
printk("Device %s detected, press button 1 to provision.\n", uuid_hex_str);
err = k_sem_take(&sem_button_pressed, K_SECONDS(30));
Expand Down
6 changes: 6 additions & 0 deletions samples/bluetooth/periodic_sync/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@ config PER_ADV_NAME
help
Name of target advertising for Periodic Advertising Synchronization.

config PER_BLINK_LED0
bool "Blink led0"
depends on $(dt_alias_enabled,led0)
select GPIO
default y

source "Kconfig.zephyr"
15 changes: 7 additions & 8 deletions samples/bluetooth/periodic_sync/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ static K_SEM_DEFINE(sem_per_sync_lost, 0, 1);
/* The devicetree node identifier for the "led0" alias. */
#define LED0_NODE DT_ALIAS(led0)

#if DT_NODE_HAS_STATUS_OKAY(LED0_NODE)
#define HAS_LED 1
#ifdef CONFIG_PER_BLINK_LED0
static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios);
#define BLINK_ONOFF K_MSEC(500)

Expand Down Expand Up @@ -186,7 +185,7 @@ int main(void)

printk("Starting Periodic Advertising Synchronization Demo\n");

#if defined(HAS_LED)
#ifdef CONFIG_PER_BLINK_LED0
printk("Checking LED device...");
if (!gpio_is_ready_dt(&led)) {
printk("failed.\n");
Expand All @@ -203,7 +202,7 @@ int main(void)
printk("done.\n");

k_work_init_delayable(&blink_work, blink_timeout);
#endif /* HAS_LED */
#endif /* CONFIG_PER_BLINK_LED0 */

/* Initialize the Bluetooth Subsystem */
err = bt_enable(NULL);
Expand All @@ -229,14 +228,14 @@ int main(void)
printk("success.\n");

do {
#if defined(HAS_LED)
#ifdef CONFIG_PER_BLINK_LED0
struct k_work_sync work_sync;

printk("Start blinking LED...\n");
led_is_on = false;
gpio_pin_set(led.port, led.pin, (int)led_is_on);
k_work_schedule(&blink_work, BLINK_ONOFF);
#endif /* HAS_LED */
#endif /* CONFIG_PER_BLINK_LED0 */

printk("Waiting for periodic advertising...\n");
per_adv_found = false;
Expand Down Expand Up @@ -275,14 +274,14 @@ int main(void)
}
printk("Periodic sync established.\n");

#if defined(HAS_LED)
#ifdef CONFIG_PER_BLINK_LED0
printk("Stop blinking LED.\n");
k_work_cancel_delayable_sync(&blink_work, &work_sync);

/* Keep LED on */
led_is_on = true;
gpio_pin_set(led.port, led.pin, (int)led_is_on);
#endif /* HAS_LED */
#endif /* CONFIG_PER_BLINK_LED0 */

printk("Waiting for periodic sync lost...\n");
err = k_sem_take(&sem_per_sync_lost, K_FOREVER);
Expand Down
1 change: 0 additions & 1 deletion samples/bluetooth/peripheral_past/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/conn.h>
#include <zephyr/bluetooth/hci.h>
Expand Down
1 change: 1 addition & 0 deletions samples/bluetooth/st_ble_sensor/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ CONFIG_BT_GATT_CLIENT=y
CONFIG_LOG=y
CONFIG_LOG_BUFFER_SIZE=2048
CONFIG_ENTROPY_GENERATOR=y
CONFIG_GPIO=y
1 change: 1 addition & 0 deletions samples/bluetooth/st_ble_sensor/src/button_svc.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include "button_svc.h"

#include <zephyr/drivers/gpio.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>

Expand Down
1 change: 0 additions & 1 deletion samples/boards/bbc/microbit/display/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/device.h>

#include <zephyr/display/mb_display.h>
Expand Down
1 change: 0 additions & 1 deletion samples/boards/bbc/microbit/pong/src/ble.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/device.h>
#include <string.h>

Expand Down
2 changes: 2 additions & 0 deletions samples/boards/espressif/deep_sleep/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ mainmenu "Espressif Deep Sleep demo"
config EXAMPLE_EXT1_WAKEUP
bool "Enable wakeup from GPIO"
depends on !SOC_SERIES_ESP32C3
select GPIO
help
This option enables wake-up from deep sleep using GPIO2 and
GPIO4. The sample enables internal pull-down on EXT1 pins to
Expand All @@ -16,6 +17,7 @@ config EXAMPLE_EXT1_WAKEUP
config EXAMPLE_GPIO_WAKEUP
bool "Enable wakeup from GPIO"
depends on SOC_SERIES_ESP32C3
select GPIO
help
This option enables wake-up from GPIO. Only GPIO0~5 can be used
as wake-up source. Be aware that when low level is used to trigger
Expand Down
1 change: 1 addition & 0 deletions samples/boards/espressif/light_sleep/prj.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CONFIG_PM=y
# Required to disable default behavior of deep sleep on timeout
CONFIG_PM_DEVICE=y
CONFIG_GPIO=y
1 change: 1 addition & 0 deletions samples/boards/nordic/battery/prj.conf
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
CONFIG_ADC=y
CONFIG_GPIO=y
1 change: 1 addition & 0 deletions samples/boards/nordic/dynamic_pinctrl/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ CONFIG_PINCTRL_DYNAMIC=y
# configure serial and console to come after remap hook
CONFIG_SERIAL_INIT_PRIORITY=60
CONFIG_CONSOLE_INIT_PRIORITY=70
CONFIG_GPIO=y
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/drivers/gpio.h>

#include "ble_mesh.h"
#include "common.h"
#include "device_composition.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

#include <math.h>
#include <zephyr/drivers/gpio.h>

#include "ble_mesh.h"
#include "device_composition.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/drivers/gpio.h>

#include "ble_mesh.h"
#include "common.h"
#include "device_composition.h"
Expand Down
1 change: 1 addition & 0 deletions samples/boards/nordic/nrfx_prs/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ CONFIG_NRFX_PRS_BOX_2=y

# This is needed for using another SPIM instance via the Zephyr SPI driver.
CONFIG_SPI=y
CONFIG_GPIO=y
1 change: 1 addition & 0 deletions samples/boards/nxp/mimxrt1060_evk/system_off/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ CONFIG_COUNTER=y
CONFIG_COUNTER_MCUX_SNVS=y
CONFIG_COUNTER_MCUX_SNVS_SRTC=y
CONFIG_COUNTER_MCUX_SNVS_SRTC_WAKE=y
CONFIG_GPIO=y
1 change: 0 additions & 1 deletion samples/boards/phytec/reel_board/mesh_badge/src/periphs.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

#include <zephyr/kernel.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/sensor.h>
#include "board.h"
#include "mesh.h"
Expand Down
1 change: 1 addition & 0 deletions samples/boards/st/power_mgmt/blinky/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ CONFIG_PM_DEVICE=y
CONFIG_PM_DEVICE_RUNTIME=y
CONFIG_PM_DEVICE_SYSTEM_MANAGED=y
CONFIG_ASSERT=y
CONFIG_GPIO=y
1 change: 1 addition & 0 deletions samples/boards/st/power_mgmt/standby_shutdown/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ CONFIG_PM_DEVICE=n
CONFIG_PM_DEVICE_RUNTIME=n
CONFIG_HWINFO=y
CONFIG_POWEROFF=y
CONFIG_GPIO=y
1 change: 1 addition & 0 deletions samples/boards/st/power_mgmt/stop3/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ CONFIG_PM_DEVICE=y
CONFIG_PM_DEVICE_RUNTIME=y
CONFIG_PM_DEVICE_SYSTEM_MANAGED=y
CONFIG_ASSERT=y
CONFIG_GPIO=y
1 change: 1 addition & 0 deletions samples/boards/st/power_mgmt/suspend_to_ram/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ CONFIG_SPI=y
CONFIG_SPI_STM32_DMA=y
CONFIG_SPI_STM32_INTERRUPT=n
CONFIG_SPI_ASYNC=n
CONFIG_GPIO=y
1 change: 1 addition & 0 deletions samples/boards/st/power_mgmt/wkup_pins/prj.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
CONFIG_POWEROFF=y
CONFIG_STM32_WKUP_PINS=y
CONFIG_GPIO=y
6 changes: 6 additions & 0 deletions samples/drivers/espi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@ config ESPI_VIRTUAL_WIRE_TIMEOUT
help
Timeout for virtual wires

config ESPI_USE_BOARD_POWER
bool "Use board power"
depends on $(dt_nodelabel_enabled,board_power)
select GPIO
default y

source "Kconfig.zephyr"
1 change: 0 additions & 1 deletion samples/drivers/espi/src/espi_oob_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include <zephyr/device.h>
#include <soc.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/espi.h>
#include <zephyr/logging/log_ctrl.h>
#include <zephyr/logging/log.h>
Expand Down
Loading
Loading