quec_pin_cfg_EC200G.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*================================================================
  2. Copyright (c) 2021, Quectel Wireless Solutions Co., Ltd. All rights reserved.
  3. Quectel Wireless Solutions Proprietary and Confidential.
  4. =================================================================*/
  5. /*=================================================================
  6. EDIT HISTORY FOR MODULE
  7. This section contains comments describing changes made to the module.
  8. Notice that changes are listed in reverse chronological order.
  9. WHEN WHO WHAT, WHERE, WHY
  10. ------------ ------- -------------------------------------------------------------------------------
  11. =================================================================*/
  12. /*===========================================================================
  13. * include files
  14. ===========================================================================*/
  15. #include "quec_pin_cfg.h"
  16. #include "hwregs.h"
  17. /*===========================================================================
  18. * GPIO Map
  19. ===========================================================================*/
  20. #ifdef CONFIG_QL_OPEN_EXPORT_PKG /* Open */
  21. const quec_pin_cfg_t quec_pin_cfg_map[] = /* pin initialize */
  22. { /* pin_num default_func gpio_func gpio_num gpio_dir gpio_pull gpio_lvl reg anareg drv_bits*/
  23. /*NET_MODE */{ 5 , 0, 0, GPIO_0, GPIO_OUTPUT, QUEC_PIN_NONE, LVL_LOW, &hwp_iomux->gpio_0, &hwp_iomux->pad_gpio_0, 4},
  24. /*SLEEP_IND */{ 3 , 0, 0, GPIO_1, GPIO_OUTPUT, QUEC_PIN_NONE, LVL_LOW, &hwp_iomux->gpio_1, &hwp_iomux->pad_gpio_1, 4},
  25. /*NET_STATUS */{ 6 , 5, 0, GPIO_2, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->gpio_2, &hwp_iomux->pad_gpio_2, 4},//pwm function
  26. /*W_DISABLE# */{ 13 , 0, 0, GPIO_3, GPIO_INPUT, PULL_UP, QUEC_PIN_NONE, &hwp_iomux->gpio_3, &hwp_iomux->pad_gpio_3, 4},
  27. /*AUX_RXD */{ 137, 7, 1, GPIO_8, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->keyin_4, &hwp_iomux->pad_keyin_4, 4},
  28. /*AUX_TXD */{ 138, 7, 1, GPIO_9, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->keyin_5, &hwp_iomux->pad_keyin_5, 4},
  29. /*KEYOUT4 */{ 83 , 0, 1, GPIO_10, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->keyout_4, &hwp_iomux->pad_keyout_4, 4},
  30. /*KEYOUT5 */{ 84 , 0, 1, GPIO_11, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->keyout_5, &hwp_iomux->pad_keyout_5, 4},
  31. /*MAIN_RXD */{ 68 , 0, 1, GPIO_12, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->uart_1_rxd, &hwp_iomux->pad_uart_1_rxd, 4},
  32. /*MAIN_TXD */{ 67 , 0, 1, GPIO_13, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->uart_1_txd, &hwp_iomux->pad_uart_1_txd, 4},
  33. /*MAIN_RTS */{ 65 , 0, 1, GPIO_14, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->uart_1_cts, &hwp_iomux->pad_uart_1_cts, 4},
  34. /*MAIN_CTS */{ 64 , 0, 4, GPIO_15, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->uart_1_rts, &hwp_iomux->pad_uart_1_rts, 4},
  35. /*SDIO1 CLK */{ 32 , 0, 1, GPIO_16, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->sdmmc1_clk, &hwp_iomux->pad_sdmmc1_clk, 4},
  36. /*SDIO1 CMD */{ 33 , 0, 1, GPIO_17, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->sdmmc1_cmd, &hwp_iomux->pad_sdmmc1_cmd, 4},
  37. /*SD_DET */{ 23 , 2, 2, GPIO_18, GPIO_INPUT, PULL_UP, QUEC_PIN_NONE, &hwp_iomux->spi_camera_sck, &hwp_iomux->pad_spi_camera_sck, 2},
  38. /*SDIO2 CLK */{ 133, 1, 0, GPIO_18, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->gpio_18, &hwp_iomux->pad_gpio_18, 2},
  39. /*SDIO1_DATA0 */{ 31 , 0, 1, GPIO_18, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->sdmmc1_data_0, &hwp_iomux->pad_sdmmc1_data_0, 4},
  40. /*PCM_CLK */{ 27 , 0, 2, GPIO_19, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->i2s1_bck, &hwp_iomux->pad_i2s1_bck, 2},
  41. /*SDIO2_CMD */{ 134, 1, 0, GPIO_19, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->gpio_19, &hwp_iomux->pad_gpio_19, 2},
  42. /*SDIO_DATA1 */{ 30 , 0, 1, GPIO_19, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->sdmmc1_data_1, &hwp_iomux->pad_sdmmc1_data_1, 4},
  43. /*PCM_SYNC */{ 26 , 0, 2, GPIO_20, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->i2s1_lrck, &hwp_iomux->pad_i2s1_lrck, 2},
  44. /*SDIO2_DATA0 */{ 132, 1, 0, GPIO_20, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->gpio_20, &hwp_iomux->pad_gpio_20, 2},
  45. /*SDIO_DATA2 */{ 29 , 0, 1, GPIO_20, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->sdmmc1_data_2, &hwp_iomux->pad_sdmmc1_data_2, 4},
  46. /*PCM_IN */{ 24 , 0, 2, GPIO_21, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->i2s_sdat_i, &hwp_iomux->pad_i2s_sdat_i , 2},
  47. /*SDIO2_DATA1 */{ 131, 1, 0, GPIO_21, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->gpio_21, &hwp_iomux->pad_gpio_21, 2},
  48. /*SDIO_DATA3 */{ 28 , 0, 1, GPIO_21, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->sdmmc1_data_3, &hwp_iomux->pad_sdmmc1_data_3, 4},
  49. /*PCM_OUT */{ 25 , 0, 2, GPIO_22, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->i2s1_sdat_o, &hwp_iomux->pad_i2s1_sdat_o, 2},
  50. /*SDIO2_DATA2 */{ 130, 1, 0, GPIO_22, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->gpio_22, &hwp_iomux->pad_gpio_22, 2},
  51. /*SDIO2_DATA3 */{ 129, 1, 0, GPIO_23, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->gpio_23, &hwp_iomux->pad_gpio_23, 2},
  52. /*SPI_CLK */{ 40 , 3, 1, GPIO_24, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->sw_clk, &hwp_iomux->pad_sw_clk, 2},
  53. /*WLAN_WAKE */{ 135, 1, 1, GPIO_24, GPIO_OUTPUT, QUEC_PIN_NONE, LVL_LOW, &hwp_iomux->sdmmc1_data_4, &hwp_iomux->pad_sdmmc1_data_4, 4},
  54. /*SPI_CS */{ 37 , 3, 1, GPIO_25, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->sw_dio, &hwp_iomux->pad_sw_dio, 2},
  55. /*WLAN_PWR_EN */{ 127, 1, 1, GPIO_25, GPIO_OUTPUT, QUEC_PIN_NONE, LVL_LOW, &hwp_iomux->sdmmc1_data_5, &hwp_iomux->pad_sdmmc1_data_5, 4},
  56. /*SPI_TXD */{ 38 , 3, 1, GPIO_26, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->debug_host_rx, &hwp_iomux->pad_debug_host_rx, 2},
  57. /*WLAN_EN */{ 136, 1, 1, GPIO_26, GPIO_OUTPUT, QUEC_PIN_NONE, LVL_LOW, &hwp_iomux->sdmmc1_data_6, &hwp_iomux->pad_sdmmc1_data_6, 4},
  58. /*SPI_RXD */{ 39 , 3, 1, GPIO_27, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->debug_host_tx, &hwp_iomux->pad_debug_host_tx, 2},
  59. /*BT_EN */{ 139, 1, 1, GPIO_27, GPIO_OUTPUT, QUEC_PIN_NONE, LVL_LOW, &hwp_iomux->sdmmc1_data_7, &hwp_iomux->pad_sdmmc1_data_7, 4},
  60. /*USB_BOOT */{ 115, 0, 1, GPIO_28, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->keyin_0, &hwp_iomux->pad_keyin_0, 4},
  61. /*I2C_SCL */{ 41 , 0, 1, GPIO_29, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->i2c_m1_scl, &hwp_iomux->pad_i2c_m1_scl, 2},
  62. /*I2C_SDA */{ 42 , 0, 1, GPIO_30, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->i2c_m1_sda, &hwp_iomux->pad_i2c_m1_sda, 2},
  63. /*KEYIN1 */{ 78 , 0, 1, GPIO_29, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->keyin_1, &hwp_iomux->pad_keyin_1, 4},
  64. /*KEYIN2 */{ 79 , 0, 1, GPIO_30, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->keyin_2, &hwp_iomux->pad_keyin_2, 4},
  65. /*KEYIN3 */{ 80 , 0, 1, GPIO_31, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->keyin_3, &hwp_iomux->pad_keyin_3, 4},
  66. // /*USIM2_CLK */{ 1 , 0, 1, GPIO_30, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->sim_1_clk, &hwp_iomux->pad_sim_1_clk, 4},
  67. // /*USIM2_DATA */{ 2 , 0, 1, GPIO_31, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->sim_1_dio, &hwp_iomux->pad_sim_1_dio, 4},
  68. // /*USIM2_RST */{ 4 , 0, 1, GPIO_32, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->sim_1_rst, &hwp_iomux->pad_sim_1_rst, 4},
  69. /*WAKEUP_IN */{ 1 , 1, 1, GPIO_30, GPIO_INPUT, PULL_UP, QUEC_PIN_NONE, &hwp_iomux->sim_1_clk, &hwp_iomux->pad_sim_1_clk, 4},
  70. /*AP_READY */{ 2 , 1, 1, GPIO_31, GPIO_INPUT, PULL_UP, QUEC_PIN_NONE, &hwp_iomux->sim_1_dio, &hwp_iomux->pad_sim_1_dio, 4},
  71. /*W_DISABLE */{ 4 , 1, 1, GPIO_32, GPIO_INPUT, PULL_UP, QUEC_PIN_NONE, &hwp_iomux->sim_1_rst, &hwp_iomux->pad_sim_1_rst, 4},
  72. /*KEYOUT0 */{ 81 , 0, 1, GPIO_32, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->keyout_0, &hwp_iomux->pad_keyout_0, 4},
  73. /*CPLOG */{ 126, 0, 3, GPIO_32, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->uart_2_txd, &hwp_iomux->pad_uart_2_txd, 2},
  74. /*DBG_RXD */{ 11 , 4, 1, GPIO_33, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->uart_2_cts, &hwp_iomux->pad_uart_2_cts, 2},
  75. /*KEYOUT1 */{ 82 , 0, 1, GPIO_33, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->keyout_1, &hwp_iomux->pad_keyout_1, 4},
  76. /*DBG_TXD */{ 12 , 4, 1, GPIO_34, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->uart_2_rts, &hwp_iomux->pad_uart_2_rts, 2},
  77. /*KEYOUT2 */{ 113, 0, 1, GPIO_34, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->keyout_2, &hwp_iomux->pad_keyout_2, 4},
  78. /*LCD_SPI_DOUT */{ 125, 0, 2, GPIO_35, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->spi_lcd_sio, &hwp_iomux->pad_spi_lcd_sio, 4},
  79. /*KEYOUT3 */{ 114, 0, 1, GPIO_35, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->keyout_3, &hwp_iomux->pad_keyout_3, 4},
  80. /*LCD_SPI_RS */{ 124, 0, 2, GPIO_36, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->spi_lcd_sdc, &hwp_iomux->pad_spi_lcd_sdc, 4},
  81. /*LCD_SPI_CLK */{ 123, 0, 2, GPIO_37, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->spi_lcd_clk, &hwp_iomux->pad_spi_lcd_clk, 4},
  82. /*LCD_SPI_CS */{ 122, 0, 2, GPIO_38, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->spi_lcd_cs, &hwp_iomux->pad_spi_lcd_cs, 4},
  83. /*LCD_SEL */{ 121, 0, 2, GPIO_39, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->spi_lcd_select, &hwp_iomux->pad_spi_lcd_select, 4},
  84. /*LCD_FMARK */{ 119, 0, 2, GPIO_40, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->lcd_fmark, &hwp_iomux->pad_lcd_fmark, 4},
  85. /*LCD_RSTB */{ 120, 0, 2, GPIO_41, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->lcd_rstb, &hwp_iomux->pad_lcd_rstb, 4},
  86. /*I2C2_SCL */{ 141, 0, 2, GPIO_42, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->i2c_m2_scl, &hwp_iomux->pad_i2c_m2_scl, 2},
  87. /*I2C2_SDA */{ 142, 0, 2, GPIO_43, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->i2c_m2_sda, &hwp_iomux->pad_i2c_m2_sda, 2},
  88. /*CAM_RST */{ 61 , 0, 3, GPIO_44, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->camera_rst_l, &hwp_iomux->pad_camera_rst_l, 2},
  89. /*CAM_PWDN */{ 62 , 0, 3, GPIO_45, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->camera_pwdn, &hwp_iomux->pad_camera_pwdn, 2},
  90. /*CAM_MCLK */{ 63 , 0, 2, GPIO_46, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->camera_ref_clk, &hwp_iomux->pad_camera_ref_clk, 2},
  91. /*CAM_SPI_DATA0*/{ 66 , 0, 3, GPIO_47, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->spi_camera_si_0, &hwp_iomux->pad_spi_camera_si_0, 2},
  92. //pinmux(not gpio part)
  93. /*CAM_SPI_DATA1*/{ 55 , 0, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->spi_camera_si_1, &hwp_iomux->pad_spi_camera_si_1, 0},
  94. //内置蓝牙占用!!
  95. /*UART3_RXD */{ 200, 4, QUEC_PIN_NONE, GPIO_6, QUEC_PIN_NONE, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->gpio_6, &hwp_iomux->gpio_6, 4},
  96. /*UARR3_TXD */{ 201, 4, QUEC_PIN_NONE, GPIO_7, GPIO_OUTPUT, QUEC_PIN_NONE, QUEC_PIN_NONE, &hwp_iomux->gpio_7, &hwp_iomux->gpio_7, 4},
  97. /*BT_WAKE_UP */{ 202, 1, 1, GPIO_28, GPIO_OUTPUT, QUEC_PIN_NONE, LVL_LOW, &hwp_iomux->debug_host_clk, &hwp_iomux->debug_host_clk, 2},
  98. // should before here!
  99. {QUEC_PIN_NONE,-1, -1, -1, -1, -1, -1},
  100. };
  101. #ifdef CONFIG_QUEC_PROJECT_FEATURE_PSM
  102. const quec_psm_pin_cfg_t quec_psm_pin_cfg[] =
  103. {
  104. {GPIO_0, LVL_HIGH, 0},
  105. {GPIO_1, LVL_HIGH, 0},
  106. {GPIO_2, LVL_HIGH, 0},
  107. {GPIO_3, LVL_HIGH, 0},
  108. {GPIO_4, LVL_HIGH, 0},
  109. {GPIO_5, LVL_HIGH, 0},
  110. {GPIO_6, LVL_HIGH, 0},
  111. {GPIO_7, LVL_HIGH, 0},
  112. {GPIO_MAX,LVL_HIGH, 0},
  113. };
  114. #endif
  115. #endif/* CONFIG_QL_OPEN_EXPORT_PKG */