Fork from bluejay at github and modified for my custom ESC. I need to modify it because some mistake design on my ESC hardware.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

558 lines
29 KiB

  1. ;------------------------------------------------------------------------------
  2. ; Copyright 2014 Silicon Laboratories, Inc.
  3. ; All rights reserved. This program and the accompanying materials
  4. ; are made available under the terms of the Silicon Laboratories End User
  5. ; License Agreement which accompanies this distribution, and is available at
  6. ; http://developer.silabs.com/legal/version/v11/Silicon_Labs_Software_License_Agreement.txt
  7. ; Original content and implementation provided by Silicon Laboratories.
  8. ;------------------------------------------------------------------------------
  9. ;Supported Devices:
  10. ; EFM8LB10F16E_QFN24
  11. ; EFM8LB10F16E_QFN32
  12. ; EFM8LB10F16E_QFP32
  13. ; EFM8LB10F16E_QSOP24
  14. ; EFM8LB10F16ES0_QFN24
  15. ; EFM8LB10F16ES0_QFN32
  16. ; EFM8LB11F16E_QFN24
  17. ; EFM8LB11F16E_QFN32
  18. ; EFM8LB11F16E_QFP32
  19. ; EFM8LB11F16E_QSOP24
  20. ; EFM8LB11F16ES0_QFN24
  21. ; EFM8LB11F16ES0_QFN32
  22. ; EFM8LB11F32E_QFN24
  23. ; EFM8LB11F32E_QFN32
  24. ; EFM8LB11F32E_QFP32
  25. ; EFM8LB11F32E_QSOP24
  26. ; EFM8LB11F32ES0_QFN24
  27. ; EFM8LB11F32ES0_QFN32
  28. ; EFM8LB12F32E_QFN24
  29. ; EFM8LB12F32E_QFN32
  30. ; EFM8LB12F32E_QFP32
  31. ; EFM8LB12F32E_QSOP24
  32. ; EFM8LB12F32ES0_QFN24
  33. ; EFM8LB12F32ES0_QFN32
  34. ; EFM8LB12F64E_QFN24
  35. ; EFM8LB12F64E_QFN32
  36. ; EFM8LB12F64E_QFP32
  37. ; EFM8LB12F64E_QSOP24
  38. ; EFM8LB12F64ES0_QFN24
  39. ; EFM8LB12F64ES0_QFN32
  40. ;-----------------------------------------------------------------------------
  41. ; Register Definitions
  42. ;-----------------------------------------------------------------------------
  43. ACC DATA 0E0H; Accumulator
  44. ADC0ASAH DATA 0B6H; ADC0 Autoscan Start Address High Byte
  45. ADC0ASAL DATA 0B5H; ADC0 Autoscan Start Address Low Byte
  46. ADC0ASCF DATA 0A1H; ADC0 Autoscan Configuration
  47. ADC0ASCT DATA 0C7H; ADC0 Autoscan Output Count
  48. ADC0CF0 DATA 0BCH; ADC0 Configuration
  49. ADC0CF1 DATA 0B9H; ADC0 Configuration
  50. ADC0CF2 DATA 0DFH; ADC0 Power Control
  51. ADC0CN0 DATA 0E8H; ADC0 Control 0
  52. ADC0CN1 DATA 0B2H; ADC0 Control 1
  53. ADC0CN2 DATA 0B3H; ADC0 Control 2
  54. ADC0GTH DATA 0C4H; ADC0 Greater-Than High Byte
  55. ADC0GTL DATA 0C3H; ADC0 Greater-Than Low Byte
  56. ADC0H DATA 0BEH; ADC0 Data Word High Byte
  57. ADC0L DATA 0BDH; ADC0 Data Word Low Byte
  58. ADC0LTH DATA 0C6H; ADC0 Less-Than High Byte
  59. ADC0LTL DATA 0C5H; ADC0 Less-Than Low Byte
  60. ADC0MX DATA 0BBH; ADC0 Multiplexer Selection
  61. B DATA 0F0H; B Register
  62. CKCON0 DATA 08EH; Clock Control 0
  63. CKCON1 DATA 0A6H; Clock Control 1
  64. CLEN0 DATA 0C6H; Configurable Logic Enable 0
  65. CLIE0 DATA 0C7H; Configurable Logic Interrupt Enable 0
  66. CLIF0 DATA 0E8H; Configurable Logic Interrupt Flag 0
  67. CLKSEL DATA 0A9H; Clock Select
  68. CLOUT0 DATA 0D1H; Configurable Logic Output 0
  69. CLU0CF DATA 0B1H; Configurable Logic Unit 0 Configuration
  70. CLU0FN DATA 0AFH; Configurable Logic Unit 0 Function Select
  71. CLU0MX DATA 084H; Configurable Logic Unit 0 Multiplexer
  72. CLU1CF DATA 0B3H; Configurable Logic Unit 1 Configuration
  73. CLU1FN DATA 0B2H; Configurable Logic Unit 1 Function Select
  74. CLU1MX DATA 085H; Configurable Logic Unit 1 Multiplexer
  75. CLU2CF DATA 0B6H; Configurable Logic Unit 2 Configuration
  76. CLU2FN DATA 0B5H; Configurable Logic Unit 2 Function Select
  77. CLU2MX DATA 091H; Configurable Logic Unit 2 Multiplexer
  78. CLU3CF DATA 0BFH; Configurable Logic Unit 3 Configuration
  79. CLU3FN DATA 0BEH; Configurable Logic Unit 3 Function Select
  80. CLU3MX DATA 0AEH; Configurable Logic Unit 3 Multiplexer
  81. CMP0CN0 DATA 09BH; Comparator 0 Control 0
  82. CMP0CN1 DATA 099H; Comparator 0 Control 1
  83. CMP0MD DATA 09DH; Comparator 0 Mode
  84. CMP0MX DATA 09FH; Comparator 0 Multiplexer Selection
  85. CMP1CN0 DATA 0BFH; Comparator 1 Control 0
  86. CMP1CN1 DATA 0ACH; Comparator 1 Control 1
  87. CMP1MD DATA 0ABH; Comparator 1 Mode
  88. CMP1MX DATA 0AAH; Comparator 1 Multiplexer Selection
  89. CRC0CN0 DATA 0CEH; CRC0 Control 0
  90. CRC0CN1 DATA 086H; CRC0 Control 1
  91. CRC0CNT DATA 0D3H; CRC0 Automatic Flash Sector Count
  92. CRC0DAT DATA 0CBH; CRC0 Data Output
  93. CRC0FLIP DATA 0CFH; CRC0 Bit Flip
  94. CRC0IN DATA 0CAH; CRC0 Data Input
  95. CRC0ST DATA 0D2H; CRC0 Automatic Flash Sector Start
  96. DAC0CF0 DATA 091H; DAC0 Configuration 0
  97. DAC0CF1 DATA 092H; DAC0 Configuration 1
  98. DAC0H DATA 085H; DAC0 Data Word High Byte
  99. DAC0L DATA 084H; DAC0 Data Word Low Byte
  100. DAC1CF0 DATA 093H; DAC1 Configuration 0
  101. DAC1CF1 DATA 094H; DAC1 Configuration 1
  102. DAC1H DATA 08AH; DAC1 Data Word High Byte
  103. DAC1L DATA 089H; DAC1 Data Word Low Byte
  104. DAC2CF0 DATA 095H; DAC2 Configuration 0
  105. DAC2CF1 DATA 096H; DAC2 Configuration 1
  106. DAC2H DATA 08CH; DAC2 Data Word High Byte
  107. DAC2L DATA 08BH; DAC2 Data Word Low Byte
  108. DAC3CF0 DATA 09AH; DAC3 Configuration 0
  109. DAC3CF1 DATA 09CH; DAC3 Configuration 1
  110. DAC3H DATA 08EH; DAC3 Data Word High Byte
  111. DAC3L DATA 08DH; DAC3 Data Word Low Byte
  112. DACGCF0 DATA 088H; DAC Global Configuration 0
  113. DACGCF1 DATA 098H; DAC Global Configuration 1
  114. DACGCF2 DATA 0A2H; DAC Global Configuration 2
  115. DERIVID DATA 0ADH; Derivative Identification
  116. DEVICEID DATA 0B5H; Device Identification
  117. DPH DATA 083H; Data Pointer High
  118. DPL DATA 082H; Data Pointer Low
  119. EIE1 DATA 0E6H; Extended Interrupt Enable 1
  120. EIE2 DATA 0F3H; Extended Interrupt Enable 2
  121. EIP1 DATA 0BBH; Extended Interrupt Priority 1 Low
  122. EIP1H DATA 0EEH; Extended Interrupt Priority 1 High
  123. EIP2 DATA 0EDH; Extended Interrupt Priority 2
  124. EIP2H DATA 0F6H; Extended Interrupt Priority 2 High
  125. EMI0CN DATA 0E7H; External Memory Interface Control
  126. FLKEY DATA 0B7H; Flash Lock and Key
  127. HFO0CAL DATA 0C7H; High Frequency Oscillator 0 Calibration
  128. HFO1CAL DATA 0D6H; High Frequency Oscillator 1 Calibration
  129. HFOCN DATA 0EFH; High Frequency Oscillator Control
  130. I2C0ADM DATA 0FFH; I2C0 Slave Address Mask
  131. I2C0CN0 DATA 0BAH; I2C0 Control
  132. I2C0DIN DATA 0BCH; I2C0 Received Data
  133. I2C0DOUT DATA 0BBH; I2C0 Transmit Data
  134. I2C0FCN0 DATA 0ADH; I2C0 FIFO Control 0
  135. I2C0FCN1 DATA 0ABH; I2C0 FIFO Control 1
  136. I2C0FCT DATA 0F5H; I2C0 FIFO Count
  137. I2C0SLAD DATA 0BDH; I2C0 Slave Address
  138. I2C0STAT DATA 0B9H; I2C0 Status
  139. IE DATA 0A8H; Interrupt Enable
  140. IP DATA 0B8H; Interrupt Priority
  141. IPH DATA 0F2H; Interrupt Priority High
  142. IT01CF DATA 0E4H; INT0/INT1 Configuration
  143. LFO0CN DATA 0B1H; Low Frequency Oscillator Control
  144. P0 DATA 080H; Port 0 Pin Latch
  145. P0MASK DATA 0FEH; Port 0 Mask
  146. P0MAT DATA 0FDH; Port 0 Match
  147. P0MDIN DATA 0F1H; Port 0 Input Mode
  148. P0MDOUT DATA 0A4H; Port 0 Output Mode
  149. P0SKIP DATA 0D4H; Port 0 Skip
  150. P1 DATA 090H; Port 1 Pin Latch
  151. P1MASK DATA 0EEH; Port 1 Mask
  152. P1MAT DATA 0EDH; Port 1 Match
  153. P1MDIN DATA 0F2H; Port 1 Input Mode
  154. P1MDOUT DATA 0A5H; Port 1 Output Mode
  155. P1SKIP DATA 0D5H; Port 1 Skip
  156. P2 DATA 0A0H; Port 2 Pin Latch
  157. P2MASK DATA 0FCH; Port 2 Mask
  158. P2MAT DATA 0FBH; Port 2 Match
  159. P2MDIN DATA 0F3H; Port 2 Input Mode
  160. P2MDOUT DATA 0A6H; Port 2 Output Mode
  161. P2SKIP DATA 0CCH; Port 2 Skip
  162. P3 DATA 0B0H; Port 3 Pin Latch
  163. P3MDIN DATA 0F4H; Port 3 Input Mode
  164. P3MDOUT DATA 09CH; Port 3 Output Mode
  165. PCA0CENT DATA 09EH; PCA Center Alignment Enable
  166. PCA0CLR DATA 09CH; PCA Comparator Clear Control
  167. PCA0CN0 DATA 0D8H; PCA Control
  168. PCA0CPH0 DATA 0FCH; PCA Channel 0 Capture Module High Byte
  169. PCA0CPH1 DATA 0EAH; PCA Channel 1 Capture Module High Byte
  170. PCA0CPH2 DATA 0ECH; PCA Channel 2 Capture Module High Byte
  171. PCA0CPH3 DATA 0F5H; PCA Channel 3 Capture Module High Byte
  172. PCA0CPH4 DATA 085H; PCA Channel 4 Capture Module High Byte
  173. PCA0CPH5 DATA 0DEH; PCA Channel 5 Capture Module High Byte
  174. PCA0CPL0 DATA 0FBH; PCA Channel 0 Capture Module Low Byte
  175. PCA0CPL1 DATA 0E9H; PCA Channel 1 Capture Module Low Byte
  176. PCA0CPL2 DATA 0EBH; PCA Channel 2 Capture Module Low Byte
  177. PCA0CPL3 DATA 0F4H; PCA Channel 3 Capture Module Low Byte
  178. PCA0CPL4 DATA 084H; PCA Channel 4 Capture Module Low Byte
  179. PCA0CPL5 DATA 0DDH; PCA Channel 5 Capture Module Low Byte
  180. PCA0CPM0 DATA 0DAH; PCA Channel 0 Capture/Compare Mode
  181. PCA0CPM1 DATA 0DBH; PCA Channel 1 Capture/Compare Mode
  182. PCA0CPM2 DATA 0DCH; PCA Channel 2 Capture/Compare Mode
  183. PCA0CPM3 DATA 0AEH; PCA Channel 3 Capture/Compare Mode
  184. PCA0CPM4 DATA 0AFH; PCA Channel 4 Capture/Compare Mode
  185. PCA0CPM5 DATA 0CCH; PCA Channel 5 Capture/Compare Mode
  186. PCA0H DATA 0FAH; PCA Counter/Timer High Byte
  187. PCA0L DATA 0F9H; PCA Counter/Timer Low Byte
  188. PCA0MD DATA 0D9H; PCA Mode
  189. PCA0POL DATA 096H; PCA Output Polarity
  190. PCA0PWM DATA 0F7H; PCA PWM Configuration
  191. PCON0 DATA 087H; Power Control
  192. PCON1 DATA 0CDH; Power Control 1
  193. PFE0CN DATA 0C1H; Prefetch Engine Control
  194. PRTDRV DATA 0F6H; Port Drive Strength
  195. PSCTL DATA 08FH; Program Store Control
  196. PSTAT0 DATA 0AAH; PMU Status 0
  197. PSW DATA 0D0H; Program Status Word
  198. REF0CN DATA 0D1H; Voltage Reference Control
  199. REG0CN DATA 0C9H; Voltage Regulator 0 Control
  200. REVID DATA 0B6H; Revision Identifcation
  201. RSTSRC DATA 0EFH; Reset Source
  202. SBCON1 DATA 094H; UART1 Baud Rate Generator Control
  203. SBRLH1 DATA 096H; UART1 Baud Rate Generator High Byte
  204. SBRLL1 DATA 095H; UART1 Baud Rate Generator Low Byte
  205. SBUF0 DATA 099H; UART0 Serial Port Data Buffer
  206. SBUF1 DATA 092H; UART1 Serial Port Data Buffer
  207. SCON0 DATA 098H; UART0 Serial Port Control
  208. SCON1 DATA 0C8H; UART1 Serial Port Control
  209. SFRPAGE DATA 0A7H; SFR Page
  210. SFRPGCN DATA 0BCH; SFR Page Control
  211. SFRSTACK DATA 0D7H; SFR Page Stack
  212. SMB0ADM DATA 0D6H; SMBus 0 Slave Address Mask
  213. SMB0ADR DATA 0D7H; SMBus 0 Slave Address
  214. SMB0CF DATA 0C1H; SMBus 0 Configuration
  215. SMB0CN0 DATA 0C0H; SMBus 0 Control
  216. SMB0DAT DATA 0C2H; SMBus 0 Data
  217. SMB0FCN0 DATA 0C3H; SMBus 0 FIFO Control 0
  218. SMB0FCN1 DATA 0C4H; SMBus 0 FIFO Control 1
  219. SMB0FCT DATA 0EFH; SMBus 0 FIFO Count
  220. SMB0RXLN DATA 0C5H; SMBus 0 Receive Length Counter
  221. SMB0TC DATA 0ACH; SMBus 0 Timing and Pin Control
  222. SMOD1 DATA 093H; UART1 Mode
  223. SP DATA 081H; Stack Pointer
  224. SPI0CFG DATA 0A1H; SPI0 Configuration
  225. SPI0CKR DATA 0A2H; SPI0 Clock Rate
  226. SPI0CN0 DATA 0F8H; SPI0 Control
  227. SPI0DAT DATA 0A3H; SPI0 Data
  228. SPI0FCN0 DATA 09AH; SPI0 FIFO Control 0
  229. SPI0FCN1 DATA 09BH; SPI0 FIFO Control 1
  230. SPI0FCT DATA 0F7H; SPI0 FIFO Count
  231. SPI0PCF DATA 0DFH; SPI0 Pin Configuration
  232. TCON DATA 088H; Timer 0/1 Control
  233. TH0 DATA 08CH; Timer 0 High Byte
  234. TH1 DATA 08DH; Timer 1 High Byte
  235. TL0 DATA 08AH; Timer 0 Low Byte
  236. TL1 DATA 08BH; Timer 1 Low Byte
  237. TMOD DATA 089H; Timer 0/1 Mode
  238. TMR2CN0 DATA 0C8H; Timer 2 Control 0
  239. TMR2CN1 DATA 0FDH; Timer 2 Control 1
  240. TMR2H DATA 0CFH; Timer 2 High Byte
  241. TMR2L DATA 0CEH; Timer 2 Low Byte
  242. TMR2RLH DATA 0CBH; Timer 2 Reload High Byte
  243. TMR2RLL DATA 0CAH; Timer 2 Reload Low Byte
  244. TMR3CN0 DATA 091H; Timer 3 Control 0
  245. TMR3CN1 DATA 0FEH; Timer 3 Control 1
  246. TMR3H DATA 095H; Timer 3 High Byte
  247. TMR3L DATA 094H; Timer 3 Low Byte
  248. TMR3RLH DATA 093H; Timer 3 Reload High Byte
  249. TMR3RLL DATA 092H; Timer 3 Reload Low Byte
  250. TMR4CN0 DATA 098H; Timer 4 Control 0
  251. TMR4CN1 DATA 0FFH; Timer 4 Control 1
  252. TMR4H DATA 0A5H; Timer 4 High Byte
  253. TMR4L DATA 0A4H; Timer 4 Low Byte
  254. TMR4RLH DATA 0A3H; Timer 4 Reload High Byte
  255. TMR4RLL DATA 0A2H; Timer 4 Reload Low Byte
  256. TMR5CN0 DATA 0C0H; Timer 5 Control 0
  257. TMR5CN1 DATA 0F1H; Timer 5 Control 1
  258. TMR5H DATA 0D5H; Timer 5 High Byte
  259. TMR5L DATA 0D4H; Timer 5 Low Byte
  260. TMR5RLH DATA 0D3H; Timer 5 Reload High Byte
  261. TMR5RLL DATA 0D2H; Timer 5 Reload Low Byte
  262. UART0PCF DATA 0D9H; UART0 Pin Configuration
  263. UART1FCN0 DATA 09DH; UART1 FIFO Control 0
  264. UART1FCN1 DATA 0D8H; UART1 FIFO Control 1
  265. UART1FCT DATA 0FAH; UART1 FIFO Count
  266. UART1LIN DATA 09EH; UART1 LIN Configuration
  267. UART1PCF DATA 0DAH; UART1 Pin Configuration
  268. VDM0CN DATA 0FFH; Supply Monitor Control
  269. WDTCN DATA 097H; Watchdog Timer Control
  270. XBR0 DATA 0E1H; Port I/O Crossbar 0
  271. XBR1 DATA 0E2H; Port I/O Crossbar 1
  272. XBR2 DATA 0E3H; Port I/O Crossbar 2
  273. XOSC0CN DATA 086H; External Oscillator Control
  274. ;------------------------------------------------------------------------------
  275. ; 16-bit Register Definitions (may not work on all compilers)
  276. ;------------------------------------------------------------------------------
  277. ADC0ASA DATA 0B5H ; ADC0 Autoscan Start Address Low Byte
  278. ADC0GT DATA 0C3H ; ADC0 Greater-Than Low Byte
  279. ADC0 DATA 0BDH ; ADC0 Data Word Low Byte
  280. ADC0LT DATA 0C5H ; ADC0 Less-Than Low Byte
  281. DP DATA 082H ; Data Pointer Low
  282. PCA0CP0 DATA 0FBH ; PCA Channel 0 Capture Module Low Byte
  283. PCA0CP1 DATA 0E9H ; PCA Channel 1 Capture Module Low Byte
  284. PCA0CP2 DATA 0EBH ; PCA Channel 2 Capture Module Low Byte
  285. PCA0CP3 DATA 0F4H ; PCA Channel 3 Capture Module Low Byte
  286. PCA0CP4 DATA 084H ; PCA Channel 4 Capture Module Low Byte
  287. PCA0CP5 DATA 0DDH ; PCA Channel 5 Capture Module Low Byte
  288. PCA0 DATA 0F9H ; PCA Counter/Timer Low Byte
  289. TMR2 DATA 0CEH ; Timer 2 Low Byte
  290. TMR2RL DATA 0CAH ; Timer 2 Reload Low Byte
  291. TMR3 DATA 094H ; Timer 3 Low Byte
  292. TMR3RL DATA 092H ; Timer 3 Reload Low Byte
  293. TMR4 DATA 0A4H ; Timer 4 Low Byte
  294. TMR4RL DATA 0A2H ; Timer 4 Reload Low Byte
  295. TMR5 DATA 0D4H ; Timer 5 Low Byte
  296. TMR5RL DATA 0D2H ; Timer 5 Reload Low Byte
  297. ;------------------------------------------------------------------------------
  298. ; Indirect Register Definitions
  299. ;------------------------------------------------------------------------------
  300. ;------------------------------------------------------------------------------
  301. ; Bit Definitions
  302. ;------------------------------------------------------------------------------
  303. ; ACC 0xE0 (Accumulator)
  304. ACC_ACC0 BIT ACC.0 ; Accumulator Bit 0
  305. ACC_ACC1 BIT ACC.1 ; Accumulator Bit 1
  306. ACC_ACC2 BIT ACC.2 ; Accumulator Bit 2
  307. ACC_ACC3 BIT ACC.3 ; Accumulator Bit 3
  308. ACC_ACC4 BIT ACC.4 ; Accumulator Bit 4
  309. ACC_ACC5 BIT ACC.5 ; Accumulator Bit 5
  310. ACC_ACC6 BIT ACC.6 ; Accumulator Bit 6
  311. ACC_ACC7 BIT ACC.7 ; Accumulator Bit 7
  312. ; ADC0CN0 0xE8 (ADC0 Control 0)
  313. ADC0CN0_TEMPE BIT ADC0CN0.0 ; Temperature Sensor Enable
  314. ADC0CN0_ADGN0 BIT ADC0CN0.1 ; Gain Control Bit 0
  315. ADC0CN0_ADGN1 BIT ADC0CN0.2 ; Gain Control Bit 1
  316. ADC0CN0_ADWINT BIT ADC0CN0.3 ; Window Compare Interrupt Flag
  317. ADC0CN0_ADBUSY BIT ADC0CN0.4 ; ADC Busy
  318. ADC0CN0_ADINT BIT ADC0CN0.5 ; Conversion Complete Interrupt Flag
  319. ADC0CN0_IPOEN BIT ADC0CN0.6 ; Idle Powered-off Enable
  320. ADC0CN0_ADEN BIT ADC0CN0.7 ; ADC Enable
  321. ; B 0xF0 (B Register)
  322. B_B0 BIT B.0 ; B Register Bit 0
  323. B_B1 BIT B.1 ; B Register Bit 1
  324. B_B2 BIT B.2 ; B Register Bit 2
  325. B_B3 BIT B.3 ; B Register Bit 3
  326. B_B4 BIT B.4 ; B Register Bit 4
  327. B_B5 BIT B.5 ; B Register Bit 5
  328. B_B6 BIT B.6 ; B Register Bit 6
  329. B_B7 BIT B.7 ; B Register Bit 7
  330. ; CLIF0 0xE8 (Configurable Logic Interrupt Flag 0)
  331. CLIF0_C0FIF BIT CLIF0.0 ; CLU0 Falling Edge Interrupt Flag
  332. CLIF0_C0RIF BIT CLIF0.1 ; CLU0 Rising Edge Interrupt Flag
  333. CLIF0_C1FIF BIT CLIF0.2 ; CLU1 Falling Edge Interrupt Flag
  334. CLIF0_C1RIF BIT CLIF0.3 ; CLU1 Rising Edge Interrupt Flag
  335. CLIF0_C2FIF BIT CLIF0.4 ; CLU2 Falling Edge Interrupt Flag
  336. CLIF0_C2RIF BIT CLIF0.5 ; CLU2 Rising Edge Interrupt Flag
  337. CLIF0_C3FIF BIT CLIF0.6 ; CLU3 Falling Edge Interrupt Flag
  338. CLIF0_C3RIF BIT CLIF0.7 ; CLU3 Rising Edge Interrupt Flag
  339. ; DACGCF0 0x88 (DAC Global Configuration 0)
  340. DACGCF0_D1SRC0 BIT DACGCF0.0 ; DAC1 Data Source Bit 0
  341. DACGCF0_D1SRC1 BIT DACGCF0.1 ; DAC1 Data Source Bit 1
  342. DACGCF0_D1AMEN BIT DACGCF0.2 ; DAC1 Alternating Mode Enable
  343. DACGCF0_D01REFSL BIT DACGCF0.3 ; DAC0 and DAC1 Reference Voltage Select
  344. DACGCF0_D3SRC0 BIT DACGCF0.4 ; DAC3 Data Source Bit 0
  345. DACGCF0_D3SRC1 BIT DACGCF0.5 ; DAC3 Data Source Bit 1
  346. DACGCF0_D3AMEN BIT DACGCF0.6 ; DAC3 Alternating Mode Enable
  347. DACGCF0_D23REFSL BIT DACGCF0.7 ; DAC2 and DAC3 Reference Voltage Select
  348. ; DACGCF1 0x98 (DAC Global Configuration 1)
  349. DACGCF1_D0UDIS BIT DACGCF1.0 ; DAC0 Update Disable
  350. DACGCF1_D1UDIS BIT DACGCF1.1 ; DAC1 Update Disable
  351. DACGCF1_D2UDIS BIT DACGCF1.2 ; DAC2 Update Disable
  352. DACGCF1_D3UDIS BIT DACGCF1.3 ; DAC3 Update Disable
  353. ; IE 0xA8 (Interrupt Enable)
  354. IE_EX0 BIT IE.0 ; External Interrupt 0 Enable
  355. IE_ET0 BIT IE.1 ; Timer 0 Interrupt Enable
  356. IE_EX1 BIT IE.2 ; External Interrupt 1 Enable
  357. IE_ET1 BIT IE.3 ; Timer 1 Interrupt Enable
  358. IE_ES0 BIT IE.4 ; UART0 Interrupt Enable
  359. IE_ET2 BIT IE.5 ; Timer 2 Interrupt Enable
  360. IE_ESPI0 BIT IE.6 ; SPI0 Interrupt Enable
  361. IE_EA BIT IE.7 ; All Interrupts Enable
  362. ; IP 0xB8 (Interrupt Priority)
  363. IP_PX0 BIT IP.0 ; External Interrupt 0 Priority Control LSB
  364. IP_PT0 BIT IP.1 ; Timer 0 Interrupt Priority Control LSB
  365. IP_PX1 BIT IP.2 ; External Interrupt 1 Priority Control LSB
  366. IP_PT1 BIT IP.3 ; Timer 1 Interrupt Priority Control LSB
  367. IP_PS0 BIT IP.4 ; UART0 Interrupt Priority Control LSB
  368. IP_PT2 BIT IP.5 ; Timer 2 Interrupt Priority Control LSB
  369. IP_PSPI0 BIT IP.6 ; Serial Peripheral Interface (SPI0) Interrupt Priority Control LSB
  370. ; P0 0x80 (Port 0 Pin Latch)
  371. P0_B0 BIT P0.0 ; Port 0 Bit 0 Latch
  372. P0_B1 BIT P0.1 ; Port 0 Bit 1 Latch
  373. P0_B2 BIT P0.2 ; Port 0 Bit 2 Latch
  374. P0_B3 BIT P0.3 ; Port 0 Bit 3 Latch
  375. P0_B4 BIT P0.4 ; Port 0 Bit 4 Latch
  376. P0_B5 BIT P0.5 ; Port 0 Bit 5 Latch
  377. P0_B6 BIT P0.6 ; Port 0 Bit 6 Latch
  378. P0_B7 BIT P0.7 ; Port 0 Bit 7 Latch
  379. ; P1 0x90 (Port 1 Pin Latch)
  380. P1_B0 BIT P1.0 ; Port 1 Bit 0 Latch
  381. P1_B1 BIT P1.1 ; Port 1 Bit 1 Latch
  382. P1_B2 BIT P1.2 ; Port 1 Bit 2 Latch
  383. P1_B3 BIT P1.3 ; Port 1 Bit 3 Latch
  384. P1_B4 BIT P1.4 ; Port 1 Bit 4 Latch
  385. P1_B5 BIT P1.5 ; Port 1 Bit 5 Latch
  386. P1_B6 BIT P1.6 ; Port 1 Bit 6 Latch
  387. P1_B7 BIT P1.7 ; Port 1 Bit 7 Latch
  388. ; P2 0xA0 (Port 2 Pin Latch)
  389. P2_B0 BIT P2.0 ; Port 2 Bit 0 Latch
  390. P2_B1 BIT P2.1 ; Port 2 Bit 1 Latch
  391. P2_B2 BIT P2.2 ; Port 2 Bit 2 Latch
  392. P2_B3 BIT P2.3 ; Port 2 Bit 3 Latch
  393. P2_B4 BIT P2.4 ; Port 2 Bit 4 Latch
  394. P2_B5 BIT P2.5 ; Port 2 Bit 5 Latch
  395. P2_B6 BIT P2.6 ; Port 2 Bit 6 Latch
  396. ; P3 0xB0 (Port 3 Pin Latch)
  397. P3_B0 BIT P3.0 ; Port 3 Bit 0 Latch
  398. P3_B1 BIT P3.1 ; Port 3 Bit 1 Latch
  399. P3_B2 BIT P3.2 ; Port 3 Bit 2 Latch
  400. P3_B3 BIT P3.3 ; Port 3 Bit 3 Latch
  401. P3_B4 BIT P3.4 ; Port 3 Bit 4 Latch
  402. P3_B7 BIT P3.7 ; Port 3 Bit 7 Latch
  403. ; PCA0CN0 0xD8 (PCA Control)
  404. PCA0CN0_CCF0 BIT PCA0CN0.0 ; PCA Module 0 Capture/Compare Flag
  405. PCA0CN0_CCF1 BIT PCA0CN0.1 ; PCA Module 1 Capture/Compare Flag
  406. PCA0CN0_CCF2 BIT PCA0CN0.2 ; PCA Module 2 Capture/Compare Flag
  407. PCA0CN0_CCF3 BIT PCA0CN0.3 ; PCA Module 3 Capture/Compare Flag
  408. PCA0CN0_CCF4 BIT PCA0CN0.4 ; PCA Module 4 Capture/Compare Flag
  409. PCA0CN0_CCF5 BIT PCA0CN0.5 ; PCA Module 5 Capture/Compare Flag
  410. PCA0CN0_CR BIT PCA0CN0.6 ; PCA Counter/Timer Run Control
  411. PCA0CN0_CF BIT PCA0CN0.7 ; PCA Counter/Timer Overflow Flag
  412. ; PSW 0xD0 (Program Status Word)
  413. PSW_PARITY BIT PSW.0 ; Parity Flag
  414. PSW_F1 BIT PSW.1 ; User Flag 1
  415. PSW_OV BIT PSW.2 ; Overflow Flag
  416. PSW_RS0 BIT PSW.3 ; Register Bank Select Bit 0
  417. PSW_RS1 BIT PSW.4 ; Register Bank Select Bit 1
  418. PSW_F0 BIT PSW.5 ; User Flag 0
  419. PSW_AC BIT PSW.6 ; Auxiliary Carry Flag
  420. PSW_CY BIT PSW.7 ; Carry Flag
  421. ; SCON0 0x98 (UART0 Serial Port Control)
  422. SCON0_RI BIT SCON0.0 ; Receive Interrupt Flag
  423. SCON0_TI BIT SCON0.1 ; Transmit Interrupt Flag
  424. SCON0_RB8 BIT SCON0.2 ; Ninth Receive Bit
  425. SCON0_TB8 BIT SCON0.3 ; Ninth Transmission Bit
  426. SCON0_REN BIT SCON0.4 ; Receive Enable
  427. SCON0_MCE BIT SCON0.5 ; Multiprocessor Communication Enable
  428. SCON0_SMODE BIT SCON0.7 ; Serial Port 0 Operation Mode
  429. ; SCON1 0xC8 (UART1 Serial Port Control)
  430. SCON1_RI BIT SCON1.0 ; Receive Interrupt Flag
  431. SCON1_TI BIT SCON1.1 ; Transmit Interrupt Flag
  432. SCON1_RBX BIT SCON1.2 ; Extra Receive Bit
  433. SCON1_TBX BIT SCON1.3 ; Extra Transmission Bit
  434. SCON1_REN BIT SCON1.4 ; Receive Enable
  435. SCON1_PERR BIT SCON1.6 ; Parity Error Flag
  436. SCON1_OVR BIT SCON1.7 ; Receive FIFO Overrun Flag
  437. ; SMB0CN0 0xC0 (SMBus 0 Control)
  438. SMB0CN0_SI BIT SMB0CN0.0 ; SMBus Interrupt Flag
  439. SMB0CN0_ACK BIT SMB0CN0.1 ; SMBus Acknowledge
  440. SMB0CN0_ARBLOST BIT SMB0CN0.2 ; SMBus Arbitration Lost Indicator
  441. SMB0CN0_ACKRQ BIT SMB0CN0.3 ; SMBus Acknowledge Request
  442. SMB0CN0_STO BIT SMB0CN0.4 ; SMBus Stop Flag
  443. SMB0CN0_STA BIT SMB0CN0.5 ; SMBus Start Flag
  444. SMB0CN0_TXMODE BIT SMB0CN0.6 ; SMBus Transmit Mode Indicator
  445. SMB0CN0_MASTER BIT SMB0CN0.7 ; SMBus Master/Slave Indicator
  446. ; SPI0CN0 0xF8 (SPI0 Control)
  447. SPI0CN0_SPIEN BIT SPI0CN0.0 ; SPI0 Enable
  448. SPI0CN0_TXNF BIT SPI0CN0.1 ; TX FIFO Not Full
  449. SPI0CN0_NSSMD0 BIT SPI0CN0.2 ; Slave Select Mode Bit 0
  450. SPI0CN0_NSSMD1 BIT SPI0CN0.3 ; Slave Select Mode Bit 1
  451. SPI0CN0_RXOVRN BIT SPI0CN0.4 ; Receive Overrun Flag
  452. SPI0CN0_MODF BIT SPI0CN0.5 ; Mode Fault Flag
  453. SPI0CN0_WCOL BIT SPI0CN0.6 ; Write Collision Flag
  454. SPI0CN0_SPIF BIT SPI0CN0.7 ; SPI0 Interrupt Flag
  455. ; TCON 0x88 (Timer 0/1 Control)
  456. TCON_IT0 BIT TCON.0 ; Interrupt 0 Type Select
  457. TCON_IE0 BIT TCON.1 ; External Interrupt 0
  458. TCON_IT1 BIT TCON.2 ; Interrupt 1 Type Select
  459. TCON_IE1 BIT TCON.3 ; External Interrupt 1
  460. TCON_TR0 BIT TCON.4 ; Timer 0 Run Control
  461. TCON_TF0 BIT TCON.5 ; Timer 0 Overflow Flag
  462. TCON_TR1 BIT TCON.6 ; Timer 1 Run Control
  463. TCON_TF1 BIT TCON.7 ; Timer 1 Overflow Flag
  464. ; TMR2CN0 0xC8 (Timer 2 Control 0)
  465. TMR2CN0_T2XCLK0 BIT TMR2CN0.0 ; Timer 2 External Clock Select Bit 0
  466. TMR2CN0_T2XCLK1 BIT TMR2CN0.1 ; Timer 2 External Clock Select Bit 1
  467. TMR2CN0_TR2 BIT TMR2CN0.2 ; Timer 2 Run Control
  468. TMR2CN0_T2SPLIT BIT TMR2CN0.3 ; Timer 2 Split Mode Enable
  469. TMR2CN0_TF2CEN BIT TMR2CN0.4 ; Timer 2 Capture Enable
  470. TMR2CN0_TF2LEN BIT TMR2CN0.5 ; Timer 2 Low Byte Interrupt Enable
  471. TMR2CN0_TF2L BIT TMR2CN0.6 ; Timer 2 Low Byte Overflow Flag
  472. TMR2CN0_TF2H BIT TMR2CN0.7 ; Timer 2 High Byte Overflow Flag
  473. ; TMR4CN0 0x98 (Timer 4 Control 0)
  474. TMR4CN0_T4XCLK0 BIT TMR4CN0.0 ; Timer 4 External Clock Select Bit 0
  475. TMR4CN0_T4XCLK1 BIT TMR4CN0.1 ; Timer 4 External Clock Select Bit 1
  476. TMR4CN0_TR4 BIT TMR4CN0.2 ; Timer 4 Run Control
  477. TMR4CN0_T4SPLIT BIT TMR4CN0.3 ; Timer 4 Split Mode Enable
  478. TMR4CN0_TF4CEN BIT TMR4CN0.4 ; Timer 4 Capture Enable
  479. TMR4CN0_TF4LEN BIT TMR4CN0.5 ; Timer 4 Low Byte Interrupt Enable
  480. TMR4CN0_TF4L BIT TMR4CN0.6 ; Timer 4 Low Byte Overflow Flag
  481. TMR4CN0_TF4H BIT TMR4CN0.7 ; Timer 4 High Byte Overflow Flag
  482. ; TMR5CN0 0xC0 (Timer 5 Control 0)
  483. TMR5CN0_T5XCLK0 BIT TMR5CN0.0 ; Timer 5 External Clock Select Bit 0
  484. TMR5CN0_T5XCLK1 BIT TMR5CN0.1 ; Timer 5 External Clock Select Bit 1
  485. TMR5CN0_TR5 BIT TMR5CN0.2 ; Timer 5 Run Control
  486. TMR5CN0_T5SPLIT BIT TMR5CN0.3 ; Timer 5 Split Mode Enable
  487. TMR5CN0_TF5CEN BIT TMR5CN0.4 ; Timer 5 Capture Enable
  488. TMR5CN0_TF5LEN BIT TMR5CN0.5 ; Timer 5 Low Byte Interrupt Enable
  489. TMR5CN0_TF5L BIT TMR5CN0.6 ; Timer 5 Low Byte Overflow Flag
  490. TMR5CN0_TF5H BIT TMR5CN0.7 ; Timer 5 High Byte Overflow Flag
  491. ; UART1FCN1 0xD8 (UART1 FIFO Control 1)
  492. UART1FCN1_RIE BIT UART1FCN1.0 ; Receive Interrupt Enable
  493. UART1FCN1_RXTO0 BIT UART1FCN1.1 ; Receive Timeout Bit 0
  494. UART1FCN1_RXTO1 BIT UART1FCN1.2 ; Receive Timeout Bit 1
  495. UART1FCN1_RFRQ BIT UART1FCN1.3 ; Receive FIFO Request
  496. UART1FCN1_TIE BIT UART1FCN1.4 ; Transmit Interrupt Enable
  497. UART1FCN1_TXHOLD BIT UART1FCN1.5 ; Transmit Hold
  498. UART1FCN1_TXNF BIT UART1FCN1.6 ; TX FIFO Not Full
  499. UART1FCN1_TFRQ BIT UART1FCN1.7 ; Transmit FIFO Request
  500. ;------------------------------------------------------------------------------
  501. ; Interrupt Definitions
  502. ;------------------------------------------------------------------------------
  503. INT0_IRQn EQU 0 ; External Interrupt 0
  504. TIMER0_IRQn EQU 1 ; Timer 0 Overflow
  505. INT1_IRQn EQU 2 ; External Interrupt 1
  506. TIMER1_IRQn EQU 3 ; Timer 1 Overflow
  507. UART0_IRQn EQU 4 ; UART0
  508. TIMER2_IRQn EQU 5 ; Timer 2 Overflow / Capture
  509. SPI0_IRQn EQU 6 ; SPI0
  510. SMBUS0_IRQn EQU 7 ; SMBus 0
  511. PMATCH_IRQn EQU 8 ; Port Match
  512. ADC0WC_IRQn EQU 9 ; ADC0 Window Compare
  513. ADC0EOC_IRQn EQU 10 ; ADC0 End of Conversion
  514. PCA0_IRQn EQU 11 ; PCA0
  515. CMP0_IRQn EQU 12 ; Comparator 0
  516. CMP1_IRQn EQU 13 ; Comparator 1
  517. TIMER3_IRQn EQU 14 ; Timer 3 Overflow / Capture
  518. UART1_IRQn EQU 15 ; UART1
  519. I2C0_IRQn EQU 16 ; I2C0 Slave
  520. TIMER4_IRQn EQU 17 ; Timer 4 Overflow / Capture
  521. TIMER5_IRQn EQU 18 ; Timer 5 Overflow / Capture
  522. CL0_IRQn EQU 19 ; Configurable Logic
  523. ;------------------------------------------------------------------------------
  524. ; SFR Page Definitions
  525. ;------------------------------------------------------------------------------
  526. LEGACY_PAGE EQU 000H ; Legacy SFR Page
  527. PG2_PAGE EQU 010H ; Page2
  528. PG3_PAGE EQU 020H ; Page3
  529. PG4_PAGE EQU 030H ; Page4