pin_data.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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_01_PIN_08,
  7. .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_DEBUG)
  8. },
  9. {
  10. .pin = BSP_IO_PORT_01_PIN_09,
  11. .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_DEBUG)
  12. },
  13. {
  14. .pin = BSP_IO_PORT_01_PIN_10,
  15. .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_DEBUG)
  16. },
  17. {
  18. .pin = BSP_IO_PORT_03_PIN_00,
  19. .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_DEBUG)
  20. },
  21. {
  22. .pin = BSP_IO_PORT_04_PIN_01,
  23. .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_SCI1_3_5_7_9)
  24. },
  25. {
  26. .pin = BSP_IO_PORT_04_PIN_02,
  27. .pin_cfg = ((uint32_t) IOPORT_CFG_PERIPHERAL_PIN | (uint32_t) IOPORT_PERIPHERAL_SCI1_3_5_7_9)
  28. },
  29. };
  30. const ioport_cfg_t g_bsp_pin_cfg = {
  31. .number_of_pins = sizeof(g_bsp_pin_cfg_data)/sizeof(ioport_pin_cfg_t),
  32. .p_pin_cfg_data = &g_bsp_pin_cfg_data[0],
  33. };
  34. #if BSP_TZ_SECURE_BUILD
  35. void R_BSP_PinCfgSecurityInit(void);
  36. /* Initialize SAR registers for secure pins. */
  37. void R_BSP_PinCfgSecurityInit(void)
  38. {
  39. #if (2U == BSP_FEATURE_IOPORT_VERSION)
  40. uint32_t pmsar[BSP_FEATURE_BSP_NUM_PMSAR];
  41. #else
  42. uint16_t pmsar[BSP_FEATURE_BSP_NUM_PMSAR];
  43. #endif
  44. memset(pmsar, 0xFF, BSP_FEATURE_BSP_NUM_PMSAR * sizeof(R_PMISC->PMSAR[0]));
  45. for(uint32_t i = 0; i < g_bsp_pin_cfg.number_of_pins; i++)
  46. {
  47. uint32_t port_pin = g_bsp_pin_cfg.p_pin_cfg_data[i].pin;
  48. uint32_t port = port_pin >> 8U;
  49. uint32_t pin = port_pin & 0xFFU;
  50. pmsar[port] &= (uint16_t) ~(1U << pin);
  51. }
  52. for(uint32_t i = 0; i < BSP_FEATURE_BSP_NUM_PMSAR; i++)
  53. {
  54. #if (2U == BSP_FEATURE_IOPORT_VERSION)
  55. R_PMISC->PMSAR[i].PMSAR = (uint16_t) pmsar[i];
  56. #else
  57. R_PMISC->PMSAR[i].PMSAR = pmsar[i];
  58. #endif
  59. }
  60. }
  61. #endif