m68332.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:30k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* m68332.h - Motorola MC68332 CPU control registers */
  2. /* Copyright 1984-1992 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01m,20dec96,dat  fixed SPR 4225, M332_RAM_RAMBAR was incorrect
  7. 01l,24oct92,jcf  fixed TPU defines.
  8. 01k,22sep92,rrr  added support for c++
  9. 01j,02jul92,caf  added TY_CO_DEV and function declarations for 5.1 upgrade.
  10.  for 5.0.x compatibility, define INCLUDE_TY_CO_DRV_50 when
  11.  including this header.
  12. 01e,26may92,rrr  the tree shuffle
  13. 01d,22jan92,caf  fixed M332_QSM_CMD_BASE, QSM_QILR_SPI_MASK and SIM_CSOR_IPL.
  14. 01c,04oct91,rrr  passed through the ansification filter
  15.   -fixed #else and #endif
  16.   -changed ASMLANGUAGE to _ASMLANGUAGE
  17.   -changed copyright notice
  18. 01b,30sep91,caf  added _ASMLANGUAGE conditional.
  19. 01a,13feb91,jcf  based on Tektronix original.
  20. */
  21. /*
  22. This file contains I/O address and related constants for the MC68332.
  23. */
  24. #ifndef __INCm68332h
  25. #define __INCm68332h
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. #ifndef _ASMLANGUAGE
  30. #include "tyLib.h"
  31. #ifndef  INCLUDE_TY_CO_DRV_50
  32. typedef struct /* TY_CO_DEV */
  33.     {
  34.     TY_DEV tyDev;
  35.     BOOL created; /* true if this device has been created */
  36.     int baudFreq; /* system clock frequency */
  37.     } TY_CO_DEV;
  38. #endif /* INCLUDE_TY_CO_DRV_50 */
  39. /* MC68332 parameter register addresses */
  40. #define M332_SIM_MCR ((UINT16 *) 0xfffa00)
  41. #define M332_SIM_SIMTR ((UINT16 *) 0xfffa02)
  42. #define M332_SIM_SYNCR ((UINT16 *) 0xfffa04)
  43. #define M332_SIM_RSR ((UINT8  *) 0xfffa07)
  44. #define M332_SIM_SIMTRE ((UINT16 *) 0xfffa08)
  45. #define M332_SIM_PORTE ((UINT8  *) 0xfffa11)
  46. #define M332_SIM_DDRE ((UINT8  *) 0xfffa15)
  47. #define M332_SIM_PEPAR ((UINT8  *) 0xfffa17)
  48. #define M332_SIM_PORTF ((UINT8  *) 0xfffa19)
  49. #define M332_SIM_DDRF ((UINT8  *) 0xfffa1d)
  50. #define M332_SIM_PFPAR ((UINT8  *) 0xfffa1f)
  51. #define M332_SIM_SYPCR ((UINT8  *) 0xfffa21)
  52. #define M332_SIM_PICR ((UINT16 *) 0xfffa22)
  53. #define M332_SIM_PITR ((UINT16 *) 0xfffa24)
  54. #define M332_SIM_SWSR ((UINT8  *) 0xfffa27)
  55. #define M332_SIM_TSTMSRA ((UINT16 *) 0xfffa30)
  56. #define M332_SIM_TSTMSRB ((UINT16 *) 0xfffa32)
  57. #define M332_SIM_TSTSC ((UINT16 *) 0xfffa34)
  58. #define M332_SIM_TSTRC ((UINT16 *) 0xfffa36)
  59. #define M332_SIM_CREG ((UINT16 *) 0xfffa38)
  60. #define M332_SIM_DREG ((UINT16 *) 0xfffa3a)
  61. #define M332_SIM_PORTC ((UINT8  *) 0xfffa41)
  62. #define M332_SIM_CSPAR0 ((UINT16 *) 0xfffa44)
  63. #define M332_SIM_CSPAR1 ((UINT16 *) 0xfffa46)
  64. #define M332_SIM_CSBOOT ((SIM_CS *) 0xfffa48)
  65. #define M332_SIM_CS0 ((SIM_CS *) 0xfffa4c)
  66. #define M332_SIM_CS1 ((SIM_CS *) 0xfffa50)
  67. #define M332_SIM_CS2 ((SIM_CS *) 0xfffa54)
  68. #define M332_SIM_CS3 ((SIM_CS *) 0xfffa58)
  69. #define M332_SIM_CS4 ((SIM_CS *) 0xfffa5c)
  70. #define M332_SIM_CS5 ((SIM_CS *) 0xfffa60)
  71. #define M332_SIM_CS6 ((SIM_CS *) 0xfffa64)
  72. #define M332_SIM_CS7 ((SIM_CS *) 0xfffa68)
  73. #define M332_SIM_CS8 ((SIM_CS *) 0xfffa6c)
  74. #define M332_SIM_CS9 ((SIM_CS *) 0xfffa70)
  75. #define M332_SIM_CS10 ((SIM_CS *) 0xfffa74)
  76. #define M332_RAM_RAMMCR ((UINT16 *) 0xfffb00)
  77. #define M332_RAM_RAMTST ((UINT16 *) 0xfffb02)
  78. #define M332_RAM_RAMBAR ((UINT16 *) 0xfffb04)
  79. #define M332_QSM_QMCR ((UINT16 *) 0xfffc00)
  80. #define M332_QSM_QTEST ((UINT16 *) 0xfffc02)
  81. #define M332_QSM_QILR ((UINT8  *) 0xfffc04)
  82. #define M332_QSM_QIVR ((UINT8  *) 0xfffc05)
  83. #define M332_QSM_SCCR0 ((UINT16 *) 0xfffc08)
  84. #define M332_QSM_SCCR1 ((UINT16 *) 0xfffc0a)
  85. #define M332_QSM_SCSR ((UINT16 *) 0xfffc0c)
  86. #define M332_QSM_SCDR ((UINT16 *) 0xfffc0e)
  87. #define M332_QSM_QPDR ((UINT8  *) 0xfffc15)
  88. #define M332_QSM_QPAR ((UINT8  *) 0xfffc16)
  89. #define M332_QSM_QDDR ((UINT8  *) 0xfffc17)
  90. #define M332_QSM_SPCR0 ((UINT16 *) 0xfffc18)
  91. #define M332_QSM_SPCR1 ((UINT16 *) 0xfffc1a)
  92. #define M332_QSM_SPCR2 ((UINT16 *) 0xfffc1c)
  93. #define M332_QSM_SPCR3 ((UINT8  *) 0xfffc1e)
  94. #define M332_QSM_SPSR ((UINT8  *) 0xfffc1f)
  95. #define M332_QSM_RX_BASE ((UINT16 *) 0xfffd00)
  96. #define M332_QSM_TX_BASE ((UINT16 *) 0xfffd20)
  97. #define M332_QSM_CMD_BASE ((UINT8  *) 0xfffd40)
  98. #define M332_TPU_TMCR ((UINT16 *) 0xfffe00)
  99. #define M332_TPU_TTCR ((UINT16 *) 0xfffe02)
  100. #define M332_TPU_DSCR ((UINT16 *) 0xfffe04)
  101. #define M332_TPU_DSSR ((UINT16 *) 0xfffe06)
  102. #define M332_TPU_TICR ((UINT16 *) 0xfffe08)
  103. #define M332_TPU_CIER ((UINT16 *) 0xfffe0a)
  104. #define M332_TPU_CFSR0 ((UINT16 *) 0xfffe0c)
  105. #define M332_TPU_CFSR1 ((UINT16 *) 0xfffe0e)
  106. #define M332_TPU_CFSR2 ((UINT16 *) 0xfffe10)
  107. #define M332_TPU_CFSR3 ((UINT16 *) 0xfffe12)
  108. #define M332_TPU_HSQR0 ((UINT16 *) 0xfffe14)
  109. #define M332_TPU_HSQR1 ((UINT16 *) 0xfffe16)
  110. #define M332_TPU_HSRR0 ((UINT16 *) 0xfffe18)
  111. #define M332_TPU_HSRR1 ((UINT16 *) 0xfffe1a)
  112. #define M332_TPU_CPR0 ((UINT16 *) 0xfffe1c)
  113. #define M332_TPU_CPR1 ((UINT16 *) 0xfffe1e)
  114. #define M332_TPU_CISR ((UINT16 *) 0xfffe20)
  115. #define M332_TPU_CHN ((TPU_CHN *) 0xffff00)
  116. /* SIM - Register definitions for the System Integration Module */
  117. typedef struct /* SIM_CS */
  118.     {
  119.     UINT16 csBar; /* chip select base address register */
  120.     UINT16 csOr; /* chip select options register */
  121.     } SIM_CS;
  122. /* SIM_MCR - Module Configuration Register (Write Once Only) */
  123. #define SIM_MCR_MM 0x0040 /* module mapping */
  124. #define SIM_MCR_SUPV 0x0080 /* supervisor/unrestricted data space */
  125. #define SIM_MCR_X 0x0000 /* no show cycle, ext. arbitration */
  126. #define SIM_MCR_SH 0x0100 /* show cycle enabled, no ext. arb. */
  127. #define SIM_MCR_SH_X 0x0200 /* show cycle enabled, ext. arb. */
  128. #define SIM_MCR_SH_X_BG 0x0300 /* show cycle/ext arb; int halt w/ BG */
  129. #define SIM_MCR_SLVEN 0x0800 /* slave mode enable */
  130. #define SIM_MCR_FRZBM 0x2000 /* freeze bus monitor enable */
  131. #define SIM_MCR_FRZSW 0x4000 /* freeze software enable */
  132. #define SIM_MCR_EXOFF 0x8000 /* external clock off */
  133. /* SIM_SIMTR - Module Test Register */
  134. #define SIM_SIMTR_REV_MASK 0xfc00 /* revision number for this part */
  135. /* SIM_SYNCR - Clock Synthesis Control Register */
  136. #define SIM_SYNCR_STEXT 0x0001 /* stop mode external clock */
  137. #define SIM_SYNCR_STSIM 0x0002 /* stop mode system integration clock */
  138. #define SIM_SYNCR_RSTEN 0x0004 /* reset enable */
  139. #define SIM_SYNCR_SLOCK 0x0008 /* synthesizer lock */
  140. #define SIM_SYNCR_SLIMP 0x0010 /* limp mode */
  141. #define SIM_SYNCR_EDIV  0x0080 /* E clock divide rate */
  142. #define SIM_SYNCR_Y_MASK  0x3f00 /* Y - frequency control bits */
  143. #define SIM_SYNCR_X     0x4000 /* X - frequency control bit */
  144. #define SIM_SYNCR_W     0x8000 /* W - frequency control bit */
  145. /* SIM_RSR - Reset Status Register */
  146. #define SIM_RSR_TST 0x01 /* test submodule reset */
  147. #define SIM_RSR_SYS 0x02 /* system reset (CPU reset) */
  148. #define SIM_RSR_LOC 0x04 /* loss of clock reset */
  149. #define SIM_RSR_HLT 0x10 /* halt monitor reset */
  150. #define SIM_RSR_SW 0x20 /* software watchdog reset */
  151. #define SIM_RSR_POW 0x40 /* power up reset */
  152. #define SIM_RSR_EXT 0x80 /* external reset */
  153. /* SIM_PEPAR - Port E Pin Assignment Register */
  154. #define SIM_PEPAR_DSACK0 0x01 /* select bus control pin assignment */
  155. #define SIM_PEPAR_DSACK1 0x02 /* select bus control pin assignment */
  156. #define SIM_PEPAR_AVEC 0x04 /* select bus control pin assignment */
  157. #define SIM_PEPAR_RMC 0x08 /* select bus control pin assignment */
  158. #define SIM_PEPAR_DS 0x10 /* select bus control pin assignment */
  159. #define SIM_PEPAR_AS 0x20 /* select bus control pin assignment */
  160. #define SIM_PEPAR_SIZ0 0x40 /* select bus control pin assignment */
  161. #define SIM_PEPAR_SIZ1 0x80 /* select bus control pin assignment */
  162. /* SIM_PFPAR - Port F Pin Assignment Register */
  163. #define SIM_PFPAR_MODCK 0x01 /* select bus control pin assignment */
  164. #define SIM_PFPAR_IRQ1 0x02 /* select bus control pin assignment */
  165. #define SIM_PFPAR_IRQ2 0x04 /* select bus control pin assignment */
  166. #define SIM_PFPAR_IRQ3 0x08 /* select bus control pin assignment */
  167. #define SIM_PFPAR_IRQ4 0x10 /* select bus control pin assignment */
  168. #define SIM_PFPAR_IRQ5 0x20 /* select bus control pin assignment */
  169. #define SIM_PFPAR_IRQ6 0x40 /* select bus control pin assignment */
  170. #define SIM_PFPAR_IRQ7 0x80 /* select bus control pin assignment */
  171. /* SIM_SYPCR - System Protection Control (Write Once Only) */
  172. #define SIM_SYPCR_BMT_64 0x00 /* 64 clk cycle bus monitor timeout */
  173. #define SIM_SYPCR_BMT_32 0x01 /* 32 clk cycle bus monitor timeout */
  174. #define SIM_SYPCR_BMT_16 0x02 /* 16 clk cycle bus monitor timeout */
  175. #define SIM_SYPCR_BMT_8 0x03 /* 8 clk cycle bus monitor timeout */
  176. #define SIM_SYPCR_BME 0x04 /* bus monitor enable */
  177. #define SIM_SYPCR_HME 0x08 /* halt monitor enable */
  178. #define SIM_SYPCR_SWT_9 0x00 /* 2^9 extal cycle software timeout */
  179. #define SIM_SYPCR_SWT_11 0x10 /* 2^11 extal cycle software timeout */
  180. #define SIM_SYPCR_SWT_13 0x20 /* 2^13 extal cycle software timeout */
  181. #define SIM_SYPCR_SWT_15 0x30 /* 2^15 extal cycle software timeout */
  182. #define SIM_SYPCR_SWT_18 0x40 /* 2^18 extal cycle software timeout */
  183. #define SIM_SYPCR_SWT_20 0x50 /* 2^20 extal cycle software timeout */
  184. #define SIM_SYPCR_SWT_22 0x60 /* 2^22 extal cycle software timeout */
  185. #define SIM_SYPCR_SWT_24 0x70 /* 2^24 extal cycle software timeout */
  186. #define SIM_SYPCR_SWE 0x80 /* software watchdog enable */
  187. /* SIM_PICR - Periodic Interrupt Control Register */
  188. #define SIM_PICR_PIV_MASK 0x00ff /* periodic interrupt vector */
  189. #define SIM_PICR_PIRQL_MASK 0x0700 /* periodic interrupt request level */
  190. /* SIM_PITR - Periodic Interrupt Timer */
  191. #define SIM_PITR_PITR_MASK 0x00ff /* periodic interrupt timing register */
  192. #define SIM_PITR_PTP 0x0100 /* periodic timer prescale bit */
  193. /* SIM_SWSR - Software Service Register */
  194. #define SIM_SWSR_ACK1 0x55 /* software watchdog ack. part 1 */
  195. #define SIM_SWSR_ACK2 0xaa /* software watchdog ack. part 2 */
  196. /* SIM_CSPAR0 - Chip Select Pin Assignement Register 0 */
  197. #define SIM_CSPAR0_CSBOOT_DIS 0x0000 /* discrete output */
  198. #define SIM_CSPAR0_CSBOOT_DEF 0x0001 /* default pin function */
  199. #define SIM_CSPAR0_CSBOOT_8BIT 0x0002 /* chip select with 8 bit port */
  200. #define SIM_CSPAR0_CSBOOT_16BIT 0x0003 /* chip select with 16 bit port */
  201. #define SIM_CSPAR0_CS0_DIS 0x0000 /* discrete output */
  202. #define SIM_CSPAR0_CS0_BR 0x0004 /* default pin function */
  203. #define SIM_CSPAR0_CS0_8BIT 0x0008 /* chip select with 8 bit port */
  204. #define SIM_CSPAR0_CS0_16BIT 0x000c /* chip select with 16 bit port */
  205. #define SIM_CSPAR0_CS1_DIS 0x0000 /* discrete output */
  206. #define SIM_CSPAR0_CS1_BG 0x0010 /* default pin function */
  207. #define SIM_CSPAR0_CS1_8BIT 0x0020 /* chip select with 8 bit port */
  208. #define SIM_CSPAR0_CS1_16BIT 0x0030 /* chip select with 16 bit port */
  209. #define SIM_CSPAR0_CS2_DIS 0x0000 /* discrete output */
  210. #define SIM_CSPAR0_CS2_BGACK 0x0040 /* default pin function */
  211. #define SIM_CSPAR0_CS2_8BIT 0x0080 /* chip select with 8 bit port */
  212. #define SIM_CSPAR0_CS2_16BIT 0x00c0 /* chip select with 16 bit port */
  213. #define SIM_CSPAR0_CS3_DIS 0x0000 /* discrete output */
  214. #define SIM_CSPAR0_CS3_FC0 0x0100 /* default pin function */
  215. #define SIM_CSPAR0_CS3_8BIT 0x0200 /* chip select with 8 bit port */
  216. #define SIM_CSPAR0_CS3_16BIT 0x0300 /* chip select with 16 bit port */
  217. #define SIM_CSPAR0_CS4_DIS 0x0000 /* discrete output */
  218. #define SIM_CSPAR0_CS4_FC1 0x0400 /* default pin function */
  219. #define SIM_CSPAR0_CS4_8BIT 0x0800 /* chip select with 8 bit port */
  220. #define SIM_CSPAR0_CS4_16BIT 0x0c00 /* chip select with 16 bit port */
  221. #define SIM_CSPAR0_CS5_DIS 0x0000 /* discrete output */
  222. #define SIM_CSPAR0_CS5_FC2 0x1000 /* default pin function */
  223. #define SIM_CSPAR0_CS5_8BIT 0x2000 /* chip select with 8 bit port */
  224. #define SIM_CSPAR0_CS5_16BIT 0x3000 /* chip select with 16 bit port */
  225. /* SIM_CSPAR1 - Chip Select Pin Assignement Register 1 */
  226. #define SIM_CSPAR1_CS6_DIS 0x0000 /* discrete output */
  227. #define SIM_CSPAR1_CS6_A19 0x0001 /* default pin function */
  228. #define SIM_CSPAR1_CS6_8BIT 0x0002 /* chip select with 8 bit port */
  229. #define SIM_CSPAR1_CS6_16BIT 0x0003 /* chip select with 16 bit port */
  230. #define SIM_CSPAR1_CS7_DIS 0x0000 /* discrete output */
  231. #define SIM_CSPAR1_CS7_A20 0x0004 /* default pin function */
  232. #define SIM_CSPAR1_CS7_8BIT 0x0008 /* chip select with 8 bit port */
  233. #define SIM_CSPAR1_CS7_16BIT 0x000c /* chip select with 16 bit port */
  234. #define SIM_CSPAR1_CS8_DIS 0x0000 /* discrete output */
  235. #define SIM_CSPAR1_CS8_A21 0x0010 /* default pin function */
  236. #define SIM_CSPAR1_CS8_8BIT 0x0020 /* chip select with 8 bit port */
  237. #define SIM_CSPAR1_CS8_16BIT 0x0030 /* chip select with 16 bit port */
  238. #define SIM_CSPAR1_CS9_DIS 0x0000 /* discrete output */
  239. #define SIM_CSPAR1_CS9_A22 0x0040 /* default pin function */
  240. #define SIM_CSPAR1_CS9_8BIT 0x0080 /* chip select with 8 bit port */
  241. #define SIM_CSPAR1_CS9_16BIT 0x00c0 /* chip select with 16 bit port */
  242. #define SIM_CSPAR1_CS10_E_CLK 0x0000 /* E clock output */
  243. #define SIM_CSPAR1_CS10_A23 0x0100 /* default pin function */
  244. #define SIM_CSPAR1_CS10_8BIT 0x0200 /* chip select with 8 bit port */
  245. #define SIM_CSPAR1_CS10_16BIT 0x0300 /* chip select with 16 bit port */
  246. /* SIM_CSBAR - Chip Select Base Address Register */
  247. #define SIM_CSBAR_2K 0x0000 /* 2k block size */
  248. #define SIM_CSBAR_8K 0x0001 /* 8k block size */
  249. #define SIM_CSBAR_16K 0x0002 /* 16k block size */
  250. #define SIM_CSBAR_64K 0x0003 /* 64k block size */
  251. #define SIM_CSBAR_128K 0x0004 /* 128k block size */
  252. #define SIM_CSBAR_256K 0x0005 /* 256k block size */
  253. #define SIM_CSBAR_512K 0x0006 /* 512k block size */
  254. #define SIM_CSBAR_1024K 0x0007 /* 1024k block size */
  255. /* SIM_CSOR - Chip Select Option Register */
  256. #define SIM_CSOR_AVEC 0x0001 /* autovector */
  257. #define SIM_CSOR_IPL_ALL 0x0000 /* assert chip select for any level */
  258. #define SIM_CSOR_IPL_1 0x0002 /* assert chip select for level 1 */
  259. #define SIM_CSOR_IPL_2 0x0004 /* assert chip select for level 2 */
  260. #define SIM_CSOR_IPL_3 0x0006 /* assert chip select for level 3 */
  261. #define SIM_CSOR_IPL_4 0x0008 /* assert chip select for level 4 */
  262. #define SIM_CSOR_IPL_5 0x000a /* assert chip select for level 5 */
  263. #define SIM_CSOR_IPL_6 0x000c /* assert chip select for level 6 */
  264. #define SIM_CSOR_IPL_7 0x000e /* assert chip select for level 7 */
  265. #define SIM_CSOR_SP_CPU 0x0000 /* CPU space */
  266. #define SIM_CSOR_SP_USER 0x0010 /* user space */
  267. #define SIM_CSOR_SP_SUPV 0x0020 /* supervisor space */
  268. #define SIM_CSOR_SP_SU 0x0030 /* either supervisor or user space */
  269. #define SIM_CSOR_WAIT0 0x0000 /* dsack with 0 wait states */
  270. #define SIM_CSOR_WAIT1 0x0040 /* dsack with 1 wait states */
  271. #define SIM_CSOR_WAIT2 0x0080 /* dsack with 2 wait states */
  272. #define SIM_CSOR_WAIT3 0x00c0 /* dsack with 3 wait states */
  273. #define SIM_CSOR_WAIT4 0x0100 /* dsack with 4 wait states */
  274. #define SIM_CSOR_WAIT5 0x0140 /* dsack with 5 wait states */
  275. #define SIM_CSOR_WAIT6 0x0180 /* dsack with 6 wait states */
  276. #define SIM_CSOR_WAIT7 0x01c0 /* dsack with 7 wait states */
  277. #define SIM_CSOR_WAIT8 0x0200 /* dsack with 8 wait states */
  278. #define SIM_CSOR_WAIT9 0x0240 /* dsack with 9 wait states */
  279. #define SIM_CSOR_WAIT10 0x0280 /* dsack with 10 wait states */
  280. #define SIM_CSOR_WAIT11 0x02c0 /* dsack with 11 wait states */
  281. #define SIM_CSOR_WAIT12 0x0300 /* dsack with 12 wait states */
  282. #define SIM_CSOR_WAIT13 0x0340 /* dsack with 13 wait states */
  283. #define SIM_CSOR_WAIT_FAST 0x0380 /* fast termination */
  284. #define SIM_CSOR_WAIT_EXT 0x03c0 /* external dsack generation */
  285. #define SIM_CSOR_AS   0x0000 /* strobe with AS* */
  286. #define SIM_CSOR_DS 0x0400 /* strobe with DS* */
  287. #define SIM_CSOR_READ 0x0800 /* read only */
  288. #define SIM_CSOR_WRITE 0x1000 /* write only */
  289. #define SIM_CSOR_RW 0x1800 /* read/write */
  290. #define SIM_CSOR_BYTE_OFF 0x0000 /* off */
  291. #define SIM_CSOR_BYTE_LOWER 0x2000 /* lower byte access */
  292. #define SIM_CSOR_BYTE_UPPER 0x4000 /* upper byte access */
  293. #define SIM_CSOR_BYTE_BOTH 0x6000 /* either upper or lower access */
  294. #define SIM_CSOR_ASYNC 0x0000 /* asynchronous */
  295. #define SIM_CSOR_SYNC 0x8000 /* synchronous */
  296. /* RAM - Register definitions for the RAM Control Registers */
  297. /* RAM_RAMMCR - RAM Module Configuration Register */
  298. #define RAM_RAMMCR_SUPV 0x0100 /* supv. access to on chip RAM only */
  299. #define RAM_RAMMCR_STOP 0x8000 /* low power stop mode */
  300. /* RAM_RAMTST - RAM Test Register */
  301. #define RAM_RAMTST_RTBA 0x0100 /* RAMBAR may be written as desired */
  302. /* RAM_RAMBAR - RAM Base Address Register */
  303. #define RAM_RAMBAR_DISABLE 0x0001 /* RAM array is disabled */
  304. #define RAM_RAMBAR_ENABLE 0x0000 /* RAM array is enabled */
  305. /* QSM - Register definitions for the Queued Serial Module (QSM) */
  306. /* QSM_MCR - Module Configuration Register */
  307. #define QSM_MCR_SUPV 0x0080 /* supervisor/unrestricted access */
  308. #define QSM_MCR_FRZ0 0x2000 /* reserved */
  309. #define QSM_MCR_FRZ1 0x4000 /* halt QSM on transfer bndry */
  310. #define QSM_MCR_STOP 0x8000 /* stop enable */
  311. /* QSM_QILR -  QSM Interrupt Level Register */
  312. #define QSM_QILR_SCI_MASK 0x07 /* SCI interrupt level (0 = disabled) */
  313. #define QSM_QILR_SPI_MASK 0x38 /* SCI interrupt level (0 = disabled) */
  314. /* QSM_SCCR1 - Control Register 1 */
  315. #define QSM_SCCR1_SBK 0x0001 /* send break */
  316. #define QSM_SCCR1_RWU 0x0002 /* receiver wakeup enable */
  317. #define QSM_SCCR1_RE 0x0004 /* receiver enable */
  318. #define QSM_SCCR1_TE 0x0008 /* transmitter enable */
  319. #define QSM_SCCR1_ILIE 0x0010 /* idle-line interrupt enable */
  320. #define QSM_SCCR1_RIE 0x0020 /* receiver interrupt enable */
  321. #define QSM_SCCR1_TCIE 0x0040 /* transmit complete interrupt enable */
  322. #define QSM_SCCR1_TIE 0x0080 /* transmit interrupt enable */
  323. #define QSM_SCCR1_WAKE 0x0100 /* wakeup by address mark */
  324. #define QSM_SCCR1_M 0x0200 /* mode select: 0= 8 data bits, 1 = 9 */
  325. #define QSM_SCCR1_PE 0x0400 /* parity enable */
  326. #define QSM_SCCR1_PT 0x0800 /* parity type: 1=Odd, 0=Even */
  327. #define QSM_SCCR1_ILT 0x1000 /* idle line detect type */
  328. #define QSM_SCCR1_WOMS 0x2000 /* wired or mode for SCI Pins */
  329. #define QSM_SCCR1_LOOPS 0x4000 /* test SCI operation */
  330. /* QSM_SCSR - Status Register */
  331. #define QSM_SCSR_PF 0x0001 /* parity error flag */
  332. #define QSM_SCSR_FE 0x0002 /* framing error flag */
  333. #define QSM_SCSR_NF 0x0004 /* noise error flag */
  334. #define QSM_SCSR_OR 0x0008 /* overrun error flag */
  335. #define QSM_SCSR_IDLE 0x0010 /* idle-line detected flag */
  336. #define QSM_SCSR_RAF 0x0020 /* receiver active flag */
  337. #define QSM_SCSR_RDRF 0x0040 /* receive data register full flag */
  338. #define QSM_SCSR_TC 0x0080 /* transmit complete */
  339. #define QSM_SCSR_TDRE 0x0100 /* transmit date register empty flag */
  340. /* QSM_QPDR/QSM_QDDR - Port Data and Data Direction Register */
  341. #define QSM_QPDR_MISO 0x01 /* MISO pin */
  342. #define QSM_QPDR_MOSI 0x02 /* MOSI pin */
  343. #define QSM_QPDR_SCK 0x04 /* SCK pin */
  344. #define QSM_QPDR_PCS0 0x08 /* PCS0 pin */
  345. #define QSM_QPDR_PCS1 0x10 /* PCS1 pin */
  346. #define QSM_QPDR_PCS2 0x20 /* PCS2 pin */
  347. #define QSM_QPDR_PCS3 0x40 /* PCS3 pin */
  348. #define QSM_QPDR_TXD 0x80 /* TXD pin */
  349. /* QSM_QPAR - Pin Assignment Register */
  350. #define QSM_QPAR_MISO 0x0001 /* MISO pin */
  351. #define QSM_QPAR_MOSI 0x0002 /* MOSI pin */
  352. #define QSM_QPAR_PCS0 0x0008 /* PCS0 pin */
  353. #define QSM_QPAR_PCS1 0x0010 /* PCS1 pin */
  354. #define QSM_QPAR_PCS2 0x0020 /* PCS2 pin */
  355. #define QSM_QPAR_PCS3 0x0040 /* PCS3 pin */
  356. /* QSM_SPCR0 - Serial Peripheral Control Register 0 */
  357. #define QSM_SPCR0_CPHA_CAP 0x0000 /* capture data on leading edge */
  358. #define QSM_SPCR0_CPHA_CHG 0x0100 /* change data on leading edge */
  359. #define QSM_SPCR0_CPOL_LOW 0x0000  /* clock polarity; SCK inactive low */
  360. #define QSM_SPCR0_CPOL_HIGH 0x0200  /* clock polarity; SCK inactive high */
  361. #define QSM_SPCR0_WOMQ 0x4000 /* wired or mode */
  362. #define QSM_SPCR0_MASTER 0x8000 /* device as QSM master */
  363. #define QSM_SPCR0_SLAVE 0x0000 /* device as QSM slave */
  364. /* QSM_SPCR1 - Serial Peripheral Control Register 1 */
  365. #define QSM_SPCR1_SPE 0x8000 /* QSPI is enabled */
  366. /* QSM_SPCR2 - Serial Peripheral Control Register 2 */
  367. #define QSM_SPCR2_WRTO 0x2000 /* wrap to NEWQP (0 otherwise) */
  368. #define QSM_SPCR2_WREN 0x4000 /* wrap enabled */
  369. #define QSM_SPCR2_SPIFIE 0x8000 /* finished interrupt enabled */
  370. /* QSM_SPCR3 - Serial Peripheral Control Register 3 */
  371. #define QSM_SPCR3_HALT 0x01 /* halt after current transfer */
  372. #define QSM_SPCR3_HMIE 0x02 /* HALTA or MODF interrupt enable */
  373. #define QSM_SPCR3_LOOPQ 0x04 /* loop back mode */
  374. /* QSM_SPSR - Serial Peripheral Status Register */
  375. #define QSM_SPSR_HALTA 0x20 /* QSPI halted */
  376. #define QSM_SPSR_MODF 0x40 /* mode fault (multiple masters) */
  377. #define QSM_SPSR_SPIF 0x80 /* QSPI executed last command */
  378. /* QSM_SPCCB - Serial Peripheral Command Control Byte */
  379. #define QSM_SPCCB_DSCK 0x10 /* SPCR1 contains PCS setup time */
  380. #define QSM_SPCCB_DT 0x20 /* SPCR1 contains inter-trans delay */
  381. #define QSM_SPCCB_BITSE 0x40 /* SPCR0 contains number of bits */
  382. #define QSM_SPCCB_CONT 0x80 /* continue to assert PCS after trans */
  383. /* TPU - Time Processing Unit */
  384. /* Channel control options */
  385. #define CHN_PSC_PAC 0x0000 /* force pin to PAC latches */
  386. #define CHN_PSC_HIGH 0x0001 /* force pin high */
  387. #define CHN_PSC_LOW 0x0002 /* force pin low */
  388. #define CHN_PSC_NC 0x0003 /* do not force any state */
  389. #define CHN_PAC_NCM 0x0000 /* no change on match */
  390. #define CHN_PAC_NO_DETECT 0x0000 /* do not detect transition */
  391. #define CHN_PAC_HIGH 0x0004 /* high on match */
  392. #define CHN_PAC_RISING 0x0004 /* detect rising edge */
  393. #define CHN_PAC_LOW 0x0008 /* low on match */
  394. #define CHN_PAC_FALLING 0x0008 /* detect falling edge */
  395. #define CHN_PAC_TOGGLE 0x000c /* toggle on match */
  396. #define CHN_PAC_EITHER 0x000c /* detect either edge transition */
  397. #define CHN_PAC_NC 0x0010 /* don not change PAC */
  398. #define CHN_TBS_INP_C1_M1 0x0000 /* input - capture TCR1, match TCR1 */
  399. #define CHN_TBS_INP_C1_M2 0x0020 /* input - capture TCR1, match TCR2 */
  400. #define CHN_TBS_INP_C2_M1 0x0040 /* input - capture TCR2, match TCR1 */
  401. #define CHN_TBS_INP_C2_M2 0x0060 /* input - capture TCR2, match TCR2 */
  402. #define CHN_TBS_OUT_C1_M1 0x0080 /* output - capture TCR1, match TCR1 */
  403. #define CHN_TBS_OUT_C1_M2 0x00a0 /* output - capture TCR1, match TCR2 */
  404. #define CHN_TBS_OUT_C2_M1 0x00c0 /* output - capture TCR2, match TCR1 */
  405. #define CHN_TBS_OUT_C2_M2 0x00e0 /* output - capture TCR2, match TCR2 */
  406. #define CHN_TBS_NC 0x0100 /* do not change TBS */
  407. typedef struct /* TPU_DIO */
  408.     {
  409.     UINT16 chnCont;
  410.     UINT16 pinLvl;
  411.     UINT16 matchRate;
  412.     } TPU_DIO;
  413. /* DIO_HSQR - Host Sequence Register */
  414. #define DIO_HSQR_TRANS 0x0 /* record pin on transition */
  415. #define DIO_HSQR_MATCH 0x1 /* record pin at matchRate */
  416. #define DIO_HSQR_RECORD 0x2 /* record pin on HSRR = 0x3 */
  417. /* DIO_HSRR - Host Service Register */
  418. #define DIO_HSRR_NONE 0x0 /* none */
  419. #define DIO_HSRR_HIGH 0x1 /* force output high */
  420. #define DIO_HSRR_LOW 0x2 /* force output low */
  421. #define DIO_HSRR_INIT 0x3 /* initialization */
  422. typedef struct /* TPU_ITC */
  423.     {
  424.     UINT16 chnCont;
  425.     UINT16 linkBankAdrs;
  426.     UINT16 maxCount;
  427.     UINT16 transCount;
  428.     UINT16 finalTransTime;
  429.     UINT16 lastTransTime;
  430.     } TPU_ITC;
  431. /* ITC_HSQR - Host Sequence Register */
  432. #define ITC_HSQR_SNGL 0x0 /* no link, single mode */
  433. #define ITC_HSQR_CONT 0x1 /* no link, continuous mode */
  434. #define ITC_HSQR_LINK_SNGL 0x2 /* link, single mode */
  435. #define ITC_HSQR_LINK_CONT 0x3 /* link, continuous mode */
  436. /* ITC_HSRR - Host Service Register */
  437. #define ITC_HSRR_NONE 0x0 /* none */
  438. #define ITC_HSRR_INIT 0x1 /* initialization */
  439. typedef struct /* TPU_OC */
  440.     {
  441.     UINT16 chnCont;
  442.     UINT16 offset;
  443.     UINT16 ratioRefAddr1;
  444.     UINT16 refAddr2Addr3;
  445.     UINT16 refTime;
  446.     UINT16 matchTime;
  447.     } TPU_OC;
  448. /* OC_HSQR - Host Sequence Register */
  449. #define OC_HSQR_ALL 0x0 /* all pulse mode code executed */
  450. #define OC_HSQR_RESTRICT 0x2 /* pulse mode code 0xec,0xee executed */
  451. /* OC_HSRR - Host Service Register */
  452. #define OC_HSRR_NONE 0x0 /* none */
  453. #define OC_HSRR_HIPM 0x1 /* host initiated pulse mode */
  454. #define OC_HSRR_INIT 0x3 /* initialization */
  455. typedef struct /* TPU_PWM */
  456.     {
  457.     UINT16 chnCont;
  458.     UINT16 oldris;
  459.     UINT16 pwmhi;
  460.     UINT16 pwmper;
  461.     UINT16 pwmris;
  462.     } TPU_PWM;
  463. /* PWM_HSRR - Host Service Register */
  464. #define PWM_HSRR_NONE 0x0 /* none */
  465. #define PWM_HSRR_UPDATE 0x1 /* immediate update request */
  466. #define PWM_HSRR_INIT 0x2 /* initialization */
  467. typedef struct /* TPU_SPWM_M0 */
  468.     {
  469.     UINT16 chnCont;
  470.     UINT16 nextRise;
  471.     UINT16 highTime;
  472.     UINT16 period;
  473.     UINT16 refAddr1;
  474.     UINT16  delay;
  475.     } TPU_SPWM_M0;
  476. typedef struct /* TPU_SPWM_M1 */
  477.     {
  478.     UINT16 chnCont;
  479.     UINT16 nextRise;
  480.     UINT16 highTime;
  481.     UINT16 delay;
  482.     UINT16 refAddr1Addr2;
  483.     UINT16 refValue;
  484.     } TPU_SPWM_M1;
  485. typedef struct /* TPU_SPWM_M2 */
  486.     {
  487.     UINT16 chnCont;
  488.     UINT16 nextRise;
  489.     UINT16 highTime;
  490.     UINT16 period;
  491.     UINT16 linkRefAddr1;
  492.     UINT16  delay;
  493.     } TPU_SPWM_M2;
  494. /* SPWM_HSQR - Host Sequence Register */
  495. #define SPWM_HSQR_MODE0 0x0 /* mode 0 */
  496. #define SPWM_HSQR_MODE1 0x1 /* mode 1 */
  497. #define SPWM_HSQR_MODE2 0x2 /* mode 2 */
  498. /* SPWM_HSRR - Host Service Register */
  499. #define SPWM_HSRR_NONE 0x0 /* none */
  500. #define SPWM_HSRR_INIT 0x2 /* initialization */
  501. #define SPWM_HSRR_UPDATE 0x3 /* immediate update request */
  502. typedef struct /* TPU_PMA */
  503.     {
  504.     UINT16 chnCont;
  505.     UINT16 maxAddNumTeeth;
  506.     UINT16 addRollCnt;
  507.     UINT16 ratioTcrMax;
  508.     UINT16 periodHigh;
  509.     UINT16 periodLow;
  510.     } TPU_PMA;
  511. /* PMA_HSQR - Host Sequence Register */
  512. #define PMA_HSQR_BANK 0x0 /* bank mode */
  513. #define PMA_HSQR_COUNT 0x1 /* count mode */
  514. /* PMA_HSRR - Host Service Register */
  515. #define PMA_HSRR_NONE 0x0 /* none */
  516. #define PMA_HSRR_INIT 0x1 /* initialization */
  517. typedef struct /* TPU_PMM */
  518.     {
  519.     UINT16 chnCont;
  520.     UINT16 maxMissNumTeeth;
  521.     UINT16 missRollCnt;
  522.     UINT16 ratioTcrMax;
  523.     UINT16 periodHigh;
  524.     UINT16 periodLow;
  525.     } TPU_PMM;
  526. /* PMM_HSQR - Host Sequence Register */
  527. #define PMM_HSQR_BANK 0x2 /* bank mode */
  528. #define PMM_HSQR_COUNT 0x3 /* count mode */
  529. /* PMM_HSRR - Host Service Register */
  530. #define PMM_HSRR_NONE 0x0 /* none */
  531. #define PMM_HSRR_INIT 0x1 /* initialization */
  532. typedef struct /* TPU_PSP */
  533.     {
  534.     UINT16 chnCont;
  535.     UINT16 r2A2Tmp;
  536.     UINT16 angleTime;
  537.     UINT16 ratioTmp;
  538.     UINT16 ratioAngle1;
  539.     UINT16 ratioAngle2;
  540.     } TPU_PSP;
  541. /* PSP_HSQR - Host Sequence Register */
  542. #define PSP_HSQR_ANGLE 0x0 /* angle-angle mode */
  543. #define PSP_HSQR_TIME 0x1 /* angle-time mode */
  544. /* PSP_HSRR - Host Service Register */
  545. #define PSP_HSRR_NONE 0x0 /* none */
  546. #define PSP_HSRR_UPDATE 0x1 /* immediate update request */
  547. #define PSP_HSRR_INIT 0x2 /* initialization */
  548. #define PSP_HSRR_FORCE 0x3 /* force mode */
  549. typedef struct /* TPU_SM_PRI */
  550.     {
  551.     UINT16 chnCont;
  552.     UINT16 pinCont;
  553.     UINT16 currentPos;
  554.     UINT16 desiredPos;
  555.     UINT16 modCntNextStep;
  556.     UINT16 stepCntLastChn;
  557.     } TPU_SM_PRI;
  558. typedef struct /* TPU_SM_SEC */
  559.     {
  560.     UINT16 chnCont;
  561.     UINT16 pinCont;
  562.     UINT16 stepCntl0;
  563.     UINT16 stepCntl1;
  564.     } TPU_SM_SEC;
  565. /* SM_HSRR - Host Service Register */
  566. #define SM_HSRR_NONE 0x0 /* none */
  567. #define SM_HSRR_INIT 0x2 /* initialization */
  568. #define SM_HSRR_STEP 0x3 /* step request */
  569. typedef struct /* TPU_PPWA */
  570.     {
  571.     UINT16 chnCont;
  572.     UINT16 maxPeriodCnt;
  573.     UINT16 lastAccum;
  574.     UINT16 accum;
  575.     UINT16 accumRatePpwaUb;
  576.     UINT16 ppwaLw;
  577.     } TPU_PPWA;
  578. /* PPWA_HSQR - Host Sequence Register */
  579. #define PPWA_HSQR_ACC_24 0x0 /* accumulate 24 bit periods */
  580. #define PPWA_HSQR_ACC_16 0x1 /* accumulate 16 bit periods */
  581. /* PPWA_HSRR - Host Service Register */
  582. #define PPWA_HSRR_NONE 0x0 /* none */
  583. #define PPWA_HSRR_INIT 0x2 /* initialization */
  584. typedef struct /* TPU_CHN */
  585.     {
  586.     union
  587. {
  588. TPU_DIO dio; /* discrete input/output */
  589. TPU_ITC itc; /* input transition counter */
  590. TPU_OC oc; /* output compare */
  591. TPU_PWM pwm; /* pulse width modulation */
  592. TPU_SPWM_M0 spwmM0; /* synchronized pulse width modulation*/
  593. TPU_SPWM_M1 spwmM1; /* synchronized pulse width modulation*/
  594. TPU_SPWM_M2 spwmM2; /* synchronized pulse width modulation*/
  595. TPU_PMA pma; /* period measure w/additional trans */
  596. TPU_PMM pmm; /* period measure w/missing trans */
  597. TPU_PSP psp; /* position-sync. pulse generator */
  598. TPU_SM_PRI smPri; /* stepper motor primary channel */
  599. TPU_SM_SEC smSec; /* stepper motor secondary channel */
  600. TPU_PPWA ppwa; /* period/pulse width accumulator */
  601. UINT16 pad[8]; /* each channel has 8 parameters */
  602. } tf;
  603.     } TPU_CHN;
  604. /* TPU_TMCR - TPU Module Configuration Register */
  605. #define TPU_TMCR_PSCK_32X 0x0000 /* clock/32 is TCR1 prescaler input */
  606. #define TPU_TMCR_PSCK_4X 0x0040 /* clock/4 is TCR1 prescaler input */
  607. #define TPU_TMCR_SUPV 0x0080 /* supervisor access only */
  608. #define TPU_TMCR_STF 0x0100 /* TPU is stopped */
  609. #define TPU_TMCR_T2CG 0x0200 /* TCR2 pin is gate of DIV8 clock */
  610. #define TPU_TMCR_EMU 0x0400 /* TPU and RAM in emulation mode */
  611. #define TPU_TMCR_TCR2_1X 0x0000 /* TCR2 divide by 1 prescaler */
  612. #define TPU_TMCR_TCR2_2X 0x0800 /* TCR2 divide by 2 prescaler */
  613. #define TPU_TMCR_TCR2_4X 0x1000 /* TCR2 divide by 4 prescaler */
  614. #define TPU_TMCR_TCR2_8X 0x1800 /* TCR2 divide by 8 prescaler */
  615. #define TPU_TMCR_TCR1_1X 0x0000 /* TCR1 divide by 1 prescaler */
  616. #define TPU_TMCR_TCR1_2X 0x2000 /* TCR1 divide by 2 prescaler */
  617. #define TPU_TMCR_TCR1_4X 0x4000 /* TCR1 divide by 4 prescaler */
  618. #define TPU_TMCR_TCR1_8X 0x6000 /* TCR1 divide by 8 prescaler */
  619. #define TPU_TMCR_STOP 0x8000 /* stop the clocks and microengine */
  620. /* TPU_CFSR - Channel Function Select Register */
  621. #define TPU_CFSR_DIO 0x8  /* discrete input/output */
  622. #define TPU_CFSR_ITC 0xa /* input transition counter */
  623. #define TPU_CFSR_OC 0xe /* output compare */
  624. #define TPU_CFSR_PWM 0x9 /* pulse width modulation */
  625. #define TPU_CFSR_SPWM 0x7 /* synchronized pulse width modulation*/
  626. #define TPU_CFSR_PMA 0xb /* period measure w/additional trans */
  627. #define TPU_CFSR_PMM 0xb /* period measure w/missing trans */
  628. #define TPU_CFSR_PSP 0xc /* position-sync. pulse generator */
  629. #define TPU_CFSR_SM 0xd /* stepper motor */
  630. #define TPU_CFSR_PPWA 0xf /* period/pulse width accumulator */
  631. /* TPU_CPR - Channel Priority Register */
  632. #define TPU_CPR_DISABLE 0x0 /* channel disabled */
  633. #define TPU_CPR_LOW 0x1 /* low priority */
  634. #define TPU_CPR_MEDIUM 0x2 /* medium priority */
  635. #define TPU_CPR_HIGH 0x3 /* high priority */
  636. /* function declarations */
  637. #ifndef INCLUDE_TY_CO_DRV_50
  638. #if defined(__STDC__) || defined(__cplusplus)
  639. IMPORT  void    tyCoInt (void);
  640. #else   /* __STDC__ */
  641. IMPORT  void    tyCoInt ();
  642. #endif  /* __STDC__ */
  643. #endif  /* INCLUDE_TY_CO_DRV_50 */
  644. #endif /* _ASMLANGUAGE */
  645. #ifdef __cplusplus
  646. }
  647. #endif
  648. #endif /* __INCm68332h */