44b.h
上传用户:jinguanrq
上传日期:2022-06-04
资源大小:724k
文件大小:15k
源码类别:

uCOS

开发平台:

C/C++

  1. /************************************************
  2.  * NAME     : K44b.H *
  3.  * Version  : 07.MARCH.2000 *
  4.  ***********************************************/
  5. // 
  6. // 
  7. #ifndef __44B0X_H__
  8. #define __44B0X_H__
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. #include "option.h"
  13. /* System */
  14. #define rSYSCFG (*(volatile unsigned *)0x1c00000)
  15. /* Cache */
  16. #define rNCACHBE0 (*(volatile unsigned *)0x1c00004)
  17. #define rNCACHBE1 (*(volatile unsigned *)0x1c00008)
  18. /* Bus control */
  19. #define rSBUSCON (*(volatile unsigned *)0x1c40000)
  20.     
  21. /* Memory control */
  22. #define rBWSCON (*(volatile unsigned *)0x1c80000)
  23. #define rBANKCON0 (*(volatile unsigned *)0x1c80004)
  24. #define rBANKCON1 (*(volatile unsigned *)0x1c80008)
  25. #define rBANKCON2 (*(volatile unsigned *)0x1c8000c)
  26. #define rBANKCON3 (*(volatile unsigned *)0x1c80010)
  27. #define rBANKCON4 (*(volatile unsigned *)0x1c80014)
  28. #define rBANKCON5 (*(volatile unsigned *)0x1c80018)
  29. #define rBANKCON6 (*(volatile unsigned *)0x1c8001c)
  30. #define rBANKCON7 (*(volatile unsigned *)0x1c80020)
  31. #define rREFRESH (*(volatile unsigned *)0x1c80024)
  32. #define rBANKSIZE (*(volatile unsigned *)0x1c80028)
  33. #define rMRSRB6 (*(volatile unsigned *)0x1c8002c)
  34. #define rMRSRB7 (*(volatile unsigned *)0x1c80030)
  35. /* UART */
  36. #define rULCON0 (*(volatile unsigned *)0x1d00000)
  37. #define rULCON1 (*(volatile unsigned *)0x1d04000)
  38. #define rUCON0 (*(volatile unsigned *)0x1d00004)
  39. #define rUCON1 (*(volatile unsigned *)0x1d04004)
  40. #define rUFCON0 (*(volatile unsigned *)0x1d00008)
  41. #define rUFCON1 (*(volatile unsigned *)0x1d04008)
  42. #define rUMCON0 (*(volatile unsigned *)0x1d0000c)
  43. #define rUMCON1 (*(volatile unsigned *)0x1d0400c)
  44. #define rUTRSTAT0 (*(volatile unsigned *)0x1d00010)
  45. #define rUTRSTAT1 (*(volatile unsigned *)0x1d04010)
  46. #define rUERSTAT0 (*(volatile unsigned *)0x1d00014)
  47. #define rUERSTAT1 (*(volatile unsigned *)0x1d04014)
  48. #define rUFSTAT0 (*(volatile unsigned *)0x1d00018)
  49. #define rUFSTAT1 (*(volatile unsigned *)0x1d04018)
  50. #define rUMSTAT0 (*(volatile unsigned *)0x1d0001c)
  51. #define rUMSTAT1 (*(volatile unsigned *)0x1d0401c)
  52. #define rUBRDIV0 (*(volatile unsigned *)0x1d00028)
  53. #define rUBRDIV1 (*(volatile unsigned *)0x1d04028)
  54. #ifdef __BIG_ENDIAN
  55. #define rUTXH0 (*(volatile unsigned char *)0x1d00023)
  56. #define rUTXH1 (*(volatile unsigned char *)0x1d04023)
  57. #define rURXH0 (*(volatile unsigned char *)0x1d00027)
  58. #define rURXH1 (*(volatile unsigned char *)0x1d04027)
  59. #define WrUTXH0(ch) (*(volatile unsigned char *)(0x1d00023))=(unsigned char)(ch)
  60. #define WrUTXH1(ch) (*(volatile unsigned char *)(0x1d04023))=(unsigned char)(ch)
  61. #define RdURXH0() (*(volatile unsigned char *)(0x1d00027))
  62. #define RdURXH1() (*(volatile unsigned char *)(0x1d04027))  
  63. #define UTXH0 (0x1d00020+3)  //byte_access address by BDMA
  64. #define UTXH1 (0x1d04020+3)
  65. #define URXH0 (0x1d00024+3)  
  66. #define URXH1 (0x1d04024+3)  
  67. #else //Little Endian
  68. #define rUTXH0 (*(volatile unsigned char *)0x1d00020)
  69. #define rUTXH1 (*(volatile unsigned char *)0x1d04020)
  70. #define rURXH0 (*(volatile unsigned char *)0x1d00024)
  71. #define rURXH1 (*(volatile unsigned char *)0x1d04024)
  72. #define WrUTXH0(ch) (*(volatile unsigned char *)0x1d00020)=(unsigned char)(ch)
  73. #define WrUTXH1(ch) (*(volatile unsigned char *)0x1d04020)=(unsigned char)(ch)
  74. #define RdURXH0() (*(volatile unsigned char *)0x1d00024)
  75. #define RdURXH1() (*(volatile unsigned char *)0x1d04024)
  76. #define UTXH0 (0x1d00020)    //byte_access address by BDMA
  77. #define UTXH1 (0x1d04020)
  78. #define URXH0 (0x1d00024)
  79. #define URXH1 (0x1d04024)
  80. #endif
  81. /* SIO */
  82. #define rSIOCON (*(volatile unsigned *)0x1d14000)
  83. #define rSIODAT (*(volatile unsigned *)0x1d14004)
  84. #define rSBRDR (*(volatile unsigned *)0x1d14008)
  85. #define rIVTCNT (*(volatile unsigned *)0x1d1400c)
  86. #define rDCNTZ (*(volatile unsigned *)0x1d14010)
  87. /* IIS */
  88. #define rIISCON (*(volatile unsigned *)0x1d18000)
  89. #define rIISMOD (*(volatile unsigned *)0x1d18004)
  90. #define rIISPSR (*(volatile unsigned *)0x1d18008)
  91. #define rIISFCON (*(volatile unsigned *)0x1d1800c)
  92. #ifdef __BIG_ENDIAN
  93. #define IISFIF ((volatile unsigned short *)0x1d18012)
  94. #else //Little Endian
  95. #define IISFIF ((volatile unsigned short *)0x1d18010)
  96. #endif
  97. /* I/O PORT */
  98. #define rPCONA (*(volatile unsigned *)0x1d20000)
  99. #define rPDATA (*(volatile unsigned *)0x1d20004)
  100. #define rPCONB (*(volatile unsigned *)0x1d20008)
  101. #define rPDATB (*(volatile unsigned *)0x1d2000c)
  102. #define rPCONC (*(volatile unsigned *)0x1d20010)
  103. #define rPDATC (*(volatile unsigned *)0x1d20014)
  104. #define rPUPC (*(volatile unsigned *)0x1d20018)
  105. #define rPCOND (*(volatile unsigned *)0x1d2001c)
  106. #define rPDATD (*(volatile unsigned *)0x1d20020)
  107. #define rPUPD (*(volatile unsigned *)0x1d20024)
  108. #define rPCONE (*(volatile unsigned *)0x1d20028)
  109. #define rPDATE (*(volatile unsigned *)0x1d2002c)
  110. #define rPUPE (*(volatile unsigned *)0x1d20030)
  111. #define rPCONF (*(volatile unsigned *)0x1d20034)
  112. #define rPDATF (*(volatile unsigned *)0x1d20038)
  113. #define rPUPF (*(volatile unsigned *)0x1d2003c)
  114. #define rPCONG (*(volatile unsigned *)0x1d20040)
  115. #define rPDATG (*(volatile unsigned *)0x1d20044)
  116. #define rPUPG (*(volatile unsigned *)0x1d20048)
  117. #define rSPUCR (*(volatile unsigned *)0x1d2004c)
  118. #define rEXTINT (*(volatile unsigned *)0x1d20050)
  119. #define rEXTINTPND (*(volatile unsigned *)0x1d20054)
  120. /* WATCHDOG */
  121. #define rWTCON (*(volatile unsigned *)0x1d30000)
  122. #define rWTDAT (*(volatile unsigned *)0x1d30004)
  123. #define rWTCNT (*(volatile unsigned *)0x1d30008)
  124. /* ADC */
  125. #define rADCCON (*(volatile unsigned *)0x1d40000)
  126. #define rADCPSR (*(volatile unsigned *)0x1d40004)
  127. #define rADCDAT (*(volatile unsigned *)0x1d40008)
  128. /* Timer */
  129. #define rTCFG0 (*(volatile unsigned *)0x1d50000)
  130. #define rTCFG1 (*(volatile unsigned *)0x1d50004)
  131. #define rTCON (*(volatile unsigned *)0x1d50008)
  132. #define rTCNTB0 (*(volatile unsigned *)0x1d5000c)
  133. #define rTCMPB0 (*(volatile unsigned *)0x1d50010)
  134. #define rTCNTO0 (*(volatile unsigned *)0x1d50014)
  135. #define rTCNTB1 (*(volatile unsigned *)0x1d50018)
  136. #define rTCMPB1 (*(volatile unsigned *)0x1d5001c)
  137. #define rTCNTO1 (*(volatile unsigned *)0x1d50020)
  138. #define rTCNTB2 (*(volatile unsigned *)0x1d50024)
  139. #define rTCMPB2 (*(volatile unsigned *)0x1d50028)
  140. #define rTCNTO2 (*(volatile unsigned *)0x1d5002c)
  141. #define rTCNTB3 (*(volatile unsigned *)0x1d50030)
  142. #define rTCMPB3 (*(volatile unsigned *)0x1d50034)
  143. #define rTCNTO3 (*(volatile unsigned *)0x1d50038)
  144. #define rTCNTB4 (*(volatile unsigned *)0x1d5003c)
  145. #define rTCMPB4 (*(volatile unsigned *)0x1d50040)
  146. #define rTCNTO4 (*(volatile unsigned *)0x1d50044)
  147. #define rTCNTB5 (*(volatile unsigned *)0x1d50048)
  148. #define rTCNTO5 (*(volatile unsigned *)0x1d5004c)
  149. /* IIC */
  150. #define rIICCON         (*(volatile unsigned *)0x1d60000)
  151. #define rIICSTAT        (*(volatile unsigned *)0x1d60004)
  152. #define rIICADD         (*(volatile unsigned *)0x1d60008)
  153. #define rIICDS          (*(volatile unsigned *)0x1d6000c)
  154. /* RTC */
  155. #ifdef __BIG_ENDIAN
  156. #define rRTCCON (*(volatile unsigned char *)0x1d70043)
  157. #define rRTCALM         (*(volatile unsigned char *)0x1d70053)
  158. #define rALMSEC         (*(volatile unsigned char *)0x1d70057)
  159. #define rALMMIN         (*(volatile unsigned char *)0x1d7005b)
  160. #define rALMHOUR        (*(volatile unsigned char *)0x1d7005f)
  161. #define rALMDAY         (*(volatile unsigned char *)0x1d70063)
  162. #define rALMMON         (*(volatile unsigned char *)0x1d70067)
  163. #define rALMYEAR        (*(volatile unsigned char *)0x1d7006b)
  164. #define rRTCRST         (*(volatile unsigned char *)0x1d7006f)
  165. #define rBCDSEC         (*(volatile unsigned char *)0x1d70073)
  166. #define rBCDMIN         (*(volatile unsigned char *)0x1d70077)
  167. #define rBCDHOUR        (*(volatile unsigned char *)0x1d7007b)
  168. #define rBCDDAY         (*(volatile unsigned char *)0x1d7007f)
  169. #define rBCDDATE        (*(volatile unsigned char *)0x1d70083)
  170. #define rBCDMON         (*(volatile unsigned char *)0x1d70087)
  171. #define rBCDYEAR        (*(volatile unsigned char *)0x1d7008b)
  172. #define rTICINT         (*(volatile unsigned char *)0x1d7008e)
  173. #else
  174. #define rRTCCON         (*(volatile unsigned char *)0x1d70040)
  175. #define rRTCALM         (*(volatile unsigned char *)0x1d70050)
  176. #define rALMSEC         (*(volatile unsigned char *)0x1d70054)
  177. #define rALMMIN         (*(volatile unsigned char *)0x1d70058)
  178. #define rALMHOUR        (*(volatile unsigned char *)0x1d7005c)
  179. #define rALMDAY         (*(volatile unsigned char *)0x1d70060)
  180. #define rALMMON         (*(volatile unsigned char *)0x1d70064)
  181. #define rALMYEAR        (*(volatile unsigned char *)0x1d70068)
  182. #define rRTCRST         (*(volatile unsigned char *)0x1d7006c)
  183. #define rBCDSEC         (*(volatile unsigned char *)0x1d70070)
  184. #define rBCDMIN         (*(volatile unsigned char *)0x1d70074)
  185. #define rBCDHOUR        (*(volatile unsigned char *)0x1d70078)
  186. #define rBCDDAY         (*(volatile unsigned char *)0x1d7007c)
  187. #define rBCDDATE        (*(volatile unsigned char *)0x1d70080)
  188. #define rBCDMON         (*(volatile unsigned char *)0x1d70084)
  189. #define rBCDYEAR        (*(volatile unsigned char *)0x1d70088)
  190. #define rTICINT         (*(volatile unsigned char *)0x1d7008c)
  191. #endif
  192. /* Clock & Power management */
  193. #define rPLLCON (*(volatile unsigned *)0x1d80000)
  194. #define rCLKCON (*(volatile unsigned *)0x1d80004)
  195. #define rCLKSLOW (*(volatile unsigned *)0x1d80008)
  196. #define rLOCKTIME (*(volatile unsigned *)0x1d8000c)
  197. /* INTERRUPT */
  198. #define rINTCON (*(volatile unsigned *)0x1e00000)
  199. #define rINTPND (*(volatile unsigned *)0x1e00004)
  200. #define rINTMOD (*(volatile unsigned *)0x1e00008)
  201. #define rINTMSK (*(volatile unsigned *)0x1e0000c)
  202. #define rI_PSLV (*(volatile unsigned *)0x1e00010)
  203. #define rI_PMST (*(volatile unsigned *)0x1e00014)
  204. #define rI_CSLV (*(volatile unsigned *)0x1e00018)
  205. #define rI_CMST (*(volatile unsigned *)0x1e0001c)
  206. #define rI_ISPR (*(volatile unsigned *)0x1e00020)
  207. #define rI_ISPC (*(volatile unsigned *)0x1e00024)
  208. #define rF_ISPR (*(volatile unsigned *)0x1e00038)
  209. #define rF_ISPC (*(volatile unsigned *)0x1e0003c)
  210. /* LCD */
  211. #define rLCDCON1 (*(volatile unsigned *)0x1f00000)
  212. #define rLCDCON2 (*(volatile unsigned *)0x1f00004)
  213. #define rLCDCON3 (*(volatile unsigned *)0x1f00040)
  214. #define rLCDSADDR1 (*(volatile unsigned *)0x1f00008)
  215. #define rLCDSADDR2 (*(volatile unsigned *)0x1f0000c)
  216. #define rLCDSADDR3 (*(volatile unsigned *)0x1f00010)
  217. #define rREDLUT (*(volatile unsigned *)0x1f00014)
  218. #define rGREENLUT (*(volatile unsigned *)0x1f00018)
  219. #define rBLUELUT (*(volatile unsigned *)0x1f0001c)
  220. #define rDP1_2 (*(volatile unsigned *)0x1f00020)
  221. #define rDP4_7 (*(volatile unsigned *)0x1f00024)
  222. #define rDP3_5 (*(volatile unsigned *)0x1f00028)
  223. #define rDP2_3 (*(volatile unsigned *)0x1f0002c)
  224. #define rDP5_7 (*(volatile unsigned *)0x1f00030)
  225. #define rDP3_4 (*(volatile unsigned *)0x1f00034)
  226. #define rDP4_5 (*(volatile unsigned *)0x1f00038)
  227. #define rDP6_7 (*(volatile unsigned *)0x1f0003c)
  228. #define rDITHMODE (*(volatile unsigned *)0x1f00044)
  229. /* ZDMA0 */
  230. #define rZDCON0 (*(volatile unsigned *)0x1e80000)
  231. #define rZDISRC0 (*(volatile unsigned *)0x1e80004)
  232. #define rZDIDES0 (*(volatile unsigned *)0x1e80008)
  233. #define rZDICNT0 (*(volatile unsigned *)0x1e8000c)
  234. #define rZDCSRC0 (*(volatile unsigned *)0x1e80010)
  235. #define rZDCDES0 (*(volatile unsigned *)0x1e80014)
  236. #define rZDCCNT0 (*(volatile unsigned *)0x1e80018)
  237. /* ZDMA1 */
  238. #define rZDCON1 (*(volatile unsigned *)0x1e80020)
  239. #define rZDISRC1 (*(volatile unsigned *)0x1e80024)
  240. #define rZDIDES1 (*(volatile unsigned *)0x1e80028)
  241. #define rZDICNT1 (*(volatile unsigned *)0x1e8002c)
  242. #define rZDCSRC1 (*(volatile unsigned *)0x1e80030)
  243. #define rZDCDES1 (*(volatile unsigned *)0x1e80034)
  244. #define rZDCCNT1 (*(volatile unsigned *)0x1e80038)
  245. /* BDMA0 */
  246. #define rBDCON0 (*(volatile unsigned *)0x1f80000)
  247. #define rBDISRC0 (*(volatile unsigned *)0x1f80004)
  248. #define rBDIDES0 (*(volatile unsigned *)0x1f80008)
  249. #define rBDICNT0 (*(volatile unsigned *)0x1f8000c)
  250. #define rBDCSRC0 (*(volatile unsigned *)0x1f80010)
  251. #define rBDCDES0 (*(volatile unsigned *)0x1f80014)
  252. #define rBDCCNT0 (*(volatile unsigned *)0x1f80018)
  253. /* BDMA1 */
  254. #define rBDCON1 (*(volatile unsigned *)0x1f80020)
  255. #define rBDISRC1 (*(volatile unsigned *)0x1f80024)
  256. #define rBDIDES1 (*(volatile unsigned *)0x1f80028)
  257. #define rBDICNT1 (*(volatile unsigned *)0x1f8002c)
  258. #define rBDCSRC1 (*(volatile unsigned *)0x1f80030)
  259. #define rBDCDES1 (*(volatile unsigned *)0x1f80034)
  260. #define rBDCCNT1 (*(volatile unsigned *)0x1f80038)
  261. /* ISR */
  262. #define pISR_RESET (*(unsigned *)(_ISR_STARTADDRESS+0x0))
  263. #define pISR_UNDEF (*(unsigned *)(_ISR_STARTADDRESS+0x4))
  264. #define pISR_SWI (*(unsigned *)(_ISR_STARTADDRESS+0x8))
  265. #define pISR_PABORT (*(unsigned *)(_ISR_STARTADDRESS+0xc))
  266. #define pISR_DABORT (*(unsigned *)(_ISR_STARTADDRESS+0x10))
  267. #define pISR_RESERVED (*(unsigned *)(_ISR_STARTADDRESS+0x14))
  268. #define pISR_IRQ (*(unsigned *)(_ISR_STARTADDRESS+0x18))
  269. #define pISR_FIQ (*(unsigned *)(_ISR_STARTADDRESS+0x1c))
  270. #define pISR_ADC (*(unsigned *)(_ISR_STARTADDRESS+0x20))
  271. #define pISR_RTC (*(unsigned *)(_ISR_STARTADDRESS+0x24))
  272. #define pISR_UTXD1 (*(unsigned *)(_ISR_STARTADDRESS+0x28))
  273. #define pISR_UTXD0 (*(unsigned *)(_ISR_STARTADDRESS+0x2c))
  274. #define pISR_SIO (*(unsigned *)(_ISR_STARTADDRESS+0x30))
  275. #define pISR_IIC (*(unsigned *)(_ISR_STARTADDRESS+0x34))
  276. #define pISR_URXD1 (*(unsigned *)(_ISR_STARTADDRESS+0x38))
  277. #define pISR_URXD0 (*(unsigned *)(_ISR_STARTADDRESS+0x3c))
  278. #define pISR_TIMER5 (*(unsigned *)(_ISR_STARTADDRESS+0x40))
  279. #define pISR_TIMER4 (*(unsigned *)(_ISR_STARTADDRESS+0x44))
  280. #define pISR_TIMER3 (*(unsigned *)(_ISR_STARTADDRESS+0x48))
  281. #define pISR_TIMER2 (*(unsigned *)(_ISR_STARTADDRESS+0x4c))
  282. #define pISR_TIMER1 (*(unsigned *)(_ISR_STARTADDRESS+0x50))
  283. #define pISR_TIMER0 (*(unsigned *)(_ISR_STARTADDRESS+0x54))
  284. #define pISR_UERR01 (*(unsigned *)(_ISR_STARTADDRESS+0x58))
  285. #define pISR_WDT (*(unsigned *)(_ISR_STARTADDRESS+0x5c))
  286. #define pISR_BDMA1 (*(unsigned *)(_ISR_STARTADDRESS+0x60))
  287. #define pISR_BDMA0 (*(unsigned *)(_ISR_STARTADDRESS+0x64))
  288. #define pISR_ZDMA1 (*(unsigned *)(_ISR_STARTADDRESS+0x68))
  289. #define pISR_ZDMA0 (*(unsigned *)(_ISR_STARTADDRESS+0x6c))
  290. #define pISR_TICK (*(unsigned *)(_ISR_STARTADDRESS+0x70))
  291. #define pISR_EINT4567 (*(unsigned *)(_ISR_STARTADDRESS+0x74))
  292. #define pISR_EINT3 (*(unsigned *)(_ISR_STARTADDRESS+0x78))
  293. #define pISR_EINT2 (*(unsigned *)(_ISR_STARTADDRESS+0x7c))
  294. #define pISR_EINT1 (*(unsigned *)(_ISR_STARTADDRESS+0x80))
  295. #define pISR_EINT0 (*(unsigned *)(_ISR_STARTADDRESS+0x84))
  296. /* PENDING BIT */
  297. //CAUTION:You must clear the pending bit as general special register.
  298. //        it's different way with KS32C6x00 
  299. #define BIT_ADC (0x1)
  300. #define BIT_RTC (0x1<<1)
  301. #define BIT_UTXD1 (0x1<<2)
  302. #define BIT_UTXD0 (0x1<<3)
  303. #define BIT_SIO (0x1<<4)
  304. #define BIT_IIC (0x1<<5)
  305. #define BIT_URXD1 (0x1<<6)
  306. #define BIT_URXD0 (0x1<<7)
  307. #define BIT_TIMER5 (0x1<<8)
  308. #define BIT_TIMER4 (0x1<<9)
  309. #define BIT_TIMER3 (0x1<<10)
  310. #define BIT_TIMER2 (0x1<<11)
  311. #define BIT_TIMER1 (0x1<<12)
  312. #define BIT_TIMER0 (0x1<<13)
  313. #define BIT_UERR01 (0x1<<14)
  314. #define BIT_WDT (0x1<<15)
  315. #define BIT_BDMA1 (0x1<<16)
  316. #define BIT_BDMA0 (0x1<<17)
  317. #define BIT_ZDMA1 (0x1<<18)
  318. #define BIT_ZDMA0 (0x1<<19)
  319. #define BIT_TICK (0x1<<20)
  320. #define BIT_EINT4567 (0x1<<21)
  321. #define BIT_EINT3 (0x1<<22)
  322. #define BIT_EINT2 (0x1<<23)
  323. #define BIT_EINT1 (0x1<<24)
  324. #define BIT_EINT0 (0x1<<25)
  325. #define BIT_GLOBAL (0x1<<26)
  326. #ifdef __cplusplus
  327. }
  328. #endif
  329. #endif /*__41000_H___*/