gpio_pin_define.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. #ifndef __GPIO_PIN_DEFINE_H__
  2. #define __GPIO_PIN_DEFINE_H__
  3. typedef enum{
  4. GPIO_0 = 0,
  5. GPIO_1,
  6. GPIO_2,
  7. GPIO_3,
  8. GPIO_4,
  9. GPIO_5,
  10. GPIO_6,
  11. GPIO_7,
  12. GPIO_8,
  13. GPIO_9,
  14. GPIO_10,
  15. GPIO_11,
  16. GPIO_12,
  17. GPIO_13,
  18. GPIO_14,
  19. GPIO_15,
  20. GPIO_16,
  21. GPIO_17,
  22. GPIO_18,
  23. GPIO_19,
  24. GPIO_20,
  25. GPIO_21,
  26. GPIO_22,
  27. GPIO_23,
  28. GPIO_24,
  29. GPIO_25,
  30. GPIO_26,
  31. GPIO_27,
  32. GPIO_28,
  33. GPIO_29,
  34. GPIO_30,
  35. GPIO_31,
  36. GPIO_32,
  37. GPIO_33,
  38. GPIO_34,
  39. GPIO_35,
  40. GPIO_36,
  41. GPIO_37,
  42. GPIO_38,
  43. GPIO_39,
  44. GPIO_40,
  45. GPIO_41,
  46. GPIO_42,
  47. GPIO_43,
  48. GPIO_44,
  49. GPIO_45,
  50. GPIO_46,
  51. GPIO_47,
  52. GPIO_48,
  53. GPIO_49,
  54. GPIO_50,
  55. GPIO_51,
  56. GPIO_52,
  57. GPIO_53,
  58. GPIO_54,
  59. GPIO_55,
  60. GPIO_56,
  61. GPIO_57,
  62. GPIO_58,
  63. GPIO_59,
  64. GPIO_60,
  65. GPIO_61,
  66. GPIO_62,
  67. GPIO_63,
  68. GPO_TXP4,
  69. GPO_TXP9,
  70. GPO_TXN4,
  71. GPO_TXN9,
  72. GPO_TCP2,
  73. GPO_TCN2,
  74. RM_GPIO_0,
  75. RM_GPIO_1,
  76. RM_GPIO_2,
  77. RM_GPIO_3,
  78. RM_GPIO_4,
  79. RM_GPIO_5,
  80. RM_GPIO_6,
  81. RM_GPIO_7,
  82. RM_GPIO_8,
  83. GPO_IVDD_SEL,
  84. GPO_VBUS_EN,
  85. GPIO_NOT_USE,
  86. }GPIOPin_t;
  87. #ifdef CONFIG_SUPPORT_TCON
  88. typedef enum{
  89. TCON_MHL_CABLE_EN = GPIO_0,
  90. TCON_SPDIFO = GPIO_2,
  91. TCON_HDMIA_SDA = GPIO_7,
  92. TCON_HDMIA_SCL = GPIO_8,
  93. TCON_HDMIC_SDA = GPIO_12,
  94. TCON_HDMIC_SCL = GPIO_13,
  95. TCON_VGA_HS = GPIO_16,
  96. TCON_VGA_VS = GPIO_17,
  97. TCON_TCON10 = GPIO_58,
  98. TCON_TCON11 = GPIO_59,
  99. TCON_TCON12 = GPIO_60,
  100. TCON_TCON13 = GPIO_61,
  101. TCON_LVA_TXN0 = GPIO_48+0x100,
  102. TCON_LVA_TXP0 = GPIO_49+0x100,
  103. TCON_LVA_TXN1 = GPIO_50+0x200,
  104. TCON_LVA_TXP1 = GPIO_51+0x200,
  105. TCON_LVA_TXN2 = GPIO_52+0x400,
  106. TCON_LVA_TXP2 = GPIO_53+0x400,
  107. TCON_LVA_TXN3 = GPIO_56+0x800,
  108. TCON_LVA_TXP3 = GPIO_57+0x800,
  109. TCON_LVA_TXN4 = GPIO_56+0x1000,
  110. TCON_LVA_TXP4 = GPIO_57+0x1000,
  111. TCON_LVB_TXN0 = GPIO_57+0x2000,
  112. TCON_LVB_TXP0 = GPIO_56+0x2000,
  113. TCON_LVB_TXN1 = GPIO_55+0x4000,
  114. TCON_LVB_TXP1 = GPIO_54+0x4000,
  115. TCON_LVB_TXN2 = GPIO_53+0x8000,
  116. TCON_LVB_TXP2 = GPIO_52+0x8000,
  117. TCON_LVB_TXN3 = GPIO_51+0x10000,
  118. TCON_LVB_TXP3 = GPIO_50+0x10000,
  119. TCON_LVB_TXN4 = GPIO_49+0x20000,
  120. TCON_LVB_TXP4 = GPIO_48+0x20000,
  121. TCON_LVA_CKN = GPIO_54+0x40000,
  122. TCON_LVA_CKP = GPIO_55+0x40000,
  123. }TCONPin_t;
  124. #endif
  125. /* I2S set number */
  126. #define I2S_SET1 0
  127. #define I2S_SET2 1
  128. #define I2S_SET3 2
  129. #define I2S_SET4 3
  130. #define I2S_NOT_USE 4
  131. typedef enum
  132. {
  133. GPIO_WITHOUT_INVERT = 0,
  134. GPIO_INVERT,
  135. }GPIOInvert_t;
  136. typedef enum
  137. {
  138. GPIO_LEVEL_LOW = 0,
  139. GPIO_LEVEL_HIGH,
  140. GPIO_LEVEL_TRI,
  141. }GPIOLevel_t;
  142. typedef enum
  143. {
  144. GPIO_FUNC_OFFLEVEL = 0,
  145. GPIO_FUNC_ONLEVEL,
  146. } GPIOState_t;
  147. typedef enum
  148. {
  149. GPIO_OUTPUT = 0,
  150. GPIO_INPUT,
  151. GPIO_OPEN_DRAIN,
  152. } GPIOAction_t;
  153. typedef enum
  154. {
  155. GPIO_PULLUD_NO, //NO PULL UP/DOWN
  156. GPIO_PULLUD_YES, //HAVE PULL UP/DOWN
  157. } GPIOInnerPullUDEnable_t;
  158. /* This Enum define only use for dirver, app don't care*/
  159. typedef enum
  160. {
  161. GPIO_PIN_DRIVER_IGNORE = 0xFF,
  162. GPIO_PIN_DRIVER_INIT = 0xFE,
  163. GPIO_PIN_DEMOD_RESET = 1,
  164. GPIO_PIN_DEMOD_STANDBY,
  165. GPIO_PIN_PANEL_ON,
  166. GPIO_PIN_LEDBL_DETECT,
  167. GPIO_PIN_SPI_PROTECT,
  168. GPIO_PIN_AMBIGLOW_LED,
  169. GPIO_PIN_HP_DETECT, //headphone detect
  170. GPIO_PIN_MHL_CD_SENSE_DETECT,
  171. GPIO_PIN_HDMISWITCH_SCL,
  172. GPIO_PIN_HDMISWITCH_SDA,
  173. GPIO_PIN_BACKLIGHT_ON,
  174. GPIO_PIN_BACKLIGHT_ADJ_ON,
  175. GPIO_PIN_DVD_IROUT,
  176. GPIO_PIN_AC_DET,
  177. GPIO_PIN_BL_ADJ,
  178. GPIO_PIN_USB_EN,
  179. GPIO_PIN_USB_ERR,
  180. GPIO_PIN_PR_DET,
  181. GPIO_PIN_RMII_RESET,
  182. GPIO_PIN_LNB_POWER_EN,
  183. GPIO_PIN_LNB_POWER_LDROP,
  184. GPIO_PIN_LNB_POWER_13_18V,
  185. GPIO_PIN_ANDROID_RECOVE,
  186. GPIO_PIN_ANDROID_UBOOT,
  187. GPIO_PIN_LED_G_PWM,
  188. GPIO_PIN_LED_R_PWM,
  189. GPIO_PIN_HP_MUTE,
  190. GPIO_PIN_AUDIO_LINEIN1,
  191. GPIO_PIN_AUDIO_LINEIN2,
  192. GPIO_PIN_TCON_12,
  193. GPIO_PIN_TCON_EN,
  194. GPIO_PIN_WIFI_CTL,
  195. GPIO_PIN_EDP_RESET,
  196. GPIO_PIN_POWER_CHECK,
  197. GPIO_PIN_KEY0_ON,
  198. GPIO_PIN_GPIO_I2C_SCL,
  199. GPIO_PIN_GPIO_I2C_SDA,
  200. } GPIODriverFunc_t;
  201. typedef struct
  202. {
  203. UINT8 Index; // GPIO_0~GPIO_63
  204. UINT8 AuxAction :2; // 0:output; 1: input; 2: open drain
  205. UINT8 AuxValue :2; // 0:low; 1:high
  206. UINT8 AInternalPU :1; // 0:disable/1:enable pull high
  207. UINT8 AInternalPD :1; // 0:disable/1:enable pull low
  208. UINT8 :2; // reserved
  209. } GPIOAUXConfig_t;
  210. typedef struct
  211. {
  212. UINT8 DriverFunc; //GPIODriverFunc_t
  213. UINT8 Index; // GPIO_0~GPIO_63
  214. UINT8 MainAction; // 0: output; 1: input; 2: open drain
  215. UINT8 MainInitLevel; // 0:low; 1:high
  216. UINT8 MainLevelInvert; // 0: don't invert, set on is high,set off is low; 1: invert, set on is low, set off is high
  217. UINT8 MInternalPU; // 0:disable/1:enable pull high
  218. UINT8 MInternalPD; // 0:disable/1:enable pull low
  219. } GPIOMAINConfig_t;
  220. #endif /* __GPIO_PIN_DEFINE_H__ */