1
0

hw_adc.h 73 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337
  1. //*****************************************************************************
  2. //
  3. // hw_adc.h - Macros used when accessing the ADC hardware.
  4. //
  5. // Copyright (c) 2005-2011 Texas Instruments Incorporated. All rights reserved.
  6. // Software License Agreement
  7. //
  8. // Texas Instruments (TI) is supplying this software for use solely and
  9. // exclusively on TI's microcontroller products. The software is owned by
  10. // TI and/or its suppliers, and is protected under applicable copyright
  11. // laws. You may not combine this software with "viral" open-source
  12. // software in order to form a larger program.
  13. //
  14. // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
  15. // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
  16. // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  17. // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
  18. // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
  19. // DAMAGES, FOR ANY REASON WHATSOEVER.
  20. //
  21. // This is part of revision 8264 of the Stellaris Firmware Development Package.
  22. //
  23. //*****************************************************************************
  24. #ifndef __HW_ADC_H__
  25. #define __HW_ADC_H__
  26. //*****************************************************************************
  27. //
  28. // The following are defines for the ADC register offsets.
  29. //
  30. //*****************************************************************************
  31. #define ADC_O_ACTSS 0x00000000 // ADC Active Sample Sequencer
  32. #define ADC_O_RIS 0x00000004 // ADC Raw Interrupt Status
  33. #define ADC_O_IM 0x00000008 // ADC Interrupt Mask
  34. #define ADC_O_ISC 0x0000000C // ADC Interrupt Status and Clear
  35. #define ADC_O_OSTAT 0x00000010 // ADC Overflow Status
  36. #define ADC_O_EMUX 0x00000014 // ADC Event Multiplexer Select
  37. #define ADC_O_USTAT 0x00000018 // ADC Underflow Status
  38. #define ADC_O_TSSEL 0x0000001C // ADC Trigger Source Select
  39. #define ADC_O_SSPRI 0x00000020 // ADC Sample Sequencer Priority
  40. #define ADC_O_SPC 0x00000024 // ADC Sample Phase Control
  41. #define ADC_O_PSSI 0x00000028 // ADC Processor Sample Sequence
  42. // Initiate
  43. #define ADC_O_SAC 0x00000030 // ADC Sample Averaging Control
  44. #define ADC_O_DCISC 0x00000034 // ADC Digital Comparator Interrupt
  45. // Status and Clear
  46. #define ADC_O_CTL 0x00000038 // ADC Control
  47. #define ADC_O_SSMUX0 0x00000040 // ADC Sample Sequence Input
  48. // Multiplexer Select 0
  49. #define ADC_O_SSCTL0 0x00000044 // ADC Sample Sequence Control 0
  50. #define ADC_O_SSFIFO0 0x00000048 // ADC Sample Sequence Result FIFO
  51. // 0
  52. #define ADC_O_SSFSTAT0 0x0000004C // ADC Sample Sequence FIFO 0
  53. // Status
  54. #define ADC_O_SSOP0 0x00000050 // ADC Sample Sequence 0 Operation
  55. #define ADC_O_SSDC0 0x00000054 // ADC Sample Sequence 0 Digital
  56. // Comparator Select
  57. #define ADC_O_SSEMUX0 0x00000058 // ADC Sample Sequence Extended
  58. // Input Multiplexer Select 0
  59. #define ADC_O_SSMUX1 0x00000060 // ADC Sample Sequence Input
  60. // Multiplexer Select 1
  61. #define ADC_O_SSCTL1 0x00000064 // ADC Sample Sequence Control 1
  62. #define ADC_O_SSFIFO1 0x00000068 // ADC Sample Sequence Result FIFO
  63. // 1
  64. #define ADC_O_SSFSTAT1 0x0000006C // ADC Sample Sequence FIFO 1
  65. // Status
  66. #define ADC_O_SSOP1 0x00000070 // ADC Sample Sequence 1 Operation
  67. #define ADC_O_SSDC1 0x00000074 // ADC Sample Sequence 1 Digital
  68. // Comparator Select
  69. #define ADC_O_SSEMUX1 0x00000078 // ADC Sample Sequence Extended
  70. // Input Multiplexer Select 1
  71. #define ADC_O_SSMUX2 0x00000080 // ADC Sample Sequence Input
  72. // Multiplexer Select 2
  73. #define ADC_O_SSCTL2 0x00000084 // ADC Sample Sequence Control 2
  74. #define ADC_O_SSFIFO2 0x00000088 // ADC Sample Sequence Result FIFO
  75. // 2
  76. #define ADC_O_SSFSTAT2 0x0000008C // ADC Sample Sequence FIFO 2
  77. // Status
  78. #define ADC_O_SSOP2 0x00000090 // ADC Sample Sequence 2 Operation
  79. #define ADC_O_SSDC2 0x00000094 // ADC Sample Sequence 2 Digital
  80. // Comparator Select
  81. #define ADC_O_SSEMUX2 0x00000098 // ADC Sample Sequence Extended
  82. // Input Multiplexer Select 2
  83. #define ADC_O_SSMUX3 0x000000A0 // ADC Sample Sequence Input
  84. // Multiplexer Select 3
  85. #define ADC_O_SSCTL3 0x000000A4 // ADC Sample Sequence Control 3
  86. #define ADC_O_SSFIFO3 0x000000A8 // ADC Sample Sequence Result FIFO
  87. // 3
  88. #define ADC_O_SSFSTAT3 0x000000AC // ADC Sample Sequence FIFO 3
  89. // Status
  90. #define ADC_O_SSOP3 0x000000B0 // ADC Sample Sequence 3 Operation
  91. #define ADC_O_SSDC3 0x000000B4 // ADC Sample Sequence 3 Digital
  92. // Comparator Select
  93. #define ADC_O_SSEMUX3 0x000000B8 // ADC Sample Sequence Extended
  94. // Input Multiplexer Select 3
  95. #define ADC_O_TMLB 0x00000100 // ADC Test Mode Loopback
  96. #define ADC_O_DCRIC 0x00000D00 // ADC Digital Comparator Reset
  97. // Initial Conditions
  98. #define ADC_O_DCCTL0 0x00000E00 // ADC Digital Comparator Control 0
  99. #define ADC_O_DCCTL1 0x00000E04 // ADC Digital Comparator Control 1
  100. #define ADC_O_DCCTL2 0x00000E08 // ADC Digital Comparator Control 2
  101. #define ADC_O_DCCTL3 0x00000E0C // ADC Digital Comparator Control 3
  102. #define ADC_O_DCCTL4 0x00000E10 // ADC Digital Comparator Control 4
  103. #define ADC_O_DCCTL5 0x00000E14 // ADC Digital Comparator Control 5
  104. #define ADC_O_DCCTL6 0x00000E18 // ADC Digital Comparator Control 6
  105. #define ADC_O_DCCTL7 0x00000E1C // ADC Digital Comparator Control 7
  106. #define ADC_O_DCCMP0 0x00000E40 // ADC Digital Comparator Range 0
  107. #define ADC_O_DCCMP1 0x00000E44 // ADC Digital Comparator Range 1
  108. #define ADC_O_DCCMP2 0x00000E48 // ADC Digital Comparator Range 2
  109. #define ADC_O_DCCMP3 0x00000E4C // ADC Digital Comparator Range 3
  110. #define ADC_O_DCCMP4 0x00000E50 // ADC Digital Comparator Range 4
  111. #define ADC_O_DCCMP5 0x00000E54 // ADC Digital Comparator Range 5
  112. #define ADC_O_DCCMP6 0x00000E58 // ADC Digital Comparator Range 6
  113. #define ADC_O_DCCMP7 0x00000E5C // ADC Digital Comparator Range 7
  114. #define ADC_O_PP 0x00000FC0 // ADC Peripheral Properties
  115. #define ADC_O_PC 0x00000FC4 // ADC Peripheral Configuration
  116. #define ADC_O_CC 0x00000FC8 // ADC Clock Configuration
  117. //*****************************************************************************
  118. //
  119. // The following are defines for the bit fields in the ADC_O_ACTSS register.
  120. //
  121. //*****************************************************************************
  122. #define ADC_ACTSS_ASEN3 0x00000008 // ADC SS3 Enable
  123. #define ADC_ACTSS_ASEN2 0x00000004 // ADC SS2 Enable
  124. #define ADC_ACTSS_ASEN1 0x00000002 // ADC SS1 Enable
  125. #define ADC_ACTSS_ASEN0 0x00000001 // ADC SS0 Enable
  126. //*****************************************************************************
  127. //
  128. // The following are defines for the bit fields in the ADC_O_RIS register.
  129. //
  130. //*****************************************************************************
  131. #define ADC_RIS_INRDC 0x00010000 // Digital Comparator Raw Interrupt
  132. // Status
  133. #define ADC_RIS_INR3 0x00000008 // SS3 Raw Interrupt Status
  134. #define ADC_RIS_INR2 0x00000004 // SS2 Raw Interrupt Status
  135. #define ADC_RIS_INR1 0x00000002 // SS1 Raw Interrupt Status
  136. #define ADC_RIS_INR0 0x00000001 // SS0 Raw Interrupt Status
  137. //*****************************************************************************
  138. //
  139. // The following are defines for the bit fields in the ADC_O_IM register.
  140. //
  141. //*****************************************************************************
  142. #define ADC_IM_DCONSS3 0x00080000 // Digital Comparator Interrupt on
  143. // SS3
  144. #define ADC_IM_DCONSS2 0x00040000 // Digital Comparator Interrupt on
  145. // SS2
  146. #define ADC_IM_DCONSS1 0x00020000 // Digital Comparator Interrupt on
  147. // SS1
  148. #define ADC_IM_DCONSS0 0x00010000 // Digital Comparator Interrupt on
  149. // SS0
  150. #define ADC_IM_MASK3 0x00000008 // SS3 Interrupt Mask
  151. #define ADC_IM_MASK2 0x00000004 // SS2 Interrupt Mask
  152. #define ADC_IM_MASK1 0x00000002 // SS1 Interrupt Mask
  153. #define ADC_IM_MASK0 0x00000001 // SS0 Interrupt Mask
  154. //*****************************************************************************
  155. //
  156. // The following are defines for the bit fields in the ADC_O_ISC register.
  157. //
  158. //*****************************************************************************
  159. #define ADC_ISC_DCINSS3 0x00080000 // Digital Comparator Interrupt
  160. // Status on SS3
  161. #define ADC_ISC_DCINSS2 0x00040000 // Digital Comparator Interrupt
  162. // Status on SS2
  163. #define ADC_ISC_DCINSS1 0x00020000 // Digital Comparator Interrupt
  164. // Status on SS1
  165. #define ADC_ISC_DCINSS0 0x00010000 // Digital Comparator Interrupt
  166. // Status on SS0
  167. #define ADC_ISC_IN3 0x00000008 // SS3 Interrupt Status and Clear
  168. #define ADC_ISC_IN2 0x00000004 // SS2 Interrupt Status and Clear
  169. #define ADC_ISC_IN1 0x00000002 // SS1 Interrupt Status and Clear
  170. #define ADC_ISC_IN0 0x00000001 // SS0 Interrupt Status and Clear
  171. //*****************************************************************************
  172. //
  173. // The following are defines for the bit fields in the ADC_O_OSTAT register.
  174. //
  175. //*****************************************************************************
  176. #define ADC_OSTAT_OV3 0x00000008 // SS3 FIFO Overflow
  177. #define ADC_OSTAT_OV2 0x00000004 // SS2 FIFO Overflow
  178. #define ADC_OSTAT_OV1 0x00000002 // SS1 FIFO Overflow
  179. #define ADC_OSTAT_OV0 0x00000001 // SS0 FIFO Overflow
  180. //*****************************************************************************
  181. //
  182. // The following are defines for the bit fields in the ADC_O_EMUX register.
  183. //
  184. //*****************************************************************************
  185. #define ADC_EMUX_EM3_M 0x0000F000 // SS3 Trigger Select
  186. #define ADC_EMUX_EM3_PROCESSOR 0x00000000 // Processor (default)
  187. #define ADC_EMUX_EM3_COMP0 0x00001000 // Analog Comparator 0
  188. #define ADC_EMUX_EM3_COMP1 0x00002000 // Analog Comparator 1
  189. #define ADC_EMUX_EM3_COMP2 0x00003000 // Analog Comparator 2
  190. #define ADC_EMUX_EM3_EXTERNAL 0x00004000 // External (GPIO PB4)
  191. #define ADC_EMUX_EM3_TIMER 0x00005000 // Timer
  192. #define ADC_EMUX_EM3_PWM0 0x00006000 // PWM0
  193. #define ADC_EMUX_EM3_PWM1 0x00007000 // PWM1
  194. #define ADC_EMUX_EM3_PWM2 0x00008000 // PWM2
  195. #define ADC_EMUX_EM3_PWM3 0x00009000 // PWM3
  196. #define ADC_EMUX_EM3_ALWAYS 0x0000F000 // Always (continuously sample)
  197. #define ADC_EMUX_EM2_M 0x00000F00 // SS2 Trigger Select
  198. #define ADC_EMUX_EM2_PROCESSOR 0x00000000 // Processor (default)
  199. #define ADC_EMUX_EM2_COMP0 0x00000100 // Analog Comparator 0
  200. #define ADC_EMUX_EM2_COMP1 0x00000200 // Analog Comparator 1
  201. #define ADC_EMUX_EM2_COMP2 0x00000300 // Analog Comparator 2
  202. #define ADC_EMUX_EM2_EXTERNAL 0x00000400 // External (GPIO PB4)
  203. #define ADC_EMUX_EM2_TIMER 0x00000500 // Timer
  204. #define ADC_EMUX_EM2_PWM0 0x00000600 // PWM0
  205. #define ADC_EMUX_EM2_PWM1 0x00000700 // PWM1
  206. #define ADC_EMUX_EM2_PWM2 0x00000800 // PWM2
  207. #define ADC_EMUX_EM2_PWM3 0x00000900 // PWM3
  208. #define ADC_EMUX_EM2_ALWAYS 0x00000F00 // Always (continuously sample)
  209. #define ADC_EMUX_EM1_M 0x000000F0 // SS1 Trigger Select
  210. #define ADC_EMUX_EM1_PROCESSOR 0x00000000 // Processor (default)
  211. #define ADC_EMUX_EM1_COMP0 0x00000010 // Analog Comparator 0
  212. #define ADC_EMUX_EM1_COMP1 0x00000020 // Analog Comparator 1
  213. #define ADC_EMUX_EM1_COMP2 0x00000030 // Analog Comparator 2
  214. #define ADC_EMUX_EM1_EXTERNAL 0x00000040 // External (GPIO PB4)
  215. #define ADC_EMUX_EM1_TIMER 0x00000050 // Timer
  216. #define ADC_EMUX_EM1_PWM0 0x00000060 // PWM0
  217. #define ADC_EMUX_EM1_PWM1 0x00000070 // PWM1
  218. #define ADC_EMUX_EM1_PWM2 0x00000080 // PWM2
  219. #define ADC_EMUX_EM1_PWM3 0x00000090 // PWM3
  220. #define ADC_EMUX_EM1_ALWAYS 0x000000F0 // Always (continuously sample)
  221. #define ADC_EMUX_EM0_M 0x0000000F // SS0 Trigger Select
  222. #define ADC_EMUX_EM0_PROCESSOR 0x00000000 // Processor (default)
  223. #define ADC_EMUX_EM0_COMP0 0x00000001 // Analog Comparator 0
  224. #define ADC_EMUX_EM0_COMP1 0x00000002 // Analog Comparator 1
  225. #define ADC_EMUX_EM0_COMP2 0x00000003 // Analog Comparator 2
  226. #define ADC_EMUX_EM0_EXTERNAL 0x00000004 // External (GPIO PB4)
  227. #define ADC_EMUX_EM0_TIMER 0x00000005 // Timer
  228. #define ADC_EMUX_EM0_PWM0 0x00000006 // PWM0
  229. #define ADC_EMUX_EM0_PWM1 0x00000007 // PWM1
  230. #define ADC_EMUX_EM0_PWM2 0x00000008 // PWM2
  231. #define ADC_EMUX_EM0_PWM3 0x00000009 // PWM3
  232. #define ADC_EMUX_EM0_ALWAYS 0x0000000F // Always (continuously sample)
  233. //*****************************************************************************
  234. //
  235. // The following are defines for the bit fields in the ADC_O_USTAT register.
  236. //
  237. //*****************************************************************************
  238. #define ADC_USTAT_UV3 0x00000008 // SS3 FIFO Underflow
  239. #define ADC_USTAT_UV2 0x00000004 // SS2 FIFO Underflow
  240. #define ADC_USTAT_UV1 0x00000002 // SS1 FIFO Underflow
  241. #define ADC_USTAT_UV0 0x00000001 // SS0 FIFO Underflow
  242. //*****************************************************************************
  243. //
  244. // The following are defines for the bit fields in the ADC_O_TSSEL register.
  245. //
  246. //*****************************************************************************
  247. #define ADC_TSSEL_PS3_M 0x03000000 // PWM Unit Select
  248. #define ADC_TSSEL_PS3_0 0x00000000 // PWM Unit 0
  249. #define ADC_TSSEL_PS3_1 0x01000000 // PWM Unit 1
  250. #define ADC_TSSEL_PS2_M 0x00030000 // PWM Unit Select
  251. #define ADC_TSSEL_PS2_0 0x00000000 // PWM Unit 0
  252. #define ADC_TSSEL_PS2_1 0x00010000 // PWM Unit 1
  253. #define ADC_TSSEL_PS1_M 0x00000300 // PWM Unit Select
  254. #define ADC_TSSEL_PS1_0 0x00000000 // PWM Unit 0
  255. #define ADC_TSSEL_PS1_1 0x00000100 // PWM Unit 1
  256. #define ADC_TSSEL_PS0_M 0x00000003 // PWM Unit Select
  257. #define ADC_TSSEL_PS0_0 0x00000000 // PWM Unit 0
  258. #define ADC_TSSEL_PS0_1 0x00000001 // PWM Unit 1
  259. //*****************************************************************************
  260. //
  261. // The following are defines for the bit fields in the ADC_O_SSPRI register.
  262. //
  263. //*****************************************************************************
  264. #define ADC_SSPRI_SS3_M 0x00003000 // SS3 Priority
  265. #define ADC_SSPRI_SS3_1ST 0x00000000 // First priority
  266. #define ADC_SSPRI_SS3_2ND 0x00001000 // Second priority
  267. #define ADC_SSPRI_SS3_3RD 0x00002000 // Third priority
  268. #define ADC_SSPRI_SS3_4TH 0x00003000 // Fourth priority
  269. #define ADC_SSPRI_SS2_M 0x00000300 // SS2 Priority
  270. #define ADC_SSPRI_SS2_1ST 0x00000000 // First priority
  271. #define ADC_SSPRI_SS2_2ND 0x00000100 // Second priority
  272. #define ADC_SSPRI_SS2_3RD 0x00000200 // Third priority
  273. #define ADC_SSPRI_SS2_4TH 0x00000300 // Fourth priority
  274. #define ADC_SSPRI_SS1_M 0x00000030 // SS1 Priority
  275. #define ADC_SSPRI_SS1_1ST 0x00000000 // First priority
  276. #define ADC_SSPRI_SS1_2ND 0x00000010 // Second priority
  277. #define ADC_SSPRI_SS1_3RD 0x00000020 // Third priority
  278. #define ADC_SSPRI_SS1_4TH 0x00000030 // Fourth priority
  279. #define ADC_SSPRI_SS0_M 0x00000003 // SS0 Priority
  280. #define ADC_SSPRI_SS0_1ST 0x00000000 // First priority
  281. #define ADC_SSPRI_SS0_2ND 0x00000001 // Second priority
  282. #define ADC_SSPRI_SS0_3RD 0x00000002 // Third priority
  283. #define ADC_SSPRI_SS0_4TH 0x00000003 // Fourth priority
  284. //*****************************************************************************
  285. //
  286. // The following are defines for the bit fields in the ADC_O_SPC register.
  287. //
  288. //*****************************************************************************
  289. #define ADC_SPC_PHASE_M 0x0000000F // Phase Difference
  290. #define ADC_SPC_PHASE_0 0x00000000 // ADC sample lags by 0.0
  291. #define ADC_SPC_PHASE_22_5 0x00000001 // ADC sample lags by 22.5
  292. #define ADC_SPC_PHASE_45 0x00000002 // ADC sample lags by 45.0
  293. #define ADC_SPC_PHASE_67_5 0x00000003 // ADC sample lags by 67.5
  294. #define ADC_SPC_PHASE_90 0x00000004 // ADC sample lags by 90.0
  295. #define ADC_SPC_PHASE_112_5 0x00000005 // ADC sample lags by 112.5
  296. #define ADC_SPC_PHASE_135 0x00000006 // ADC sample lags by 135.0
  297. #define ADC_SPC_PHASE_157_5 0x00000007 // ADC sample lags by 157.5
  298. #define ADC_SPC_PHASE_180 0x00000008 // ADC sample lags by 180.0
  299. #define ADC_SPC_PHASE_202_5 0x00000009 // ADC sample lags by 202.5
  300. #define ADC_SPC_PHASE_225 0x0000000A // ADC sample lags by 225.0
  301. #define ADC_SPC_PHASE_247_5 0x0000000B // ADC sample lags by 247.5
  302. #define ADC_SPC_PHASE_270 0x0000000C // ADC sample lags by 270.0
  303. #define ADC_SPC_PHASE_292_5 0x0000000D // ADC sample lags by 292.5
  304. #define ADC_SPC_PHASE_315 0x0000000E // ADC sample lags by 315.0
  305. #define ADC_SPC_PHASE_337_5 0x0000000F // ADC sample lags by 337.5
  306. //*****************************************************************************
  307. //
  308. // The following are defines for the bit fields in the ADC_O_PSSI register.
  309. //
  310. //*****************************************************************************
  311. #define ADC_PSSI_GSYNC 0x80000000 // Global Synchronize
  312. #define ADC_PSSI_SYNCWAIT 0x08000000 // Synchronize Wait
  313. #define ADC_PSSI_SS3 0x00000008 // SS3 Initiate
  314. #define ADC_PSSI_SS2 0x00000004 // SS2 Initiate
  315. #define ADC_PSSI_SS1 0x00000002 // SS1 Initiate
  316. #define ADC_PSSI_SS0 0x00000001 // SS0 Initiate
  317. //*****************************************************************************
  318. //
  319. // The following are defines for the bit fields in the ADC_O_SAC register.
  320. //
  321. //*****************************************************************************
  322. #define ADC_SAC_AVG_M 0x00000007 // Hardware Averaging Control
  323. #define ADC_SAC_AVG_OFF 0x00000000 // No hardware oversampling
  324. #define ADC_SAC_AVG_2X 0x00000001 // 2x hardware oversampling
  325. #define ADC_SAC_AVG_4X 0x00000002 // 4x hardware oversampling
  326. #define ADC_SAC_AVG_8X 0x00000003 // 8x hardware oversampling
  327. #define ADC_SAC_AVG_16X 0x00000004 // 16x hardware oversampling
  328. #define ADC_SAC_AVG_32X 0x00000005 // 32x hardware oversampling
  329. #define ADC_SAC_AVG_64X 0x00000006 // 64x hardware oversampling
  330. //*****************************************************************************
  331. //
  332. // The following are defines for the bit fields in the ADC_O_DCISC register.
  333. //
  334. //*****************************************************************************
  335. #define ADC_DCISC_DCINT7 0x00000080 // Digital Comparator 7 Interrupt
  336. // Status and Clear
  337. #define ADC_DCISC_DCINT6 0x00000040 // Digital Comparator 6 Interrupt
  338. // Status and Clear
  339. #define ADC_DCISC_DCINT5 0x00000020 // Digital Comparator 5 Interrupt
  340. // Status and Clear
  341. #define ADC_DCISC_DCINT4 0x00000010 // Digital Comparator 4 Interrupt
  342. // Status and Clear
  343. #define ADC_DCISC_DCINT3 0x00000008 // Digital Comparator 3 Interrupt
  344. // Status and Clear
  345. #define ADC_DCISC_DCINT2 0x00000004 // Digital Comparator 2 Interrupt
  346. // Status and Clear
  347. #define ADC_DCISC_DCINT1 0x00000002 // Digital Comparator 1 Interrupt
  348. // Status and Clear
  349. #define ADC_DCISC_DCINT0 0x00000001 // Digital Comparator 0 Interrupt
  350. // Status and Clear
  351. //*****************************************************************************
  352. //
  353. // The following are defines for the bit fields in the ADC_O_CTL register.
  354. //
  355. //*****************************************************************************
  356. #define ADC_CTL_RES 0x00000010 // Sample Resolution
  357. #define ADC_CTL_VREF_M 0x00000003 // Voltage Reference Select
  358. #define ADC_CTL_VREF_INTERNAL 0x00000000 // The internal reference as the
  359. // voltage reference
  360. #define ADC_CTL_VREF_EXT_3V 0x00000001 // A 3.0 V external VREFA input is
  361. // the voltage reference. The ADC
  362. // conversion range is 0.0 V to the
  363. // external reference value
  364. #define ADC_CTL_VREF_EXT_1V 0x00000003 // A 1.0 V external VREFA input is
  365. // the voltage reference. The ADC
  366. // conversion range is 0.0 V to
  367. // three times the external
  368. // reference value
  369. #define ADC_CTL_VREF 0x00000001 // Voltage Reference Select
  370. //*****************************************************************************
  371. //
  372. // The following are defines for the bit fields in the ADC_O_SSMUX0 register.
  373. //
  374. //*****************************************************************************
  375. #define ADC_SSMUX0_MUX7_M 0xF0000000 // 8th Sample Input Select
  376. #define ADC_SSMUX0_MUX6_M 0x0F000000 // 7th Sample Input Select
  377. #define ADC_SSMUX0_MUX5_M 0x00F00000 // 6th Sample Input Select
  378. #define ADC_SSMUX0_MUX4_M 0x000F0000 // 5th Sample Input Select
  379. #define ADC_SSMUX0_MUX3_M 0x0000F000 // 4th Sample Input Select
  380. #define ADC_SSMUX0_MUX2_M 0x00000F00 // 3rd Sample Input Select
  381. #define ADC_SSMUX0_MUX1_M 0x000000F0 // 2nd Sample Input Select
  382. #define ADC_SSMUX0_MUX0_M 0x0000000F // 1st Sample Input Select
  383. #define ADC_SSMUX0_MUX7_S 28
  384. #define ADC_SSMUX0_MUX6_S 24
  385. #define ADC_SSMUX0_MUX5_S 20
  386. #define ADC_SSMUX0_MUX4_S 16
  387. #define ADC_SSMUX0_MUX3_S 12
  388. #define ADC_SSMUX0_MUX2_S 8
  389. #define ADC_SSMUX0_MUX1_S 4
  390. #define ADC_SSMUX0_MUX0_S 0
  391. //*****************************************************************************
  392. //
  393. // The following are defines for the bit fields in the ADC_O_SSCTL0 register.
  394. //
  395. //*****************************************************************************
  396. #define ADC_SSCTL0_TS7 0x80000000 // 8th Sample Temp Sensor Select
  397. #define ADC_SSCTL0_IE7 0x40000000 // 8th Sample Interrupt Enable
  398. #define ADC_SSCTL0_END7 0x20000000 // 8th Sample is End of Sequence
  399. #define ADC_SSCTL0_D7 0x10000000 // 8th Sample Diff Input Select
  400. #define ADC_SSCTL0_TS6 0x08000000 // 7th Sample Temp Sensor Select
  401. #define ADC_SSCTL0_IE6 0x04000000 // 7th Sample Interrupt Enable
  402. #define ADC_SSCTL0_END6 0x02000000 // 7th Sample is End of Sequence
  403. #define ADC_SSCTL0_D6 0x01000000 // 7th Sample Diff Input Select
  404. #define ADC_SSCTL0_TS5 0x00800000 // 6th Sample Temp Sensor Select
  405. #define ADC_SSCTL0_IE5 0x00400000 // 6th Sample Interrupt Enable
  406. #define ADC_SSCTL0_END5 0x00200000 // 6th Sample is End of Sequence
  407. #define ADC_SSCTL0_D5 0x00100000 // 6th Sample Diff Input Select
  408. #define ADC_SSCTL0_TS4 0x00080000 // 5th Sample Temp Sensor Select
  409. #define ADC_SSCTL0_IE4 0x00040000 // 5th Sample Interrupt Enable
  410. #define ADC_SSCTL0_END4 0x00020000 // 5th Sample is End of Sequence
  411. #define ADC_SSCTL0_D4 0x00010000 // 5th Sample Diff Input Select
  412. #define ADC_SSCTL0_TS3 0x00008000 // 4th Sample Temp Sensor Select
  413. #define ADC_SSCTL0_IE3 0x00004000 // 4th Sample Interrupt Enable
  414. #define ADC_SSCTL0_END3 0x00002000 // 4th Sample is End of Sequence
  415. #define ADC_SSCTL0_D3 0x00001000 // 4th Sample Diff Input Select
  416. #define ADC_SSCTL0_TS2 0x00000800 // 3rd Sample Temp Sensor Select
  417. #define ADC_SSCTL0_IE2 0x00000400 // 3rd Sample Interrupt Enable
  418. #define ADC_SSCTL0_END2 0x00000200 // 3rd Sample is End of Sequence
  419. #define ADC_SSCTL0_D2 0x00000100 // 3rd Sample Diff Input Select
  420. #define ADC_SSCTL0_TS1 0x00000080 // 2nd Sample Temp Sensor Select
  421. #define ADC_SSCTL0_IE1 0x00000040 // 2nd Sample Interrupt Enable
  422. #define ADC_SSCTL0_END1 0x00000020 // 2nd Sample is End of Sequence
  423. #define ADC_SSCTL0_D1 0x00000010 // 2nd Sample Diff Input Select
  424. #define ADC_SSCTL0_TS0 0x00000008 // 1st Sample Temp Sensor Select
  425. #define ADC_SSCTL0_IE0 0x00000004 // 1st Sample Interrupt Enable
  426. #define ADC_SSCTL0_END0 0x00000002 // 1st Sample is End of Sequence
  427. #define ADC_SSCTL0_D0 0x00000001 // 1st Sample Diff Input Select
  428. //*****************************************************************************
  429. //
  430. // The following are defines for the bit fields in the ADC_O_SSFIFO0 register.
  431. //
  432. //*****************************************************************************
  433. #define ADC_SSFIFO0_DATA_M 0x00000FFF // Conversion Result Data
  434. #define ADC_SSFIFO0_DATA_S 0
  435. //*****************************************************************************
  436. //
  437. // The following are defines for the bit fields in the ADC_O_SSFSTAT0 register.
  438. //
  439. //*****************************************************************************
  440. #define ADC_SSFSTAT0_FULL 0x00001000 // FIFO Full
  441. #define ADC_SSFSTAT0_EMPTY 0x00000100 // FIFO Empty
  442. #define ADC_SSFSTAT0_HPTR_M 0x000000F0 // FIFO Head Pointer
  443. #define ADC_SSFSTAT0_TPTR_M 0x0000000F // FIFO Tail Pointer
  444. #define ADC_SSFSTAT0_HPTR_S 4
  445. #define ADC_SSFSTAT0_TPTR_S 0
  446. //*****************************************************************************
  447. //
  448. // The following are defines for the bit fields in the ADC_O_SSOP0 register.
  449. //
  450. //*****************************************************************************
  451. #define ADC_SSOP0_S7DCOP 0x10000000 // Sample 7 Digital Comparator
  452. // Operation
  453. #define ADC_SSOP0_S6DCOP 0x01000000 // Sample 6 Digital Comparator
  454. // Operation
  455. #define ADC_SSOP0_S5DCOP 0x00100000 // Sample 5 Digital Comparator
  456. // Operation
  457. #define ADC_SSOP0_S4DCOP 0x00010000 // Sample 4 Digital Comparator
  458. // Operation
  459. #define ADC_SSOP0_S3DCOP 0x00001000 // Sample 3 Digital Comparator
  460. // Operation
  461. #define ADC_SSOP0_S2DCOP 0x00000100 // Sample 2 Digital Comparator
  462. // Operation
  463. #define ADC_SSOP0_S1DCOP 0x00000010 // Sample 1 Digital Comparator
  464. // Operation
  465. #define ADC_SSOP0_S0DCOP 0x00000001 // Sample 0 Digital Comparator
  466. // Operation
  467. //*****************************************************************************
  468. //
  469. // The following are defines for the bit fields in the ADC_O_SSDC0 register.
  470. //
  471. //*****************************************************************************
  472. #define ADC_SSDC0_S7DCSEL_M 0xF0000000 // Sample 7 Digital Comparator
  473. // Select
  474. #define ADC_SSDC0_S6DCSEL_M 0x0F000000 // Sample 6 Digital Comparator
  475. // Select
  476. #define ADC_SSDC0_S5DCSEL_M 0x00F00000 // Sample 5 Digital Comparator
  477. // Select
  478. #define ADC_SSDC0_S4DCSEL_M 0x000F0000 // Sample 4 Digital Comparator
  479. // Select
  480. #define ADC_SSDC0_S3DCSEL_M 0x0000F000 // Sample 3 Digital Comparator
  481. // Select
  482. #define ADC_SSDC0_S2DCSEL_M 0x00000F00 // Sample 2 Digital Comparator
  483. // Select
  484. #define ADC_SSDC0_S1DCSEL_M 0x000000F0 // Sample 1 Digital Comparator
  485. // Select
  486. #define ADC_SSDC0_S0DCSEL_M 0x0000000F // Sample 0 Digital Comparator
  487. // Select
  488. #define ADC_SSDC0_S6DCSEL_S 24
  489. #define ADC_SSDC0_S5DCSEL_S 20
  490. #define ADC_SSDC0_S4DCSEL_S 16
  491. #define ADC_SSDC0_S3DCSEL_S 12
  492. #define ADC_SSDC0_S2DCSEL_S 8
  493. #define ADC_SSDC0_S1DCSEL_S 4
  494. #define ADC_SSDC0_S0DCSEL_S 0
  495. //*****************************************************************************
  496. //
  497. // The following are defines for the bit fields in the ADC_O_SSEMUX0 register.
  498. //
  499. //*****************************************************************************
  500. #define ADC_SSEMUX0_EMUX7 0x10000000 // 8th Sample Input Select (Upper
  501. // Bit)
  502. #define ADC_SSEMUX0_EMUX6 0x01000000 // 7th Sample Input Select (Upper
  503. // Bit)
  504. #define ADC_SSEMUX0_EMUX5 0x00100000 // 6th Sample Input Select (Upper
  505. // Bit)
  506. #define ADC_SSEMUX0_EMUX4 0x00010000 // 5th Sample Input Select (Upper
  507. // Bit)
  508. #define ADC_SSEMUX0_EMUX3 0x00001000 // 4th Sample Input Select (Upper
  509. // Bit)
  510. #define ADC_SSEMUX0_EMUX2 0x00000100 // 3rd Sample Input Select (Upper
  511. // Bit)
  512. #define ADC_SSEMUX0_EMUX1 0x00000010 // 2th Sample Input Select (Upper
  513. // Bit)
  514. #define ADC_SSEMUX0_EMUX0 0x00000001 // 1st Sample Input Select (Upper
  515. // Bit)
  516. //*****************************************************************************
  517. //
  518. // The following are defines for the bit fields in the ADC_O_SSMUX1 register.
  519. //
  520. //*****************************************************************************
  521. #define ADC_SSMUX1_MUX3_M 0x0000F000 // 4th Sample Input Select
  522. #define ADC_SSMUX1_MUX2_M 0x00000F00 // 3rd Sample Input Select
  523. #define ADC_SSMUX1_MUX1_M 0x000000F0 // 2nd Sample Input Select
  524. #define ADC_SSMUX1_MUX0_M 0x0000000F // 1st Sample Input Select
  525. #define ADC_SSMUX1_MUX3_S 12
  526. #define ADC_SSMUX1_MUX2_S 8
  527. #define ADC_SSMUX1_MUX1_S 4
  528. #define ADC_SSMUX1_MUX0_S 0
  529. //*****************************************************************************
  530. //
  531. // The following are defines for the bit fields in the ADC_O_SSCTL1 register.
  532. //
  533. //*****************************************************************************
  534. #define ADC_SSCTL1_TS3 0x00008000 // 4th Sample Temp Sensor Select
  535. #define ADC_SSCTL1_IE3 0x00004000 // 4th Sample Interrupt Enable
  536. #define ADC_SSCTL1_END3 0x00002000 // 4th Sample is End of Sequence
  537. #define ADC_SSCTL1_D3 0x00001000 // 4th Sample Diff Input Select
  538. #define ADC_SSCTL1_TS2 0x00000800 // 3rd Sample Temp Sensor Select
  539. #define ADC_SSCTL1_IE2 0x00000400 // 3rd Sample Interrupt Enable
  540. #define ADC_SSCTL1_END2 0x00000200 // 3rd Sample is End of Sequence
  541. #define ADC_SSCTL1_D2 0x00000100 // 3rd Sample Diff Input Select
  542. #define ADC_SSCTL1_TS1 0x00000080 // 2nd Sample Temp Sensor Select
  543. #define ADC_SSCTL1_IE1 0x00000040 // 2nd Sample Interrupt Enable
  544. #define ADC_SSCTL1_END1 0x00000020 // 2nd Sample is End of Sequence
  545. #define ADC_SSCTL1_D1 0x00000010 // 2nd Sample Diff Input Select
  546. #define ADC_SSCTL1_TS0 0x00000008 // 1st Sample Temp Sensor Select
  547. #define ADC_SSCTL1_IE0 0x00000004 // 1st Sample Interrupt Enable
  548. #define ADC_SSCTL1_END0 0x00000002 // 1st Sample is End of Sequence
  549. #define ADC_SSCTL1_D0 0x00000001 // 1st Sample Diff Input Select
  550. //*****************************************************************************
  551. //
  552. // The following are defines for the bit fields in the ADC_O_SSFIFO1 register.
  553. //
  554. //*****************************************************************************
  555. #define ADC_SSFIFO1_DATA_M 0x00000FFF // Conversion Result Data
  556. #define ADC_SSFIFO1_DATA_S 0
  557. //*****************************************************************************
  558. //
  559. // The following are defines for the bit fields in the ADC_O_SSFSTAT1 register.
  560. //
  561. //*****************************************************************************
  562. #define ADC_SSFSTAT1_FULL 0x00001000 // FIFO Full
  563. #define ADC_SSFSTAT1_EMPTY 0x00000100 // FIFO Empty
  564. #define ADC_SSFSTAT1_HPTR_M 0x000000F0 // FIFO Head Pointer
  565. #define ADC_SSFSTAT1_TPTR_M 0x0000000F // FIFO Tail Pointer
  566. #define ADC_SSFSTAT1_HPTR_S 4
  567. #define ADC_SSFSTAT1_TPTR_S 0
  568. //*****************************************************************************
  569. //
  570. // The following are defines for the bit fields in the ADC_O_SSOP1 register.
  571. //
  572. //*****************************************************************************
  573. #define ADC_SSOP1_S3DCOP 0x00001000 // Sample 3 Digital Comparator
  574. // Operation
  575. #define ADC_SSOP1_S2DCOP 0x00000100 // Sample 2 Digital Comparator
  576. // Operation
  577. #define ADC_SSOP1_S1DCOP 0x00000010 // Sample 1 Digital Comparator
  578. // Operation
  579. #define ADC_SSOP1_S0DCOP 0x00000001 // Sample 0 Digital Comparator
  580. // Operation
  581. //*****************************************************************************
  582. //
  583. // The following are defines for the bit fields in the ADC_O_SSDC1 register.
  584. //
  585. //*****************************************************************************
  586. #define ADC_SSDC1_S3DCSEL_M 0x0000F000 // Sample 3 Digital Comparator
  587. // Select
  588. #define ADC_SSDC1_S2DCSEL_M 0x00000F00 // Sample 2 Digital Comparator
  589. // Select
  590. #define ADC_SSDC1_S1DCSEL_M 0x000000F0 // Sample 1 Digital Comparator
  591. // Select
  592. #define ADC_SSDC1_S0DCSEL_M 0x0000000F // Sample 0 Digital Comparator
  593. // Select
  594. #define ADC_SSDC1_S2DCSEL_S 8
  595. #define ADC_SSDC1_S1DCSEL_S 4
  596. #define ADC_SSDC1_S0DCSEL_S 0
  597. //*****************************************************************************
  598. //
  599. // The following are defines for the bit fields in the ADC_O_SSEMUX1 register.
  600. //
  601. //*****************************************************************************
  602. #define ADC_SSEMUX1_EMUX3 0x00001000 // 4th Sample Input Select (Upper
  603. // Bit)
  604. #define ADC_SSEMUX1_EMUX2 0x00000100 // 3rd Sample Input Select (Upper
  605. // Bit)
  606. #define ADC_SSEMUX1_EMUX1 0x00000010 // 2th Sample Input Select (Upper
  607. // Bit)
  608. #define ADC_SSEMUX1_EMUX0 0x00000001 // 1st Sample Input Select (Upper
  609. // Bit)
  610. //*****************************************************************************
  611. //
  612. // The following are defines for the bit fields in the ADC_O_SSMUX2 register.
  613. //
  614. //*****************************************************************************
  615. #define ADC_SSMUX2_MUX3_M 0x0000F000 // 4th Sample Input Select
  616. #define ADC_SSMUX2_MUX2_M 0x00000F00 // 3rd Sample Input Select
  617. #define ADC_SSMUX2_MUX1_M 0x000000F0 // 2nd Sample Input Select
  618. #define ADC_SSMUX2_MUX0_M 0x0000000F // 1st Sample Input Select
  619. #define ADC_SSMUX2_MUX3_S 12
  620. #define ADC_SSMUX2_MUX2_S 8
  621. #define ADC_SSMUX2_MUX1_S 4
  622. #define ADC_SSMUX2_MUX0_S 0
  623. //*****************************************************************************
  624. //
  625. // The following are defines for the bit fields in the ADC_O_SSCTL2 register.
  626. //
  627. //*****************************************************************************
  628. #define ADC_SSCTL2_TS3 0x00008000 // 4th Sample Temp Sensor Select
  629. #define ADC_SSCTL2_IE3 0x00004000 // 4th Sample Interrupt Enable
  630. #define ADC_SSCTL2_END3 0x00002000 // 4th Sample is End of Sequence
  631. #define ADC_SSCTL2_D3 0x00001000 // 4th Sample Diff Input Select
  632. #define ADC_SSCTL2_TS2 0x00000800 // 3rd Sample Temp Sensor Select
  633. #define ADC_SSCTL2_IE2 0x00000400 // 3rd Sample Interrupt Enable
  634. #define ADC_SSCTL2_END2 0x00000200 // 3rd Sample is End of Sequence
  635. #define ADC_SSCTL2_D2 0x00000100 // 3rd Sample Diff Input Select
  636. #define ADC_SSCTL2_TS1 0x00000080 // 2nd Sample Temp Sensor Select
  637. #define ADC_SSCTL2_IE1 0x00000040 // 2nd Sample Interrupt Enable
  638. #define ADC_SSCTL2_END1 0x00000020 // 2nd Sample is End of Sequence
  639. #define ADC_SSCTL2_D1 0x00000010 // 2nd Sample Diff Input Select
  640. #define ADC_SSCTL2_TS0 0x00000008 // 1st Sample Temp Sensor Select
  641. #define ADC_SSCTL2_IE0 0x00000004 // 1st Sample Interrupt Enable
  642. #define ADC_SSCTL2_END0 0x00000002 // 1st Sample is End of Sequence
  643. #define ADC_SSCTL2_D0 0x00000001 // 1st Sample Diff Input Select
  644. //*****************************************************************************
  645. //
  646. // The following are defines for the bit fields in the ADC_O_SSFIFO2 register.
  647. //
  648. //*****************************************************************************
  649. #define ADC_SSFIFO2_DATA_M 0x00000FFF // Conversion Result Data
  650. #define ADC_SSFIFO2_DATA_S 0
  651. //*****************************************************************************
  652. //
  653. // The following are defines for the bit fields in the ADC_O_SSFSTAT2 register.
  654. //
  655. //*****************************************************************************
  656. #define ADC_SSFSTAT2_FULL 0x00001000 // FIFO Full
  657. #define ADC_SSFSTAT2_EMPTY 0x00000100 // FIFO Empty
  658. #define ADC_SSFSTAT2_HPTR_M 0x000000F0 // FIFO Head Pointer
  659. #define ADC_SSFSTAT2_TPTR_M 0x0000000F // FIFO Tail Pointer
  660. #define ADC_SSFSTAT2_HPTR_S 4
  661. #define ADC_SSFSTAT2_TPTR_S 0
  662. //*****************************************************************************
  663. //
  664. // The following are defines for the bit fields in the ADC_O_SSOP2 register.
  665. //
  666. //*****************************************************************************
  667. #define ADC_SSOP2_S3DCOP 0x00001000 // Sample 3 Digital Comparator
  668. // Operation
  669. #define ADC_SSOP2_S2DCOP 0x00000100 // Sample 2 Digital Comparator
  670. // Operation
  671. #define ADC_SSOP2_S1DCOP 0x00000010 // Sample 1 Digital Comparator
  672. // Operation
  673. #define ADC_SSOP2_S0DCOP 0x00000001 // Sample 0 Digital Comparator
  674. // Operation
  675. //*****************************************************************************
  676. //
  677. // The following are defines for the bit fields in the ADC_O_SSDC2 register.
  678. //
  679. //*****************************************************************************
  680. #define ADC_SSDC2_S3DCSEL_M 0x0000F000 // Sample 3 Digital Comparator
  681. // Select
  682. #define ADC_SSDC2_S2DCSEL_M 0x00000F00 // Sample 2 Digital Comparator
  683. // Select
  684. #define ADC_SSDC2_S1DCSEL_M 0x000000F0 // Sample 1 Digital Comparator
  685. // Select
  686. #define ADC_SSDC2_S0DCSEL_M 0x0000000F // Sample 0 Digital Comparator
  687. // Select
  688. #define ADC_SSDC2_S2DCSEL_S 8
  689. #define ADC_SSDC2_S1DCSEL_S 4
  690. #define ADC_SSDC2_S0DCSEL_S 0
  691. //*****************************************************************************
  692. //
  693. // The following are defines for the bit fields in the ADC_O_SSEMUX2 register.
  694. //
  695. //*****************************************************************************
  696. #define ADC_SSEMUX2_EMUX3 0x00001000 // 4th Sample Input Select (Upper
  697. // Bit)
  698. #define ADC_SSEMUX2_EMUX2 0x00000100 // 3rd Sample Input Select (Upper
  699. // Bit)
  700. #define ADC_SSEMUX2_EMUX1 0x00000010 // 2th Sample Input Select (Upper
  701. // Bit)
  702. #define ADC_SSEMUX2_EMUX0 0x00000001 // 1st Sample Input Select (Upper
  703. // Bit)
  704. //*****************************************************************************
  705. //
  706. // The following are defines for the bit fields in the ADC_O_SSMUX3 register.
  707. //
  708. //*****************************************************************************
  709. #define ADC_SSMUX3_MUX0_M 0x0000000F // 1st Sample Input Select
  710. #define ADC_SSMUX3_MUX0_S 0
  711. //*****************************************************************************
  712. //
  713. // The following are defines for the bit fields in the ADC_O_SSCTL3 register.
  714. //
  715. //*****************************************************************************
  716. #define ADC_SSCTL3_TS0 0x00000008 // 1st Sample Temp Sensor Select
  717. #define ADC_SSCTL3_IE0 0x00000004 // 1st Sample Interrupt Enable
  718. #define ADC_SSCTL3_END0 0x00000002 // 1st Sample is End of Sequence
  719. #define ADC_SSCTL3_D0 0x00000001 // 1st Sample Diff Input Select
  720. //*****************************************************************************
  721. //
  722. // The following are defines for the bit fields in the ADC_O_SSFIFO3 register.
  723. //
  724. //*****************************************************************************
  725. #define ADC_SSFIFO3_DATA_M 0x00000FFF // Conversion Result Data
  726. #define ADC_SSFIFO3_DATA_S 0
  727. //*****************************************************************************
  728. //
  729. // The following are defines for the bit fields in the ADC_O_SSFSTAT3 register.
  730. //
  731. //*****************************************************************************
  732. #define ADC_SSFSTAT3_FULL 0x00001000 // FIFO Full
  733. #define ADC_SSFSTAT3_EMPTY 0x00000100 // FIFO Empty
  734. #define ADC_SSFSTAT3_HPTR_M 0x000000F0 // FIFO Head Pointer
  735. #define ADC_SSFSTAT3_TPTR_M 0x0000000F // FIFO Tail Pointer
  736. #define ADC_SSFSTAT3_HPTR_S 4
  737. #define ADC_SSFSTAT3_TPTR_S 0
  738. //*****************************************************************************
  739. //
  740. // The following are defines for the bit fields in the ADC_O_SSOP3 register.
  741. //
  742. //*****************************************************************************
  743. #define ADC_SSOP3_S0DCOP 0x00000001 // Sample 0 Digital Comparator
  744. // Operation
  745. //*****************************************************************************
  746. //
  747. // The following are defines for the bit fields in the ADC_O_SSDC3 register.
  748. //
  749. //*****************************************************************************
  750. #define ADC_SSDC3_S0DCSEL_M 0x0000000F // Sample 0 Digital Comparator
  751. // Select
  752. //*****************************************************************************
  753. //
  754. // The following are defines for the bit fields in the ADC_O_SSEMUX3 register.
  755. //
  756. //*****************************************************************************
  757. #define ADC_SSEMUX3_EMUX0 0x00000001 // 1st Sample Input Select (Upper
  758. // Bit)
  759. //*****************************************************************************
  760. //
  761. // The following are defines for the bit fields in the ADC_O_TMLB register.
  762. //
  763. //*****************************************************************************
  764. #define ADC_TMLB_LB 0x00000001 // Loopback Mode Enable
  765. //*****************************************************************************
  766. //
  767. // The following are defines for the bit fields in the ADC_O_DCRIC register.
  768. //
  769. //*****************************************************************************
  770. #define ADC_DCRIC_DCTRIG7 0x00800000 // Digital Comparator Trigger 7
  771. #define ADC_DCRIC_DCTRIG6 0x00400000 // Digital Comparator Trigger 6
  772. #define ADC_DCRIC_DCTRIG5 0x00200000 // Digital Comparator Trigger 5
  773. #define ADC_DCRIC_DCTRIG4 0x00100000 // Digital Comparator Trigger 4
  774. #define ADC_DCRIC_DCTRIG3 0x00080000 // Digital Comparator Trigger 3
  775. #define ADC_DCRIC_DCTRIG2 0x00040000 // Digital Comparator Trigger 2
  776. #define ADC_DCRIC_DCTRIG1 0x00020000 // Digital Comparator Trigger 1
  777. #define ADC_DCRIC_DCTRIG0 0x00010000 // Digital Comparator Trigger 0
  778. #define ADC_DCRIC_DCINT7 0x00000080 // Digital Comparator Interrupt 7
  779. #define ADC_DCRIC_DCINT6 0x00000040 // Digital Comparator Interrupt 6
  780. #define ADC_DCRIC_DCINT5 0x00000020 // Digital Comparator Interrupt 5
  781. #define ADC_DCRIC_DCINT4 0x00000010 // Digital Comparator Interrupt 4
  782. #define ADC_DCRIC_DCINT3 0x00000008 // Digital Comparator Interrupt 3
  783. #define ADC_DCRIC_DCINT2 0x00000004 // Digital Comparator Interrupt 2
  784. #define ADC_DCRIC_DCINT1 0x00000002 // Digital Comparator Interrupt 1
  785. #define ADC_DCRIC_DCINT0 0x00000001 // Digital Comparator Interrupt 0
  786. //*****************************************************************************
  787. //
  788. // The following are defines for the bit fields in the ADC_O_DCCTL0 register.
  789. //
  790. //*****************************************************************************
  791. #define ADC_DCCTL0_CTE 0x00001000 // Comparison Trigger Enable
  792. #define ADC_DCCTL0_CTC_M 0x00000C00 // Comparison Trigger Condition
  793. #define ADC_DCCTL0_CTC_LOW 0x00000000 // Low Band
  794. #define ADC_DCCTL0_CTC_MID 0x00000400 // Mid Band
  795. #define ADC_DCCTL0_CTC_HIGH 0x00000C00 // High Band
  796. #define ADC_DCCTL0_CTM_M 0x00000300 // Comparison Trigger Mode
  797. #define ADC_DCCTL0_CTM_ALWAYS 0x00000000 // Always
  798. #define ADC_DCCTL0_CTM_ONCE 0x00000100 // Once
  799. #define ADC_DCCTL0_CTM_HALWAYS 0x00000200 // Hysteresis Always
  800. #define ADC_DCCTL0_CTM_HONCE 0x00000300 // Hysteresis Once
  801. #define ADC_DCCTL0_CIE 0x00000010 // Comparison Interrupt Enable
  802. #define ADC_DCCTL0_CIC_M 0x0000000C // Comparison Interrupt Condition
  803. #define ADC_DCCTL0_CIC_LOW 0x00000000 // Low Band
  804. #define ADC_DCCTL0_CIC_MID 0x00000004 // Mid Band
  805. #define ADC_DCCTL0_CIC_HIGH 0x0000000C // High Band
  806. #define ADC_DCCTL0_CIM_M 0x00000003 // Comparison Interrupt Mode
  807. #define ADC_DCCTL0_CIM_ALWAYS 0x00000000 // Always
  808. #define ADC_DCCTL0_CIM_ONCE 0x00000001 // Once
  809. #define ADC_DCCTL0_CIM_HALWAYS 0x00000002 // Hysteresis Always
  810. #define ADC_DCCTL0_CIM_HONCE 0x00000003 // Hysteresis Once
  811. //*****************************************************************************
  812. //
  813. // The following are defines for the bit fields in the ADC_O_DCCTL1 register.
  814. //
  815. //*****************************************************************************
  816. #define ADC_DCCTL1_CTE 0x00001000 // Comparison Trigger Enable
  817. #define ADC_DCCTL1_CTC_M 0x00000C00 // Comparison Trigger Condition
  818. #define ADC_DCCTL1_CTC_LOW 0x00000000 // Low Band
  819. #define ADC_DCCTL1_CTC_MID 0x00000400 // Mid Band
  820. #define ADC_DCCTL1_CTC_HIGH 0x00000C00 // High Band
  821. #define ADC_DCCTL1_CTM_M 0x00000300 // Comparison Trigger Mode
  822. #define ADC_DCCTL1_CTM_ALWAYS 0x00000000 // Always
  823. #define ADC_DCCTL1_CTM_ONCE 0x00000100 // Once
  824. #define ADC_DCCTL1_CTM_HALWAYS 0x00000200 // Hysteresis Always
  825. #define ADC_DCCTL1_CTM_HONCE 0x00000300 // Hysteresis Once
  826. #define ADC_DCCTL1_CIE 0x00000010 // Comparison Interrupt Enable
  827. #define ADC_DCCTL1_CIC_M 0x0000000C // Comparison Interrupt Condition
  828. #define ADC_DCCTL1_CIC_LOW 0x00000000 // Low Band
  829. #define ADC_DCCTL1_CIC_MID 0x00000004 // Mid Band
  830. #define ADC_DCCTL1_CIC_HIGH 0x0000000C // High Band
  831. #define ADC_DCCTL1_CIM_M 0x00000003 // Comparison Interrupt Mode
  832. #define ADC_DCCTL1_CIM_ALWAYS 0x00000000 // Always
  833. #define ADC_DCCTL1_CIM_ONCE 0x00000001 // Once
  834. #define ADC_DCCTL1_CIM_HALWAYS 0x00000002 // Hysteresis Always
  835. #define ADC_DCCTL1_CIM_HONCE 0x00000003 // Hysteresis Once
  836. //*****************************************************************************
  837. //
  838. // The following are defines for the bit fields in the ADC_O_DCCTL2 register.
  839. //
  840. //*****************************************************************************
  841. #define ADC_DCCTL2_CTE 0x00001000 // Comparison Trigger Enable
  842. #define ADC_DCCTL2_CTC_M 0x00000C00 // Comparison Trigger Condition
  843. #define ADC_DCCTL2_CTC_LOW 0x00000000 // Low Band
  844. #define ADC_DCCTL2_CTC_MID 0x00000400 // Mid Band
  845. #define ADC_DCCTL2_CTC_HIGH 0x00000C00 // High Band
  846. #define ADC_DCCTL2_CTM_M 0x00000300 // Comparison Trigger Mode
  847. #define ADC_DCCTL2_CTM_ALWAYS 0x00000000 // Always
  848. #define ADC_DCCTL2_CTM_ONCE 0x00000100 // Once
  849. #define ADC_DCCTL2_CTM_HALWAYS 0x00000200 // Hysteresis Always
  850. #define ADC_DCCTL2_CTM_HONCE 0x00000300 // Hysteresis Once
  851. #define ADC_DCCTL2_CIE 0x00000010 // Comparison Interrupt Enable
  852. #define ADC_DCCTL2_CIC_M 0x0000000C // Comparison Interrupt Condition
  853. #define ADC_DCCTL2_CIC_LOW 0x00000000 // Low Band
  854. #define ADC_DCCTL2_CIC_MID 0x00000004 // Mid Band
  855. #define ADC_DCCTL2_CIC_HIGH 0x0000000C // High Band
  856. #define ADC_DCCTL2_CIM_M 0x00000003 // Comparison Interrupt Mode
  857. #define ADC_DCCTL2_CIM_ALWAYS 0x00000000 // Always
  858. #define ADC_DCCTL2_CIM_ONCE 0x00000001 // Once
  859. #define ADC_DCCTL2_CIM_HALWAYS 0x00000002 // Hysteresis Always
  860. #define ADC_DCCTL2_CIM_HONCE 0x00000003 // Hysteresis Once
  861. //*****************************************************************************
  862. //
  863. // The following are defines for the bit fields in the ADC_O_DCCTL3 register.
  864. //
  865. //*****************************************************************************
  866. #define ADC_DCCTL3_CTE 0x00001000 // Comparison Trigger Enable
  867. #define ADC_DCCTL3_CTC_M 0x00000C00 // Comparison Trigger Condition
  868. #define ADC_DCCTL3_CTC_LOW 0x00000000 // Low Band
  869. #define ADC_DCCTL3_CTC_MID 0x00000400 // Mid Band
  870. #define ADC_DCCTL3_CTC_HIGH 0x00000C00 // High Band
  871. #define ADC_DCCTL3_CTM_M 0x00000300 // Comparison Trigger Mode
  872. #define ADC_DCCTL3_CTM_ALWAYS 0x00000000 // Always
  873. #define ADC_DCCTL3_CTM_ONCE 0x00000100 // Once
  874. #define ADC_DCCTL3_CTM_HALWAYS 0x00000200 // Hysteresis Always
  875. #define ADC_DCCTL3_CTM_HONCE 0x00000300 // Hysteresis Once
  876. #define ADC_DCCTL3_CIE 0x00000010 // Comparison Interrupt Enable
  877. #define ADC_DCCTL3_CIC_M 0x0000000C // Comparison Interrupt Condition
  878. #define ADC_DCCTL3_CIC_LOW 0x00000000 // Low Band
  879. #define ADC_DCCTL3_CIC_MID 0x00000004 // Mid Band
  880. #define ADC_DCCTL3_CIC_HIGH 0x0000000C // High Band
  881. #define ADC_DCCTL3_CIM_M 0x00000003 // Comparison Interrupt Mode
  882. #define ADC_DCCTL3_CIM_ALWAYS 0x00000000 // Always
  883. #define ADC_DCCTL3_CIM_ONCE 0x00000001 // Once
  884. #define ADC_DCCTL3_CIM_HALWAYS 0x00000002 // Hysteresis Always
  885. #define ADC_DCCTL3_CIM_HONCE 0x00000003 // Hysteresis Once
  886. //*****************************************************************************
  887. //
  888. // The following are defines for the bit fields in the ADC_O_DCCTL4 register.
  889. //
  890. //*****************************************************************************
  891. #define ADC_DCCTL4_CTE 0x00001000 // Comparison Trigger Enable
  892. #define ADC_DCCTL4_CTC_M 0x00000C00 // Comparison Trigger Condition
  893. #define ADC_DCCTL4_CTC_LOW 0x00000000 // Low Band
  894. #define ADC_DCCTL4_CTC_MID 0x00000400 // Mid Band
  895. #define ADC_DCCTL4_CTC_HIGH 0x00000C00 // High Band
  896. #define ADC_DCCTL4_CTM_M 0x00000300 // Comparison Trigger Mode
  897. #define ADC_DCCTL4_CTM_ALWAYS 0x00000000 // Always
  898. #define ADC_DCCTL4_CTM_ONCE 0x00000100 // Once
  899. #define ADC_DCCTL4_CTM_HALWAYS 0x00000200 // Hysteresis Always
  900. #define ADC_DCCTL4_CTM_HONCE 0x00000300 // Hysteresis Once
  901. #define ADC_DCCTL4_CIE 0x00000010 // Comparison Interrupt Enable
  902. #define ADC_DCCTL4_CIC_M 0x0000000C // Comparison Interrupt Condition
  903. #define ADC_DCCTL4_CIC_LOW 0x00000000 // Low Band
  904. #define ADC_DCCTL4_CIC_MID 0x00000004 // Mid Band
  905. #define ADC_DCCTL4_CIC_HIGH 0x0000000C // High Band
  906. #define ADC_DCCTL4_CIM_M 0x00000003 // Comparison Interrupt Mode
  907. #define ADC_DCCTL4_CIM_ALWAYS 0x00000000 // Always
  908. #define ADC_DCCTL4_CIM_ONCE 0x00000001 // Once
  909. #define ADC_DCCTL4_CIM_HALWAYS 0x00000002 // Hysteresis Always
  910. #define ADC_DCCTL4_CIM_HONCE 0x00000003 // Hysteresis Once
  911. //*****************************************************************************
  912. //
  913. // The following are defines for the bit fields in the ADC_O_DCCTL5 register.
  914. //
  915. //*****************************************************************************
  916. #define ADC_DCCTL5_CTE 0x00001000 // Comparison Trigger Enable
  917. #define ADC_DCCTL5_CTC_M 0x00000C00 // Comparison Trigger Condition
  918. #define ADC_DCCTL5_CTC_LOW 0x00000000 // Low Band
  919. #define ADC_DCCTL5_CTC_MID 0x00000400 // Mid Band
  920. #define ADC_DCCTL5_CTC_HIGH 0x00000C00 // High Band
  921. #define ADC_DCCTL5_CTM_M 0x00000300 // Comparison Trigger Mode
  922. #define ADC_DCCTL5_CTM_ALWAYS 0x00000000 // Always
  923. #define ADC_DCCTL5_CTM_ONCE 0x00000100 // Once
  924. #define ADC_DCCTL5_CTM_HALWAYS 0x00000200 // Hysteresis Always
  925. #define ADC_DCCTL5_CTM_HONCE 0x00000300 // Hysteresis Once
  926. #define ADC_DCCTL5_CIE 0x00000010 // Comparison Interrupt Enable
  927. #define ADC_DCCTL5_CIC_M 0x0000000C // Comparison Interrupt Condition
  928. #define ADC_DCCTL5_CIC_LOW 0x00000000 // Low Band
  929. #define ADC_DCCTL5_CIC_MID 0x00000004 // Mid Band
  930. #define ADC_DCCTL5_CIC_HIGH 0x0000000C // High Band
  931. #define ADC_DCCTL5_CIM_M 0x00000003 // Comparison Interrupt Mode
  932. #define ADC_DCCTL5_CIM_ALWAYS 0x00000000 // Always
  933. #define ADC_DCCTL5_CIM_ONCE 0x00000001 // Once
  934. #define ADC_DCCTL5_CIM_HALWAYS 0x00000002 // Hysteresis Always
  935. #define ADC_DCCTL5_CIM_HONCE 0x00000003 // Hysteresis Once
  936. //*****************************************************************************
  937. //
  938. // The following are defines for the bit fields in the ADC_O_DCCTL6 register.
  939. //
  940. //*****************************************************************************
  941. #define ADC_DCCTL6_CTE 0x00001000 // Comparison Trigger Enable
  942. #define ADC_DCCTL6_CTC_M 0x00000C00 // Comparison Trigger Condition
  943. #define ADC_DCCTL6_CTC_LOW 0x00000000 // Low Band
  944. #define ADC_DCCTL6_CTC_MID 0x00000400 // Mid Band
  945. #define ADC_DCCTL6_CTC_HIGH 0x00000C00 // High Band
  946. #define ADC_DCCTL6_CTM_M 0x00000300 // Comparison Trigger Mode
  947. #define ADC_DCCTL6_CTM_ALWAYS 0x00000000 // Always
  948. #define ADC_DCCTL6_CTM_ONCE 0x00000100 // Once
  949. #define ADC_DCCTL6_CTM_HALWAYS 0x00000200 // Hysteresis Always
  950. #define ADC_DCCTL6_CTM_HONCE 0x00000300 // Hysteresis Once
  951. #define ADC_DCCTL6_CIE 0x00000010 // Comparison Interrupt Enable
  952. #define ADC_DCCTL6_CIC_M 0x0000000C // Comparison Interrupt Condition
  953. #define ADC_DCCTL6_CIC_LOW 0x00000000 // Low Band
  954. #define ADC_DCCTL6_CIC_MID 0x00000004 // Mid Band
  955. #define ADC_DCCTL6_CIC_HIGH 0x0000000C // High Band
  956. #define ADC_DCCTL6_CIM_M 0x00000003 // Comparison Interrupt Mode
  957. #define ADC_DCCTL6_CIM_ALWAYS 0x00000000 // Always
  958. #define ADC_DCCTL6_CIM_ONCE 0x00000001 // Once
  959. #define ADC_DCCTL6_CIM_HALWAYS 0x00000002 // Hysteresis Always
  960. #define ADC_DCCTL6_CIM_HONCE 0x00000003 // Hysteresis Once
  961. //*****************************************************************************
  962. //
  963. // The following are defines for the bit fields in the ADC_O_DCCTL7 register.
  964. //
  965. //*****************************************************************************
  966. #define ADC_DCCTL7_CTE 0x00001000 // Comparison Trigger Enable
  967. #define ADC_DCCTL7_CTC_M 0x00000C00 // Comparison Trigger Condition
  968. #define ADC_DCCTL7_CTC_LOW 0x00000000 // Low Band
  969. #define ADC_DCCTL7_CTC_MID 0x00000400 // Mid Band
  970. #define ADC_DCCTL7_CTC_HIGH 0x00000C00 // High Band
  971. #define ADC_DCCTL7_CTM_M 0x00000300 // Comparison Trigger Mode
  972. #define ADC_DCCTL7_CTM_ALWAYS 0x00000000 // Always
  973. #define ADC_DCCTL7_CTM_ONCE 0x00000100 // Once
  974. #define ADC_DCCTL7_CTM_HALWAYS 0x00000200 // Hysteresis Always
  975. #define ADC_DCCTL7_CTM_HONCE 0x00000300 // Hysteresis Once
  976. #define ADC_DCCTL7_CIE 0x00000010 // Comparison Interrupt Enable
  977. #define ADC_DCCTL7_CIC_M 0x0000000C // Comparison Interrupt Condition
  978. #define ADC_DCCTL7_CIC_LOW 0x00000000 // Low Band
  979. #define ADC_DCCTL7_CIC_MID 0x00000004 // Mid Band
  980. #define ADC_DCCTL7_CIC_HIGH 0x0000000C // High Band
  981. #define ADC_DCCTL7_CIM_M 0x00000003 // Comparison Interrupt Mode
  982. #define ADC_DCCTL7_CIM_ALWAYS 0x00000000 // Always
  983. #define ADC_DCCTL7_CIM_ONCE 0x00000001 // Once
  984. #define ADC_DCCTL7_CIM_HALWAYS 0x00000002 // Hysteresis Always
  985. #define ADC_DCCTL7_CIM_HONCE 0x00000003 // Hysteresis Once
  986. //*****************************************************************************
  987. //
  988. // The following are defines for the bit fields in the ADC_O_DCCMP0 register.
  989. //
  990. //*****************************************************************************
  991. #define ADC_DCCMP0_COMP1_M 0x0FFF0000 // Compare 1
  992. #define ADC_DCCMP0_COMP0_M 0x00000FFF // Compare 0
  993. #define ADC_DCCMP0_COMP1_S 16
  994. #define ADC_DCCMP0_COMP0_S 0
  995. //*****************************************************************************
  996. //
  997. // The following are defines for the bit fields in the ADC_O_DCCMP1 register.
  998. //
  999. //*****************************************************************************
  1000. #define ADC_DCCMP1_COMP1_M 0x0FFF0000 // Compare 1
  1001. #define ADC_DCCMP1_COMP0_M 0x00000FFF // Compare 0
  1002. #define ADC_DCCMP1_COMP1_S 16
  1003. #define ADC_DCCMP1_COMP0_S 0
  1004. //*****************************************************************************
  1005. //
  1006. // The following are defines for the bit fields in the ADC_O_DCCMP2 register.
  1007. //
  1008. //*****************************************************************************
  1009. #define ADC_DCCMP2_COMP1_M 0x0FFF0000 // Compare 1
  1010. #define ADC_DCCMP2_COMP0_M 0x00000FFF // Compare 0
  1011. #define ADC_DCCMP2_COMP1_S 16
  1012. #define ADC_DCCMP2_COMP0_S 0
  1013. //*****************************************************************************
  1014. //
  1015. // The following are defines for the bit fields in the ADC_O_DCCMP3 register.
  1016. //
  1017. //*****************************************************************************
  1018. #define ADC_DCCMP3_COMP1_M 0x0FFF0000 // Compare 1
  1019. #define ADC_DCCMP3_COMP0_M 0x00000FFF // Compare 0
  1020. #define ADC_DCCMP3_COMP1_S 16
  1021. #define ADC_DCCMP3_COMP0_S 0
  1022. //*****************************************************************************
  1023. //
  1024. // The following are defines for the bit fields in the ADC_O_DCCMP4 register.
  1025. //
  1026. //*****************************************************************************
  1027. #define ADC_DCCMP4_COMP1_M 0x0FFF0000 // Compare 1
  1028. #define ADC_DCCMP4_COMP0_M 0x00000FFF // Compare 0
  1029. #define ADC_DCCMP4_COMP1_S 16
  1030. #define ADC_DCCMP4_COMP0_S 0
  1031. //*****************************************************************************
  1032. //
  1033. // The following are defines for the bit fields in the ADC_O_DCCMP5 register.
  1034. //
  1035. //*****************************************************************************
  1036. #define ADC_DCCMP5_COMP1_M 0x0FFF0000 // Compare 1
  1037. #define ADC_DCCMP5_COMP0_M 0x00000FFF // Compare 0
  1038. #define ADC_DCCMP5_COMP1_S 16
  1039. #define ADC_DCCMP5_COMP0_S 0
  1040. //*****************************************************************************
  1041. //
  1042. // The following are defines for the bit fields in the ADC_O_DCCMP6 register.
  1043. //
  1044. //*****************************************************************************
  1045. #define ADC_DCCMP6_COMP1_M 0x0FFF0000 // Compare 1
  1046. #define ADC_DCCMP6_COMP0_M 0x00000FFF // Compare 0
  1047. #define ADC_DCCMP6_COMP1_S 16
  1048. #define ADC_DCCMP6_COMP0_S 0
  1049. //*****************************************************************************
  1050. //
  1051. // The following are defines for the bit fields in the ADC_O_DCCMP7 register.
  1052. //
  1053. //*****************************************************************************
  1054. #define ADC_DCCMP7_COMP1_M 0x0FFF0000 // Compare 1
  1055. #define ADC_DCCMP7_COMP0_M 0x00000FFF // Compare 0
  1056. #define ADC_DCCMP7_COMP1_S 16
  1057. #define ADC_DCCMP7_COMP0_S 0
  1058. //*****************************************************************************
  1059. //
  1060. // The following are defines for the bit fields in the ADC_O_PP register.
  1061. //
  1062. //*****************************************************************************
  1063. #define ADC_PP_TS 0x00800000 // Temperature Sensor
  1064. #define ADC_PP_RSL_M 0x007C0000 // Resolution
  1065. #define ADC_PP_TYPE_M 0x00030000 // ADC Architecture
  1066. #define ADC_PP_TYPE_SAR 0x00000000 // SAR
  1067. #define ADC_PP_DC_M 0x0000FC00 // Digital Comparator Count
  1068. #define ADC_PP_CH_M 0x000003F0 // ADC Channel Count
  1069. #define ADC_PP_MSR_M 0x0000000F // Maximum ADC Sample Rate
  1070. #define ADC_PP_MSR_125K 0x00000001 // 125 ksps
  1071. #define ADC_PP_MSR_250K 0x00000003 // 250 ksps
  1072. #define ADC_PP_MSR_500K 0x00000005 // 500 ksps
  1073. #define ADC_PP_MSR_1M 0x00000007 // 1 Msps
  1074. #define ADC_PP_RSL_S 18
  1075. #define ADC_PP_DC_S 10
  1076. #define ADC_PP_CH_S 4
  1077. //*****************************************************************************
  1078. //
  1079. // The following are defines for the bit fields in the ADC_O_PC register.
  1080. //
  1081. //*****************************************************************************
  1082. #define ADC_PC_SR_M 0x0000000F // ADC Sample Rate
  1083. #define ADC_PC_SR_125K 0x00000001 // 125 ksps
  1084. #define ADC_PC_SR_250K 0x00000003 // 250 ksps
  1085. #define ADC_PC_SR_500K 0x00000005 // 500 ksps
  1086. #define ADC_PC_SR_1M 0x00000007 // 1 Msps
  1087. //*****************************************************************************
  1088. //
  1089. // The following are defines for the bit fields in the ADC_O_CC register.
  1090. //
  1091. //*****************************************************************************
  1092. #define ADC_CC_CS_M 0x0000000F // ADC Clock Source
  1093. #define ADC_CC_CS_SYSPLL 0x00000000 // Either the system clock (if the
  1094. // PLL bypass is in effect) or the
  1095. // 16 MHz clock derived from PLL /
  1096. // 25 (default)
  1097. #define ADC_CC_CS_PIOSC 0x00000001 // PIOSC
  1098. //*****************************************************************************
  1099. //
  1100. // The following are defines for the the interpretation of the data in the
  1101. // SSFIFOx when the ADC TMLB is enabled.
  1102. //
  1103. //*****************************************************************************
  1104. #define ADC_SSFIFO_TMLB_CNT_M 0x000003C0 // Continuous Sample Counter
  1105. #define ADC_SSFIFO_TMLB_CONT 0x00000020 // Continuation Sample Indicator
  1106. #define ADC_SSFIFO_TMLB_DIFF 0x00000010 // Differential Sample Indicator
  1107. #define ADC_SSFIFO_TMLB_TS 0x00000008 // Temp Sensor Sample Indicator
  1108. #define ADC_SSFIFO_TMLB_MUX_M 0x00000007 // Analog Input Indicator
  1109. #define ADC_SSFIFO_TMLB_CNT_S 6 // Sample counter shift
  1110. #define ADC_SSFIFO_TMLB_MUX_S 0 // Input channel number shift
  1111. //*****************************************************************************
  1112. //
  1113. // The following definitions are deprecated.
  1114. //
  1115. //*****************************************************************************
  1116. #ifndef DEPRECATED
  1117. //*****************************************************************************
  1118. //
  1119. // The following are deprecated defines for the bit fields in the ADC_O_EMUX
  1120. // register.
  1121. //
  1122. //*****************************************************************************
  1123. #define ADC_EMUX_EM3_MASK 0x0000F000 // Event mux 3 mask
  1124. #define ADC_EMUX_EM2_MASK 0x00000F00 // Event mux 2 mask
  1125. #define ADC_EMUX_EM1_MASK 0x000000F0 // Event mux 1 mask
  1126. #define ADC_EMUX_EM0_MASK 0x0000000F // Event mux 0 mask
  1127. #define ADC_EMUX_EM3_SHIFT 12 // The shift for the fourth event
  1128. #define ADC_EMUX_EM2_SHIFT 8 // The shift for the third event
  1129. #define ADC_EMUX_EM1_SHIFT 4 // The shift for the second event
  1130. #define ADC_EMUX_EM0_SHIFT 0 // The shift for the first event
  1131. //*****************************************************************************
  1132. //
  1133. // The following are deprecated defines for the bit fields in the ADC_O_SSPRI
  1134. // register.
  1135. //
  1136. //*****************************************************************************
  1137. #define ADC_SSPRI_SS3_MASK 0x00003000 // Sequencer 3 priority mask
  1138. #define ADC_SSPRI_SS2_MASK 0x00000300 // Sequencer 2 priority mask
  1139. #define ADC_SSPRI_SS1_MASK 0x00000030 // Sequencer 1 priority mask
  1140. #define ADC_SSPRI_SS0_MASK 0x00000003 // Sequencer 0 priority mask
  1141. //*****************************************************************************
  1142. //
  1143. // The following are deprecated defines for the ADC sequence register offsets..
  1144. //
  1145. //*****************************************************************************
  1146. #define ADC_O_SEQ 0x00000040 // Offset to the first sequence
  1147. #define ADC_O_SEQ_STEP 0x00000020 // Increment to the next sequence
  1148. #define ADC_O_X_SSFSTAT 0x0000000C // FIFO status register
  1149. #define ADC_O_X_SSFIFO 0x00000008 // Result FIFO register
  1150. #define ADC_O_X_SSCTL 0x00000004 // Sample sequence control register
  1151. #define ADC_O_X_SSMUX 0x00000000 // Multiplexer select register
  1152. //*****************************************************************************
  1153. //
  1154. // The following are deprecated defines for the bit fields in the ADC_SSMUX0,
  1155. // ADC_SSMUX1, ADC_SSMUX2, and ADC_SSMUX3 registers. Not all fields are present
  1156. // in all registers..
  1157. //
  1158. //*****************************************************************************
  1159. #define ADC_SSMUX_MUX7_MASK 0x70000000 // 8th mux select mask
  1160. #define ADC_SSMUX_MUX6_MASK 0x07000000 // 7th mux select mask
  1161. #define ADC_SSMUX_MUX5_MASK 0x00700000 // 6th mux select mask
  1162. #define ADC_SSMUX_MUX4_MASK 0x00070000 // 5th mux select mask
  1163. #define ADC_SSMUX_MUX3_MASK 0x00007000 // 4th mux select mask
  1164. #define ADC_SSMUX_MUX2_MASK 0x00000700 // 3rd mux select mask
  1165. #define ADC_SSMUX_MUX1_MASK 0x00000070 // 2nd mux select mask
  1166. #define ADC_SSMUX_MUX0_MASK 0x00000007 // 1st mux select mask
  1167. #define ADC_SSMUX_MUX7_SHIFT 28
  1168. #define ADC_SSMUX_MUX6_SHIFT 24
  1169. #define ADC_SSMUX_MUX5_SHIFT 20
  1170. #define ADC_SSMUX_MUX4_SHIFT 16
  1171. #define ADC_SSMUX_MUX3_SHIFT 12
  1172. #define ADC_SSMUX_MUX2_SHIFT 8
  1173. #define ADC_SSMUX_MUX1_SHIFT 4
  1174. #define ADC_SSMUX_MUX0_SHIFT 0
  1175. //*****************************************************************************
  1176. //
  1177. // The following are deprecated defines for the bit fields in the ADC_SSCTL0,
  1178. // ADC_SSCTL1, ADC_SSCTL2, and ADC_SSCTL3 registers. Not all fields are present
  1179. // in all registers.
  1180. //
  1181. //*****************************************************************************
  1182. #define ADC_SSCTL_TS7 0x80000000 // 8th temperature sensor select
  1183. #define ADC_SSCTL_IE7 0x40000000 // 8th interrupt enable
  1184. #define ADC_SSCTL_END7 0x20000000 // 8th sequence end select
  1185. #define ADC_SSCTL_D7 0x10000000 // 8th differential select
  1186. #define ADC_SSCTL_TS6 0x08000000 // 7th temperature sensor select
  1187. #define ADC_SSCTL_IE6 0x04000000 // 7th interrupt enable
  1188. #define ADC_SSCTL_END6 0x02000000 // 7th sequence end select
  1189. #define ADC_SSCTL_D6 0x01000000 // 7th differential select
  1190. #define ADC_SSCTL_TS5 0x00800000 // 6th temperature sensor select
  1191. #define ADC_SSCTL_IE5 0x00400000 // 6th interrupt enable
  1192. #define ADC_SSCTL_END5 0x00200000 // 6th sequence end select
  1193. #define ADC_SSCTL_D5 0x00100000 // 6th differential select
  1194. #define ADC_SSCTL_TS4 0x00080000 // 5th temperature sensor select
  1195. #define ADC_SSCTL_IE4 0x00040000 // 5th interrupt enable
  1196. #define ADC_SSCTL_END4 0x00020000 // 5th sequence end select
  1197. #define ADC_SSCTL_D4 0x00010000 // 5th differential select
  1198. #define ADC_SSCTL_TS3 0x00008000 // 4th temperature sensor select
  1199. #define ADC_SSCTL_IE3 0x00004000 // 4th interrupt enable
  1200. #define ADC_SSCTL_END3 0x00002000 // 4th sequence end select
  1201. #define ADC_SSCTL_D3 0x00001000 // 4th differential select
  1202. #define ADC_SSCTL_TS2 0x00000800 // 3rd temperature sensor select
  1203. #define ADC_SSCTL_IE2 0x00000400 // 3rd interrupt enable
  1204. #define ADC_SSCTL_END2 0x00000200 // 3rd sequence end select
  1205. #define ADC_SSCTL_D2 0x00000100 // 3rd differential select
  1206. #define ADC_SSCTL_TS1 0x00000080 // 2nd temperature sensor select
  1207. #define ADC_SSCTL_IE1 0x00000040 // 2nd interrupt enable
  1208. #define ADC_SSCTL_END1 0x00000020 // 2nd sequence end select
  1209. #define ADC_SSCTL_D1 0x00000010 // 2nd differential select
  1210. #define ADC_SSCTL_TS0 0x00000008 // 1st temperature sensor select
  1211. #define ADC_SSCTL_IE0 0x00000004 // 1st interrupt enable
  1212. #define ADC_SSCTL_END0 0x00000002 // 1st sequence end select
  1213. #define ADC_SSCTL_D0 0x00000001 // 1st differential select
  1214. //*****************************************************************************
  1215. //
  1216. // The following are deprecated defines for the bit fields in the ADC_SSFIFO0,
  1217. // ADC_SSFIFO1, ADC_SSFIFO2, and ADC_SSFIFO3 registers.
  1218. //
  1219. //*****************************************************************************
  1220. #define ADC_SSFIFO_DATA_MASK 0x000003FF // Sample data
  1221. #define ADC_SSFIFO_DATA_SHIFT 0
  1222. //*****************************************************************************
  1223. //
  1224. // The following are deprecated defines for the bit fields in the ADC_SSFSTAT0,
  1225. // ADC_SSFSTAT1, ADC_SSFSTAT2, and ADC_SSFSTAT3 registers.
  1226. //
  1227. //*****************************************************************************
  1228. #define ADC_SSFSTAT_FULL 0x00001000 // FIFO is full
  1229. #define ADC_SSFSTAT_EMPTY 0x00000100 // FIFO is empty
  1230. #define ADC_SSFSTAT_HPTR 0x000000F0 // FIFO head pointer
  1231. #define ADC_SSFSTAT_TPTR 0x0000000F // FIFO tail pointer
  1232. //*****************************************************************************
  1233. //
  1234. // The following are deprecated defines for the the interpretation of the data
  1235. // in the SSFIFOx when the ADC TMLB is enabled.
  1236. //
  1237. //*****************************************************************************
  1238. #define ADC_TMLB_CNT_M 0x000003C0 // Continuous Sample Counter
  1239. #define ADC_TMLB_CONT 0x00000020 // Continuation Sample Indicator
  1240. #define ADC_TMLB_DIFF 0x00000010 // Differential Sample Indicator
  1241. #define ADC_TMLB_TS 0x00000008 // Temp Sensor Sample Indicator
  1242. #define ADC_TMLB_MUX_M 0x00000007 // Analog Input Indicator
  1243. #define ADC_TMLB_CNT_S 6 // Sample counter shift
  1244. #define ADC_TMLB_MUX_S 0 // Input channel number shift
  1245. //*****************************************************************************
  1246. //
  1247. // The following are deprecated defines for the bit fields in the loopback ADC
  1248. // data.
  1249. //
  1250. //*****************************************************************************
  1251. #define ADC_LB_CNT_MASK 0x000003C0 // Sample counter mask
  1252. #define ADC_LB_CONT 0x00000020 // Continuation sample
  1253. #define ADC_LB_DIFF 0x00000010 // Differential sample
  1254. #define ADC_LB_TS 0x00000008 // Temperature sensor sample
  1255. #define ADC_LB_MUX_MASK 0x00000007 // Input channel number mask
  1256. #define ADC_LB_CNT_SHIFT 6 // Sample counter shift
  1257. #define ADC_LB_MUX_SHIFT 0 // Input channel number shift
  1258. #endif
  1259. #endif // __HW_ADC_H__