Lines Matching +full:backup +full:- +full:regs
4 * SPDX-License-Identifier: Apache-2.0
16 #include <zephyr/dt-bindings/gpio/numicro-gpio.h>
31 GPIO_T *regs; member
41 * backup of the INTEN register.
52 const struct gpio_numicro_config *cfg = dev->config; in gpio_numicro_configure()
53 GPIO_T * const regs = cfg->regs; in gpio_numicro_configure() local
70 return -ENOTSUP; in gpio_numicro_configure()
103 regs->MODE = (regs->MODE & ~MODE_MASK(pin)) | in gpio_numicro_configure()
105 regs->DBEN = (regs->DBEN & ~BIT(pin)) | (debounce_enable << pin); in gpio_numicro_configure()
106 regs->SMTEN = (regs->SMTEN & ~BIT(pin)) | (schmitt_enable << pin); in gpio_numicro_configure()
107 regs->DINOFF = (regs->DINOFF & ~DINOFF_MASK(pin)) | in gpio_numicro_configure()
109 regs->PUSEL = (regs->PUSEL & ~PUSEL_MASK(pin)) | in gpio_numicro_configure()
117 const struct gpio_numicro_config *cfg = dev->config; in gpio_numicro_port_get_raw()
119 *value = cfg->regs->PIN & PORT_PIN_MASK; in gpio_numicro_port_get_raw()
128 const struct gpio_numicro_config *cfg = dev->config; in gpio_numicro_port_set_masked_raw()
130 cfg->regs->DATMSK = ~mask; in gpio_numicro_port_set_masked_raw()
131 cfg->regs->DOUT = value; in gpio_numicro_port_set_masked_raw()
139 const struct gpio_numicro_config *cfg = dev->config; in gpio_numicro_port_set_bits_raw()
141 cfg->regs->DATMSK = ~mask; in gpio_numicro_port_set_bits_raw()
142 cfg->regs->DOUT = PORT_PIN_MASK; in gpio_numicro_port_set_bits_raw()
150 const struct gpio_numicro_config *cfg = dev->config; in gpio_numicro_port_clear_bits_raw()
152 cfg->regs->DATMSK = ~mask; in gpio_numicro_port_clear_bits_raw()
153 cfg->regs->DOUT = 0; in gpio_numicro_port_clear_bits_raw()
160 const struct gpio_numicro_config *cfg = dev->config; in gpio_numicro_port_toggle_bits()
162 cfg->regs->DATMSK = 0; in gpio_numicro_port_toggle_bits()
163 cfg->regs->DOUT ^= mask; in gpio_numicro_port_toggle_bits()
172 const struct gpio_numicro_config *cfg = dev->config; in gpio_numicro_pin_interrupt_configure()
174 struct gpio_numicro_data *data = dev->data; in gpio_numicro_pin_interrupt_configure()
182 cfg->regs->INTEN &= ~(BIT(pin) | BIT(pin + 16)); in gpio_numicro_pin_interrupt_configure()
185 cfg->regs->INTEN |= data->interrupt_en_reg_bak & (BIT(pin) | BIT(pin + 16)); in gpio_numicro_pin_interrupt_configure()
204 return -EINVAL; in gpio_numicro_pin_interrupt_configure()
208 cfg->regs->INTTYPE = (cfg->regs->INTTYPE & ~BIT(pin)) | (int_type << pin); in gpio_numicro_pin_interrupt_configure()
209 cfg->regs->INTEN = (cfg->regs->INTEN & ~int_level_mask) | int_level; in gpio_numicro_pin_interrupt_configure()
211 data->interrupt_en_reg_bak = cfg->regs->INTEN; in gpio_numicro_pin_interrupt_configure()
221 struct gpio_numicro_data *data = dev->data; in gpio_numicro_manage_callback()
223 return gpio_manage_callback(&data->callbacks, callback, set); in gpio_numicro_manage_callback()
228 const struct gpio_numicro_config *cfg = dev->config; in gpio_numicro_isr()
229 struct gpio_numicro_data *data = dev->data; in gpio_numicro_isr()
232 int_status = cfg->regs->INTSRC; in gpio_numicro_isr()
235 cfg->regs->INTSRC = int_status; in gpio_numicro_isr()
237 gpio_fire_callbacks(&data->callbacks, dev, int_status); in gpio_numicro_isr()
268 .regs = (GPIO_T *)DT_INST_REG_ADDR(n), \