1 /*
2 * Copyright (c) 2019 Derek Hageman <hageman@inthat.cloud>
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7 #ifndef ZEPHYR_DRIVERS_INTERRUPT_CONTROLLER_INTC_SAM0_EIC_PRIV_H_
8 #define ZEPHYR_DRIVERS_INTERRUPT_CONTROLLER_INTC_SAM0_EIC_PRIV_H_
9
10 #include <zephyr/types.h>
11 #include <soc.h>
12
13 /*
14 * Used in the ASF headers, but not always defined by them (looks like they
15 * sometimes define __L instead).
16 */
17 #ifndef _L
18 #define _L(i) i ## L
19 #endif
20
21 /*
22 * Unfortunately the ASF headers define the EIC mappings somewhat painfully:
23 * the macros have both the port letter and are only defined if that pin
24 * has an EIC channel. So we can't just use a macro expansion here, because
25 * some of them might be undefined for a port and we can't test for another
26 * macro definition inside a macro.
27 */
28 static const uint8_t sam0_eic_channels[PORT_GROUPS][32] = {
29 #if PORT_GROUPS >= 1
30 {
31 #ifdef PIN_PA00A_EIC_EXTINT_NUM
32 PIN_PA00A_EIC_EXTINT_NUM,
33 #else
34 0xFF,
35 #endif
36 #ifdef PIN_PA01A_EIC_EXTINT_NUM
37 PIN_PA01A_EIC_EXTINT_NUM,
38 #else
39 0xFF,
40 #endif
41 #ifdef PIN_PA02A_EIC_EXTINT_NUM
42 PIN_PA02A_EIC_EXTINT_NUM,
43 #else
44 0xFF,
45 #endif
46 #ifdef PIN_PA03A_EIC_EXTINT_NUM
47 PIN_PA03A_EIC_EXTINT_NUM,
48 #else
49 0xFF,
50 #endif
51 #ifdef PIN_PA04A_EIC_EXTINT_NUM
52 PIN_PA04A_EIC_EXTINT_NUM,
53 #else
54 0xFF,
55 #endif
56 #ifdef PIN_PA05A_EIC_EXTINT_NUM
57 PIN_PA05A_EIC_EXTINT_NUM,
58 #else
59 0xFF,
60 #endif
61 #ifdef PIN_PA06A_EIC_EXTINT_NUM
62 PIN_PA06A_EIC_EXTINT_NUM,
63 #else
64 0xFF,
65 #endif
66 #ifdef PIN_PA07A_EIC_EXTINT_NUM
67 PIN_PA07A_EIC_EXTINT_NUM,
68 #else
69 0xFF,
70 #endif
71 #ifdef PIN_PA08A_EIC_EXTINT_NUM
72 PIN_PA08A_EIC_EXTINT_NUM,
73 #else
74 0xFF,
75 #endif
76 #ifdef PIN_PA09A_EIC_EXTINT_NUM
77 PIN_PA09A_EIC_EXTINT_NUM,
78 #else
79 0xFF,
80 #endif
81 #ifdef PIN_PA10A_EIC_EXTINT_NUM
82 PIN_PA10A_EIC_EXTINT_NUM,
83 #else
84 0xFF,
85 #endif
86 #ifdef PIN_PA11A_EIC_EXTINT_NUM
87 PIN_PA11A_EIC_EXTINT_NUM,
88 #else
89 0xFF,
90 #endif
91 #ifdef PIN_PA12A_EIC_EXTINT_NUM
92 PIN_PA12A_EIC_EXTINT_NUM,
93 #else
94 0xFF,
95 #endif
96 #ifdef PIN_PA13A_EIC_EXTINT_NUM
97 PIN_PA13A_EIC_EXTINT_NUM,
98 #else
99 0xFF,
100 #endif
101 #ifdef PIN_PA14A_EIC_EXTINT_NUM
102 PIN_PA14A_EIC_EXTINT_NUM,
103 #else
104 0xFF,
105 #endif
106 #ifdef PIN_PA15A_EIC_EXTINT_NUM
107 PIN_PA15A_EIC_EXTINT_NUM,
108 #else
109 0xFF,
110 #endif
111 #ifdef PIN_PA16A_EIC_EXTINT_NUM
112 PIN_PA16A_EIC_EXTINT_NUM,
113 #else
114 0xFF,
115 #endif
116 #ifdef PIN_PA17A_EIC_EXTINT_NUM
117 PIN_PA17A_EIC_EXTINT_NUM,
118 #else
119 0xFF,
120 #endif
121 #ifdef PIN_PA18A_EIC_EXTINT_NUM
122 PIN_PA18A_EIC_EXTINT_NUM,
123 #else
124 0xFF,
125 #endif
126 #ifdef PIN_PA19A_EIC_EXTINT_NUM
127 PIN_PA19A_EIC_EXTINT_NUM,
128 #else
129 0xFF,
130 #endif
131 #ifdef PIN_PA20A_EIC_EXTINT_NUM
132 PIN_PA20A_EIC_EXTINT_NUM,
133 #else
134 0xFF,
135 #endif
136 #ifdef PIN_PA21A_EIC_EXTINT_NUM
137 PIN_PA21A_EIC_EXTINT_NUM,
138 #else
139 0xFF,
140 #endif
141 #ifdef PIN_PA22A_EIC_EXTINT_NUM
142 PIN_PA22A_EIC_EXTINT_NUM,
143 #else
144 0xFF,
145 #endif
146 #ifdef PIN_PA23A_EIC_EXTINT_NUM
147 PIN_PA23A_EIC_EXTINT_NUM,
148 #else
149 0xFF,
150 #endif
151 #ifdef PIN_PA24A_EIC_EXTINT_NUM
152 PIN_PA24A_EIC_EXTINT_NUM,
153 #else
154 0xFF,
155 #endif
156 #ifdef PIN_PA25A_EIC_EXTINT_NUM
157 PIN_PA25A_EIC_EXTINT_NUM,
158 #else
159 0xFF,
160 #endif
161 #ifdef PIN_PA26A_EIC_EXTINT_NUM
162 PIN_PA26A_EIC_EXTINT_NUM,
163 #else
164 0xFF,
165 #endif
166 #ifdef PIN_PA27A_EIC_EXTINT_NUM
167 PIN_PA27A_EIC_EXTINT_NUM,
168 #else
169 0xFF,
170 #endif
171 #ifdef PIN_PA28A_EIC_EXTINT_NUM
172 PIN_PA28A_EIC_EXTINT_NUM,
173 #else
174 0xFF,
175 #endif
176 #ifdef PIN_PA29A_EIC_EXTINT_NUM
177 PIN_PA29A_EIC_EXTINT_NUM,
178 #else
179 0xFF,
180 #endif
181 #ifdef PIN_PA30A_EIC_EXTINT_NUM
182 PIN_PA30A_EIC_EXTINT_NUM,
183 #else
184 0xFF,
185 #endif
186 #ifdef PIN_PA31A_EIC_EXTINT_NUM
187 PIN_PA31A_EIC_EXTINT_NUM,
188 #else
189 0xFF,
190 #endif
191 },
192 #endif
193
194 #if PORT_GROUPS >= 2
195 {
196 #ifdef PIN_PB00A_EIC_EXTINT_NUM
197 PIN_PB00A_EIC_EXTINT_NUM,
198 #else
199 0xFF,
200 #endif
201 #ifdef PIN_PB01A_EIC_EXTINT_NUM
202 PIN_PB01A_EIC_EXTINT_NUM,
203 #else
204 0xFF,
205 #endif
206 #ifdef PIN_PB02A_EIC_EXTINT_NUM
207 PIN_PB02A_EIC_EXTINT_NUM,
208 #else
209 0xFF,
210 #endif
211 #ifdef PIN_PB03A_EIC_EXTINT_NUM
212 PIN_PB03A_EIC_EXTINT_NUM,
213 #else
214 0xFF,
215 #endif
216 #ifdef PIN_PB04A_EIC_EXTINT_NUM
217 PIN_PB04A_EIC_EXTINT_NUM,
218 #else
219 0xFF,
220 #endif
221 #ifdef PIN_PB05A_EIC_EXTINT_NUM
222 PIN_PB05A_EIC_EXTINT_NUM,
223 #else
224 0xFF,
225 #endif
226 #ifdef PIN_PB06A_EIC_EXTINT_NUM
227 PIN_PB06A_EIC_EXTINT_NUM,
228 #else
229 0xFF,
230 #endif
231 #ifdef PIN_PB07A_EIC_EXTINT_NUM
232 PIN_PB07A_EIC_EXTINT_NUM,
233 #else
234 0xFF,
235 #endif
236 #ifdef PIN_PB08A_EIC_EXTINT_NUM
237 PIN_PB08A_EIC_EXTINT_NUM,
238 #else
239 0xFF,
240 #endif
241 #ifdef PIN_PB09A_EIC_EXTINT_NUM
242 PIN_PB09A_EIC_EXTINT_NUM,
243 #else
244 0xFF,
245 #endif
246 #ifdef PIN_PB10A_EIC_EXTINT_NUM
247 PIN_PB10A_EIC_EXTINT_NUM,
248 #else
249 0xFF,
250 #endif
251 #ifdef PIN_PB11A_EIC_EXTINT_NUM
252 PIN_PB11A_EIC_EXTINT_NUM,
253 #else
254 0xFF,
255 #endif
256 #ifdef PIN_PB12A_EIC_EXTINT_NUM
257 PIN_PB12A_EIC_EXTINT_NUM,
258 #else
259 0xFF,
260 #endif
261 #ifdef PIN_PB13A_EIC_EXTINT_NUM
262 PIN_PB13A_EIC_EXTINT_NUM,
263 #else
264 0xFF,
265 #endif
266 #ifdef PIN_PB14A_EIC_EXTINT_NUM
267 PIN_PB14A_EIC_EXTINT_NUM,
268 #else
269 0xFF,
270 #endif
271 #ifdef PIN_PB15A_EIC_EXTINT_NUM
272 PIN_PB15A_EIC_EXTINT_NUM,
273 #else
274 0xFF,
275 #endif
276 #ifdef PIN_PB16A_EIC_EXTINT_NUM
277 PIN_PB16A_EIC_EXTINT_NUM,
278 #else
279 0xFF,
280 #endif
281 #ifdef PIN_PB17A_EIC_EXTINT_NUM
282 PIN_PB17A_EIC_EXTINT_NUM,
283 #else
284 0xFF,
285 #endif
286 #ifdef PIN_PB18A_EIC_EXTINT_NUM
287 PIN_PB18A_EIC_EXTINT_NUM,
288 #else
289 0xFF,
290 #endif
291 #ifdef PIN_PB19A_EIC_EXTINT_NUM
292 PIN_PB19A_EIC_EXTINT_NUM,
293 #else
294 0xFF,
295 #endif
296 #ifdef PIN_PB20A_EIC_EXTINT_NUM
297 PIN_PB20A_EIC_EXTINT_NUM,
298 #else
299 0xFF,
300 #endif
301 #ifdef PIN_PB21A_EIC_EXTINT_NUM
302 PIN_PB21A_EIC_EXTINT_NUM,
303 #else
304 0xFF,
305 #endif
306 #ifdef PIN_PB22A_EIC_EXTINT_NUM
307 PIN_PB22A_EIC_EXTINT_NUM,
308 #else
309 0xFF,
310 #endif
311 #ifdef PIN_PB23A_EIC_EXTINT_NUM
312 PIN_PB23A_EIC_EXTINT_NUM,
313 #else
314 0xFF,
315 #endif
316 #ifdef PIN_PB24A_EIC_EXTINT_NUM
317 PIN_PB24A_EIC_EXTINT_NUM,
318 #else
319 0xFF,
320 #endif
321 #ifdef PIN_PB25A_EIC_EXTINT_NUM
322 PIN_PB25A_EIC_EXTINT_NUM,
323 #else
324 0xFF,
325 #endif
326 #ifdef PIN_PB26A_EIC_EXTINT_NUM
327 PIN_PB26A_EIC_EXTINT_NUM,
328 #else
329 0xFF,
330 #endif
331 #ifdef PIN_PB27A_EIC_EXTINT_NUM
332 PIN_PB27A_EIC_EXTINT_NUM,
333 #else
334 0xFF,
335 #endif
336 #ifdef PIN_PB28A_EIC_EXTINT_NUM
337 PIN_PB28A_EIC_EXTINT_NUM,
338 #else
339 0xFF,
340 #endif
341 #ifdef PIN_PB29A_EIC_EXTINT_NUM
342 PIN_PB29A_EIC_EXTINT_NUM,
343 #else
344 0xFF,
345 #endif
346 #ifdef PIN_PB30A_EIC_EXTINT_NUM
347 PIN_PB30A_EIC_EXTINT_NUM,
348 #else
349 0xFF,
350 #endif
351 #ifdef PIN_PB31A_EIC_EXTINT_NUM
352 PIN_PB31A_EIC_EXTINT_NUM,
353 #else
354 0xFF,
355 #endif
356 },
357 #endif
358
359 #if PORT_GROUPS >= 3
360 {
361 #ifdef PIN_PC00A_EIC_EXTINT_NUM
362 PIN_PC00A_EIC_EXTINT_NUM,
363 #else
364 0xFF,
365 #endif
366 #ifdef PIN_PC01A_EIC_EXTINT_NUM
367 PIN_PC01A_EIC_EXTINT_NUM,
368 #else
369 0xFF,
370 #endif
371 #ifdef PIN_PC02A_EIC_EXTINT_NUM
372 PIN_PC02A_EIC_EXTINT_NUM,
373 #else
374 0xFF,
375 #endif
376 #ifdef PIN_PC03A_EIC_EXTINT_NUM
377 PIN_PC03A_EIC_EXTINT_NUM,
378 #else
379 0xFF,
380 #endif
381 #ifdef PIN_PC04A_EIC_EXTINT_NUM
382 PIN_PC04A_EIC_EXTINT_NUM,
383 #else
384 0xFF,
385 #endif
386 #ifdef PIN_PC05A_EIC_EXTINT_NUM
387 PIN_PC05A_EIC_EXTINT_NUM,
388 #else
389 0xFF,
390 #endif
391 #ifdef PIN_PC06A_EIC_EXTINT_NUM
392 PIN_PC06A_EIC_EXTINT_NUM,
393 #else
394 0xFF,
395 #endif
396 #ifdef PIN_PC07A_EIC_EXTINT_NUM
397 PIN_PC07A_EIC_EXTINT_NUM,
398 #else
399 0xFF,
400 #endif
401 #ifdef PIN_PC08A_EIC_EXTINT_NUM
402 PIN_PC08A_EIC_EXTINT_NUM,
403 #else
404 0xFF,
405 #endif
406 #ifdef PIN_PC09A_EIC_EXTINT_NUM
407 PIN_PC09A_EIC_EXTINT_NUM,
408 #else
409 0xFF,
410 #endif
411 #ifdef PIN_PC10A_EIC_EXTINT_NUM
412 PIN_PC10A_EIC_EXTINT_NUM,
413 #else
414 0xFF,
415 #endif
416 #ifdef PIN_PC11A_EIC_EXTINT_NUM
417 PIN_PC11A_EIC_EXTINT_NUM,
418 #else
419 0xFF,
420 #endif
421 #ifdef PIN_PC12A_EIC_EXTINT_NUM
422 PIN_PC12A_EIC_EXTINT_NUM,
423 #else
424 0xFF,
425 #endif
426 #ifdef PIN_PC13A_EIC_EXTINT_NUM
427 PIN_PC13A_EIC_EXTINT_NUM,
428 #else
429 0xFF,
430 #endif
431 #ifdef PIN_PC14A_EIC_EXTINT_NUM
432 PIN_PC14A_EIC_EXTINT_NUM,
433 #else
434 0xFF,
435 #endif
436 #ifdef PIN_PC15A_EIC_EXTINT_NUM
437 PIN_PC15A_EIC_EXTINT_NUM,
438 #else
439 0xFF,
440 #endif
441 #ifdef PIN_PC16A_EIC_EXTINT_NUM
442 PIN_PC16A_EIC_EXTINT_NUM,
443 #else
444 0xFF,
445 #endif
446 #ifdef PIN_PC17A_EIC_EXTINT_NUM
447 PIN_PC17A_EIC_EXTINT_NUM,
448 #else
449 0xFF,
450 #endif
451 #ifdef PIN_PC18A_EIC_EXTINT_NUM
452 PIN_PC18A_EIC_EXTINT_NUM,
453 #else
454 0xFF,
455 #endif
456 #ifdef PIN_PC19A_EIC_EXTINT_NUM
457 PIN_PC19A_EIC_EXTINT_NUM,
458 #else
459 0xFF,
460 #endif
461 #ifdef PIN_PC20A_EIC_EXTINT_NUM
462 PIN_PC20A_EIC_EXTINT_NUM,
463 #else
464 0xFF,
465 #endif
466 #ifdef PIN_PC21A_EIC_EXTINT_NUM
467 PIN_PC21A_EIC_EXTINT_NUM,
468 #else
469 0xFF,
470 #endif
471 #ifdef PIN_PC22A_EIC_EXTINT_NUM
472 PIN_PC22A_EIC_EXTINT_NUM,
473 #else
474 0xFF,
475 #endif
476 #ifdef PIN_PC23A_EIC_EXTINT_NUM
477 PIN_PC23A_EIC_EXTINT_NUM,
478 #else
479 0xFF,
480 #endif
481 #ifdef PIN_PC24A_EIC_EXTINT_NUM
482 PIN_PC24A_EIC_EXTINT_NUM,
483 #else
484 0xFF,
485 #endif
486 #ifdef PIN_PC25A_EIC_EXTINT_NUM
487 PIN_PC25A_EIC_EXTINT_NUM,
488 #else
489 0xFF,
490 #endif
491 #ifdef PIN_PC26A_EIC_EXTINT_NUM
492 PIN_PC26A_EIC_EXTINT_NUM,
493 #else
494 0xFF,
495 #endif
496 #ifdef PIN_PC27A_EIC_EXTINT_NUM
497 PIN_PC27A_EIC_EXTINT_NUM,
498 #else
499 0xFF,
500 #endif
501 #ifdef PIN_PC28A_EIC_EXTINT_NUM
502 PIN_PC28A_EIC_EXTINT_NUM,
503 #else
504 0xFF,
505 #endif
506 #ifdef PIN_PC29A_EIC_EXTINT_NUM
507 PIN_PC29A_EIC_EXTINT_NUM,
508 #else
509 0xFF,
510 #endif
511 #ifdef PIN_PC30A_EIC_EXTINT_NUM
512 PIN_PC30A_EIC_EXTINT_NUM,
513 #else
514 0xFF,
515 #endif
516 #ifdef PIN_PC31A_EIC_EXTINT_NUM
517 PIN_PC31A_EIC_EXTINT_NUM,
518 #else
519 0xFF,
520 #endif
521 },
522 #endif
523
524 #if PORT_GROUPS >= 4
525 {
526 #ifdef PIN_PD00A_EIC_EXTINT_NUM
527 PIN_PD00A_EIC_EXTINT_NUM,
528 #else
529 0xFF,
530 #endif
531 #ifdef PIN_PD01A_EIC_EXTINT_NUM
532 PIN_PD01A_EIC_EXTINT_NUM,
533 #else
534 0xFF,
535 #endif
536 #ifdef PIN_PD02A_EIC_EXTINT_NUM
537 PIN_PD02A_EIC_EXTINT_NUM,
538 #else
539 0xFF,
540 #endif
541 #ifdef PIN_PD03A_EIC_EXTINT_NUM
542 PIN_PD03A_EIC_EXTINT_NUM,
543 #else
544 0xFF,
545 #endif
546 #ifdef PIN_PD04A_EIC_EXTINT_NUM
547 PIN_PD04A_EIC_EXTINT_NUM,
548 #else
549 0xFF,
550 #endif
551 #ifdef PIN_PD05A_EIC_EXTINT_NUM
552 PIN_PD05A_EIC_EXTINT_NUM,
553 #else
554 0xFF,
555 #endif
556 #ifdef PIN_PD06A_EIC_EXTINT_NUM
557 PIN_PD06A_EIC_EXTINT_NUM,
558 #else
559 0xFF,
560 #endif
561 #ifdef PIN_PD07A_EIC_EXTINT_NUM
562 PIN_PD07A_EIC_EXTINT_NUM,
563 #else
564 0xFF,
565 #endif
566 #ifdef PIN_PD08A_EIC_EXTINT_NUM
567 PIN_PD08A_EIC_EXTINT_NUM,
568 #else
569 0xFF,
570 #endif
571 #ifdef PIN_PD09A_EIC_EXTINT_NUM
572 PIN_PD09A_EIC_EXTINT_NUM,
573 #else
574 0xFF,
575 #endif
576 #ifdef PIN_PD10A_EIC_EXTINT_NUM
577 PIN_PD10A_EIC_EXTINT_NUM,
578 #else
579 0xFF,
580 #endif
581 #ifdef PIN_PD11A_EIC_EXTINT_NUM
582 PIN_PD11A_EIC_EXTINT_NUM,
583 #else
584 0xFF,
585 #endif
586 #ifdef PIN_PD12A_EIC_EXTINT_NUM
587 PIN_PD12A_EIC_EXTINT_NUM,
588 #else
589 0xFF,
590 #endif
591 #ifdef PIN_PD13A_EIC_EXTINT_NUM
592 PIN_PD13A_EIC_EXTINT_NUM,
593 #else
594 0xFF,
595 #endif
596 #ifdef PIN_PD14A_EIC_EXTINT_NUM
597 PIN_PD14A_EIC_EXTINT_NUM,
598 #else
599 0xFF,
600 #endif
601 #ifdef PIN_PD15A_EIC_EXTINT_NUM
602 PIN_PD15A_EIC_EXTINT_NUM,
603 #else
604 0xFF,
605 #endif
606 #ifdef PIN_PD16A_EIC_EXTINT_NUM
607 PIN_PD16A_EIC_EXTINT_NUM,
608 #else
609 0xFF,
610 #endif
611 #ifdef PIN_PD17A_EIC_EXTINT_NUM
612 PIN_PD17A_EIC_EXTINT_NUM,
613 #else
614 0xFF,
615 #endif
616 #ifdef PIN_PD18A_EIC_EXTINT_NUM
617 PIN_PD18A_EIC_EXTINT_NUM,
618 #else
619 0xFF,
620 #endif
621 #ifdef PIN_PD19A_EIC_EXTINT_NUM
622 PIN_PD19A_EIC_EXTINT_NUM,
623 #else
624 0xFF,
625 #endif
626 #ifdef PIN_PD20A_EIC_EXTINT_NUM
627 PIN_PD20A_EIC_EXTINT_NUM,
628 #else
629 0xFF,
630 #endif
631 #ifdef PIN_PD21A_EIC_EXTINT_NUM
632 PIN_PD21A_EIC_EXTINT_NUM,
633 #else
634 0xFF,
635 #endif
636 #ifdef PIN_PD22A_EIC_EXTINT_NUM
637 PIN_PD22A_EIC_EXTINT_NUM,
638 #else
639 0xFF,
640 #endif
641 #ifdef PIN_PD23A_EIC_EXTINT_NUM
642 PIN_PD23A_EIC_EXTINT_NUM,
643 #else
644 0xFF,
645 #endif
646 #ifdef PIN_PD24A_EIC_EXTINT_NUM
647 PIN_PD24A_EIC_EXTINT_NUM,
648 #else
649 0xFF,
650 #endif
651 #ifdef PIN_PD25A_EIC_EXTINT_NUM
652 PIN_PD25A_EIC_EXTINT_NUM,
653 #else
654 0xFF,
655 #endif
656 #ifdef PIN_PD26A_EIC_EXTINT_NUM
657 PIN_PD26A_EIC_EXTINT_NUM,
658 #else
659 0xFF,
660 #endif
661 #ifdef PIN_PD27A_EIC_EXTINT_NUM
662 PIN_PD27A_EIC_EXTINT_NUM,
663 #else
664 0xFF,
665 #endif
666 #ifdef PIN_PD28A_EIC_EXTINT_NUM
667 PIN_PD28A_EIC_EXTINT_NUM,
668 #else
669 0xFF,
670 #endif
671 #ifdef PIN_PD29A_EIC_EXTINT_NUM
672 PIN_PD29A_EIC_EXTINT_NUM,
673 #else
674 0xFF,
675 #endif
676 #ifdef PIN_PD30A_EIC_EXTINT_NUM
677 PIN_PD30A_EIC_EXTINT_NUM,
678 #else
679 0xFF,
680 #endif
681 #ifdef PIN_PD31A_EIC_EXTINT_NUM
682 PIN_PD31A_EIC_EXTINT_NUM,
683 #else
684 0xFF,
685 #endif
686 },
687 #endif
688 };
689
sam0_eic_map_to_line(int port,int pin)690 static inline int sam0_eic_map_to_line(int port, int pin)
691 {
692 uint8_t ch = sam0_eic_channels[port][pin];
693
694 if (ch == 0xFF) {
695 return -ENOTSUP;
696 }
697 return ch;
698 }
699
700 #endif /* ZEPHYR_DRIVERS_INTERRUPT_CONTROLLER_INTC_SAM0_EIC_PRIV_H_ */
701