Lines Matching full:i
130 int i; in nrf_gpio_irq_handler() local
138 for (i = 0; i < NRF_GPIO_MAX_IRQ; i++) in nrf_gpio_irq_handler()
140 if ((!nrf_gpio_irqs[i].func) || in nrf_gpio_irq_handler()
141 (nrf_gpio_irqs[i].sense_trig == NRF_GPIO_SENSE_TRIG_NONE)) in nrf_gpio_irq_handler()
146 gpio_port = NRF_GPIO_PORT(nrf_gpio_irqs[i].pin); in nrf_gpio_irq_handler()
147 pin_index = NRF_GPIO_INDEX(nrf_gpio_irqs[i].pin); in nrf_gpio_irq_handler()
162 pin_state = (gpio_state >> nrf_gpio_irqs[i].pin) & 0x01; in nrf_gpio_irq_handler()
186 if ((nrf_gpio_irqs[i].sense_trig == NRF_GPIO_SENSE_TRIG_BOTH) || in nrf_gpio_irq_handler()
187 (nrf_gpio_irqs[i].sense_trig == sense_trig)) in nrf_gpio_irq_handler()
189 nrf_gpio_irqs[i].func(nrf_gpio_irqs[i].args); in nrf_gpio_irq_handler()
193 for (i = 0; i < NRF_GPIO_MAX_IRQ; i++) in nrf_gpio_irq_handler()
195 if (NRF_GPIOTE->EVENTS_IN[i] && (NRF_GPIOTE->INTENSET & (1 << i))) in nrf_gpio_irq_handler()
197 NRF_GPIOTE->EVENTS_IN[i] = 0; in nrf_gpio_irq_handler()
198 if (nrf_gpio_irqs[i].func) in nrf_gpio_irq_handler()
200 nrf_gpio_irqs[i].func(nrf_gpio_irqs[i].args); in nrf_gpio_irq_handler()
235 int i; in hal_gpio_find_empty_slot() local
237 for (i = 0; i < NRF_GPIO_MAX_IRQ; i++) in hal_gpio_find_empty_slot()
239 if (nrf_gpio_irqs[i].func == NULL) in hal_gpio_find_empty_slot()
241 return i; in hal_gpio_find_empty_slot()
252 int i; in nrf_gpio_find_pin() local
255 for (i = 0; i < NRF_GPIO_MAX_IRQ; i++) in nrf_gpio_find_pin()
257 if (nrf_gpio_irqs[i].func && nrf_gpio_irqs[i].pin == pin) in nrf_gpio_find_pin()
259 return i; in nrf_gpio_find_pin()
265 for (i = 0; i < NRF_GPIO_MAX_IRQ; i++) in nrf_gpio_find_pin()
267 if (nrf_gpio_irqs[i].func && in nrf_gpio_find_pin()
268 (NRF_GPIOTE->CONFIG[i] & NRF_GPIOTE_PIN_MASK) == pin) in nrf_gpio_find_pin()
270 return i; in nrf_gpio_find_pin()
282 int i; in nrf_pin_attach_irq() local
285 i = hal_gpio_find_empty_slot(); in nrf_pin_attach_irq()
286 if (i < 0) in nrf_pin_attach_irq()
293 nrf_gpio_irqs[i].pin = pin; in nrf_pin_attach_irq()
298 nrf_gpio_irqs[i].sense_trig = NRF_GPIO_SENSE_TRIG_HIGH; in nrf_pin_attach_irq()
301 nrf_gpio_irqs[i].sense_trig = NRF_GPIO_SENSE_TRIG_LOW; in nrf_pin_attach_irq()
304 nrf_gpio_irqs[i].sense_trig = NRF_GPIO_SENSE_TRIG_BOTH; in nrf_pin_attach_irq()
307 nrf_gpio_irqs[i].sense_trig = NRF_GPIO_SENSE_TRIG_NONE; in nrf_pin_attach_irq()
328 NRF_GPIOTE->CONFIG[i] = conf; in nrf_pin_attach_irq()
331 nrf_gpio_irqs[i].func = hdr; in nrf_pin_attach_irq()
332 nrf_gpio_irqs[i].args = args; in nrf_pin_attach_irq()
341 int i; in nrf_pin_detach_irq() local
343 i = nrf_gpio_find_pin(pin); in nrf_pin_detach_irq()
344 if (i < 0) in nrf_pin_detach_irq()
352 nrf_gpio_irqs[i].sense_trig = NRF_GPIO_SENSE_TRIG_NONE; in nrf_pin_detach_irq()
354 NRF_GPIOTE->CONFIG[i] = 0; in nrf_pin_detach_irq()
355 NRF_GPIOTE->EVENTS_IN[i] = 0; in nrf_pin_detach_irq()
358 nrf_gpio_irqs[i].args = NULL; in nrf_pin_detach_irq()
359 nrf_gpio_irqs[i].func = NULL; in nrf_pin_detach_irq()
370 int i; in nrf_pin_irq_enable() local
372 i = nrf_gpio_find_pin(pin); in nrf_pin_irq_enable()
373 if (i < 0) in nrf_pin_irq_enable()
402 for (i = 0; i < NRF_GPIO_MAX_IRQ; i++) in nrf_pin_irq_enable()
404 if (nrf_gpio_irqs[i].sense_trig != NRF_GPIO_SENSE_TRIG_NONE) in nrf_pin_irq_enable()
418 NRF_GPIOTE->EVENTS_IN[i] = 0; in nrf_pin_irq_enable()
419 NRF_GPIOTE->INTENSET = 1 << i; in nrf_pin_irq_enable()
423 NRF_GPIOTE->INTENCLR = 1 << i; in nrf_pin_irq_enable()