rtuTemperatureAndHumidityDataOperation.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. /* arch/arm/mach-s3c2410/include/mach/regs-gpio.h
  2. *
  3. * Copyright (c) 2003-2004 Simtec Electronics <linux@simtec.co.uk>
  4. * http://www.simtec.co.uk/products/SWLINUX/
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. * S3C2410 GPIO register definitions
  11. */
  12. #ifndef __ASM_ARCH_REGS_GPIO_H
  13. #define __ASM_ARCH_REGS_GPIO_H
  14. #include <mach/gpio-nrs.h>
  15. #define S3C24XX_MISCCR S3C24XX_GPIOREG2(0x80)
  16. /* general configuration options */
  17. #define S3C2410_GPIO_LEAVE (0xFFFFFFFF)
  18. #define S3C2410_GPIO_INPUT (0xFFFFFFF0) /* not available on A */
  19. #define S3C2410_GPIO_OUTPUT (0xFFFFFFF1)
  20. #define S3C2410_GPIO_IRQ (0xFFFFFFF2) /* not available for all */
  21. #define S3C2410_GPIO_SFN2 (0xFFFFFFF2) /* bank A => addr/cs/nand */
  22. #define S3C2410_GPIO_SFN3 (0xFFFFFFF3) /* not available on A */
  23. /* register address for the GPIO registers.
  24. * S3C24XX_GPIOREG2 is for the second set of registers in the
  25. * GPIO which move between s3c2410 and s3c2412 type systems */
  26. #define S3C2410_GPIOREG(x) ((x) + S3C24XX_VA_GPIO)
  27. #define S3C24XX_GPIOREG2(x) ((x) + S3C24XX_VA_GPIO2)
  28. /* configure GPIO ports A..G */
  29. /* port A - S3C2410: 22bits, zero in bit X makes pin X output
  30. * 1 makes port special function, this is default
  31. */
  32. #define S3C2410_GPACON S3C2410_GPIOREG(0x00)
  33. #define S3C2410_GPADAT S3C2410_GPIOREG(0x04)
  34. #define S3C2410_GPA0_ADDR0 (1<<0)
  35. #define S3C2410_GPA1_ADDR16 (1<<1)
  36. #define S3C2410_GPA2_ADDR17 (1<<2)
  37. #define S3C2410_GPA3_ADDR18 (1<<3)
  38. #define S3C2410_GPA4_ADDR19 (1<<4)
  39. #define S3C2410_GPA5_ADDR20 (1<<5)
  40. #define S3C2410_GPA6_ADDR21 (1<<6)
  41. #define S3C2410_GPA7_ADDR22 (1<<7)
  42. #define S3C2410_GPA8_ADDR23 (1<<8)
  43. #define S3C2410_GPA9_ADDR24 (1<<9)
  44. #define S3C2410_GPA10_ADDR25 (1<<10)
  45. #define S3C2410_GPA11_ADDR26 (1<<11)
  46. #define S3C2410_GPA12_nGCS1 (1<<12)
  47. #define S3C2410_GPA13_nGCS2 (1<<13)
  48. #define S3C2410_GPA14_nGCS3 (1<<14)
  49. #define S3C2410_GPA15_nGCS4 (1<<15)
  50. #define S3C2410_GPA16_nGCS5 (1<<16)
  51. #define S3C2410_GPA17_CLE (1<<17)
  52. #define S3C2410_GPA18_ALE (1<<18)
  53. #define S3C2410_GPA19_nFWE (1<<19)
  54. #define S3C2410_GPA20_nFRE (1<<20)
  55. #define S3C2410_GPA21_nRSTOUT (1<<21)
  56. #define S3C2410_GPA22_nFCE (1<<22)
  57. /* 0x08 and 0x0c are reserved on S3C2410 */
  58. /* S3C2410:
  59. * GPB is 10 IO pins, each configured by 2 bits each in GPBCON.
  60. * 00 = input, 01 = output, 10=special function, 11=reserved
  61. * bit 0,1 = pin 0, 2,3= pin 1...
  62. *
  63. * CPBUP = pull up resistor control, 1=disabled, 0=enabled
  64. */
  65. #define S3C2410_GPBCON S3C2410_GPIOREG(0x10)
  66. #define S3C2410_GPBDAT S3C2410_GPIOREG(0x14)
  67. #define S3C2410_GPBUP S3C2410_GPIOREG(0x18)
  68. /* no i/o pin in port b can have value 3 (unless it is a s3c2443) ! */
  69. #define S3C2410_GPB0_TOUT0 (0x02 << 0)
  70. #define S3C2410_GPB1_TOUT1 (0x02 << 2)
  71. #define S3C2410_GPB2_TOUT2 (0x02 << 4)
  72. #define S3C2410_GPB3_TOUT3 (0x02 << 6)
  73. #define S3C2410_GPB4_TCLK0 (0x02 << 8)
  74. #define S3C2410_GPB4_MASK (0x03 << 8)
  75. #define S3C2410_GPB5_nXBACK (0x02 << 10)
  76. #define S3C2443_GPB5_XBACK (0x03 << 10)
  77. #define S3C2410_GPB6_nXBREQ (0x02 << 12)
  78. #define S3C2443_GPB6_XBREQ (0x03 << 12)
  79. #define S3C2410_GPB7_nXDACK1 (0x02 << 14)
  80. #define S3C2443_GPB7_XDACK1 (0x03 << 14)
  81. #define S3C2410_GPB8_nXDREQ1 (0x02 << 16)
  82. #define S3C2410_GPB9_nXDACK0 (0x02 << 18)
  83. #define S3C2443_GPB9_XDACK0 (0x03 << 18)
  84. #define S3C2410_GPB10_nXDRE0 (0x02 << 20)
  85. #define S3C2443_GPB10_XDREQ0 (0x03 << 20)
  86. #define S3C2410_GPB_PUPDIS(x) (1<<(x))
  87. /* Port C consits of 16 GPIO/Special function
  88. *
  89. * almost identical setup to port b, but the special functions are mostly
  90. * to do with the video system's sync/etc.
  91. */
  92. #define S3C2410_GPCCON S3C2410_GPIOREG(0x20)
  93. #define S3C2410_GPCDAT S3C2410_GPIOREG(0x24)
  94. #define S3C2410_GPCUP S3C2410_GPIOREG(0x28)
  95. #define S3C2410_GPC0_LEND (0x02 << 0)
  96. #define S3C2410_GPC1_VCLK (0x02 << 2)
  97. #define S3C2410_GPC2_VLINE (0x02 << 4)
  98. #define S3C2410_GPC3_VFRAME (0x02 << 6)
  99. #define S3C2410_GPC4_VM (0x02 << 8)
  100. #define S3C2410_GPC5_LCDVF0 (0x02 << 10)
  101. #define S3C2410_GPC6_LCDVF1 (0x02 << 12)
  102. #define S3C2410_GPC7_LCDVF2 (0x02 << 14)
  103. #define S3C2410_GPC8_VD0 (0x02 << 16)
  104. #define S3C2410_GPC9_VD1 (0x02 << 18)
  105. #define S3C2410_GPC10_VD2 (0x02 << 20)
  106. #define S3C2410_GPC11_VD3 (0x02 << 22)
  107. #define S3C2410_GPC12_VD4 (0x02 << 24)
  108. #define S3C2410_GPC13_VD5 (0x02 << 26)
  109. #define S3C2410_GPC14_VD6 (0x02 << 28)
  110. #define S3C2410_GPC15_VD7 (0x02 << 30)
  111. #define S3C2410_GPC_PUPDIS(x) (1<<(x))
  112. /*
  113. * S3C2410: Port D consists of 16 GPIO/Special function
  114. *
  115. * almost identical setup to port b, but the special functions are mostly
  116. * to do with the video system's data.
  117. *
  118. * almost identical setup to port c
  119. */
  120. #define S3C2410_GPDCON S3C2410_GPIOREG(0x30)
  121. #define S3C2410_GPDDAT S3C2410_GPIOREG(0x34)
  122. #define S3C2410_GPDUP S3C2410_GPIOREG(0x38)
  123. #define S3C2410_GPD0_VD8 (0x02 << 0)
  124. #define S3C2442_GPD0_nSPICS1 (0x03 << 0)
  125. #define S3C2410_GPD1_VD9 (0x02 << 2)
  126. #define S3C2442_GPD1_SPICLK1 (0x03 << 2)
  127. #define S3C2410_GPD2_VD10 (0x02 << 4)
  128. #define S3C2410_GPD3_VD11 (0x02 << 6)
  129. #define S3C2410_GPD4_VD12 (0x02 << 8)
  130. #define S3C2410_GPD5_VD13 (0x02 << 10)
  131. #define S3C2410_GPD6_VD14 (0x02 << 12)
  132. #define S3C2410_GPD7_VD15 (0x02 << 14)
  133. #define S3C2410_GPD8_VD16 (0x02 << 16)
  134. #define S3C2440_GPD8_SPIMISO1 (0x03 << 16)
  135. #define S3C2410_GPD9_VD17 (0x02 << 18)
  136. #define S3C2440_GPD9_SPIMOSI1 (0x03 << 18)
  137. #define S3C2410_GPD10_VD18 (0x02 << 20)
  138. #define S3C2440_GPD10_SPICLK1 (0x03 << 20)
  139. #define S3C2410_GPD11_VD19 (0x02 << 22)
  140. #define S3C2410_GPD12_VD20 (0x02 << 24)
  141. #define S3C2410_GPD13_VD21 (0x02 << 26)
  142. #define S3C2410_GPD14_VD22 (0x02 << 28)
  143. #define S3C2410_GPD14_nSS1 (0x03 << 28)
  144. #define S3C2410_GPD15_VD23 (0x02 << 30)
  145. #define S3C2410_GPD15_nSS0 (0x03 << 30)
  146. #define S3C2410_GPD_PUPDIS(x) (1<<(x))
  147. /* S3C2410:
  148. * Port E consists of 16 GPIO/Special function
  149. *
  150. * again, the same as port B, but dealing with I2S, SDI, and
  151. * more miscellaneous functions
  152. *
  153. * GPIO / interrupt inputs
  154. */
  155. #define S3C2410_GPECON S3C2410_GPIOREG(0x40)
  156. #define S3C2410_GPEDAT S3C2410_GPIOREG(0x44)
  157. #define S3C2410_GPEUP S3C2410_GPIOREG(0x48)
  158. #define S3C2410_GPE0_I2SLRCK (0x02 << 0)
  159. #define S3C2443_GPE0_AC_nRESET (0x03 << 0)
  160. #define S3C2410_GPE0_MASK (0x03 << 0)
  161. #define S3C2410_GPE1_I2SSCLK (0x02 << 2)
  162. #define S3C2443_GPE1_AC_SYNC (0x03 << 2)
  163. #define S3C2410_GPE1_MASK (0x03 << 2)
  164. #define S3C2410_GPE2_CDCLK (0x02 << 4)
  165. #define S3C2443_GPE2_AC_BITCLK (0x03 << 4)
  166. #define S3C2410_GPE3_I2SSDI (0x02 << 6)
  167. #define S3C2443_GPE3_AC_SDI (0x03 << 6)
  168. #define S3C2410_GPE3_nSS0 (0x03 << 6)
  169. #define S3C2410_GPE3_MASK (0x03 << 6)
  170. #define S3C2410_GPE4_I2SSDO (0x02 << 8)
  171. #define S3C2443_GPE4_AC_SDO (0x03 << 8)
  172. #define S3C2410_GPE4_I2SSDI (0x03 << 8)
  173. #define S3C2410_GPE4_MASK (0x03 << 8)
  174. #define S3C2410_GPE5_SDCLK (0x02 << 10)
  175. #define S3C2443_GPE5_SD1_CLK (0x02 << 10)
  176. #define S3C2443_GPE5_AC_BITCLK (0x03 << 10)