pin_data.c 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /* generated pin source file - do not edit */
  2. #include "bsp_api.h"
  3. #include "r_ioport_api.h"
  4. const ioport_pin_cfg_t g_bsp_pin_cfg_data[] = {
  5. {
  6. .pin = BSP_IO_PORT_00_PIN_00,
  7. .pin_cfg = ((uint32_t) IOPORT_CFG_ANALOG_ENABLE)
  8. },
  9. {
  10. .pin = BSP_IO_PORT_00_PIN_01,
  11. .pin_cfg = ((uint32_t) IOPORT_CFG_ANALOG_ENABLE)
  12. },
  13. {
  14. .pin = BSP_IO_PORT_00_PIN_02,
  15. .pin_cfg = ((uint32_t) IOPORT_CFG_ANALOG_ENABLE)
  16. },
  17. {
  18. .pin = BSP_IO_PORT_00_PIN_03,
  19. .pin_cfg = ((uint32_t) IOPORT_CFG_ANALOG_ENABLE)
  20. },
  21. {
  22. .pin = BSP_IO_PORT_00_PIN_08,
  23. .pin_cfg = ((uint32_t) IOPORT_CFG_ANALOG_ENABLE)
  24. },
  25. {
  26. .pin = BSP_IO_PORT_00_PIN_14,
  27. .pin_cfg = ((uint32_t) IOPORT_CFG_ANALOG_ENABLE)
  28. },
  29. {
  30. .pin = BSP_IO_PORT_01_PIN_08,
  31. .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_DEBUG)
  32. },
  33. {
  34. .pin = BSP_IO_PORT_01_PIN_09,
  35. .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_SCI1_3_5_7_9)
  36. },
  37. {
  38. .pin = BSP_IO_PORT_01_PIN_10,
  39. .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_SCI1_3_5_7_9)
  40. },
  41. {
  42. .pin = BSP_IO_PORT_02_PIN_05,
  43. .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_SCI0_2_4_6_8)
  44. },
  45. {
  46. .pin = BSP_IO_PORT_02_PIN_06,
  47. .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_SCI0_2_4_6_8)
  48. },
  49. {
  50. .pin = BSP_IO_PORT_03_PIN_00,
  51. .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_DEBUG)
  52. },
  53. {
  54. .pin = BSP_IO_PORT_05_PIN_08,
  55. .pin_cfg = ((uint32_t) IOPORT_CFG_ANALOG_ENABLE)
  56. },
  57. {
  58. .pin = BSP_IO_PORT_05_PIN_12,
  59. .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_GPT1)
  60. },
  61. {
  62. .pin = BSP_IO_PORT_06_PIN_04,
  63. .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_GPT1)
  64. },
  65. {
  66. .pin = BSP_IO_PORT_06_PIN_05,
  67. .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_GPT1)
  68. },
  69. {
  70. .pin = BSP_IO_PORT_07_PIN_12,
  71. .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_GPT1)
  72. },
  73. };
  74. const ioport_cfg_t g_bsp_pin_cfg = {
  75. .number_of_pins = sizeof(g_bsp_pin_cfg_data)/sizeof(ioport_pin_cfg_t),
  76. .p_pin_cfg_data = &g_bsp_pin_cfg_data[0],
  77. };
  78. #if BSP_TZ_SECURE_BUILD
  79. void R_BSP_PinCfgSecurityInit(void);
  80. /* Initialize SAR registers for secure pins. */
  81. void R_BSP_PinCfgSecurityInit(void)
  82. {
  83. #if (2U == BSP_FEATURE_IOPORT_VERSION)
  84. uint32_t pmsar[BSP_FEATURE_BSP_NUM_PMSAR];
  85. #else
  86. uint16_t pmsar[BSP_FEATURE_BSP_NUM_PMSAR];
  87. #endif
  88. memset(pmsar, 0xFF, BSP_FEATURE_BSP_NUM_PMSAR * sizeof(R_PMISC->PMSAR[0]));
  89. for(uint32_t i = 0; i < g_bsp_pin_cfg.number_of_pins; i++)
  90. {
  91. uint32_t port_pin = g_bsp_pin_cfg.p_pin_cfg_data[i].pin;
  92. uint32_t port = port_pin >> 8U;
  93. uint32_t pin = port_pin & 0xFFU;
  94. pmsar[port] &= (uint16_t) ~(1U << pin);
  95. }
  96. for(uint32_t i = 0; i < BSP_FEATURE_BSP_NUM_PMSAR; i++)
  97. {
  98. #if (2U == BSP_FEATURE_IOPORT_VERSION)
  99. R_PMISC->PMSAR[i].PMSAR = (uint16_t) pmsar[i];
  100. #else
  101. R_PMISC->PMSAR[i].PMSAR = pmsar[i];
  102. #endif
  103. }
  104. }
  105. #endif