rt-thread-official/bsp/renesas/ra8d1-ek/board/ports/gpio_cfg.h

96 lines
3.9 KiB
C
Raw Normal View History

2023-12-17 21:19:16 +08:00
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2022-01-19 Sherman first version
*/
/* Number of IRQ channels on the device */
#define RA_IRQ_MAX 16
/* PIN to IRQx table */
#define PIN2IRQX_TABLE(pin) \
{ \
switch (pin) \
{ \
case BSP_IO_PORT_04_PIN_00: \
case BSP_IO_PORT_02_PIN_06: \
case BSP_IO_PORT_01_PIN_05: \
2024-04-11 17:45:38 +08:00
case BSP_IO_PORT_08_PIN_06: \
2023-12-17 21:19:16 +08:00
return 0; \
2024-04-11 17:45:38 +08:00
case BSP_IO_PORT_05_PIN_08: \
2023-12-17 21:19:16 +08:00
case BSP_IO_PORT_01_PIN_01: \
case BSP_IO_PORT_01_PIN_04: \
return 1; \
2024-04-11 17:45:38 +08:00
case BSP_IO_PORT_05_PIN_09: \
2023-12-17 21:19:16 +08:00
case BSP_IO_PORT_01_PIN_00: \
case BSP_IO_PORT_02_PIN_13: \
return 2; \
2024-04-11 17:45:38 +08:00
case BSP_IO_PORT_02_PIN_08: \
case BSP_IO_PORT_05_PIN_10: \
2023-12-17 21:19:16 +08:00
case BSP_IO_PORT_02_PIN_12: \
return 3; \
case BSP_IO_PORT_04_PIN_02: \
2024-04-11 17:45:38 +08:00
case BSP_IO_PORT_03_PIN_00: \
2023-12-17 21:19:16 +08:00
case BSP_IO_PORT_04_PIN_11: \
2024-04-11 17:45:38 +08:00
case BSP_IO_PORT_10_PIN_10: \
2023-12-17 21:19:16 +08:00
return 4; \
case BSP_IO_PORT_04_PIN_01: \
case BSP_IO_PORT_03_PIN_02: \
case BSP_IO_PORT_04_PIN_10: \
2024-04-11 17:45:38 +08:00
case BSP_IO_PORT_10_PIN_09: \
2023-12-17 21:19:16 +08:00
return 5; \
case BSP_IO_PORT_03_PIN_01: \
case BSP_IO_PORT_00_PIN_00: \
case BSP_IO_PORT_04_PIN_09: \
2024-04-11 17:45:38 +08:00
case BSP_IO_PORT_10_PIN_08: \
2023-12-17 21:19:16 +08:00
return 6; \
case BSP_IO_PORT_00_PIN_01: \
case BSP_IO_PORT_04_PIN_08: \
2024-04-11 17:45:38 +08:00
case BSP_IO_PORT_06_PIN_15: \
case BSP_IO_PORT_07_PIN_06: \
2023-12-17 21:19:16 +08:00
return 7; \
case BSP_IO_PORT_00_PIN_02: \
case BSP_IO_PORT_03_PIN_05: \
case BSP_IO_PORT_04_PIN_15: \
2024-04-11 17:45:38 +08:00
case BSP_IO_PORT_07_PIN_07: \
case BSP_IO_PORT_09_PIN_05: \
2023-12-17 21:19:16 +08:00
return 8; \
case BSP_IO_PORT_00_PIN_04: \
case BSP_IO_PORT_03_PIN_04: \
case BSP_IO_PORT_04_PIN_14: \
2024-04-11 17:45:38 +08:00
case BSP_IO_PORT_09_PIN_06: \
2023-12-17 21:19:16 +08:00
return 9; \
case BSP_IO_PORT_00_PIN_05: \
case BSP_IO_PORT_07_PIN_09: \
2024-04-11 17:45:38 +08:00
case BSP_IO_PORT_09_PIN_07: \
2023-12-17 21:19:16 +08:00
return 10; \
case BSP_IO_PORT_05_PIN_01: \
case BSP_IO_PORT_00_PIN_06: \
case BSP_IO_PORT_07_PIN_08: \
2024-04-11 17:45:38 +08:00
case BSP_IO_PORT_08_PIN_00: \
case BSP_IO_PORT_09_PIN_08: \
2023-12-17 21:19:16 +08:00
return 11; \
2024-04-11 17:45:38 +08:00
case BSP_IO_PORT_08_PIN_01: \
2023-12-17 21:19:16 +08:00
case BSP_IO_PORT_00_PIN_08: \
return 12; \
case BSP_IO_PORT_00_PIN_15: \
case BSP_IO_PORT_00_PIN_09: \
return 13; \
case BSP_IO_PORT_04_PIN_03: \
case BSP_IO_PORT_05_PIN_12: \
2024-04-11 17:45:38 +08:00
case BSP_IO_PORT_08_PIN_04: \
case BSP_IO_PORT_00_PIN_10: \
2023-12-17 21:19:16 +08:00
return 14; \
case BSP_IO_PORT_04_PIN_04: \
case BSP_IO_PORT_05_PIN_11: \
2024-04-11 17:45:38 +08:00
case BSP_IO_PORT_08_PIN_08: \
2023-12-17 21:19:16 +08:00
return 15; \
default : \
return -1; \
} \
}