Lines Matching +full:line +full:- +full:ranges
4 * SPDX-License-Identifier: Apache-2.0
19 /** Unsupported line indicator */
25 /** @brief EXTI line ranges hold by a single ISR */
33 /** @brief EXTI line interrupt callback. */
57 /** @brief Obtain line IRQ number if enabled. */
58 #define EXTI_LINE_IRQ_COND(enabled, line) \ argument
59 COND_CODE_1(enabled, (DT_INST_IRQ_BY_NAME(0, line, irq)), (EXTI_NOTSUP))
92 struct gd32_exti_data *data = dev->data; in gd32_exti_isr()
95 for (uint8_t i = range->min; i <= range->max; i++) { in gd32_exti_isr()
99 if (data->cbs[i].cb != NULL) { in gd32_exti_isr()
100 data->cbs[i].cb(i, data->cbs[i].user); in gd32_exti_isr()
106 void gd32_exti_enable(uint8_t line) in gd32_exti_enable() argument
108 __ASSERT_NO_MSG(line < NUM_EXTI_LINES); in gd32_exti_enable()
109 __ASSERT_NO_MSG(line2irq[line] != EXTI_NOTSUP); in gd32_exti_enable()
111 EXTI_INTEN |= BIT(line); in gd32_exti_enable()
113 irq_enable(line2irq[line]); in gd32_exti_enable()
116 void gd32_exti_disable(uint8_t line) in gd32_exti_disable() argument
118 __ASSERT_NO_MSG(line < NUM_EXTI_LINES); in gd32_exti_disable()
119 __ASSERT_NO_MSG(line2irq[line] != EXTI_NOTSUP); in gd32_exti_disable()
121 EXTI_INTEN &= ~BIT(line); in gd32_exti_disable()
124 void gd32_exti_trigger(uint8_t line, uint8_t trigger) in gd32_exti_trigger() argument
126 __ASSERT_NO_MSG(line < NUM_EXTI_LINES); in gd32_exti_trigger()
127 __ASSERT_NO_MSG(line2irq[line] != EXTI_NOTSUP); in gd32_exti_trigger()
130 EXTI_RTEN |= BIT(line); in gd32_exti_trigger()
132 EXTI_RTEN &= ~BIT(line); in gd32_exti_trigger()
136 EXTI_FTEN |= BIT(line); in gd32_exti_trigger()
138 EXTI_FTEN &= ~BIT(line); in gd32_exti_trigger()
142 int gd32_exti_configure(uint8_t line, gd32_exti_cb_t cb, void *user) in gd32_exti_configure() argument
145 struct gd32_exti_data *data = dev->data; in gd32_exti_configure()
147 __ASSERT_NO_MSG(line < NUM_EXTI_LINES); in gd32_exti_configure()
148 __ASSERT_NO_MSG(line2irq[line] != EXTI_NOTSUP); in gd32_exti_configure()
150 if ((data->cbs[line].cb != NULL) && (cb != NULL)) { in gd32_exti_configure()
151 return -EALREADY; in gd32_exti_configure()
154 data->cbs[line].cb = cb; in gd32_exti_configure()
155 data->cbs[line].user = user; in gd32_exti_configure()