pin_mux.c 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*
  2. * Copyright 2020-2021 NXP
  3. * All rights reserved.
  4. *
  5. * SPDX-License-Identifier: BSD-3-Clause
  6. */
  7. /***********************************************************************************************************************
  8. * This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file
  9. * will be overwritten if the respective MCUXpresso Config Tools is used to update this file.
  10. **********************************************************************************************************************/
  11. /*
  12. * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
  13. !!GlobalInfo
  14. product: Pins v9.0
  15. processor: MIMXRT1176xxxxx
  16. package_id: MIMXRT1176DVMAA
  17. mcu_data: ksdk2_0
  18. processor_version: 0.9.6
  19. * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
  20. */
  21. #include "fsl_common.h"
  22. #include "fsl_iomuxc.h"
  23. #include "fsl_gpio.h"
  24. #include "pin_mux.h"
  25. /* FUNCTION ************************************************************************************************************
  26. *
  27. * Function Name : BOARD_InitBootPins
  28. * Description : Calls initialization functions.
  29. *
  30. * END ****************************************************************************************************************/
  31. void BOARD_InitBootPins(void) {
  32. BOARD_InitPins();
  33. }
  34. /*
  35. * TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
  36. BOARD_InitPins:
  37. - options: {callFromInitBoot: 'true', coreID: cm7, enableClock: 'true'}
  38. - pin_list:
  39. - {pin_num: M15, peripheral: LPUART1, signal: RXD, pin_signal: GPIO_AD_25, software_input_on: Disable, pull_up_down_config: Pull_Down, pull_keeper_select: Keeper,
  40. open_drain: Disable, drive_strength: High, slew_rate: Slow}
  41. - {pin_num: L13, peripheral: LPUART1, signal: TXD, pin_signal: GPIO_AD_24, software_input_on: Disable, pull_up_down_config: Pull_Down, pull_keeper_select: Keeper,
  42. open_drain: Disable, drive_strength: High, slew_rate: Slow}
  43. - {pin_num: D6, peripheral: ARM, signal: arm_trace_swo, pin_signal: GPIO_DISP_B2_07, software_input_on: Disable, pull_up_down_config: Pull_Down, pull_keeper_select: Keeper,
  44. open_drain: Disable, drive_strength: High, slew_rate: Slow}
  45. * BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
  46. */
  47. /* FUNCTION ************************************************************************************************************
  48. *
  49. * Function Name : BOARD_InitPins, assigned for the Cortex-M7F core.
  50. * Description : Configures pin routing and optionally pin electrical features.
  51. *
  52. * END ****************************************************************************************************************/
  53. void BOARD_InitPins(void) {
  54. CLOCK_EnableClock(kCLOCK_Iomuxc); /* LPCG on: LPCG is ON. */
  55. CLOCK_EnableClock(kCLOCK_Iomuxc_Lpsr); /* LPCG on: LPCG is ON. */
  56. /* GPIO configuration on GPIO_AD_04 (pin M13) */
  57. gpio_pin_config_t gpio9_pinM13_config = {
  58. .direction = kGPIO_DigitalOutput,
  59. .outputLogic = 0U,
  60. .interruptMode = kGPIO_NoIntmode
  61. };
  62. /* Initialize GPIO functionality on GPIO_AD_04 (pin M13) */
  63. GPIO_PinInit(GPIO9, 3U, &gpio9_pinM13_config);
  64. /* GPIO configuration on GPIO_AD_26 (pin L14) */
  65. gpio_pin_config_t gpio9_pinL14_config = {
  66. .direction = kGPIO_DigitalOutput,
  67. .outputLogic = 0U,
  68. .interruptMode = kGPIO_NoIntmode
  69. };
  70. /* Initialize GPIO functionality on GPIO_AD_04 (pin L14) */
  71. GPIO_PinInit(GPIO9, 25U, &gpio9_pinL14_config);
  72. IOMUXC_SetPinMux(
  73. IOMUXC_GPIO_AD_04_GPIO9_IO03, /* GPIO_AD_04 is configured as GPIO9_IO03 */
  74. 0U);
  75. IOMUXC_SetPinMux(
  76. IOMUXC_GPIO_AD_26_GPIO9_IO25, /* GPIO_AD_04 is configured as GPIO9_IO03 */
  77. 0U);
  78. IOMUXC_SetPinMux(
  79. IOMUXC_GPIO_AD_24_LPUART1_TXD, /* GPIO_AD_24 is configured as LPUART1_TXD */
  80. 0U); /* Software Input On Field: Input Path is determined by functionality */
  81. IOMUXC_SetPinMux(
  82. IOMUXC_GPIO_AD_25_LPUART1_RXD, /* GPIO_AD_25 is configured as LPUART1_RXD */
  83. 0U); /* Software Input On Field: Input Path is determined by functionality */
  84. IOMUXC_SetPinMux(
  85. IOMUXC_GPIO_DISP_B2_07_ARM_TRACE_SWO, /* GPIO_DISP_B2_07 is configured as ARM_TRACE_SWO */
  86. 0U); /* Software Input On Field: Input Path is determined by functionality */
  87. IOMUXC_SetPinConfig(
  88. IOMUXC_GPIO_AD_24_LPUART1_TXD, /* GPIO_AD_24 PAD functional properties : */
  89. 0x02U); /* Slew Rate Field: Slow Slew Rate
  90. Drive Strength Field: high drive strength
  91. Pull / Keep Select Field: Pull Disable, Highz
  92. Pull Up / Down Config. Field: Weak pull down
  93. Open Drain Field: Disabled
  94. Domain write protection: Both cores are allowed
  95. Domain write protection lock: Neither of DWP bits is locked */
  96. IOMUXC_SetPinConfig(
  97. IOMUXC_GPIO_AD_25_LPUART1_RXD, /* GPIO_AD_25 PAD functional properties : */
  98. 0x02U); /* Slew Rate Field: Slow Slew Rate
  99. Drive Strength Field: high drive strength
  100. Pull / Keep Select Field: Pull Disable, Highz
  101. Pull Up / Down Config. Field: Weak pull down
  102. Open Drain Field: Disabled
  103. Domain write protection: Both cores are allowed
  104. Domain write protection lock: Neither of DWP bits is locked */
  105. IOMUXC_SetPinConfig(
  106. IOMUXC_GPIO_DISP_B2_07_ARM_TRACE_SWO, /* GPIO_DISP_B2_07 PAD functional properties : */
  107. 0x02U); /* Slew Rate Field: Slow Slew Rate
  108. Drive Strength Field: high drive strength
  109. Pull / Keep Select Field: Pull Disable, Highz
  110. Pull Up / Down Config. Field: Weak pull down
  111. Open Drain Field: Disabled
  112. Domain write protection: Both cores are allowed
  113. Domain write protection lock: Neither of DWP bits is locked */
  114. }
  115. /***********************************************************************************************************************
  116. * EOF
  117. **********************************************************************************************************************/