Lines Matching +full:port +full:- +full:num
4 * SPDX-License-Identifier: Apache-2.0
11 #include <zephyr/dt-bindings/gpio/renesas-ra-gpio-ioport.h>
19 size_t num; member
25 R_PORT0_Type *port; member
39 const struct gpio_ra_config *config = dev->config; in query_irq_info()
41 for (int i = 0; i < config->irq_info_size; i++) { in query_irq_info()
42 const struct gpio_ra_irq_info *info = &config->irq_info[i]; in query_irq_info()
44 for (int j = 0; j < info->num; j++) { in query_irq_info()
45 if (info->pins[j] == pin) { in query_irq_info()
56 struct gpio_ra_data *data = dev->data; in gpio_ra_callback_adapter()
58 gpio_fire_callbacks(&data->callbacks, dev, BIT(pin)); in gpio_ra_callback_adapter()
64 const struct gpio_ra_config *config = dev->config; in gpio_ra_pin_configure()
70 return -ENOTSUP; in gpio_ra_pin_configure()
74 return -ENOTSUP; in gpio_ra_pin_configure()
78 return -ENOTSUP; in gpio_ra_pin_configure()
81 if (config->vbatt_pins[0] != 0xFF) { in gpio_ra_pin_configure()
84 for (int i = 0; config->vbatt_pins[i] != '\0'; i++) { in gpio_ra_pin_configure()
85 if (config->vbatt_pins[i] == pin) { in gpio_ra_pin_configure()
92 R_SYSTEM->VBTICTLR &= (uint8_t)~clear; in gpio_ra_pin_configure()
97 pincfg.port_num = config->port_num; in gpio_ra_pin_configure()
101 * - Low output, input mode in gpio_ra_pin_configure()
102 * - Pull-up disabled, CMOS output in gpio_ra_pin_configure()
103 * - Low drive strength in gpio_ra_pin_configure()
104 * - Not used for IRQ or analog in gpio_ra_pin_configure()
105 * - Configured as general I/O in gpio_ra_pin_configure()
132 return -EINVAL; in gpio_ra_pin_configure()
135 if (!device_is_ready(irq_info->port_irq)) { in gpio_ra_pin_configure()
136 return -EWOULDBLOCK; in gpio_ra_pin_configure()
140 .port = (struct device *)dev, in gpio_ra_pin_configure()
141 .port_num = config->port_num, in gpio_ra_pin_configure()
148 err = gpio_ra_interrupt_set(irq_info->port_irq, &callback); in gpio_ra_pin_configure()
160 return -EINVAL; in gpio_ra_pin_configure()
163 if (!device_is_ready(irq_info->port_irq)) { in gpio_ra_pin_configure()
164 return -EWOULDBLOCK; in gpio_ra_pin_configure()
167 gpio_ra_interrupt_unset(irq_info->port_irq, config->port_num, pin); in gpio_ra_pin_configure()
180 const struct gpio_ra_config *config = dev->config; in gpio_ra_port_get_raw()
181 R_PORT0_Type *port = config->port; in gpio_ra_port_get_raw() local
183 *value = port->PIDR; in gpio_ra_port_get_raw()
191 const struct gpio_ra_config *config = dev->config; in gpio_ra_port_set_masked_raw()
192 R_PORT0_Type *port = config->port; in gpio_ra_port_set_masked_raw() local
194 port->PODR = ((port->PODR & ~mask) | (value & mask)); in gpio_ra_port_set_masked_raw()
201 const struct gpio_ra_config *config = dev->config; in gpio_ra_port_set_bits_raw()
202 R_PORT0_Type *port = config->port; in gpio_ra_port_set_bits_raw() local
204 port->PODR = (port->PODR | pins); in gpio_ra_port_set_bits_raw()
211 const struct gpio_ra_config *config = dev->config; in gpio_ra_port_clear_bits_raw()
212 R_PORT0_Type *port = config->port; in gpio_ra_port_clear_bits_raw() local
214 port->PODR = (port->PODR & ~pins); in gpio_ra_port_clear_bits_raw()
221 const struct gpio_ra_config *config = dev->config; in gpio_ra_port_toggle_bits()
222 R_PORT0_Type *port = config->port; in gpio_ra_port_toggle_bits() local
224 port->PODR = (port->PODR ^ pins); in gpio_ra_port_toggle_bits()
230 static int gpio_ra_pin_interrupt_configure(const struct device *port, gpio_pin_t pin, in gpio_ra_pin_interrupt_configure() argument
233 return gpio_ra_pin_configure(port, pin, (mode | trig)); in gpio_ra_pin_interrupt_configure()
239 struct gpio_ra_data *data = dev->data; in gpio_ra_manage_callback()
241 return gpio_manage_callback(&data->callbacks, callback, set); in gpio_ra_manage_callback()
268 .num = ARRAY_SIZE(CONCAT(n, ___pins##i)), \
281 .port = (R_PORT0_Type *)addr, \
292 DT_PROP(DT_NODELABEL(ioport##suffix), port), suffix, \