Home
last modified time | relevance | path

Searched refs:button (Results 1 – 25 of 572) sorted by relevance

12345678910>>...23

/Zephyr-latest/samples/bluetooth/st_ble_sensor/src/
Dbutton_svc.c25 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/
Dmain.c32 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/
Dmain.c36 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/
Dmain.c28 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/
Dmain.c31 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/
Dmain.c28 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/
Dmain.c35 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/
Dmicrobit.c16 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/
Dmain.c22 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/boards/nordic/dynamic_pinctrl/src/
Dremap.c34 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/shields/x_nucleo_53l0a1/src/
Dmain.c121 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/nrf54l20pdk/
Dnrf54l20pdk_nrf54l20-common.dtsi34 label = "Push button 0";
39 label = "Push button 1";
44 label = "Push button 2";
49 label = "Push button 3";
/Zephyr-latest/samples/basic/button/
DREADME.rst1 .. 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/
Dmain.c319 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/
Dcc3235sf_launchxl.dts54 /* Push button 2 */
58 label = "Push button switch 2";
61 /* Push button 3 */
64 label = "Push button switch 3";
/Zephyr-latest/drivers/input/
Dinput_sdl_touch_bottom.c24 data->x = event->button.x; in sdl_filter()
25 data->y = event->button.y; in sdl_filter()
/Zephyr-latest/samples/subsys/usb/hid-mouse/
DREADME.rst11 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/
DREADME.rst16 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/
Dcc3220sf_launchxl.dts51 /* 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/
Dnrf5340_audio_dk_nrf5340_shared.dtsi48 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/samples/bluetooth/st_ble_sensor/
DREADME.rst11 GATT services. Currently only button notification and LED service are
27 Open ST Bluetooth LE Sensor app and click on "CONNECT TO A DEVICE" button to scan Bluetooth LE devi…
30 Push SW0 button on embedded device to test button service.
/Zephyr-latest/boards/nordic/nrf5340dk/
Dnrf5340dk_common.dtsi32 label = "Push button 1";
37 label = "Push button 2";
42 label = "Push button 3";
47 label = "Push button 4";
/Zephyr-latest/boards/waveshare/nrf51_ble400/
Dnrf51_ble400.dts62 /* Push button switch 0 KEY1 */
66 label = "Push button switch 0";
69 /* Push button switch 1 KEY2 */
72 label = "Push button switch 1";
/Zephyr-latest/boards/nordic/nrf54l15dk/
Dnrf54l15dk_common.dtsi47 label = "Push button 0";
52 label = "Push button 1";
57 label = "Push button 2";
62 label = "Push button 3";
/Zephyr-latest/samples/boards/espressif/light_sleep/
DREADME.rst19 * ``EXT0``: wake up the chip if a button attached to GPIO0 is pressed (i.e. if
26 button attached to GPIO0, often labelled BOOT. If the board does not have such
27 button, an external button can be connected, along with a 10k pull-up resistor,
44 In the scenario below, the button attached to GPIO0 was pressed and held for
68 If pressing the button attached to GPIO0 does not affect program behavior,

12345678910>>...23