Home
last modified time | relevance | path

Searched +full:device +full:- +full:state +full:- +full:gpios (Results 1 – 25 of 71) sorted by relevance

123

/Zephyr-Core-3.5.0/dts/bindings/base/
Dpower.yaml2 # SPDX-License-Identifier: Apache-2.0
7 supply-gpios:
8 type: phandle-array
10 GPIO specifier that controls power to the device.
12 This property should be provided when the device has a dedicated
13 switch that controls power to the device. The supply state is
14 entirely the responsibility of the device driver.
16 Contrast with vin-supply.
18 vin-supply:
21 Reference to the regulator that controls power to the device.
[all …]
/Zephyr-Core-3.5.0/dts/bindings/can/
Dti,tcan4x5x.yaml2 # SPDX-License-Identifier: Apache-2.0
5 Texas Instruments TCAN4x5x SPI CAN-FD controller.
12 spi-max-frequency = <18000000>;
13 clock-frequency = <40000000>;
14 device-state-gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
15 device-wake-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
16 reset-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
17 int-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
18 bosch,mram-cfg = <0x0 15 15 5 5 0 10 10>;
19 sample-point = <875>;
[all …]
/Zephyr-Core-3.5.0/drivers/regulator/
Dregulator_gpio.c3 * SPDX-License-Identifier: Apache-2.0
20 const struct gpio_dt_spec *gpios; member
35 static int regulator_gpio_apply_state(const struct device *dev, uint32_t state) in regulator_gpio_apply_state() argument
37 const struct regulator_gpio_config *cfg = dev->config; in regulator_gpio_apply_state()
39 for (unsigned int gpio_idx = 0; gpio_idx < cfg->num_gpios; gpio_idx++) { in regulator_gpio_apply_state()
41 int new_state_of_gpio = (state >> gpio_idx) & 0x1; in regulator_gpio_apply_state()
43 ret = gpio_pin_get_dt(&cfg->gpios[gpio_idx]); in regulator_gpio_apply_state()
45 LOG_ERR("%s: can't get pin state", dev->name); in regulator_gpio_apply_state()
50 ret = gpio_pin_set_dt(&cfg->gpios[gpio_idx], new_state_of_gpio); in regulator_gpio_apply_state()
52 LOG_ERR("%s: can't set pin state", dev->name); in regulator_gpio_apply_state()
[all …]
/Zephyr-Core-3.5.0/dts/bindings/lora/
Dsemtech,sx126x-base.yaml3 # SPDX-License-Identifier: Apache-2.0
5 include: spi-device.yaml
8 reset-gpios:
9 type: phandle-array
13 This signal is open-drain, active-low as interpreted by the
16 busy-gpios:
17 type: phandle-array
21 antenna-enable-gpios:
22 type: phandle-array
26 tx-enable-gpios:
[all …]
/Zephyr-Core-3.5.0/boards/shields/tcan4550evm/
Dtcan4550evm.overlay4 * SPDX-License-Identifier: Apache-2.0
7 #include <zephyr/dt-bindings/gpio/gpio.h>
17 cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */
22 /* reduced spi-max-frequency to accommodate flywire connections */
23 spi-max-frequency = <2000000>;
25 clock-frequency = <40000000>;
26 device-state-gpios = <&arduino_header 12 GPIO_ACTIVE_HIGH>; /* D6 */
27 device-wake-gpios = <&arduino_header 13 GPIO_ACTIVE_HIGH>; /* D7 */
28 reset-gpios = <&arduino_header 14 GPIO_ACTIVE_HIGH>; /* D8 */
29 int-gpios = <&arduino_header 15 GPIO_ACTIVE_LOW>; /* D9 */
[all …]
/Zephyr-Core-3.5.0/samples/sensor/fxos8700-hid/src/
Dmain.c6 * SPDX-License-Identifier: Apache-2.0
9 #include <zephyr/device.h>
23 static const struct gpio_dt_spec sw0_gpio = GPIO_DT_SPEC_GET(SW0_NODE, gpios);
26 /* If second button exists, use it as right-click. */
28 static const struct gpio_dt_spec sw1_gpio = GPIO_DT_SPEC_GET(SW1_NODE, gpios);
31 static const struct gpio_dt_spec led_gpio = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios);
50 static void left_button(const struct device *gpio, struct gpio_callback *cb, in left_button()
54 uint8_t state = status[MOUSE_BTN_REPORT_POS]; in left_button() local
58 state |= MOUSE_BTN_LEFT; in left_button()
60 state &= ~MOUSE_BTN_LEFT; in left_button()
[all …]
/Zephyr-Core-3.5.0/dts/bindings/gpio/
Dzephyr,gpio-emul-sdl.yaml2 # SPDX-License-Identifier: Apache-2.0
7 Simulate GPIO state/interrupts using SDL keyboard events. This node has
8 to be a child of a `zephyr,gpio-emul` compatible.
16 /* gpio0 has to be a zephyr,gpio-emul device */
21 compatible = "zephyr,gpio-emul-sdl";
27 compatible = "gpio-keys";
29 gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
32 gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
35 gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
40 - Only active high as we don't get events for keys that aren't pressed
[all …]
/Zephyr-Core-3.5.0/samples/subsys/modbus/rtu_server/src/
Dmain.c5 * SPDX-License-Identifier: Apache-2.0
21 GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios),
22 GPIO_DT_SPEC_GET(DT_ALIAS(led1), gpios),
23 GPIO_DT_SPEC_GET(DT_ALIAS(led2), gpios),
26 static int coil_rd(uint16_t addr, bool *state) in coil_rd() argument
29 return -ENOTSUP; in coil_rd()
33 *state = true; in coil_rd()
35 *state = false; in coil_rd()
38 LOG_INF("Coil read, addr %u, %d", addr, (int)*state); in coil_rd()
43 static int coil_wr(uint16_t addr, bool state) in coil_wr() argument
[all …]
/Zephyr-Core-3.5.0/dts/bindings/input/
Dgpio-qdec.yaml2 # SPDX-License-Identifier: Apache-2.0
5 GPIO based QDEC input device
7 Implement an input device generating relative axis event reports for a rotary
8 encoder connected to two GPIOs. The driver is normally idling until it sees a
15 #include <zephyr/dt-bindings/input/input-event-codes.h>
18 compatible = "gpio-qdec";
19 gpios = <&gpio0 14 (GPIO_PULL_UP | GPIO_ACTIVE_HIGH)>,
21 steps-per-period = <4>;
23 sample-time-us = <2000>;
24 idle-timeout-ms = <200>;
[all …]
/Zephyr-Core-3.5.0/boards/arm/nrf9160dk_nrf9160/
Dnrf52840_reset.c4 * SPDX-License-Identifier: Apache-2.0
9 #include <zephyr/device.h>
17 #define RESET_GPIO_CTRL DT_GPIO_CTLR(RESET_NODE, gpios)
18 #define RESET_GPIO_PIN DT_GPIO_PIN(RESET_NODE, gpios)
19 #define RESET_GPIO_FLAGS DT_GPIO_FLAGS(RESET_NODE, gpios)
21 int bt_hci_transport_setup(const struct device *h4) in bt_hci_transport_setup()
25 const struct device *const port = DEVICE_DT_GET(RESET_GPIO_CTRL); in bt_hci_transport_setup()
28 return -EIO; in bt_hci_transport_setup()
31 /* Configure pin as output and initialize it to inactive state. */ in bt_hci_transport_setup()
40 * the H4 device is setup and ready to receive. in bt_hci_transport_setup()
/Zephyr-Core-3.5.0/dts/bindings/test/
Dvnd,busy-sim.yaml2 # SPDX-License-Identifier: Apache-2.0
7 compatible: "vnd,busy-sim"
14 Counter device used for generating intervals.
16 active-gpios:
17 type: phandle-array
19 Debug pin is set to active state when cpu load is active.
/Zephyr-Core-3.5.0/drivers/serial/
DKconfig.nrfx3 # Copyright (c) 2016 - 2018, Nordic Semiconductor ASA
4 # SPDX-License-Identifier: Apache-2.0
39 # ----------------- port 0 -----------------
107 If enabled, the driver will configure the GPIOs used by the uart to
108 their default configuration when device is powered down. The GPIOs
109 will be configured back to correct state when UART is powered up.
113 # ----------------- port 1 -----------------
178 If enabled, the driver will configure the GPIOs used by the uart to
179 their default configuration when device is powered down. The GPIOs
180 will be configured back to correct state when UART is powered up.
[all …]
Duart_ite_it8xxx2.c4 * SPDX-License-Identifier: Apache-2.0
9 #include <zephyr/device.h>
14 #include <zephyr/pm/device.h>
30 const struct device *uart_dev;
47 void uart1_wui_isr(const struct device *gpio, struct gpio_callback *cb, in uart1_wui_isr()
51 (void)gpio_pin_interrupt_configure(gpio, (find_msb_set(pins) - 1), in uart1_wui_isr()
54 /* Refresh console expired time if got UART Rx wake-up event */ in uart1_wui_isr()
59 * The pm state of it8xxx2 chip only supports standby, so here we in uart1_wui_isr()
63 k_work_reschedule(&uart_console_data->rx_refresh_timeout_work, delay); in uart1_wui_isr()
67 void uart2_wui_isr(const struct device *gpio, struct gpio_callback *cb, in uart2_wui_isr()
[all …]
/Zephyr-Core-3.5.0/samples/boards/nrf/mesh/onoff-app/src/
Dmain.c1 /* main.c - Application main entry point */
6 * SPDX-License-Identifier: Apache-2.0
10 * This application is specific to the Nordic nRF52840-PDK board.
14 * Prior to provisioning, a button inverts the state of the
17 * The unprovisioned beacon uses the device address set by Nordic
29 * also publish its status on a state change.
32 * the LED's state has already been changed locally by the button client.
42 #include <zephyr/device.h>
94 * it is re-transmitted several times. This occurs
157 { .led_device = GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios), },
[all …]
/Zephyr-Core-3.5.0/dts/bindings/watchdog/
Dnxp,fs26-wdog.yaml2 # SPDX-License-Identifier: Apache-2.0
12 state. This driver covers only the watchdog functionality of FS26. The rest
15 The FS26 uses a 32-bit SPI interface. The MCU is the primary driving MOSI and
24 compatible = "nxp,fs26-wdog";
26 spi-max-frequency = <DT_FREQ_M(5)>;
28 int-gpios = <&gpioa_h 3 GPIO_ACTIVE_LOW>;
37 indicated through int-gpios property. It is also required to configure the
40 compatible: "nxp,fs26-wdog"
42 include: spi-device.yaml
49 - simple
[all …]
/Zephyr-Core-3.5.0/include/zephyr/drivers/
Dgpio.h2 * Copyright (c) 2019-2020 Nordic Semiconductor ASA
5 * Copyright (c) 2015-2016 Intel Corporation.
7 * SPDX-License-Identifier: Apache-2.0
25 #include <zephyr/device.h>
26 #include <zephyr/dt-bindings/gpio/gpio.h>
47 /** Enables pin as output, no change to the output state. */
55 /* Initializes output to a low state. */
58 /* Initializes output to a high state. */
66 /** Configures GPIO pin as output and initializes it to a low state. */
68 /** Configures GPIO pin as output and initializes it to a high state. */
[all …]
/Zephyr-Core-3.5.0/soc/arm/nordic_nrf/
DKconfig3 # Copyright (c) 2016-2018 Nordic Semiconductor ASA
4 # SPDX-License-Identifier: Apache-2.0
24 The functions are always available when not in non-secure.
25 For non-secure the functions must redirect to secure services exposed
37 default $(dt_node_int_prop_hex,$(DT_CHOSEN_ZEPHYR_FLASH),erase-block-size)
44 default $(dt_node_int_prop_hex,$(DT_CHOSEN_ZEPHYR_FLASH),erase-block-size)
50 bool "[DEPRECATED] NFCT pins as GPIOs"
56 HW enabling happens once in the device lifetime, during the first
59 flashing device using the image which has this option disabled.
65 pins as GPIOS like this:
[all …]
/Zephyr-Core-3.5.0/dts/bindings/spi/
Dnordic,nrf-spi-common.yaml2 # SPDX-License-Identifier: Apache-2.0
6 include: [spi-controller.yaml, pinctrl-device.yaml]
15 pinctrl-0:
18 max-frequency:
25 overrun-character:
33 easydma-maxcnt-bits:
40 wake-gpios:
41 type: phandle-array
43 Optional bi-directional line that allows SPI master to indicate to SPI
46 transfer when it is actually needed, and stay in any desired low-power
[all …]
/Zephyr-Core-3.5.0/dts/bindings/sensor/
Dti,bq274xx.yaml4 # SPDX-License-Identifier: Apache-2.0
11 include: [sensor-device.yaml, i2c-device.yaml]
14 design-voltage:
17 description: Battery Design Voltage in mV (3300 - 4400)
19 design-capacity:
24 taper-current:
29 terminate-voltage:
34 int-gpios:
35 type: phandle-array
38 pull-up on the board. By default it acts as an output and signals
[all …]
/Zephyr-Core-3.5.0/subsys/bluetooth/controller/coex/
Dreadme.rst2 Bluetooth co-existence drivers
5 Co-existence Ticker
8 …cker.c` is designed to utilize co-existence with another transmitter. Chips such as nordic nRF9160…
10 Nordic connect SDK provides detailed description of the 1-wire and 3-wire co-existence interface fo…
12 …the 1-wire interface, the coexistence ticker utilizes a single pin called BLE_GRANT, which active …
14 .. code-block:: DTS
17 compatible = "gpio-radio-coex";
18 grant-gpios = <&gpio0 0 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>;
19 grant-delay-us = <150>;
22-active (such as 1 for the nRF9160). state the implementation starts a ticker job, which in predef…
/Zephyr-Core-3.5.0/samples/basic/button/src/
Dmain.c2 * Copyright (c) 2016 Open-RnD Sp. z o.o.
5 * SPDX-License-Identifier: Apache-2.0
9 #include <zephyr/device.h>
24 static const struct gpio_dt_spec button = GPIO_DT_SPEC_GET_OR(SW0_NODE, gpios,
32 static struct gpio_dt_spec led = GPIO_DT_SPEC_GET_OR(DT_ALIAS(led0), gpios,
35 void button_pressed(const struct device *dev, struct gpio_callback *cb, in button_pressed()
46 printk("Error: button device %s is not ready\n", in main()
47 button.port->name); in main()
54 ret, button.port->name, button.pin); in main()
62 ret, button.port->name, button.pin); in main()
[all …]
/Zephyr-Core-3.5.0/samples/shields/npm1300_ek/src/
Dmain.c3 * SPDX-License-Identifier: Apache-2.0
8 #include <zephyr/device.h>
14 #include <zephyr/dt-bindings/regulator/npm1300.h>
22 static const struct gpio_dt_spec button1 = GPIO_DT_SPEC_GET(DT_ALIAS(sw0), gpios);
24 static const struct device *regulators = DEVICE_DT_GET(DT_NODELABEL(npm1300_ek_regulators));
26 static const struct device *charger = DEVICE_DT_GET(DT_NODELABEL(npm1300_ek_charger));
28 static const struct device *leds = DEVICE_DT_GET(DT_NODELABEL(npm1300_ek_leds));
30 static const struct device *pmic = DEVICE_DT_GET(DT_NODELABEL(npm1300_ek_pmic));
37 printk("Error: button device %s is not ready\n", button1.port->name); in configure_ui()
43 printk("Error %d: failed to configure %s pin %d\n", ret, button1.port->name, in configure_ui()
[all …]
/Zephyr-Core-3.5.0/samples/drivers/can/counter/src/
Dmain.c4 * SPDX-License-Identifier: Apache-2.0
11 #include <zephyr/device.h>
29 const struct device *const can_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus));
30 struct gpio_dt_spec led = GPIO_DT_SPEC_GET_OR(DT_ALIAS(led0), gpios, {0});
48 void tx_irq_callback(const struct device *dev, int error, void *arg) in tx_irq_callback()
55 printf("Callback! error-code: %d\nSender: %s\n", in tx_irq_callback()
109 char *state_to_str(enum can_state state) in state_to_str() argument
111 switch (state) { in state_to_str()
113 return "error-active"; in state_to_str()
115 return "error-warning"; in state_to_str()
[all …]
/Zephyr-Core-3.5.0/samples/boards/mimxrt1060_evk/system_off/src/
Dmain.c4 * SPDX-License-Identifier: Apache-2.0
9 #include <zephyr/device.h>
31 static const struct gpio_dt_spec button = GPIO_DT_SPEC_GET_OR(SW0_NODE, gpios, { 0 });
32 static const struct device *const snvs_rtc_dev = DEVICE_DT_GET(SNVS_RTC_NODE);
39 printk("Error: button device %s is not ready\n", button.port->name); in main()
44 /* No external pull-up on the user button, so configure one here */ in main()
48 printk("Error %d: failed to configure %s pin %d\n", ret, button.port->name, in main()
56 button.port->name, button.pin); in main()
60 printk("Busy-wait %u s\n", BUSY_WAIT_S); in main()
83 printk("RTC Alarm set for %llu seconds to wake from soft-off.\n", in main()
[all …]
/Zephyr-Core-3.5.0/samples/boards/nrf/system_off/src/
Dmain.c4 * SPDX-License-Identifier: Apache-2.0
12 #include <zephyr/device.h>
15 #include <zephyr/pm/device.h>
19 static const struct gpio_dt_spec sw0 = GPIO_DT_SPEC_GET(DT_ALIAS(sw0), gpios);
24 const struct device *const cons = DEVICE_DT_GET(DT_CHOSEN(zephyr_console)); in main()
27 printf("%s: device not ready.\n", cons->name); in main()
48 /* configure sw0 as input, interrupt as level active to allow wake-up */ in main()
70 /* Update the retained state */ in main()

123