Home
last modified time | relevance | path

Searched +full:gpio +full:- +full:n (Results 1 – 25 of 473) sorted by relevance

12345678910>>...19

/Zephyr-Core-3.5.0/drivers/gpio/
Dgpio_sam4l.c3 * Copyright (c) 2020-2023 Gerson Fernando Budke <nandojve@gmail.com>
5 * SPDX-License-Identifier: Apache-2.0
15 #include <zephyr/drivers/gpio.h>
19 #include <zephyr/drivers/gpio/gpio_utils.h>
26 Gpio *regs;
44 const struct gpio_sam_config * const cfg = dev->config; in gpio_sam_port_configure()
45 Gpio * const gpio = cfg->regs; in gpio_sam_port_configure() local
49 return -ENOTSUP; in gpio_sam_port_configure()
53 gpio->IERC = mask; in gpio_sam_port_configure()
54 gpio->PUERC = mask; in gpio_sam_port_configure()
[all …]
Dgpio_mchp_mss.c4 * SPDX-License-Identifier: Apache-2.0
13 #include <zephyr/drivers/gpio.h>
17 #include <zephyr/drivers/gpio/gpio_utils.h>
62 /* Helper Macros for GPIO */
64 ((const struct mss_gpio_config * const)(dev)->config)
66 ((volatile struct mss_gpio_t *)(DEV_GPIO_CFG(dev))->gpio_base_addr)
68 ((struct mss_gpio_data *)(dev)->data)
75 volatile struct mss_gpio_t *gpio = DEV_GPIO(dev); in mss_gpio_config() local
80 return -ENOTSUP; in mss_gpio_config()
85 gpio->gpio_cfg[pin] |= MSS_GPIO_OUTPUT_MODE; in mss_gpio_config()
[all …]
Dgpio_nct38xx.h4 * SPDX-License-Identifier: Apache-2.0
11 #include <zephyr/drivers/gpio.h>
19 #define NCT38XX_REG_GPIO_DATA_IN(n) (0xC0 + ((n) * 8)) argument
20 #define NCT38XX_REG_GPIO_DATA_OUT(n) (0xC1 + ((n) * 8)) argument
21 #define NCT38XX_REG_GPIO_DIR(n) (0xC2 + ((n) * 8)) argument
22 #define NCT38XX_REG_GPIO_OD_SEL(n) (0xC3 + ((n) * 8)) argument
23 #define NCT38XX_REG_GPIO_ALERT_RISE(n) (0xC4 + ((n) * 8)) argument
24 #define NCT38XX_REG_GPIO_ALERT_FALL(n) (0xC5 + ((n) * 8)) argument
25 #define NCT38XX_REG_GPIO_ALERT_LEVEL(n) (0xC6 + ((n) * 8)) argument
26 #define NCT38XX_REG_GPIO_ALERT_MASK(n) (0xC7 + ((n) * 8)) argument
[all …]
Dgpio_test.c5 * SPDX-License-Identifier: Apache-2.0
9 * This is not a real GPIO driver. It is used to instantiate struct
10 * devices for the "vnd,gpio" devicetree compatible used in test code.
15 #include <zephyr/drivers/gpio.h>
16 #include <zephyr/drivers/gpio/gpio_utils.h>
32 return -ENOTSUP; in vnd_gpio_pin_configure()
38 return -ENOTSUP; in vnd_gpio_port_get_raw()
45 return -ENOTSUP; in vnd_gpio_port_set_masked_raw()
51 return -ENOTSUP; in vnd_gpio_port_set_bits_raw()
57 return -ENOTSUP; in vnd_gpio_port_clear_bits_raw()
[all …]
Dgpio_numaker.c4 * SPDX-License-Identifier: Apache-2.0
11 #include <zephyr/drivers/gpio.h>
14 #include <zephyr/drivers/gpio/gpio_utils.h>
38 const struct gpio_numaker_config *config = dev->config; in gpio_numaker_configure()
39 struct gpio_numaker_data *data = dev->data; in gpio_numaker_configure()
40 GPIO_T *gpio_base = (GPIO_T *)config->reg; in gpio_numaker_configure()
42 uint32_t pinMask = BIT(pin); /* mask for pin index --> (0x01 << pin) */ in gpio_numaker_configure()
52 return -EINVAL; in gpio_numaker_configure()
57 /* Enable GPIO clock */ in gpio_numaker_configure()
62 scc_subsys.pcc.clk_modidx = config->clk_modidx; in gpio_numaker_configure()
[all …]
Dgpio_cmsdk_ahb.c4 * SPDX-License-Identifier: Apache-2.0
13 #include <zephyr/drivers/gpio.h>
17 #include <zephyr/drivers/gpio/gpio_cmsdk_ahb.h>
20 #include <zephyr/drivers/gpio/gpio_utils.h>
23 * @brief GPIO driver for ARM CMSDK AHB GPIO
33 /* GPIO Clock control in Active State */
35 /* GPIO Clock control in Sleep State */
37 /* GPIO Clock control in Deep Sleep State */
51 const struct gpio_cmsdk_ahb_cfg * const cfg = dev->config; in gpio_cmsdk_ahb_port_get_raw()
53 *value = cfg->port->data; in gpio_cmsdk_ahb_port_get_raw()
[all …]
Dgpio_ifx_cat1.c5 * SPDX-License-Identifier: Apache-2.0
9 * @brief GPIO driver for Infineon CAT1 MCU family.
12 * - Trigger detection on pin rising or falling edge (GPIO_INT_TRIG_BOTH)
13 * is not supported in current version of GPIO CAT1 driver.
18 #include <zephyr/drivers/gpio.h>
19 #include <zephyr/drivers/gpio/gpio_utils.h>
51 * GPIO base address divided by GPIO structure size.
55 (dev)->config)->regs - CY_GPIO_BASE) / GPIO_PRT_SECTION_SIZE)
113 return -ENOTSUP; in gpio_cat1_configure()
118 /* If the gpio requested resource is already in use, try to free and in gpio_cat1_configure()
[all …]
Dgpio_b91.c4 * SPDX-License-Identifier: Apache-2.0
10 #include <zephyr/drivers/gpio.h>
12 #include <zephyr/drivers/gpio/gpio_utils.h>
18 /* Get GPIO instance */
20 ((const struct gpio_b91_config *)dev->config)->gpio_base)
22 /* Get GPIO IRQ number defined in dts */
23 #define GET_IRQ_NUM(dev) (((const struct gpio_b91_config *)dev->config)->irq_num)
25 /* Get GPIO IRQ priority defined in dts */
26 #define GET_IRQ_PRIORITY(dev) (((const struct gpio_b91_config *)dev->config)->irq_priority)
28 /* Get GPIO port number: port A - 0, port B - 1, ..., port F - 5 */
[all …]
Dgpio_sedi.c3 * SPDX-License-Identifier: Apache-2.0
9 #include <zephyr/drivers/gpio.h>
11 #include <zephyr/drivers/gpio/gpio_utils.h>
37 const struct gpio_sedi_config *config = dev->config; in gpio_sedi_suspend_device()
38 sedi_gpio_t gpio_dev = config->device; in gpio_sedi_suspend_device()
42 return -EBUSY; in gpio_sedi_suspend_device()
48 return -EIO; in gpio_sedi_suspend_device()
56 const struct gpio_sedi_config *config = dev->config; in gpio_sedi_resume_device_from_suspend()
57 sedi_gpio_t gpio_dev = config->device; in gpio_sedi_resume_device_from_suspend()
62 return -EIO; in gpio_sedi_resume_device_from_suspend()
[all …]
Dgpio_cc32xx.c4 * SPDX-License-Identifier: Apache-2.0
11 #include <zephyr/drivers/gpio.h>
23 #undef __GPIO_H__ /* Zephyr and CC32XX SDK gpio.h conflict */
24 #include <driverlib/gpio.h>
29 #include <zephyr/drivers/gpio/gpio_utils.h>
50 /* base address of GPIO port */
52 /* GPIO port number */
72 const struct gpio_cc32xx_config *gpio_config = port->config; in gpio_cc32xx_config()
73 unsigned long port_base = gpio_config->port_base; in gpio_cc32xx_config()
76 return -ENOTSUP; in gpio_cc32xx_config()
[all …]
Dgpio_mcux.c5 * SPDX-License-Identifier: Apache-2.0
12 #include <zephyr/drivers/gpio.h>
13 #include <zephyr/dt-bindings/gpio/nxp-kinetis-gpio.h>
18 #include <zephyr/drivers/gpio/gpio_utils.h>
38 const struct gpio_mcux_config *config = dev->config; in gpio_mcux_configure()
39 GPIO_Type *gpio_base = config->gpio_base; in gpio_mcux_configure()
40 PORT_Type *port_base = config->port_base; in gpio_mcux_configure()
45 if (pin >= ARRAY_SIZE(port_base->PCR)) { in gpio_mcux_configure()
46 return -EINVAL; in gpio_mcux_configure()
50 return -ENOTSUP; in gpio_mcux_configure()
[all …]
Dgpio_rcar.c4 * SPDX-License-Identifier: Apache-2.0
14 #include <zephyr/drivers/gpio.h>
19 #include <zephyr/drivers/gpio/gpio_utils.h>
25 ((const struct gpio_rcar_cfg *)(_dev)->config)
26 #define DEV_DATA(_dev) ((struct gpio_rcar_data *)(_dev)->data)
82 struct gpio_rcar_data *data = dev->data; in gpio_rcar_port_isr()
90 fsb = find_lsb_set(pending) - 1; in gpio_rcar_port_isr()
91 gpio_fire_callbacks(&data->cb, dev, BIT(fsb)); in gpio_rcar_port_isr()
98 uint32_t gpio, in gpio_rcar_config_general_input_output_mode() argument
101 /* follow steps in the GPIO documentation for in gpio_rcar_config_general_input_output_mode()
[all …]
/Zephyr-Core-3.5.0/dts/bindings/gpio/
Dxlnx,xps-gpio-1.00.a.yaml1 description: Xilinx AXI GPIO IP node
3 compatible: "xlnx,xps-gpio-1.00.a"
5 include: [gpio-controller.yaml, base.yaml]
7 bus: xlnx,xps-gpio-1.00.a
10 # https://github.com/Xilinx/device-tree-xlnx
16 xlnx,all-inputs:
21 xlnx,all-outputs:
26 xlnx,dout-default:
29 Default output value. If n-th bit is 1, GPIO-n default value is 1.
31 xlnx,gpio-width:
[all …]
/Zephyr-Core-3.5.0/samples/boards/esp32/deep_sleep/src/
Dmain.c4 * SPDX-License-Identifier: Apache-2.0
7 #include <zephyr/drivers/gpio.h>
20 #error "Unsupported: wakeup-button alias is not defined"
35 int pin = __builtin_ffsll(wakeup_pin_mask) - 1; in main()
37 printk("Wake up from GPIO %d\n", pin); in main()
39 printk("Wake up from GPIO\n"); in main()
50 int pin = __builtin_ffsll(wakeup_pin_mask) - 1; in main()
52 printk("Wake up from GPIO %d\n", pin); in main()
54 printk("Wake up from GPIO\n"); in main()
60 printk("Wake up from timer.\n"); in main()
[all …]
/Zephyr-Core-3.5.0/drivers/input/
Dinput_gpio_qdec.c4 * SPDX-License-Identifier: Apache-2.0
13 #include <zephyr/drivers/gpio.h>
23 struct gpio_dt_spec gpio[GPIO_QDEC_GPIO_NUM]; member
54 const struct gpio_qdec_config *cfg = dev->config; in gpio_qdec_get_step()
57 if (gpio_pin_get_dt(&cfg->gpio[0])) { in gpio_qdec_get_step()
60 if (gpio_pin_get_dt(&cfg->gpio[1])) { in gpio_qdec_get_step()
70 const struct gpio_qdec_config *cfg = dev->config; in gpio_qdec_sample_timer_timeout()
71 struct gpio_qdec_data *data = dev->data; in gpio_qdec_sample_timer_timeout()
78 if (data->prev_step == step) { in gpio_qdec_sample_timer_timeout()
82 switch ((data->prev_step << 4U) | step) { in gpio_qdec_sample_timer_timeout()
[all …]
/Zephyr-Core-3.5.0/soc/arm/arm/mps3/
Dsoc.c4 * SPDX-License-Identifier: Apache-2.0
7 #include <zephyr/drivers/gpio/gpio_mmio32.h>
9 #include <zephyr/linker/linker-defs.h>
12 /* Setup GPIO drivers for accessing FPGAIO registers */
13 #define FPGAIO_NODE(n) DT_INST(n, arm_mps3_fpgaio_gpio) argument
14 #define FPGAIO_INIT(n) \ argument
15 GPIO_MMIO32_INIT(FPGAIO_NODE(n), \
16 DT_REG_ADDR(FPGAIO_NODE(n)), \
17 BIT_MASK(DT_PROP(FPGAIO_NODE(n), ngpios)))
19 /* We expect there to be 3 arm,mps3-fpgaio-gpio devices:
/Zephyr-Core-3.5.0/samples/basic/custom_dts_binding/src/
Dmain.c4 * SPDX-License-Identifier: Apache-2.0
10 #include <zephyr/drivers/gpio.h>
25 printf("The load switch pin GPIO port is not ready.\n"); in main()
29 printf("Initializing pin with inactive level.\n"); in main()
33 printf("Configuring GPIO pin failed: %d\n", err); in main()
37 printf("Waiting one second.\n"); in main()
41 printf("Setting pin to active level.\n"); in main()
45 printf("Setting GPIO pin level failed: %d\n", err); in main()
/Zephyr-Core-3.5.0/include/zephyr/devicetree/
Dgpio.h3 * @brief GPIO Devicetree macro public API header file.
10 * SPDX-License-Identifier: Apache-2.0
21 * @defgroup devicetree-gpio Devicetree GPIO API
28 * gpio phandle-array property at an index
32 * gpio1: gpio@... { };
34 * gpio2: gpio@... { };
36 * n: node {
43 * DT_GPIO_CTLR_BY_IDX(DT_NODELABEL(n), gpios, 1) // DT_NODELABEL(gpio2)
46 * @param gpio_pha lowercase-and-underscores GPIO property with
47 * type "phandle-array"
[all …]
/Zephyr-Core-3.5.0/samples/boards/up_squared/gpio_counter/src/
Dmain.c4 * SPDX-License-Identifier: Apache-2.0
11 #include <zephyr/drivers/gpio.h>
21 * This example outputs the value of a counter via 4 GPIO lines
22 * as a 4-bit value (bin 0, 1, 2, 3 -> HAT Pin 35, 37, 38, 40).
27 * () Advanced -> HAT Configurations:
28 * - HD-Audio / I2S6 Selec -> Disabled
29 * - GPIO / PWM3 Selection -> GPIO
30 * - GPIO / I2S2 Selection -> GPIO
32 * - GPIO 19 (Pin16) Confi -> Input
34 * - GPIO 14 (Pin35) Confi -> Output
[all …]
/Zephyr-Core-3.5.0/samples/boards/ti/cc13x2_cc26x2/system_off/src/
Dmain.c5 * SPDX-License-Identifier: Apache-2.0
12 #include <zephyr/drivers/gpio.h>
29 printk("\n%s system off demo\n", CONFIG_BOARD); in main()
36 printk("%s: device not ready.\n", sw0_gpio.port->name); in main()
42 /* Set wakeup bits for button gpio */ in main()
47 printk("Busy-wait %u s\n", BUSY_WAIT_S); in main()
50 printk("Sleep %u us (IDLE)\n", SLEEP_US); in main()
53 printk("Sleep %u s (STANDBY)\n", SLEEP_S); in main()
56 printk("Powering off; press BUTTON1 to restart\n"); in main()
58 /* Clear GPIO interrupt */ in main()
/Zephyr-Core-3.5.0/samples/boards/nrf/nrfx_prs/src/
Dmain.c4 * SPDX-License-Identifier: Apache-2.0
8 #include <zephyr/drivers/gpio.h>
60 struct gpio_dt_spec gpio; in init_buttons() member
84 if (!gpio_is_ready_dt(&btn->gpio)) { in init_buttons()
85 printk("%s is not ready\n", btn->gpio.port->name); in init_buttons()
89 ret = gpio_pin_configure_dt(&btn->gpio, GPIO_INPUT); in init_buttons()
91 printk("Failed to configure %s pin %d: %d\n", in init_buttons()
92 btn->gpio.port->name, btn->gpio.pin, ret); in init_buttons()
96 ret = gpio_pin_interrupt_configure_dt(&btn->gpio, in init_buttons()
99 printk("Failed to configure interrupt on %s pin %d: %d\n", in init_buttons()
[all …]
/Zephyr-Core-3.5.0/samples/boards/nrf/system_off/src/
Dmain.c4 * SPDX-License-Identifier: Apache-2.0
13 #include <zephyr/drivers/gpio.h>
27 printf("%s: device not ready.\n", cons->name); in main()
31 printf("\n%s system off demo\n", CONFIG_BOARD); in main()
40 printf("Retained data: %s\n", retained_ok ? "valid" : "INVALID"); in main()
41 printf("Boot count: %u\n", retained.boots); in main()
42 printf("Off count: %u\n", retained.off_count); in main()
43 printf("Active Ticks: %" PRIu64 "\n", retained.uptime_sum); in main()
45 printf("Retained data not supported\n"); in main()
48 /* configure sw0 as input, interrupt as level active to allow wake-up */ in main()
[all …]
/Zephyr-Core-3.5.0/boards/arm/efm32gg_stk3701a/
Dboard.c5 * SPDX-License-Identifier: Apache-2.0
10 #include <zephyr/drivers/gpio.h>
22 printk("Ethernet PHY power gpio port is not ready!\n"); in efm32gg_stk3701a_init()
23 return -ENODEV; in efm32gg_stk3701a_init()
32 printk("Ethernet reference clock gpio port is not ready!\n"); in efm32gg_stk3701a_init()
33 return -ENODEV; in efm32gg_stk3701a_init()
42 CMU->CTRL |= CMU_CTRL_CLKOUTSEL2_HFXO; in efm32gg_stk3701a_init()
43 CMU->ROUTELOC0 = (CMU->ROUTELOC0 & ~_CMU_ROUTELOC0_CLKOUT2LOC_MASK) | in efm32gg_stk3701a_init()
45 CMU->ROUTEPEN |= CMU_ROUTEPEN_CLKOUT2PEN; in efm32gg_stk3701a_init()
50 printk("Ethernet PHY reset gpio port is not ready!\n"); in efm32gg_stk3701a_init()
[all …]
/Zephyr-Core-3.5.0/drivers/adc/
Diadc_gecko.c4 * SPDX-License-Identifier: Apache-2.0
51 struct adc_gecko_data *data = dev->data; in adc_gecko_set_config()
53 const struct adc_gecko_config *config = dev->config; in adc_gecko_set_config()
55 IADC_TypeDef *iadc = (IADC_TypeDef *)config->base; in adc_gecko_set_config()
61 channel_config = &data->channel_config[data->channel_id]; in adc_gecko_set_config()
63 initSingleInput.posInput = channel_config->input_positive; in adc_gecko_set_config()
64 initSingleInput.negInput = channel_config->input_negative; in adc_gecko_set_config()
66 initAllConfigs.configs[0].analogGain = channel_config->gain; in adc_gecko_set_config()
68 initAllConfigs.configs[0].reference = channel_config->reference; in adc_gecko_set_config()
82 if (sequence->options) { in adc_gecko_check_buffer_size()
[all …]
/Zephyr-Core-3.5.0/soc/arm/arm/mps2/
Dsoc.c5 * Copyright (c) 2013-2015 Wind River Systems, Inc.
7 * SPDX-License-Identifier: Apache-2.0
10 #include <zephyr/drivers/gpio/gpio_mmio32.h>
12 #include <zephyr/linker/linker-defs.h>
15 /* Setup GPIO drivers for accessing FPGAIO registers */
16 #define FPGAIO_NODE(n) DT_INST(n, arm_mps2_fpgaio_gpio) argument
17 #define FPGAIO_INIT(n) \ argument
18 GPIO_MMIO32_INIT(FPGAIO_NODE(n), \
19 DT_REG_ADDR(FPGAIO_NODE(n)), \
20 BIT_MASK(DT_PROP(FPGAIO_NODE(n), ngpios)))
[all …]

12345678910>>...19