Lines Matching +full:pin +full:- +full:mask

4  * SPDX-License-Identifier: Apache-2.0
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()
59 uint32_t mask, in gpio_cmsdk_ahb_port_set_masked_raw() argument
62 const struct gpio_cmsdk_ahb_cfg * const cfg = dev->config; in gpio_cmsdk_ahb_port_set_masked_raw()
64 cfg->port->dataout = (cfg->port->dataout & ~mask) | (mask & value); in gpio_cmsdk_ahb_port_set_masked_raw()
70 uint32_t mask) in gpio_cmsdk_ahb_port_set_bits_raw() argument
72 const struct gpio_cmsdk_ahb_cfg * const cfg = dev->config; in gpio_cmsdk_ahb_port_set_bits_raw()
74 cfg->port->dataout |= mask; in gpio_cmsdk_ahb_port_set_bits_raw()
80 uint32_t mask) in gpio_cmsdk_ahb_port_clear_bits_raw() argument
82 const struct gpio_cmsdk_ahb_cfg * const cfg = dev->config; in gpio_cmsdk_ahb_port_clear_bits_raw()
84 cfg->port->dataout &= ~mask; in gpio_cmsdk_ahb_port_clear_bits_raw()
90 uint32_t mask) in gpio_cmsdk_ahb_port_toggle_bits() argument
92 const struct gpio_cmsdk_ahb_cfg * const cfg = dev->config; in gpio_cmsdk_ahb_port_toggle_bits()
94 cfg->port->dataout ^= mask; in gpio_cmsdk_ahb_port_toggle_bits()
99 static int cmsdk_ahb_gpio_config(const struct device *dev, uint32_t mask, in cmsdk_ahb_gpio_config() argument
102 const struct gpio_cmsdk_ahb_cfg * const cfg = dev->config; in cmsdk_ahb_gpio_config()
105 return -ENOTSUP; in cmsdk_ahb_gpio_config()
109 return -ENOTSUP; in cmsdk_ahb_gpio_config()
113 return -ENOTSUP; in cmsdk_ahb_gpio_config()
117 * Setup the pin direction in cmsdk_ahb_gpio_config()
119 * 0 - Input in cmsdk_ahb_gpio_config()
120 * 1 - Output in cmsdk_ahb_gpio_config()
124 gpio_cmsdk_ahb_port_set_bits_raw(dev, mask); in cmsdk_ahb_gpio_config()
126 gpio_cmsdk_ahb_port_clear_bits_raw(dev, mask); in cmsdk_ahb_gpio_config()
128 cfg->port->outenableset = mask; in cmsdk_ahb_gpio_config()
130 cfg->port->outenableclr = mask; in cmsdk_ahb_gpio_config()
133 cfg->port->altfuncclr = mask; in cmsdk_ahb_gpio_config()
139 * @brief Configure pin or port
142 * @param pin The pin number
143 * @param flags Flags of pin or port
148 gpio_pin_t pin, in gpio_cmsdk_ahb_config() argument
151 return cmsdk_ahb_gpio_config(dev, BIT(pin), flags); in gpio_cmsdk_ahb_config()
155 gpio_pin_t pin, in gpio_cmsdk_ahb_pin_interrupt_configure() argument
159 const struct gpio_cmsdk_ahb_cfg * const cfg = dev->config; in gpio_cmsdk_ahb_pin_interrupt_configure()
162 return -ENOTSUP; in gpio_cmsdk_ahb_pin_interrupt_configure()
169 return -ENOTSUP; in gpio_cmsdk_ahb_pin_interrupt_configure()
173 cfg->port->intenclr = BIT(pin); in gpio_cmsdk_ahb_pin_interrupt_configure()
176 cfg->port->inttypeset = BIT(pin); in gpio_cmsdk_ahb_pin_interrupt_configure()
179 cfg->port->inttypeclr = BIT(pin); in gpio_cmsdk_ahb_pin_interrupt_configure()
184 cfg->port->intpolset = BIT(pin); in gpio_cmsdk_ahb_pin_interrupt_configure()
186 cfg->port->intpolclr = BIT(pin); in gpio_cmsdk_ahb_pin_interrupt_configure()
188 cfg->port->intclear = BIT(pin); in gpio_cmsdk_ahb_pin_interrupt_configure()
189 cfg->port->intenset = BIT(pin); in gpio_cmsdk_ahb_pin_interrupt_configure()
197 const struct gpio_cmsdk_ahb_cfg * const cfg = dev->config; in gpio_cmsdk_ahb_isr()
198 struct gpio_cmsdk_ahb_dev_data *data = dev->data; in gpio_cmsdk_ahb_isr()
201 int_stat = cfg->port->intstatus; in gpio_cmsdk_ahb_isr()
204 cfg->port->intclear = int_stat; in gpio_cmsdk_ahb_isr()
206 gpio_fire_callbacks(&data->gpio_cb, dev, int_stat); in gpio_cmsdk_ahb_isr()
214 struct gpio_cmsdk_ahb_dev_data *data = dev->data; in gpio_cmsdk_ahb_manage_callback()
216 return gpio_manage_callback(&data->gpio_cb, callback, set); in gpio_cmsdk_ahb_manage_callback()
238 const struct gpio_cmsdk_ahb_cfg * const cfg = dev->config; in gpio_cmsdk_ahb_init()
245 return -ENODEV; in gpio_cmsdk_ahb_init()
249 clock_control_on(clk, (clock_control_subsys_t) &cfg->gpio_cc_as); in gpio_cmsdk_ahb_init()
250 clock_control_off(clk, (clock_control_subsys_t) &cfg->gpio_cc_ss); in gpio_cmsdk_ahb_init()
251 clock_control_off(clk, (clock_control_subsys_t) &cfg->gpio_cc_dss); in gpio_cmsdk_ahb_init()
255 cfg->gpio_config_func(dev); in gpio_cmsdk_ahb_init()