| /Zephyr-latest/samples/bluetooth/st_ble_sensor/src/ |
| D | button_svc.c | 25 static const struct gpio_dt_spec button = GPIO_DT_SPEC_GET(DT_ALIAS(sw0), gpios); variable 32 if (!gpio_is_ready_dt(&button)) { in button_init() 34 button.port->name); in button_init() 38 ret = gpio_pin_configure_dt(&button, GPIO_INPUT); in button_init() 41 ret, button.port->name, button.pin); in button_init() 46 gpio_init_callback(&gpio_cb, handler, BIT(button.pin)); in button_init() 47 gpio_add_callback(button.port, &gpio_cb); in button_init() 48 ret = gpio_pin_interrupt_configure_dt(&button, GPIO_INT_EDGE_TO_ACTIVE); in button_init() 51 "GPIO %s pin %d", ret, button.port->name, button.pin); in button_init()
|
| /Zephyr-latest/samples/bluetooth/encrypted_advertising/peripheral/src/ |
| D | main.c | 32 static const struct gpio_dt_spec button = GPIO_DT_SPEC_GET_OR(SW0_NODE, gpios, {0}); variable 52 printk("Confirm passkey by pressing button at %s pin %d...\n", button.port->name, in get_passkey_confirmation() 53 button.pin); in get_passkey_confirmation() 74 if (!gpio_is_ready_dt(&button)) { in setup_btn() 75 LOG_ERR("Error: button device %s is not ready", button.port->name); in setup_btn() 79 ret = gpio_pin_configure_dt(&button, GPIO_INPUT); in setup_btn() 81 LOG_ERR("Error %d: failed to configure %s pin %d", ret, button.port->name, in setup_btn() 82 button.pin); in setup_btn() 86 ret = gpio_pin_interrupt_configure_dt(&button, GPIO_INT_EDGE_TO_ACTIVE); in setup_btn() 89 button.port->name, button.pin); in setup_btn() [all …]
|
| /Zephyr-latest/samples/bluetooth/encrypted_advertising/central/src/ |
| D | main.c | 36 static const struct gpio_dt_spec button = GPIO_DT_SPEC_GET_OR(SW0_NODE, gpios, {0}); variable 58 printk("Confirm passkey by pressing button at %s pin %d...\n", button.port->name, in get_passkey_confirmation() 59 button.pin); in get_passkey_confirmation() 80 if (!gpio_is_ready_dt(&button)) { in setup_btn() 81 LOG_ERR("Error: button device %s is not ready", button.port->name); in setup_btn() 85 ret = gpio_pin_configure_dt(&button, GPIO_INPUT); in setup_btn() 87 LOG_ERR("Error %d: failed to configure %s pin %d", ret, button.port->name, in setup_btn() 88 button.pin); in setup_btn() 92 ret = gpio_pin_interrupt_configure_dt(&button, GPIO_INT_EDGE_TO_ACTIVE); in setup_btn() 95 button.port->name, button.pin); in setup_btn() [all …]
|
| /Zephyr-latest/samples/basic/button/src/ |
| D | main.c | 28 static const struct gpio_dt_spec button = GPIO_DT_SPEC_GET_OR(SW0_NODE, gpios, variable 49 if (!gpio_is_ready_dt(&button)) { in main() 51 button.port->name); in main() 55 ret = gpio_pin_configure_dt(&button, GPIO_INPUT); in main() 58 ret, button.port->name, button.pin); in main() 62 ret = gpio_pin_interrupt_configure_dt(&button, in main() 66 ret, button.port->name, button.pin); in main() 70 gpio_init_callback(&button_cb_data, button_pressed, BIT(button.pin)); in main() 71 gpio_add_callback(button.port, &button_cb_data); in main() 72 printk("Set up button at %s pin %d\n", button.port->name, button.pin); in main() [all …]
|
| /Zephyr-latest/samples/boards/nxp/mimxrt1060_evk/system_off/src/ |
| D | main.c | 31 static const struct gpio_dt_spec button = GPIO_DT_SPEC_GET_OR(SW0_NODE, gpios, { 0 }); variable 38 if (!gpio_is_ready_dt(&button)) { in main() 39 printk("Error: button device %s is not ready\n", button.port->name); in main() 45 int ret = gpio_pin_configure_dt(&button, GPIO_INPUT | GPIO_PULL_UP); in main() 48 printk("Error %d: failed to configure %s pin %d\n", ret, button.port->name, in main() 49 button.pin); in main() 53 ret = gpio_pin_interrupt_configure_dt(&button, GPIO_INT_LEVEL_LOW); in main() 56 button.port->name, button.pin); in main() 85 printk("Entering system off; press %s to restart sooner\n", button.port->name); in main()
|
| /Zephyr-latest/samples/boards/espressif/light_sleep/src/ |
| D | main.c | 28 static const struct gpio_dt_spec button = variable 33 if (!gpio_is_ready_dt(&button)) { in main() 34 printk("Error: button device %s is not ready\n", button.port->name); in main() 38 const int wakeup_level = (button.dt_flags & GPIO_ACTIVE_LOW) ? 0 : 1; in main() 40 esp_gpio_wakeup_enable(button.pin, in main() 49 if (gpio_pin_get_dt(&button) == wakeup_level) { in main() 50 printk("Waiting for GPIO%d to go high...\n", button.pin); in main() 53 } while (gpio_pin_get_dt(&button) == wakeup_level); in main()
|
| /Zephyr-latest/samples/boards/st/power_mgmt/standby_shutdown/src/ |
| D | main.c | 35 static const struct gpio_dt_spec button = variable 115 if (!gpio_is_ready_dt(&button)) { in main() 117 button.port->name); in main() 121 ret = gpio_pin_configure_dt(&button, GPIO_INPUT); in main() 124 ret, button.port->name, button.pin); in main() 128 ret = gpio_pin_interrupt_configure_dt(&button, in main() 132 ret, button.port->name, button.pin); in main() 136 gpio_init_callback(&button_cb_data, button_pressed, BIT(button.pin)); in main() 137 gpio_add_callback(button.port, &button_cb_data); in main()
|
| /Zephyr-latest/samples/bluetooth/mesh/src/ |
| D | microbit.c | 16 static const struct gpio_dt_spec button = variable 53 gpio_pin_configure_dt(&button, GPIO_INPUT); in configure_button() 54 gpio_pin_interrupt_configure_dt(&button, GPIO_INT_EDGE_TO_ACTIVE); in configure_button() 56 gpio_init_callback(&button_cb, button_pressed, BIT(button.pin)); in configure_button() 58 gpio_add_callback(button.port, &button_cb); in configure_button() 72 gpio_pin_interrupt_configure_dt(&button, GPIO_INT_EDGE_TO_ACTIVE); in board_output_number() 87 gpio_pin_interrupt_configure_dt(&button, GPIO_INT_DISABLE); in board_prov_complete()
|
| /Zephyr-latest/samples/boards/st/power_mgmt/wkup_pins/src/ |
| D | main.c | 22 static const struct gpio_dt_spec button = GPIO_DT_SPEC_GET(WKUP_SRC_NODE, gpios); variable 28 printk("\nWake-up button is connected to %s pin %d\n", button.port->name, button.pin); in main() 35 gpio_pin_configure_dt(&button, STM32_GPIO_WKUP); in main()
|
| /Zephyr-latest/samples/net/openthread/coap/src/ |
| D | main.c | 27 static const struct gpio_dt_spec button = GPIO_DT_SPEC_GET_OR(SW0_NODE, gpios, {0}); variable 55 button_init(&button); in main() 57 gpio_init_callback(&button_cb_data, button_pressed, BIT(button.pin)); in main() 58 gpio_add_callback_dt(&button, &button_cb_data); in main()
|
| /Zephyr-latest/samples/boards/nordic/dynamic_pinctrl/src/ |
| D | remap.c | 34 const struct gpio_dt_spec button = GPIO_DT_SPEC_GET_OR(DT_ALIAS(sw0), in remap_pins() local 38 if (!gpio_is_ready_dt(&button)) { in remap_pins() 42 ret = gpio_pin_configure_dt(&button, GPIO_INPUT); in remap_pins() 48 if (gpio_pin_get_dt(&button)) { in remap_pins()
|
| /Zephyr-latest/samples/boards/renesas/comparator/src/ |
| D | main.c | 26 static const struct gpio_dt_spec button = GPIO_DT_SPEC_GET_OR(SW0_NODE, gpios, {0}); variable 84 if (!gpio_is_ready_dt(&button)) { in main() 85 printk("Error: button device %s is not ready\n", button.port->name); in main() 89 ret = gpio_pin_configure_dt(&button, GPIO_INPUT); in main() 91 printk("Error %d: failed to configure %s pin %d\n", ret, button.port->name, in main() 92 button.pin); in main()
|
| /Zephyr-latest/samples/shields/x_nucleo_53l0a1/src/ |
| D | main.c | 121 const struct gpio_dt_spec button = GPIO_DT_SPEC_GET(SW0_NODE, gpios); in main() local 126 if (!gpio_is_ready_dt(&button)) { in main() 128 button.port->name); in main() 132 gpio_pin_configure_dt(&button, GPIO_INPUT); in main() 133 gpio_pin_interrupt_configure_dt(&button, GPIO_INT_EDGE_RISING); in main() 134 gpio_init_callback(&button_cb_data, change_mode, BIT(button.pin)); in main() 135 gpio_add_callback(button.port, &button_cb_data); in main()
|
| /Zephyr-latest/boards/nordic/nrf54l09pdk/ |
| D | nrf54l09pdk_nrf54l09-common.dtsi | 26 label = "Push button 0"; 31 label = "Push button 1"; 36 label = "Push button 2"; 41 label = "Push button 3";
|
| /Zephyr-latest/samples/basic/button/ |
| D | README.rst | 1 .. zephyr:code-sample:: button 10 A simple button demo showcasing the use of GPIO input with interrupts. 11 The sample prints a message to the console each time a button is pressed. 13 .. NOTE:: If you are looking into an implementation of button events with 20 The board hardware must have a push button connected via a GPIO pin. These are 23 The button must be configured using the ``sw0`` :ref:`devicetree <dt-guide>` 36 will be turned on when the button is pressed, and turned off off when it is 68 label = "User button"; 82 meant to apply to the button, such as ``(GPIO_PULL_UP | GPIO_ACTIVE_LOW)`` 105 :zephyr-app: samples/basic/button [all …]
|
| /Zephyr-latest/samples/bluetooth/mesh_provisioner/src/ |
| D | main.c | 319 static const struct gpio_dt_spec button = GPIO_DT_SPEC_GET_OR(SW0_NODE, gpios, {0}); variable 331 if (!gpio_is_ready_dt(&button)) { in button_init() 332 printk("Error: button device %s is not ready\n", button.port->name); in button_init() 335 ret = gpio_pin_configure_dt(&button, GPIO_INPUT); in button_init() 337 printk("Error %d: failed to configure %s pin %d\n", ret, button.port->name, in button_init() 338 button.pin); in button_init() 341 ret = gpio_pin_interrupt_configure_dt(&button, GPIO_INT_EDGE_TO_ACTIVE); in button_init() 344 button.port->name, button.pin); in button_init() 347 gpio_init_callback(&button_cb_data, button_pressed, BIT(button.pin)); in button_init() 348 gpio_add_callback(button.port, &button_cb_data); in button_init()
|
| /Zephyr-latest/boards/ti/cc3235sf_launchxl/ |
| D | cc3235sf_launchxl.dts | 54 /* Push button 2 */ 58 label = "Push button switch 2"; 61 /* Push button 3 */ 64 label = "Push button switch 3";
|
| /Zephyr-latest/drivers/input/ |
| D | input_sdl_touch_bottom.c | 24 data->x = event->button.x; in sdl_filter() 25 data->y = event->button.y; in sdl_filter()
|
| /Zephyr-latest/samples/subsys/usb/hid-mouse/ |
| D | README.rst | 11 by the Zephyr project. This very simple driver enumerates a board with a button 12 into a mouse that has a left mouse button and optionally (depending on 13 the number of buttons on the board) a right mouse button, X-axis movement, 16 will be performed on every button click if the bus is in suspended state. 30 - ``INPUT_KEY_0``: left button 31 - ``INPUT_KEY_1``: right button 97 When you press the button on your board, it will act as if the left 98 mouse button was pressed, and this information will be displayed 110 If your board has more than one button, they will act as right mouse button,
|
| /Zephyr-latest/samples/boards/nordic/mesh/onoff-app/ |
| D | README.rst | 16 FICR. Each button controls the state of its 19 The models for button 1 and LED 1 are in the node's root element. 20 The 3 remaining button/LED pairs are in elements 1 through 3. 24 After provisioning, the button clients must 30 If a button is pressed only once within a 1 second interval, it sends an 35 using one button for "on" and another for "off" would reduce the number 58 Prior to provisioning, each button controls its corresponding LED as one 62 binds button 2 and LED 1 to application key 1. It then configures button 2 74 bind 1 1 1001 # bind appkey 1 to button 2 on element 1 (unicast 0101) 75 pub-set 0101 c000 1 0 0 1001 # publish button 2 to group address c000
|
| /Zephyr-latest/boards/ti/cc3220sf_launchxl/ |
| D | cc3220sf_launchxl.dts | 51 /* Push button 2 */ 55 label = "Push button switch 2"; 58 /* Push button 3 */ 61 label = "Push button switch 3";
|
| /Zephyr-latest/boards/nordic/nrf5340_audio_dk/ |
| D | nrf5340_audio_dk_nrf5340_shared.dtsi | 48 label = "Push button 1"; 53 label = "Push button 2"; 58 label = "Push button 3"; 63 label = "Push button 4"; 68 label = "Push button 5";
|
| /Zephyr-latest/boards/holyiot/yj16019/doc/ |
| D | index.rst | 20 The board is equipped with one LED, one push button, and is powered by 38 LED and push button 41 * Push button = P0.28 90 Testing the LED and button on the Holyiot YJ-16019 93 There are 2 samples that allow you to test that the button and LED on 99 samples/basic/button 102 correctly on your board. The button and LED definitions can be found
|
| /Zephyr-latest/boards/adafruit/macropad_rp2040/doc/ |
| D | index.rst | 11 individual RGB NeoPixels, a rotary encoder with push button, a 128x64 OLED display, 23 - Rotary encoder with push button 27 - Reset button 46 encoder button (BOOT) and, while continuing to hold it, pressing and releasing the reset button.
|
| /Zephyr-latest/boards/nordic/nrf5340dk/ |
| D | nrf5340dk_common.dtsi | 32 label = "Push button 1"; 37 label = "Push button 2"; 42 label = "Push button 3"; 47 label = "Push button 4";
|