Lines Matching +full:pin +full:- +full:mask
3 * SPDX-License-Identifier: Apache-2.0
7 * @brief Atmel SAM MCU family General-Purpose Input/Output Controller (GPIO)
15 uint32_t mask, uint32_t flags) in configure_common_attr() argument
19 /* Disable interrupts on the pin(s) */ in configure_common_attr()
20 gpio->IERC = mask; in configure_common_attr()
22 /* Configure pull-up(s) */ in configure_common_attr()
24 gpio->PUERS = mask; in configure_common_attr()
26 gpio->PUERC = mask; in configure_common_attr()
29 /* Configure pull-down(s) */ in configure_common_attr()
31 gpio->PDERS = mask; in configure_common_attr()
33 gpio->PDERC = mask; in configure_common_attr()
36 /* Configure open drain (multi-drive) */ in configure_common_attr()
38 gpio->ODMERS = mask; in configure_common_attr()
40 gpio->ODMERC = mask; in configure_common_attr()
45 uint32_t mask, uint32_t flags) in configure_input_attr() argument
51 /* Enable de-bounce, disable de-glitch */ in configure_input_attr()
52 gpio->GFERC = mask; in configure_input_attr()
54 /* Disable de-bounce, enable de-glitch */ in configure_input_attr()
55 gpio->GFERS = mask; in configure_input_attr()
58 gpio->GFERC = mask; in configure_input_attr()
65 gpio->IMR0C = mask; in configure_input_attr()
66 gpio->IMR1C = mask; in configure_input_attr()
70 gpio->IMR0S = mask; in configure_input_attr()
71 gpio->IMR1C = mask; in configure_input_attr()
74 gpio->IMR0C = mask; in configure_input_attr()
75 gpio->IMR1S = mask; in configure_input_attr()
78 /* Enable interrupts on the pin(s) */ in configure_input_attr()
79 gpio->IERS = mask; in configure_input_attr()
81 gpio->IERC = mask; in configure_input_attr()
85 void soc_gpio_configure(const struct soc_gpio_pin *pin) in soc_gpio_configure() argument
87 uint32_t mask = pin->mask; in soc_gpio_configure() local
88 volatile Gpio *gpio = pin->regs; in soc_gpio_configure()
89 uint8_t periph_id = pin->periph_id; in soc_gpio_configure()
90 uint32_t flags = pin->flags; in soc_gpio_configure()
91 uint32_t type = pin->flags & SOC_GPIO_FUNC_MASK; in soc_gpio_configure()
93 /* Configure pin attributes common to all functions */ in soc_gpio_configure()
94 configure_common_attr(gpio, mask, flags); in soc_gpio_configure()
98 gpio->PMR0C = mask; in soc_gpio_configure()
99 gpio->PMR1C = mask; in soc_gpio_configure()
100 gpio->PMR2C = mask; in soc_gpio_configure()
101 gpio->GPERC = mask; in soc_gpio_configure()
105 gpio->PMR0S = mask; in soc_gpio_configure()
106 gpio->PMR1C = mask; in soc_gpio_configure()
107 gpio->PMR2C = mask; in soc_gpio_configure()
108 gpio->GPERC = mask; in soc_gpio_configure()
112 gpio->PMR0C = mask; in soc_gpio_configure()
113 gpio->PMR1S = mask; in soc_gpio_configure()
114 gpio->PMR2C = mask; in soc_gpio_configure()
115 gpio->GPERC = mask; in soc_gpio_configure()
119 gpio->PMR0S = mask; in soc_gpio_configure()
120 gpio->PMR1S = mask; in soc_gpio_configure()
121 gpio->PMR2C = mask; in soc_gpio_configure()
122 gpio->GPERC = mask; in soc_gpio_configure()
126 gpio->PMR0C = mask; in soc_gpio_configure()
127 gpio->PMR1C = mask; in soc_gpio_configure()
128 gpio->PMR2S = mask; in soc_gpio_configure()
129 gpio->GPERC = mask; in soc_gpio_configure()
133 gpio->PMR0S = mask; in soc_gpio_configure()
134 gpio->PMR1C = mask; in soc_gpio_configure()
135 gpio->PMR2S = mask; in soc_gpio_configure()
136 gpio->GPERC = mask; in soc_gpio_configure()
140 gpio->PMR0C = mask; in soc_gpio_configure()
141 gpio->PMR1S = mask; in soc_gpio_configure()
142 gpio->PMR2S = mask; in soc_gpio_configure()
143 gpio->GPERC = mask; in soc_gpio_configure()
147 gpio->PMR0S = mask; in soc_gpio_configure()
148 gpio->PMR1S = mask; in soc_gpio_configure()
149 gpio->PMR2S = mask; in soc_gpio_configure()
150 gpio->GPERC = mask; in soc_gpio_configure()
155 configure_input_attr(gpio, mask, flags); in soc_gpio_configure()
157 gpio->ODERC = mask; in soc_gpio_configure()
158 gpio->STERS = mask; in soc_gpio_configure()
159 gpio->GPERS = mask; in soc_gpio_configure()
165 gpio->OVRS = mask; in soc_gpio_configure()
167 gpio->OVRC = mask; in soc_gpio_configure()
170 gpio->ODCR0S = mask; in soc_gpio_configure()
171 gpio->ODCR1S = mask; in soc_gpio_configure()
172 gpio->ODERS = mask; in soc_gpio_configure()
173 gpio->STERC = mask; in soc_gpio_configure()
174 gpio->GPERS = mask; in soc_gpio_configure()
178 __ASSERT(0, "Unsupported pin function, check pin.flags value"); in soc_gpio_configure()