pwm3_iomux_config.c 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * Copyright (c) 2012, Freescale Semiconductor, Inc.
  3. * All rights reserved.
  4. *
  5. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  6. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  7. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  8. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
  9. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  10. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  11. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  12. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  13. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  14. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  15. */
  16. // File: pwm3_iomux_config.c
  17. /* ------------------------------------------------------------------------------
  18. * <auto-generated>
  19. * This code was generated by a tool.
  20. * Runtime Version:3.4.0.0
  21. *
  22. * Changes to this file may cause incorrect behavior and will be lost if
  23. * the code is regenerated.
  24. * </auto-generated>
  25. * ------------------------------------------------------------------------------
  26. */
  27. #include "iomux_config.h"
  28. #include "registers/regsiomuxc.h"
  29. // Function to configure IOMUXC for pwm3 module.
  30. void pwm3_iomux_config(void)
  31. {
  32. // Config pwm3.PWM3_OUT to pad SD4_DATA1(B19)
  33. // HW_IOMUXC_SW_MUX_CTL_PAD_SD4_DATA1_WR(0x00000002);
  34. // HW_IOMUXC_SW_PAD_CTL_PAD_SD4_DATA1_WR(0x0001B0B0);
  35. // Mux Register:
  36. // IOMUXC_SW_MUX_CTL_PAD_SD4_DATA1(0x020E0344)
  37. // SION [4] - Software Input On Field Reset: DISABLED
  38. // Force the selected mux mode Input path no matter of MUX_MODE functionality.
  39. // DISABLED (0) - Input Path is determined by functionality of the selected mux mode (regular).
  40. // ENABLED (1) - Force input path of pad.
  41. // MUX_MODE [2:0] - MUX Mode Select Field Reset: ALT5
  42. // Select iomux modes to be used for pad.
  43. // ALT1 (1) - Select instance: usdhc4 signal: SD4_DATA1
  44. // ALT2 (2) - Select instance: pwm3 signal: PWM3_OUT
  45. // ALT5 (5) - Select instance: gpio2 signal: GPIO2_IO09
  46. HW_IOMUXC_SW_MUX_CTL_PAD_SD4_DATA1_WR(
  47. BF_IOMUXC_SW_MUX_CTL_PAD_SD4_DATA1_SION_V(DISABLED) |
  48. BF_IOMUXC_SW_MUX_CTL_PAD_SD4_DATA1_MUX_MODE_V(ALT2));
  49. // Pad Control Register:
  50. // IOMUXC_SW_PAD_CTL_PAD_SD4_DATA1(0x020E072C)
  51. // HYS [16] - Hysteresis Enable Field Reset: ENABLED
  52. // DISABLED (0) - CMOS input
  53. // ENABLED (1) - Schmitt trigger input
  54. // PUS [15:14] - Pull Up / Down Config. Field Reset: 100K_OHM_PU
  55. // 100K_OHM_PD (0) - 100K Ohm Pull Down
  56. // 47K_OHM_PU (1) - 47K Ohm Pull Up
  57. // 100K_OHM_PU (2) - 100K Ohm Pull Up
  58. // 22K_OHM_PU (3) - 22K Ohm Pull Up
  59. // PUE [13] - Pull / Keep Select Field Reset: PULL
  60. // KEEP (0) - Keeper Enabled
  61. // PULL (1) - Pull Enabled
  62. // PKE [12] - Pull / Keep Enable Field Reset: ENABLED
  63. // DISABLED (0) - Pull/Keeper Disabled
  64. // ENABLED (1) - Pull/Keeper Enabled
  65. // ODE [11] - Open Drain Enable Field Reset: DISABLED
  66. // Enables open drain of the pin.
  67. // DISABLED (0) - Output is CMOS.
  68. // ENABLED (1) - Output is Open Drain.
  69. // SPEED [7:6] - Speed Field Reset: 100MHZ
  70. // RESERVED0 (0) - Reserved
  71. // 50MHZ (1) - Low (50 MHz)
  72. // 100MHZ (2) - Medium (100 MHz)
  73. // 200MHZ (3) - Maximum (200 MHz)
  74. // DSE [5:3] - Drive Strength Field Reset: 40_OHM
  75. // HIZ (0) - HI-Z
  76. // 240_OHM (1) - 240 Ohm
  77. // 120_OHM (2) - 120 Ohm
  78. // 80_OHM (3) - 80 Ohm
  79. // 60_OHM (4) - 60 Ohm
  80. // 48_OHM (5) - 48 Ohm
  81. // 40_OHM (6) - 40 Ohm
  82. // 34_OHM (7) - 34 Ohm
  83. // SRE [0] - Slew Rate Field Reset: SLOW
  84. // Slew rate control.
  85. // SLOW (0) - Slow Slew Rate
  86. // FAST (1) - Fast Slew Rate
  87. HW_IOMUXC_SW_PAD_CTL_PAD_SD4_DATA1_WR(
  88. BF_IOMUXC_SW_PAD_CTL_PAD_SD4_DATA1_HYS_V(ENABLED) |
  89. BF_IOMUXC_SW_PAD_CTL_PAD_SD4_DATA1_PUS_V(100K_OHM_PU) |
  90. BF_IOMUXC_SW_PAD_CTL_PAD_SD4_DATA1_PUE_V(PULL) |
  91. BF_IOMUXC_SW_PAD_CTL_PAD_SD4_DATA1_PKE_V(ENABLED) |
  92. BF_IOMUXC_SW_PAD_CTL_PAD_SD4_DATA1_ODE_V(DISABLED) |
  93. BF_IOMUXC_SW_PAD_CTL_PAD_SD4_DATA1_SPEED_V(100MHZ) |
  94. BF_IOMUXC_SW_PAD_CTL_PAD_SD4_DATA1_DSE_V(40_OHM) |
  95. BF_IOMUXC_SW_PAD_CTL_PAD_SD4_DATA1_SRE_V(SLOW));
  96. }