-
Notifications
You must be signed in to change notification settings - Fork 0
/
msp430f5510.nim
5269 lines (5267 loc) · 249 KB
/
msp430f5510.nim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import iomacros
# ============================================================================
# Copyright (c) 2012, Texas Instruments Incorporated
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the name of Texas Instruments Incorporated nor the names of
# its contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ============================================================================
#*******************************************************************
#
# Standard register and bit definitions for the Texas Instruments
# MSP430 microcontroller.
#
# This file supports assembler and C development for
# MSP430F5510 devices.
#
# Texas Instruments, Version 1.4
#
# Rev. 1.0, Setup
# Rev. 1.1, Fixed Error in DMA Trigger Definitons
# Rev. 1.2, fixed SYSUNIV_BUSIFG definition
# fixed wrong bit definition in PM5CTL0 (LOCKLPM5)
# Rev. 1.3, Changed access type of DMAxSZ registers to word only
# Rev. 1.4 Changed access type of TimerA/B registers to word only
#
#******************************************************************
when not(defined(MSP430F5510)):
const
MSP430F5510* = true
MSP430_HEADER_VERSION* = 1064
MSP430_TI_HEADERS* = true
#***********************************************************
# STANDARD BITS
# Interrupt Vectors (offset from 0xFF80)
#**********************************************************
const
RTC_VECTOR* = (0x00000052) # 0xFFD2 RTC
PORT2_VECTOR* = (0x00000054) # 0xFFD4 Port 2
TIMER2_A1_VECTOR* = (0x00000056) # 0xFFD6 Timer0_A5 CC1-4, TA
TIMER2_A0_VECTOR* = (0x00000058) # 0xFFD8 Timer0_A5 CC0
USCI_B1_VECTOR* = (0x0000005A) # 0xFFDA USCI B1 Receive/Transmit
USCI_A1_VECTOR* = (0x0000005C) # 0xFFDC USCI A1 Receive/Transmit
PORT1_VECTOR* = (0x0000005E) # 0xFFDE Port 1
TIMER1_A1_VECTOR* = (0x00000060) # 0xFFE0 Timer1_A3 CC1-2, TA1
TIMER1_A0_VECTOR* = (0x00000062) # 0xFFE2 Timer1_A3 CC0
DMA_VECTOR* = (0x00000064) # 0xFFE4 DMA
USB_UBM_VECTOR* = (0x00000066) # 0xFFE6 USB Timer / cable event / USB reset
TIMER0_A1_VECTOR* = (0x00000068) # 0xFFE8 Timer0_A5 CC1-4, TA
TIMER0_A0_VECTOR* = (0x0000006A) # 0xFFEA Timer0_A5 CC0
ADC10_VECTOR* = (0x0000006C) # 0xFFEC ADC
USCI_B0_VECTOR* = (0x0000006E) # 0xFFEE USCI B0 Receive/Transmit
USCI_A0_VECTOR* = (0x00000070) # 0xFFF0 USCI A0 Receive/Transmit
WDT_VECTOR* = (0x00000072) # 0xFFF2 Watchdog Timer
TIMER0_B1_VECTOR* = (0x00000074) # 0xFFF4 Timer0_B7 CC1-6, TB
TIMER0_B0_VECTOR* = (0x00000076) # 0xFFF6 Timer0_B7 CC0
COMP_B_VECTOR* = (0x00000078) # 0xFFF8 Comparator B
UNMI_VECTOR* = (0x0000007A) # 0xFFFA User Non-maskable
SYSNMI_VECTOR* = (0x0000007C) # 0xFFFC System Non-maskable
RESET_VECTOR* = (0x0000007E) # 0xFFFE Reset [Highest Priority]
#***********************************************************
# End of Modules
#**********************************************************
const
BIT0* = (0x00000001)
BIT1* = (0x00000002)
BIT2* = (0x00000004)
BIT3* = (0x00000008)
BIT4* = (0x00000010)
BIT5* = (0x00000020)
BIT6* = (0x00000040)
BIT7* = (0x00000080)
BIT8* = (0x00000100)
BIT9* = (0x00000200)
BITA* = (0x00000400)
BITB* = (0x00000800)
BITC* = (0x00001000)
BITD* = (0x00002000)
BITE* = (0x00004000)
BITF* = (0x00008000)
#***********************************************************
# STATUS REGISTER BITS
#**********************************************************
const
C* = (0x00000001)
Z* = (0x00000002)
N* = (0x00000004)
V* = (0x00000100)
GIE* = (0x00000008)
CPUOFF* = (0x00000010)
OSCOFF* = (0x00000020)
SCG0* = (0x00000040)
SCG1* = (0x00000080)
# Low Power Modes coded with Bits 4-7 in SR
when not(defined(STDC)): # Begin #defines for assembler
const
LPM0* = (CPUOFF)
LPM1* = (SCG0 + CPUOFF)
LPM2* = (SCG1 + CPUOFF)
LPM3* = (SCG1 + SCG0 + CPUOFF)
LPM4* = (SCG1 + SCG0 + OSCOFF + CPUOFF)
# End #defines for assembler
else:
const
LPM0_bits* = (CPUOFF)
LPM1_bits* = (SCG0 + CPUOFF)
LPM2_bits* = (SCG1 + CPUOFF)
LPM3_bits* = (SCG1 + SCG0 + CPUOFF)
LPM4_bits* = (SCG1 + SCG0 + OSCOFF + CPUOFF)
import
"in430"
const
LPM0* = BIS_SR(LPM0_bits) # Enter Low Power Mode 0
LPM0_EXIT* = BIC_SR_IRQ(LPM0_bits) # Exit Low Power Mode 0
LPM1* = BIS_SR(LPM1_bits) # Enter Low Power Mode 1
LPM1_EXIT* = BIC_SR_IRQ(LPM1_bits) # Exit Low Power Mode 1
LPM2* = BIS_SR(LPM2_bits) # Enter Low Power Mode 2
LPM2_EXIT* = BIC_SR_IRQ(LPM2_bits) # Exit Low Power Mode 2
LPM3* = BIS_SR(LPM3_bits) # Enter Low Power Mode 3
LPM3_EXIT* = BIC_SR_IRQ(LPM3_bits) # Exit Low Power Mode 3
LPM4* = BIS_SR(LPM4_bits) # Enter Low Power Mode 4
LPM4_EXIT* = BIC_SR_IRQ(LPM4_bits) # Exit Low Power Mode 4
#***********************************************************
# CPU
#**********************************************************
const
MSP430_HAS_MSP430XV2_CPU* = true # Definition to show that it has MSP430XV2 CPU
#***********************************************************
# PERIPHERAL FILE MAP
#**********************************************************
#***********************************************************
# ADC10_A
#**********************************************************
const
MSP430_HAS_ADC10_A* = true # Definition to show that Module is available
MSP430_BASEADDRESS_ADC10_A* = 0x00000740
ADC10CTL0_ADDR* = 0x00000740
sfrb(ADC10CTL0_L, ADC10CTL0_ADDR)
sfrb(ADC10CTL0_H, ADC10CTL0_ADDR + 1)
sfrw(ADC10CTL0, ADC10CTL0_ADDR)
const
ADC10CTL1_ADDR* = 0x00000742
sfrb(ADC10CTL1_L, ADC10CTL1_ADDR)
sfrb(ADC10CTL1_H, ADC10CTL1_ADDR + 1)
sfrw(ADC10CTL1, ADC10CTL1_ADDR)
const
ADC10CTL2_ADDR* = 0x00000744
sfrb(ADC10CTL2_L, ADC10CTL2_ADDR)
sfrb(ADC10CTL2_H, ADC10CTL2_ADDR + 1)
sfrw(ADC10CTL2, ADC10CTL2_ADDR)
const
ADC10LO_ADDR* = 0x00000746
sfrb(ADC10LO_L, ADC10LO_ADDR)
sfrb(ADC10LO_H, ADC10LO_ADDR + 1)
sfrw(ADC10LO, ADC10LO_ADDR)
const
ADC10HI_ADDR* = 0x00000748
sfrb(ADC10HI_L, ADC10HI_ADDR)
sfrb(ADC10HI_H, ADC10HI_ADDR + 1)
sfrw(ADC10HI, ADC10HI_ADDR)
const
ADC10MCTL0_ADDR* = 0x0000074A
sfrb(ADC10MCTL0_L, ADC10MCTL0_ADDR)
sfrb(ADC10MCTL0_H, ADC10MCTL0_ADDR + 1)
sfrw(ADC10MCTL0, ADC10MCTL0_ADDR)
const
ADC10MEM0_ADDR* = 0x00000752
sfrb(ADC10MEM0_L, ADC10MEM0_ADDR)
sfrb(ADC10MEM0_H, ADC10MEM0_ADDR + 1)
sfrw(ADC10MEM0, ADC10MEM0_ADDR)
const
ADC10IE_ADDR* = 0x0000075A
sfrb(ADC10IE_L, ADC10IE_ADDR)
sfrb(ADC10IE_H, ADC10IE_ADDR + 1)
sfrw(ADC10IE, ADC10IE_ADDR)
const
ADC10IFG_ADDR* = 0x0000075C
sfrb(ADC10IFG_L, ADC10IFG_ADDR)
sfrb(ADC10IFG_H, ADC10IFG_ADDR + 1)
sfrw(ADC10IFG, ADC10IFG_ADDR)
const
ADC10IV_ADDR* = 0x0000075E
sfrb(ADC10IV_L, ADC10IV_ADDR)
sfrb(ADC10IV_H, ADC10IV_ADDR + 1)
sfrw(ADC10IV, ADC10IV_ADDR)
# ADC10CTL0 Control Bits
const
ADC10SC* = (0x00000001) # ADC10 Start Conversion
ADC10ENC* = (0x00000002) # ADC10 Enable Conversion
ADC10ON* = (0x00000010) # ADC10 On/enable
ADC10MSC* = (0x00000080) # ADC10 Multiple SampleConversion
ADC10SHT0* = (0x00000100) # ADC10 Sample Hold Select Bit: 0
ADC10SHT1* = (0x00000200) # ADC10 Sample Hold Select Bit: 1
ADC10SHT2* = (0x00000400) # ADC10 Sample Hold Select Bit: 2
ADC10SHT3* = (0x00000800) # ADC10 Sample Hold Select Bit: 3
# ADC10CTL0 Control Bits
const
ADC10SC_L* = (0x00000001) # ADC10 Start Conversion
ADC10ENC_L* = (0x00000002) # ADC10 Enable Conversion
ADC10ON_L* = (0x00000010) # ADC10 On/enable
ADC10MSC_L* = (0x00000080) # ADC10 Multiple SampleConversion
# ADC10CTL0 Control Bits
const
ADC10SHT0_H* = (0x00000001) # ADC10 Sample Hold Select Bit: 0
ADC10SHT1_H* = (0x00000002) # ADC10 Sample Hold Select Bit: 1
ADC10SHT2_H* = (0x00000004) # ADC10 Sample Hold Select Bit: 2
ADC10SHT3_H* = (0x00000008) # ADC10 Sample Hold Select Bit: 3
ADC10SHT_VAL_0* = (0x00000000) # ADC10 Sample Hold Select 0
ADC10SHT_VAL_1* = (0x00000100) # ADC10 Sample Hold Select 1
ADC10SHT_VAL_2* = (0x00000200) # ADC10 Sample Hold Select 2
ADC10SHT_VAL_3* = (0x00000300) # ADC10 Sample Hold Select 3
ADC10SHT_VAL_4* = (0x00000400) # ADC10 Sample Hold Select 4
ADC10SHT_VAL_5* = (0x00000500) # ADC10 Sample Hold Select 5
ADC10SHT_VAL_6* = (0x00000600) # ADC10 Sample Hold Select 6
ADC10SHT_VAL_7* = (0x00000700) # ADC10 Sample Hold Select 7
ADC10SHT_VAL_8* = (0x00000800) # ADC10 Sample Hold Select 8
ADC10SHT_VAL_9* = (0x00000900) # ADC10 Sample Hold Select 9
ADC10SHT_VAL_10* = (0x00000A00) # ADC10 Sample Hold Select 10
ADC10SHT_VAL_11* = (0x00000B00) # ADC10 Sample Hold Select 11
ADC10SHT_VAL_12* = (0x00000C00) # ADC10 Sample Hold Select 12
ADC10SHT_VAL_13* = (0x00000D00) # ADC10 Sample Hold Select 13
ADC10SHT_VAL_14* = (0x00000E00) # ADC10 Sample Hold Select 14
ADC10SHT_VAL_15* = (0x00000F00) # ADC10 Sample Hold Select 15
# ADC10CTL1 Control Bits
const
ADC10BUSY* = (0x00000001) # ADC10 Busy
ADC10CONSEQ0* = (0x00000002) # ADC10 Conversion Sequence Select 0
ADC10CONSEQ1* = (0x00000004) # ADC10 Conversion Sequence Select 1
ADC10SSEL0* = (0x00000008) # ADC10 Clock Source Select 0
ADC10SSEL1* = (0x00000010) # ADC10 Clock Source Select 1
ADC10DIV0* = (0x00000020) # ADC10 Clock Divider Select 0
ADC10DIV1* = (0x00000040) # ADC10 Clock Divider Select 1
ADC10DIV2* = (0x00000080) # ADC10 Clock Divider Select 2
ADC10ISSH* = (0x00000100) # ADC10 Invert Sample Hold Signal
ADC10SHP* = (0x00000200) # ADC10 Sample/Hold Pulse Mode
ADC10SHS0* = (0x00000400) # ADC10 Sample/Hold Source 0
ADC10SHS1* = (0x00000800) # ADC10 Sample/Hold Source 1
# ADC10CTL1 Control Bits
const
ADC10BUSY_L* = (0x00000001) # ADC10 Busy
ADC10CONSEQ0_L* = (0x00000002) # ADC10 Conversion Sequence Select 0
ADC10CONSEQ1_L* = (0x00000004) # ADC10 Conversion Sequence Select 1
ADC10SSEL0_L* = (0x00000008) # ADC10 Clock Source Select 0
ADC10SSEL1_L* = (0x00000010) # ADC10 Clock Source Select 1
ADC10DIV0_L* = (0x00000020) # ADC10 Clock Divider Select 0
ADC10DIV1_L* = (0x00000040) # ADC10 Clock Divider Select 1
ADC10DIV2_L* = (0x00000080) # ADC10 Clock Divider Select 2
# ADC10CTL1 Control Bits
const
ADC10ISSH_H* = (0x00000001) # ADC10 Invert Sample Hold Signal
ADC10SHP_H* = (0x00000002) # ADC10 Sample/Hold Pulse Mode
ADC10SHS0_H* = (0x00000004) # ADC10 Sample/Hold Source 0
ADC10SHS1_H* = (0x00000008) # ADC10 Sample/Hold Source 1
ADC10CONSEQ_VAL_0* = (0x00000000) # ADC10 Conversion Sequence Select: 0
ADC10CONSEQ_VAL_1* = (0x00000002) # ADC10 Conversion Sequence Select: 1
ADC10CONSEQ_VAL_2* = (0x00000004) # ADC10 Conversion Sequence Select: 2
ADC10CONSEQ_VAL_3* = (0x00000006) # ADC10 Conversion Sequence Select: 3
ADC10SSEL_VAL_0* = (0x00000000) # ADC10 Clock Source Select: 0
ADC10SSEL_VAL_1* = (0x00000008) # ADC10 Clock Source Select: 1
ADC10SSEL_VAL_2* = (0x00000010) # ADC10 Clock Source Select: 2
ADC10SSEL_VAL_3* = (0x00000018) # ADC10 Clock Source Select: 3
ADC10DIV_VAL_0* = (0x00000000) # ADC10 Clock Divider Select: 0
ADC10DIV_VAL_1* = (0x00000020) # ADC10 Clock Divider Select: 1
ADC10DIV_VAL_2* = (0x00000040) # ADC10 Clock Divider Select: 2
ADC10DIV_VAL_3* = (0x00000060) # ADC10 Clock Divider Select: 3
ADC10DIV_VAL_4* = (0x00000080) # ADC10 Clock Divider Select: 4
ADC10DIV_VAL_5* = (0x000000A0) # ADC10 Clock Divider Select: 5
ADC10DIV_VAL_6* = (0x000000C0) # ADC10 Clock Divider Select: 6
ADC10DIV_VAL_7* = (0x000000E0) # ADC10 Clock Divider Select: 7
ADC10SHS_VAL_0* = (0x00000000) # ADC10 Sample/Hold Source: 0
ADC10SHS_VAL_1* = (0x00000400) # ADC10 Sample/Hold Source: 1
ADC10SHS_VAL_2* = (0x00000800) # ADC10 Sample/Hold Source: 2
ADC10SHS_VAL_3* = (0x00000C00) # ADC10 Sample/Hold Source: 3
# ADC10CTL2 Control Bits
const
ADC10REFBURST* = (0x00000001) # ADC10 Reference Burst
ADC10SR* = (0x00000004) # ADC10 Sampling Rate
ADC10DF* = (0x00000008) # ADC10 Data Format
ADC10RES* = (0x00000010) # ADC10 Resolution Bit
ADC10PDIV0* = (0x00000100) # ADC10 predivider Bit: 0
ADC10PDIV1* = (0x00000200) # ADC10 predivider Bit: 1
# ADC10CTL2 Control Bits
const
ADC10REFBURST_L* = (0x00000001) # ADC10 Reference Burst
ADC10SR_L* = (0x00000004) # ADC10 Sampling Rate
ADC10DF_L* = (0x00000008) # ADC10 Data Format
ADC10RES_L* = (0x00000010) # ADC10 Resolution Bit
# ADC10CTL2 Control Bits
const
ADC10PDIV0_H* = (0x00000001) # ADC10 predivider Bit: 0
ADC10PDIV1_H* = (0x00000002) # ADC10 predivider Bit: 1
# ADC10PDIV_VAL_0* = (0x00000000) # ADC10 predivider /1
# ADC10PDIV_VAL_1* = (0x00000100) # ADC10 predivider /2
# ADC10PDIV_VAL_2* = (0x00000200) # ADC10 predivider /64
# ADC10PDIV_VAL_3* = (0x00000300) # ADC10 predivider reserved
ADC10PDIV_VAL_1* = (0x00000000) # ADC10 predivider /1
ADC10PDIV_VAL_4* = (0x00000100) # ADC10 predivider /2
ADC10PDIV_VAL_64* = (0x00000200) # ADC10 predivider /64
# ADC10MCTL0 Control Bits
const
ADC10INCH0* = (0x00000001) # ADC10 Input Channel Select Bit 0
ADC10INCH1* = (0x00000002) # ADC10 Input Channel Select Bit 1
ADC10INCH2* = (0x00000004) # ADC10 Input Channel Select Bit 2
ADC10INCH3* = (0x00000008) # ADC10 Input Channel Select Bit 3
ADC10SREF0* = (0x00000010) # ADC10 Select Reference Bit 0
ADC10SREF1* = (0x00000020) # ADC10 Select Reference Bit 1
ADC10SREF2* = (0x00000040) # ADC10 Select Reference Bit 2
# ADC10MCTL0 Control Bits
const
ADC10INCH0_L* = (0x00000001) # ADC10 Input Channel Select Bit 0
ADC10INCH1_L* = (0x00000002) # ADC10 Input Channel Select Bit 1
ADC10INCH2_L* = (0x00000004) # ADC10 Input Channel Select Bit 2
ADC10INCH3_L* = (0x00000008) # ADC10 Input Channel Select Bit 3
ADC10SREF0_L* = (0x00000010) # ADC10 Select Reference Bit 0
ADC10SREF1_L* = (0x00000020) # ADC10 Select Reference Bit 1
ADC10SREF2_L* = (0x00000040) # ADC10 Select Reference Bit 2
# ADC10MCTL0 Control Bits
const
ADC10INCH_VAL_0* = (0) # ADC10 Input Channel 0
ADC10INCH_VAL_1* = (1) # ADC10 Input Channel 1
ADC10INCH_VAL_2* = (2) # ADC10 Input Channel 2
ADC10INCH_VAL_3* = (3) # ADC10 Input Channel 3
ADC10INCH_VAL_4* = (4) # ADC10 Input Channel 4
ADC10INCH_VAL_5* = (5) # ADC10 Input Channel 5
ADC10INCH_VAL_6* = (6) # ADC10 Input Channel 6
ADC10INCH_VAL_7* = (7) # ADC10 Input Channel 7
ADC10INCH_VAL_8* = (8) # ADC10 Input Channel 8
ADC10INCH_VAL_9* = (9) # ADC10 Input Channel 9
ADC10INCH_VAL_10* = (10) # ADC10 Input Channel 10
ADC10INCH_VAL_11* = (11) # ADC10 Input Channel 11
ADC10INCH_VAL_12* = (12) # ADC10 Input Channel 12
ADC10INCH_VAL_13* = (13) # ADC10 Input Channel 13
ADC10INCH_VAL_14* = (14) # ADC10 Input Channel 14
ADC10INCH_VAL_15* = (15) # ADC10 Input Channel 15
ADC10SREF_VAL_0* = (0x00000000) # ADC10 Select Reference 0
ADC10SREF_VAL_1* = (0x00000010) # ADC10 Select Reference 1
ADC10SREF_VAL_2* = (0x00000020) # ADC10 Select Reference 2
ADC10SREF_VAL_3* = (0x00000030) # ADC10 Select Reference 3
ADC10SREF_VAL_4* = (0x00000040) # ADC10 Select Reference 4
ADC10SREF_VAL_5* = (0x00000050) # ADC10 Select Reference 5
ADC10SREF_VAL_6* = (0x00000060) # ADC10 Select Reference 6
ADC10SREF_VAL_7* = (0x00000070) # ADC10 Select Reference 7
# ADC10IE Interrupt Enable Bits
const
ADC10IE0* = (0x00000001) # ADC10_A Interrupt enable
ADC10INIE* = (0x00000002) # ADC10_A Interrupt enable for the inside of window of the Window comparator
ADC10LOIE* = (0x00000004) # ADC10_A Interrupt enable for lower threshold of the Window comparator
ADC10HIIE* = (0x00000008) # ADC10_A Interrupt enable for upper threshold of the Window comparator
ADC10OVIE* = (0x00000010) # ADC10_A ADC10MEM overflow Interrupt enable
ADC10TOVIE* = (0x00000020) # ADC10_A conversion-time-overflow Interrupt enable
# ADC10IE Interrupt Enable Bits
const
ADC10IE0_L* = (0x00000001) # ADC10_A Interrupt enable
ADC10INIE_L* = (0x00000002) # ADC10_A Interrupt enable for the inside of window of the Window comparator
ADC10LOIE_L* = (0x00000004) # ADC10_A Interrupt enable for lower threshold of the Window comparator
ADC10HIIE_L* = (0x00000008) # ADC10_A Interrupt enable for upper threshold of the Window comparator
ADC10OVIE_L* = (0x00000010) # ADC10_A ADC10MEM overflow Interrupt enable
ADC10TOVIE_L* = (0x00000020) # ADC10_A conversion-time-overflow Interrupt enable
# ADC10IE Interrupt Enable Bits
# ADC10IFG Interrupt Flag Bits
const
ADC10IFG0* = (0x00000001) # ADC10_A Interrupt Flag
ADC10INIFG* = (0x00000002) # ADC10_A Interrupt Flag for the inside of window of the Window comparator
ADC10LOIFG* = (0x00000004) # ADC10_A Interrupt Flag for lower threshold of the Window comparator
ADC10HIIFG* = (0x00000008) # ADC10_A Interrupt Flag for upper threshold of the Window comparator
ADC10OVIFG* = (0x00000010) # ADC10_A ADC10MEM overflow Interrupt Flag
ADC10TOVIFG* = (0x00000020) # ADC10_A conversion-time-overflow Interrupt Flag
# ADC10IFG Interrupt Flag Bits
const
ADC10IFG0_L* = (0x00000001) # ADC10_A Interrupt Flag
ADC10INIFG_L* = (0x00000002) # ADC10_A Interrupt Flag for the inside of window of the Window comparator
ADC10LOIFG_L* = (0x00000004) # ADC10_A Interrupt Flag for lower threshold of the Window comparator
ADC10HIIFG_L* = (0x00000008) # ADC10_A Interrupt Flag for upper threshold of the Window comparator
ADC10OVIFG_L* = (0x00000010) # ADC10_A ADC10MEM overflow Interrupt Flag
ADC10TOVIFG_L* = (0x00000020) # ADC10_A conversion-time-overflow Interrupt Flag
# ADC10IFG Interrupt Flag Bits
# ADC10IV Definitions
const
ADC10IV_NONE* = (0x00000000) # No Interrupt pending
ADC10IV_ADC10OVIFG* = (0x00000002) # ADC10OVIFG
ADC10IV_ADC10TOVIFG* = (0x00000004) # ADC10TOVIFG
ADC10IV_ADC10HIIFG* = (0x00000006) # ADC10HIIFG
ADC10IV_ADC10LOIFG* = (0x00000008) # ADC10LOIFG
ADC10IV_ADC10INIFG* = (0x0000000A) # ADC10INIFG
ADC10IV_ADC10IFG* = (0x0000000C) # ADC10IFG
#***********************************************************
# Comparator B
#**********************************************************
const
MSP430_HAS_COMPB* = true # Definition to show that Module is available
MSP430_BASEADDRESS_COMPB* = 0x000008C0
CBCTL0_ADDR* = 0x000008C0
sfrb(CBCTL0_L, CBCTL0_ADDR)
sfrb(CBCTL0_H, CBCTL0_ADDR + 1)
sfrw(CBCTL0, CBCTL0_ADDR)
const
CBCTL1_ADDR* = 0x000008C2
sfrb(CBCTL1_L, CBCTL1_ADDR)
sfrb(CBCTL1_H, CBCTL1_ADDR + 1)
sfrw(CBCTL1, CBCTL1_ADDR)
const
CBCTL2_ADDR* = 0x000008C4
sfrb(CBCTL2_L, CBCTL2_ADDR)
sfrb(CBCTL2_H, CBCTL2_ADDR + 1)
sfrw(CBCTL2, CBCTL2_ADDR)
const
CBCTL3_ADDR* = 0x000008C6
sfrb(CBCTL3_L, CBCTL3_ADDR)
sfrb(CBCTL3_H, CBCTL3_ADDR + 1)
sfrw(CBCTL3, CBCTL3_ADDR)
const
CBINT_ADDR* = 0x000008CC
sfrb(CBINT_L, CBINT_ADDR)
sfrb(CBINT_H, CBINT_ADDR + 1)
sfrw(CBINT, CBINT_ADDR)
const
CBIV_ADDR* = 0x000008CE
sfrw(CBIV, CBIV_ADDR)
# CBCTL0 Control Bits
const
CBIPSEL0* = (0x00000001) # Comp. B Pos. Channel Input Select 0
CBIPSEL1* = (0x00000002) # Comp. B Pos. Channel Input Select 1
CBIPSEL2* = (0x00000004) # Comp. B Pos. Channel Input Select 2
CBIPSEL3* = (0x00000008) # Comp. B Pos. Channel Input Select 3
##define RESERVED (0x0010) /* Comp. B */
##define RESERVED (0x0020) /* Comp. B */
##define RESERVED (0x0040) /* Comp. B */
const
CBIPEN* = (0x00000080) # Comp. B Pos. Channel Input Enable
CBIMSEL0* = (0x00000100) # Comp. B Neg. Channel Input Select 0
CBIMSEL1* = (0x00000200) # Comp. B Neg. Channel Input Select 1
CBIMSEL2* = (0x00000400) # Comp. B Neg. Channel Input Select 2
CBIMSEL3* = (0x00000800) # Comp. B Neg. Channel Input Select 3
##define RESERVED (0x1000) /* Comp. B */
##define RESERVED (0x2000) /* Comp. B */
##define RESERVED (0x4000) /* Comp. B */
const
CBIMEN* = (0x00008000) # Comp. B Neg. Channel Input Enable
# CBCTL0 Control Bits
const
CBIPSEL0_L* = (0x00000001) # Comp. B Pos. Channel Input Select 0
CBIPSEL1_L* = (0x00000002) # Comp. B Pos. Channel Input Select 1
CBIPSEL2_L* = (0x00000004) # Comp. B Pos. Channel Input Select 2
CBIPSEL3_L* = (0x00000008) # Comp. B Pos. Channel Input Select 3
##define RESERVED (0x0010) /* Comp. B */
##define RESERVED (0x0020) /* Comp. B */
##define RESERVED (0x0040) /* Comp. B */
const
CBIPEN_L* = (0x00000080) # Comp. B Pos. Channel Input Enable
##define RESERVED (0x1000) /* Comp. B */
##define RESERVED (0x2000) /* Comp. B */
##define RESERVED (0x4000) /* Comp. B */
# CBCTL0 Control Bits
##define RESERVED (0x0010) /* Comp. B */
##define RESERVED (0x0020) /* Comp. B */
##define RESERVED (0x0040) /* Comp. B */
const
CBIMSEL0_H* = (0x00000001) # Comp. B Neg. Channel Input Select 0
CBIMSEL1_H* = (0x00000002) # Comp. B Neg. Channel Input Select 1
CBIMSEL2_H* = (0x00000004) # Comp. B Neg. Channel Input Select 2
CBIMSEL3_H* = (0x00000008) # Comp. B Neg. Channel Input Select 3
##define RESERVED (0x1000) /* Comp. B */
##define RESERVED (0x2000) /* Comp. B */
##define RESERVED (0x4000) /* Comp. B */
const
CBIMEN_H* = (0x00000080) # Comp. B Neg. Channel Input Enable
CBIPSEL_VAL_0* = (0x00000000) # Comp. B V+ terminal Input Select: Channel 0
CBIPSEL_VAL_1* = (0x00000001) # Comp. B V+ terminal Input Select: Channel 1
CBIPSEL_VAL_2* = (0x00000002) # Comp. B V+ terminal Input Select: Channel 2
CBIPSEL_VAL_3* = (0x00000003) # Comp. B V+ terminal Input Select: Channel 3
CBIPSEL_VAL_4* = (0x00000004) # Comp. B V+ terminal Input Select: Channel 4
CBIPSEL_VAL_5* = (0x00000005) # Comp. B V+ terminal Input Select: Channel 5
CBIPSEL_VAL_6* = (0x00000006) # Comp. B V+ terminal Input Select: Channel 6
CBIPSEL_VAL_7* = (0x00000007) # Comp. B V+ terminal Input Select: Channel 7
CBIPSEL_VAL_8* = (0x00000008) # Comp. B V+ terminal Input Select: Channel 8
CBIPSEL_VAL_9* = (0x00000009) # Comp. B V+ terminal Input Select: Channel 9
CBIPSEL_VAL_10* = (0x0000000A) # Comp. B V+ terminal Input Select: Channel 10
CBIPSEL_VAL_11* = (0x0000000B) # Comp. B V+ terminal Input Select: Channel 11
CBIPSEL_VAL_12* = (0x0000000C) # Comp. B V+ terminal Input Select: Channel 12
CBIPSEL_VAL_13* = (0x0000000D) # Comp. B V+ terminal Input Select: Channel 13
CBIPSEL_VAL_14* = (0x0000000E) # Comp. B V+ terminal Input Select: Channel 14
CBIPSEL_VAL_15* = (0x0000000F) # Comp. B V+ terminal Input Select: Channel 15
CBIMSEL_VAL_0* = (0x00000000) # Comp. B V- Terminal Input Select: Channel 0
CBIMSEL_VAL_1* = (0x00000100) # Comp. B V- Terminal Input Select: Channel 1
CBIMSEL_VAL_2* = (0x00000200) # Comp. B V- Terminal Input Select: Channel 2
CBIMSEL_VAL_3* = (0x00000300) # Comp. B V- Terminal Input Select: Channel 3
CBIMSEL_VAL_4* = (0x00000400) # Comp. B V- Terminal Input Select: Channel 4
CBIMSEL_VAL_5* = (0x00000500) # Comp. B V- Terminal Input Select: Channel 5
CBIMSEL_VAL_6* = (0x00000600) # Comp. B V- Terminal Input Select: Channel 6
CBIMSEL_VAL_7* = (0x00000700) # Comp. B V- Terminal Input Select: Channel 7
CBIMSEL_VAL_8* = (0x00000800) # Comp. B V- terminal Input Select: Channel 8
CBIMSEL_VAL_9* = (0x00000900) # Comp. B V- terminal Input Select: Channel 9
CBIMSEL_VAL_10* = (0x00000A00) # Comp. B V- terminal Input Select: Channel 10
CBIMSEL_VAL_11* = (0x00000B00) # Comp. B V- terminal Input Select: Channel 11
CBIMSEL_VAL_12* = (0x00000C00) # Comp. B V- terminal Input Select: Channel 12
CBIMSEL_VAL_13* = (0x00000D00) # Comp. B V- terminal Input Select: Channel 13
CBIMSEL_VAL_14* = (0x00000E00) # Comp. B V- terminal Input Select: Channel 14
CBIMSEL_VAL_15* = (0x00000F00) # Comp. B V- terminal Input Select: Channel 15
# CBCTL1 Control Bits
const
CBOUT* = (0x00000001) # Comp. B Output
CBOUTPOL* = (0x00000002) # Comp. B Output Polarity
CBF* = (0x00000004) # Comp. B Enable Output Filter
CBIES* = (0x00000008) # Comp. B Interrupt Edge Select
CBSHORT* = (0x00000010) # Comp. B Input Short
CBEX* = (0x00000020) # Comp. B Exchange Inputs
CBFDLY0* = (0x00000040) # Comp. B Filter delay Bit 0
CBFDLY1* = (0x00000080) # Comp. B Filter delay Bit 1
CBPWRMD0* = (0x00000100) # Comp. B Power Mode Bit 0
CBPWRMD1* = (0x00000200) # Comp. B Power Mode Bit 1
CBON* = (0x00000400) # Comp. B enable
CBMRVL* = (0x00000800) # Comp. B CBMRV Level
CBMRVS* = (0x00001000) # Comp. B Output selects between VREF0 or VREF1
##define RESERVED (0x2000) /* Comp. B */
##define RESERVED (0x4000) /* Comp. B */
##define RESERVED (0x8000) /* Comp. B */
# CBCTL1 Control Bits
const
CBOUT_L* = (0x00000001) # Comp. B Output
CBOUTPOL_L* = (0x00000002) # Comp. B Output Polarity
CBF_L* = (0x00000004) # Comp. B Enable Output Filter
CBIES_L* = (0x00000008) # Comp. B Interrupt Edge Select
CBSHORT_L* = (0x00000010) # Comp. B Input Short
CBEX_L* = (0x00000020) # Comp. B Exchange Inputs
CBFDLY0_L* = (0x00000040) # Comp. B Filter delay Bit 0
CBFDLY1_L* = (0x00000080) # Comp. B Filter delay Bit 1
##define RESERVED (0x2000) /* Comp. B */
##define RESERVED (0x4000) /* Comp. B */
##define RESERVED (0x8000) /* Comp. B */
# CBCTL1 Control Bits
const
CBPWRMD0_H* = (0x00000001) # Comp. B Power Mode Bit 0
CBPWRMD1_H* = (0x00000002) # Comp. B Power Mode Bit 1
CBON_H* = (0x00000004) # Comp. B enable
CBMRVL_H* = (0x00000008) # Comp. B CBMRV Level
CBMRVS_H* = (0x00000010) # Comp. B Output selects between VREF0 or VREF1
##define RESERVED (0x2000) /* Comp. B */
##define RESERVED (0x4000) /* Comp. B */
##define RESERVED (0x8000) /* Comp. B */
const
CBFDLY_VAL_0* = (0x00000000) # Comp. B Filter delay 0 : 450ns
CBFDLY_VAL_1* = (0x00000040) # Comp. B Filter delay 1 : 900ns
CBFDLY_VAL_2* = (0x00000080) # Comp. B Filter delay 2 : 1800ns
CBFDLY_VAL_3* = (0x000000C0) # Comp. B Filter delay 3 : 3600ns
CBPWRMD_VAL_0* = (0x00000000) # Comp. B Power Mode 0 : High speed
CBPWRMD_VAL_1* = (0x00000100) # Comp. B Power Mode 1 : Normal
CBPWRMD_VAL_2* = (0x00000200) # Comp. B Power Mode 2 : Ultra-Low
CBPWRMD_VAL_3* = (0x00000300) # Comp. B Power Mode 3 : Reserved
# CBCTL2 Control Bits
const
CBREF00* = (0x00000001) # Comp. B Reference 0 Resistor Select Bit : 0
CBREF01* = (0x00000002) # Comp. B Reference 0 Resistor Select Bit : 1
CBREF02* = (0x00000004) # Comp. B Reference 0 Resistor Select Bit : 2
CBREF03* = (0x00000008) # Comp. B Reference 0 Resistor Select Bit : 3
CBREF04* = (0x00000010) # Comp. B Reference 0 Resistor Select Bit : 4
CBRSEL* = (0x00000020) # Comp. B Reference select
CBRS0* = (0x00000040) # Comp. B Reference Source Bit : 0
CBRS1* = (0x00000080) # Comp. B Reference Source Bit : 1
CBREF10* = (0x00000100) # Comp. B Reference 1 Resistor Select Bit : 0
CBREF11* = (0x00000200) # Comp. B Reference 1 Resistor Select Bit : 1
CBREF12* = (0x00000400) # Comp. B Reference 1 Resistor Select Bit : 2
CBREF13* = (0x00000800) # Comp. B Reference 1 Resistor Select Bit : 3
CBREF14* = (0x00001000) # Comp. B Reference 1 Resistor Select Bit : 4
CBREFL0* = (0x00002000) # Comp. B Reference voltage level Bit : 0
CBREFL1* = (0x00004000) # Comp. B Reference voltage level Bit : 1
CBREFACC* = (0x00008000) # Comp. B Reference Accuracy
# CBCTL2 Control Bits
const
CBREF00_L* = (0x00000001) # Comp. B Reference 0 Resistor Select Bit : 0
CBREF01_L* = (0x00000002) # Comp. B Reference 0 Resistor Select Bit : 1
CBREF02_L* = (0x00000004) # Comp. B Reference 0 Resistor Select Bit : 2
CBREF03_L* = (0x00000008) # Comp. B Reference 0 Resistor Select Bit : 3
CBREF04_L* = (0x00000010) # Comp. B Reference 0 Resistor Select Bit : 4
CBRSEL_L* = (0x00000020) # Comp. B Reference select
CBRS0_L* = (0x00000040) # Comp. B Reference Source Bit : 0
CBRS1_L* = (0x00000080) # Comp. B Reference Source Bit : 1
# CBCTL2 Control Bits
const
CBREF10_H* = (0x00000001) # Comp. B Reference 1 Resistor Select Bit : 0
CBREF11_H* = (0x00000002) # Comp. B Reference 1 Resistor Select Bit : 1
CBREF12_H* = (0x00000004) # Comp. B Reference 1 Resistor Select Bit : 2
CBREF13_H* = (0x00000008) # Comp. B Reference 1 Resistor Select Bit : 3
CBREF14_H* = (0x00000010) # Comp. B Reference 1 Resistor Select Bit : 4
CBREFL0_H* = (0x00000020) # Comp. B Reference voltage level Bit : 0
CBREFL1_H* = (0x00000040) # Comp. B Reference voltage level Bit : 1
CBREFACC_H* = (0x00000080) # Comp. B Reference Accuracy
CBREF0_VAL_0* = (0x00000000) # Comp. B Int. Ref.0 Select 0 : 1/32
CBREF0_VAL_1* = (0x00000001) # Comp. B Int. Ref.0 Select 1 : 2/32
CBREF0_VAL_2* = (0x00000002) # Comp. B Int. Ref.0 Select 2 : 3/32
CBREF0_VAL_3* = (0x00000003) # Comp. B Int. Ref.0 Select 3 : 4/32
CBREF0_VAL_4* = (0x00000004) # Comp. B Int. Ref.0 Select 4 : 5/32
CBREF0_VAL_5* = (0x00000005) # Comp. B Int. Ref.0 Select 5 : 6/32
CBREF0_VAL_6* = (0x00000006) # Comp. B Int. Ref.0 Select 6 : 7/32
CBREF0_VAL_7* = (0x00000007) # Comp. B Int. Ref.0 Select 7 : 8/32
CBREF0_VAL_8* = (0x00000008) # Comp. B Int. Ref.0 Select 0 : 9/32
CBREF0_VAL_9* = (0x00000009) # Comp. B Int. Ref.0 Select 1 : 10/32
CBREF0_VAL_10* = (0x0000000A) # Comp. B Int. Ref.0 Select 2 : 11/32
CBREF0_VAL_11* = (0x0000000B) # Comp. B Int. Ref.0 Select 3 : 12/32
CBREF0_VAL_12* = (0x0000000C) # Comp. B Int. Ref.0 Select 4 : 13/32
CBREF0_VAL_13* = (0x0000000D) # Comp. B Int. Ref.0 Select 5 : 14/32
CBREF0_VAL_14* = (0x0000000E) # Comp. B Int. Ref.0 Select 6 : 15/32
CBREF0_VAL_15* = (0x0000000F) # Comp. B Int. Ref.0 Select 7 : 16/32
CBREF0_VAL_16* = (0x00000010) # Comp. B Int. Ref.0 Select 0 : 17/32
CBREF0_VAL_17* = (0x00000011) # Comp. B Int. Ref.0 Select 1 : 18/32
CBREF0_VAL_18* = (0x00000012) # Comp. B Int. Ref.0 Select 2 : 19/32
CBREF0_VAL_19* = (0x00000013) # Comp. B Int. Ref.0 Select 3 : 20/32
CBREF0_VAL_20* = (0x00000014) # Comp. B Int. Ref.0 Select 4 : 21/32
CBREF0_VAL_21* = (0x00000015) # Comp. B Int. Ref.0 Select 5 : 22/32
CBREF0_VAL_22* = (0x00000016) # Comp. B Int. Ref.0 Select 6 : 23/32
CBREF0_VAL_23* = (0x00000017) # Comp. B Int. Ref.0 Select 7 : 24/32
CBREF0_VAL_24* = (0x00000018) # Comp. B Int. Ref.0 Select 0 : 25/32
CBREF0_VAL_25* = (0x00000019) # Comp. B Int. Ref.0 Select 1 : 26/32
CBREF0_VAL_26* = (0x0000001A) # Comp. B Int. Ref.0 Select 2 : 27/32
CBREF0_VAL_27* = (0x0000001B) # Comp. B Int. Ref.0 Select 3 : 28/32
CBREF0_VAL_28* = (0x0000001C) # Comp. B Int. Ref.0 Select 4 : 29/32
CBREF0_VAL_29* = (0x0000001D) # Comp. B Int. Ref.0 Select 5 : 30/32
CBREF0_VAL_30* = (0x0000001E) # Comp. B Int. Ref.0 Select 6 : 31/32
CBREF0_VAL_31* = (0x0000001F) # Comp. B Int. Ref.0 Select 7 : 32/32
CBRS_VAL_0* = (0x00000000) # Comp. B Reference Source 0 : Off
CBRS_VAL_1* = (0x00000040) # Comp. B Reference Source 1 : Vcc
CBRS_VAL_2* = (0x00000080) # Comp. B Reference Source 2 : Shared Ref.
CBRS_VAL_3* = (0x000000C0) # Comp. B Reference Source 3 : Shared Ref. / Off
CBREF1_VAL_0* = (0x00000000) # Comp. B Int. Ref.1 Select 0 : 1/32
CBREF1_VAL_1* = (0x00000100) # Comp. B Int. Ref.1 Select 1 : 2/32
CBREF1_VAL_2* = (0x00000200) # Comp. B Int. Ref.1 Select 2 : 3/32
CBREF1_VAL_3* = (0x00000300) # Comp. B Int. Ref.1 Select 3 : 4/32
CBREF1_VAL_4* = (0x00000400) # Comp. B Int. Ref.1 Select 4 : 5/32
CBREF1_VAL_5* = (0x00000500) # Comp. B Int. Ref.1 Select 5 : 6/32
CBREF1_VAL_6* = (0x00000600) # Comp. B Int. Ref.1 Select 6 : 7/32
CBREF1_VAL_7* = (0x00000700) # Comp. B Int. Ref.1 Select 7 : 8/32
CBREF1_VAL_8* = (0x00000800) # Comp. B Int. Ref.1 Select 0 : 9/32
CBREF1_VAL_9* = (0x00000900) # Comp. B Int. Ref.1 Select 1 : 10/32
CBREF1_VAL_10* = (0x00000A00) # Comp. B Int. Ref.1 Select 2 : 11/32
CBREF1_VAL_11* = (0x00000B00) # Comp. B Int. Ref.1 Select 3 : 12/32
CBREF1_VAL_12* = (0x00000C00) # Comp. B Int. Ref.1 Select 4 : 13/32
CBREF1_VAL_13* = (0x00000D00) # Comp. B Int. Ref.1 Select 5 : 14/32
CBREF1_VAL_14* = (0x00000E00) # Comp. B Int. Ref.1 Select 6 : 15/32
CBREF1_VAL_15* = (0x00000F00) # Comp. B Int. Ref.1 Select 7 : 16/32
CBREF1_VAL_16* = (0x00001000) # Comp. B Int. Ref.1 Select 0 : 17/32
CBREF1_VAL_17* = (0x00001100) # Comp. B Int. Ref.1 Select 1 : 18/32
CBREF1_VAL_18* = (0x00001200) # Comp. B Int. Ref.1 Select 2 : 19/32
CBREF1_VAL_19* = (0x00001300) # Comp. B Int. Ref.1 Select 3 : 20/32
CBREF1_VAL_20* = (0x00001400) # Comp. B Int. Ref.1 Select 4 : 21/32
CBREF1_VAL_21* = (0x00001500) # Comp. B Int. Ref.1 Select 5 : 22/32
CBREF1_VAL_22* = (0x00001600) # Comp. B Int. Ref.1 Select 6 : 23/32
CBREF1_VAL_23* = (0x00001700) # Comp. B Int. Ref.1 Select 7 : 24/32
CBREF1_VAL_24* = (0x00001800) # Comp. B Int. Ref.1 Select 0 : 25/32
CBREF1_VAL_25* = (0x00001900) # Comp. B Int. Ref.1 Select 1 : 26/32
CBREF1_VAL_26* = (0x00001A00) # Comp. B Int. Ref.1 Select 2 : 27/32
CBREF1_VAL_27* = (0x00001B00) # Comp. B Int. Ref.1 Select 3 : 28/32
CBREF1_VAL_28* = (0x00001C00) # Comp. B Int. Ref.1 Select 4 : 29/32
CBREF1_VAL_29* = (0x00001D00) # Comp. B Int. Ref.1 Select 5 : 30/32
CBREF1_VAL_30* = (0x00001E00) # Comp. B Int. Ref.1 Select 6 : 31/32
CBREF1_VAL_31* = (0x00001F00) # Comp. B Int. Ref.1 Select 7 : 32/32
CBREFL_VAL_0* = (0x00000000) # Comp. B Reference voltage level 0 : None
CBREFL_VAL_1* = (0x00002000) # Comp. B Reference voltage level 1 : 1.5V
CBREFL_VAL_2* = (0x00004000) # Comp. B Reference voltage level 2 : 2.0V
CBREFL_VAL_3* = (0x00006000) # Comp. B Reference voltage level 3 : 2.5V
CBPD0* = (0x00000001) # Comp. B Disable Input Buffer of Port Register .0
CBPD1* = (0x00000002) # Comp. B Disable Input Buffer of Port Register .1
CBPD2* = (0x00000004) # Comp. B Disable Input Buffer of Port Register .2
CBPD3* = (0x00000008) # Comp. B Disable Input Buffer of Port Register .3
CBPD4* = (0x00000010) # Comp. B Disable Input Buffer of Port Register .4
CBPD5* = (0x00000020) # Comp. B Disable Input Buffer of Port Register .5
CBPD6* = (0x00000040) # Comp. B Disable Input Buffer of Port Register .6
CBPD7* = (0x00000080) # Comp. B Disable Input Buffer of Port Register .7
CBPD8* = (0x00000100) # Comp. B Disable Input Buffer of Port Register .8
CBPD9* = (0x00000200) # Comp. B Disable Input Buffer of Port Register .9
CBPD10* = (0x00000400) # Comp. B Disable Input Buffer of Port Register .10
CBPD11* = (0x00000800) # Comp. B Disable Input Buffer of Port Register .11
CBPD12* = (0x00001000) # Comp. B Disable Input Buffer of Port Register .12
CBPD13* = (0x00002000) # Comp. B Disable Input Buffer of Port Register .13
CBPD14* = (0x00004000) # Comp. B Disable Input Buffer of Port Register .14
CBPD15* = (0x00008000) # Comp. B Disable Input Buffer of Port Register .15
CBPD0_L* = (0x00000001) # Comp. B Disable Input Buffer of Port Register .0
CBPD1_L* = (0x00000002) # Comp. B Disable Input Buffer of Port Register .1
CBPD2_L* = (0x00000004) # Comp. B Disable Input Buffer of Port Register .2
CBPD3_L* = (0x00000008) # Comp. B Disable Input Buffer of Port Register .3
CBPD4_L* = (0x00000010) # Comp. B Disable Input Buffer of Port Register .4
CBPD5_L* = (0x00000020) # Comp. B Disable Input Buffer of Port Register .5
CBPD6_L* = (0x00000040) # Comp. B Disable Input Buffer of Port Register .6
CBPD7_L* = (0x00000080) # Comp. B Disable Input Buffer of Port Register .7
CBPD8_H* = (0x00000001) # Comp. B Disable Input Buffer of Port Register .8
CBPD9_H* = (0x00000002) # Comp. B Disable Input Buffer of Port Register .9
CBPD10_H* = (0x00000004) # Comp. B Disable Input Buffer of Port Register .10
CBPD11_H* = (0x00000008) # Comp. B Disable Input Buffer of Port Register .11
CBPD12_H* = (0x00000010) # Comp. B Disable Input Buffer of Port Register .12
CBPD13_H* = (0x00000020) # Comp. B Disable Input Buffer of Port Register .13
CBPD14_H* = (0x00000040) # Comp. B Disable Input Buffer of Port Register .14
CBPD15_H* = (0x00000080) # Comp. B Disable Input Buffer of Port Register .15
# CBINT Control Bits
const
CBIFG* = (0x00000001) # Comp. B Interrupt Flag
CBIIFG* = (0x00000002) # Comp. B Interrupt Flag Inverted Polarity
##define RESERVED (0x0004) /* Comp. B */
##define RESERVED (0x0008) /* Comp. B */
##define RESERVED (0x0010) /* Comp. B */
##define RESERVED (0x0020) /* Comp. B */
##define RESERVED (0x0040) /* Comp. B */
##define RESERVED (0x0080) /* Comp. B */
const
CBIE* = (0x00000100) # Comp. B Interrupt Enable
CBIIE* = (0x00000200) # Comp. B Interrupt Enable Inverted Polarity
##define RESERVED (0x0400) /* Comp. B */
##define RESERVED (0x0800) /* Comp. B */
##define RESERVED (0x1000) /* Comp. B */
##define RESERVED (0x2000) /* Comp. B */
##define RESERVED (0x4000) /* Comp. B */
##define RESERVED (0x8000) /* Comp. B */
# CBINT Control Bits
const
CBIFG_L* = (0x00000001) # Comp. B Interrupt Flag
CBIIFG_L* = (0x00000002) # Comp. B Interrupt Flag Inverted Polarity
##define RESERVED (0x0004) /* Comp. B */
##define RESERVED (0x0008) /* Comp. B */
##define RESERVED (0x0010) /* Comp. B */
##define RESERVED (0x0020) /* Comp. B */
##define RESERVED (0x0040) /* Comp. B */
##define RESERVED (0x0080) /* Comp. B */
##define RESERVED (0x0400) /* Comp. B */
##define RESERVED (0x0800) /* Comp. B */
##define RESERVED (0x1000) /* Comp. B */
##define RESERVED (0x2000) /* Comp. B */
##define RESERVED (0x4000) /* Comp. B */
##define RESERVED (0x8000) /* Comp. B */
# CBINT Control Bits
##define RESERVED (0x0004) /* Comp. B */
##define RESERVED (0x0008) /* Comp. B */
##define RESERVED (0x0010) /* Comp. B */
##define RESERVED (0x0020) /* Comp. B */
##define RESERVED (0x0040) /* Comp. B */
##define RESERVED (0x0080) /* Comp. B */
const
CBIE_H* = (0x00000001) # Comp. B Interrupt Enable
CBIIE_H* = (0x00000002) # Comp. B Interrupt Enable Inverted Polarity
##define RESERVED (0x0400) /* Comp. B */
##define RESERVED (0x0800) /* Comp. B */
##define RESERVED (0x1000) /* Comp. B */
##define RESERVED (0x2000) /* Comp. B */
##define RESERVED (0x4000) /* Comp. B */
##define RESERVED (0x8000) /* Comp. B */
# CBIV Definitions
const
CBIV_NONE* = (0x00000000) # No Interrupt pending
CBIV_CBIFG* = (0x00000002) # CBIFG
CBIV_CBIIFG* = (0x00000004) # CBIIFG
#************************************************************
# CRC Module
#***********************************************************
const
MSP430_HAS_CRC* = true # Definition to show that Module is available
MSP430_BASEADDRESS_CRC* = 0x00000150
CRCDI_ADDR* = 0x00000150
sfrb(CRCDI_L, CRCDI_ADDR)
sfrb(CRCDI_H, CRCDI_ADDR + 1)
sfrw(CRCDI, CRCDI_ADDR)
const
CRCDIRB_ADDR* = 0x00000152
sfrb(CRCDIRB_L, CRCDIRB_ADDR)
sfrb(CRCDIRB_H, CRCDIRB_ADDR + 1)
sfrw(CRCDIRB, CRCDIRB_ADDR)
const
CRCINIRES_ADDR* = 0x00000154
sfrb(CRCINIRES_L, CRCINIRES_ADDR)
sfrb(CRCINIRES_H, CRCINIRES_ADDR + 1)
sfrw(CRCINIRES, CRCINIRES_ADDR)
const
CRCRESR_ADDR* = 0x00000156
sfrb(CRCRESR_L, CRCRESR_ADDR)
sfrb(CRCRESR_H, CRCRESR_ADDR + 1)
sfrw(CRCRESR, CRCRESR_ADDR)
#***********************************************************
# DMA_X
#**********************************************************
const
MSP430_HAS_DMAX_3* = true # Definition to show that Module is available
MSP430_BASEADDRESS_DMAX_3* = 0x00000500
DMACTL0_ADDR* = 0x00000500
sfrb(DMACTL0_L, DMACTL0_ADDR)
sfrb(DMACTL0_H, DMACTL0_ADDR + 1)
sfrw(DMACTL0, DMACTL0_ADDR)
const
DMACTL1_ADDR* = 0x00000502
sfrb(DMACTL1_L, DMACTL1_ADDR)
sfrb(DMACTL1_H, DMACTL1_ADDR + 1)
sfrw(DMACTL1, DMACTL1_ADDR)
const
DMACTL2_ADDR* = 0x00000504
sfrb(DMACTL2_L, DMACTL2_ADDR)
sfrb(DMACTL2_H, DMACTL2_ADDR + 1)
sfrw(DMACTL2, DMACTL2_ADDR)
const
DMACTL3_ADDR* = 0x00000506
sfrb(DMACTL3_L, DMACTL3_ADDR)
sfrb(DMACTL3_H, DMACTL3_ADDR + 1)
sfrw(DMACTL3, DMACTL3_ADDR)
const
DMACTL4_ADDR* = 0x00000508
sfrb(DMACTL4_L, DMACTL4_ADDR)
sfrb(DMACTL4_H, DMACTL4_ADDR + 1)
sfrw(DMACTL4, DMACTL4_ADDR)
const
DMAIV_ADDR* = 0x0000050E
sfrb(DMAIV_L, DMAIV_ADDR)
sfrb(DMAIV_H, DMAIV_ADDR + 1)
sfrw(DMAIV, DMAIV_ADDR)
const
DMA0CTL_ADDR* = 0x00000510
sfrb(DMA0CTL_L, DMA0CTL_ADDR)
sfrb(DMA0CTL_H, DMA0CTL_ADDR + 1)
sfrw(DMA0CTL, DMA0CTL_ADDR)
const
DMA0SA_ADDR* = 0x00000512
sfra(DMA0SA, DMA0SA_ADDR)
const
DMA0DA_ADDR* = 0x00000516
sfra(DMA0DA, DMA0DA_ADDR)
const
DMA0SZ_ADDR* = 0x0000051A
sfrw(DMA0SZ, DMA0SZ_ADDR)
const
DMA1CTL_ADDR* = 0x00000520
sfrb(DMA1CTL_L, DMA1CTL_ADDR)
sfrb(DMA1CTL_H, DMA1CTL_ADDR + 1)
sfrw(DMA1CTL, DMA1CTL_ADDR)
const
DMA1SA_ADDR* = 0x00000522
sfra(DMA1SA, DMA1SA_ADDR)
const
DMA1DA_ADDR* = 0x00000526
sfra(DMA1DA, DMA1DA_ADDR)
const
DMA1SZ_ADDR* = 0x0000052A
sfrw(DMA1SZ, DMA1SZ_ADDR)
const
DMA2CTL_ADDR* = 0x00000530
sfrb(DMA2CTL_L, DMA2CTL_ADDR)
sfrb(DMA2CTL_H, DMA2CTL_ADDR + 1)
sfrw(DMA2CTL, DMA2CTL_ADDR)
const
DMA2SA_ADDR* = 0x00000532
sfra(DMA2SA, DMA2SA_ADDR)
const
DMA2DA_ADDR* = 0x00000536
sfra(DMA2DA, DMA2DA_ADDR)
const
DMA2SZ_ADDR* = 0x0000053A
sfrw(DMA2SZ, DMA2SZ_ADDR)
# DMACTL0 Control Bits
const
DMA0TSEL0* = (0x00000001) # DMA channel 0 transfer select bit 0
DMA0TSEL1* = (0x00000002) # DMA channel 0 transfer select bit 1
DMA0TSEL2* = (0x00000004) # DMA channel 0 transfer select bit 2
DMA0TSEL3* = (0x00000008) # DMA channel 0 transfer select bit 3
DMA0TSEL4* = (0x00000010) # DMA channel 0 transfer select bit 4
DMA1TSEL0* = (0x00000100) # DMA channel 1 transfer select bit 0
DMA1TSEL1* = (0x00000200) # DMA channel 1 transfer select bit 1
DMA1TSEL2* = (0x00000400) # DMA channel 1 transfer select bit 2
DMA1TSEL3* = (0x00000800) # DMA channel 1 transfer select bit 3
DMA1TSEL4* = (0x00001000) # DMA channel 1 transfer select bit 4
# DMACTL0 Control Bits
const
DMA0TSEL0_L* = (0x00000001) # DMA channel 0 transfer select bit 0
DMA0TSEL1_L* = (0x00000002) # DMA channel 0 transfer select bit 1
DMA0TSEL2_L* = (0x00000004) # DMA channel 0 transfer select bit 2
DMA0TSEL3_L* = (0x00000008) # DMA channel 0 transfer select bit 3
DMA0TSEL4_L* = (0x00000010) # DMA channel 0 transfer select bit 4
# DMACTL0 Control Bits
const
DMA1TSEL0_H* = (0x00000001) # DMA channel 1 transfer select bit 0
DMA1TSEL1_H* = (0x00000002) # DMA channel 1 transfer select bit 1
DMA1TSEL2_H* = (0x00000004) # DMA channel 1 transfer select bit 2
DMA1TSEL3_H* = (0x00000008) # DMA channel 1 transfer select bit 3
DMA1TSEL4_H* = (0x00000010) # DMA channel 1 transfer select bit 4
# DMACTL01 Control Bits
const
DMA2TSEL0* = (0x00000001) # DMA channel 2 transfer select bit 0
DMA2TSEL1* = (0x00000002) # DMA channel 2 transfer select bit 1
DMA2TSEL2* = (0x00000004) # DMA channel 2 transfer select bit 2
DMA2TSEL3* = (0x00000008) # DMA channel 2 transfer select bit 3
DMA2TSEL4* = (0x00000010) # DMA channel 2 transfer select bit 4
# DMACTL01 Control Bits
const
DMA2TSEL0_L* = (0x00000001) # DMA channel 2 transfer select bit 0
DMA2TSEL1_L* = (0x00000002) # DMA channel 2 transfer select bit 1
DMA2TSEL2_L* = (0x00000004) # DMA channel 2 transfer select bit 2
DMA2TSEL3_L* = (0x00000008) # DMA channel 2 transfer select bit 3
DMA2TSEL4_L* = (0x00000010) # DMA channel 2 transfer select bit 4
# DMACTL01 Control Bits
# DMACTL4 Control Bits
const
ENNMI* = (0x00000001) # Enable NMI interruption of DMA
ROUNDROBIN* = (0x00000002) # Round-Robin DMA channel priorities
DMARMWDIS* = (0x00000004) # Inhibited DMA transfers during read-modify-write CPU operations
# DMACTL4 Control Bits
const
ENNMI_L* = (0x00000001) # Enable NMI interruption of DMA
ROUNDROBIN_L* = (0x00000002) # Round-Robin DMA channel priorities
DMARMWDIS_L* = (0x00000004) # Inhibited DMA transfers during read-modify-write CPU operations
# DMACTL4 Control Bits
# DMAxCTL Control Bits
const
DMAREQ* = (0x00000001) # Initiate DMA transfer with DMATSEL
DMAABORT* = (0x00000002) # DMA transfer aborted by NMI
DMAIE* = (0x00000004) # DMA interrupt enable
DMAIFG* = (0x00000008) # DMA interrupt flag
DMAEN* = (0x00000010) # DMA enable
DMALEVEL* = (0x00000020) # DMA level sensitive trigger select
DMASRCBYTE* = (0x00000040) # DMA source byte
DMADSTBYTE* = (0x00000080) # DMA destination byte
DMASRCINCR0* = (0x00000100) # DMA source increment bit 0
DMASRCINCR1* = (0x00000200) # DMA source increment bit 1
DMADSTINCR0* = (0x00000400) # DMA destination increment bit 0
DMADSTINCR1* = (0x00000800) # DMA destination increment bit 1
DMADT0* = (0x00001000) # DMA transfer mode bit 0
DMADT1* = (0x00002000) # DMA transfer mode bit 1
DMADT2* = (0x00004000) # DMA transfer mode bit 2
# DMAxCTL Control Bits
const
DMAREQ_L* = (0x00000001) # Initiate DMA transfer with DMATSEL
DMAABORT_L* = (0x00000002) # DMA transfer aborted by NMI
DMAIE_L* = (0x00000004) # DMA interrupt enable
DMAIFG_L* = (0x00000008) # DMA interrupt flag
DMAEN_L* = (0x00000010) # DMA enable
DMALEVEL_L* = (0x00000020) # DMA level sensitive trigger select
DMASRCBYTE_L* = (0x00000040) # DMA source byte
DMADSTBYTE_L* = (0x00000080) # DMA destination byte
# DMAxCTL Control Bits
const
DMASRCINCR0_H* = (0x00000001) # DMA source increment bit 0
DMASRCINCR1_H* = (0x00000002) # DMA source increment bit 1
DMADSTINCR0_H* = (0x00000004) # DMA destination increment bit 0
DMADSTINCR1_H* = (0x00000008) # DMA destination increment bit 1
DMADT0_H* = (0x00000010) # DMA transfer mode bit 0
DMADT1_H* = (0x00000020) # DMA transfer mode bit 1
DMADT2_H* = (0x00000040) # DMA transfer mode bit 2
DMASWDW* = (0x00000000) # DMA transfer: source word to destination word
DMASBDW* = (0x00000040) # DMA transfer: source byte to destination word
DMASWDB* = (0x00000080) # DMA transfer: source word to destination byte
DMASBDB* = (0x000000C0) # DMA transfer: source byte to destination byte
DMASRCINCR_VAL_0* = (0x00000000) # DMA source increment 0: source address unchanged
DMASRCINCR_VAL_1* = (0x00000100) # DMA source increment 1: source address unchanged
DMASRCINCR_VAL_2* = (0x00000200) # DMA source increment 2: source address decremented
DMASRCINCR_VAL_3* = (0x00000300) # DMA source increment 3: source address incremented
DMADSTINCR_VAL_0* = (0x00000000) # DMA destination increment 0: destination address unchanged
DMADSTINCR_VAL_1* = (0x00000400) # DMA destination increment 1: destination address unchanged
DMADSTINCR_VAL_2* = (0x00000800) # DMA destination increment 2: destination address decremented
DMADSTINCR_VAL_3* = (0x00000C00) # DMA destination increment 3: destination address incremented
DMADT_VAL_0* = (0x00000000) # DMA transfer mode 0: Single transfer
DMADT_VAL_1* = (0x00001000) # DMA transfer mode 1: Block transfer
DMADT_VAL_2* = (0x00002000) # DMA transfer mode 2: Burst-Block transfer
DMADT_VAL_3* = (0x00003000) # DMA transfer mode 3: Burst-Block transfer
DMADT_VAL_4* = (0x00004000) # DMA transfer mode 4: Repeated Single transfer
DMADT_VAL_5* = (0x00005000) # DMA transfer mode 5: Repeated Block transfer
DMADT_VAL_6* = (0x00006000) # DMA transfer mode 6: Repeated Burst-Block transfer
DMADT_VAL_7* = (0x00007000) # DMA transfer mode 7: Repeated Burst-Block transfer
# DMAIV Definitions
const
DMAIV_NONE* = (0x00000000) # No Interrupt pending
DMAIV_DMA0IFG* = (0x00000002) # DMA0IFG
DMAIV_DMA1IFG* = (0x00000004) # DMA1IFG
DMAIV_DMA2IFG* = (0x00000006) # DMA2IFG
DMA0TSEL_VAL_0* = (0x00000000) # DMA channel 0 transfer select 0: DMA_REQ (sw)
DMA0TSEL_VAL_1* = (0x00000001) # DMA channel 0 transfer select 1: Timer0_A (TA0CCR0.IFG)
DMA0TSEL_VAL_2* = (0x00000002) # DMA channel 0 transfer select 2: Timer0_A (TA0CCR2.IFG)
DMA0TSEL_VAL_3* = (0x00000003) # DMA channel 0 transfer select 3: Timer1_A (TA1CCR0.IFG)
DMA0TSEL_VAL_4* = (0x00000004) # DMA channel 0 transfer select 4: Timer1_A (TA1CCR2.IFG)
DMA0TSEL_VAL_5* = (0x00000005) # DMA channel 0 transfer select 5: Timer2_A (TA2CCR0.IFG)
DMA0TSEL_VAL_6* = (0x00000006) # DMA channel 0 transfer select 6: Timer2_A (TA2CCR2.IFG)
DMA0TSEL_VAL_7* = (0x00000007) # DMA channel 0 transfer select 7: TimerB (TB0CCR0.IFG)
DMA0TSEL_VAL_8* = (0x00000008) # DMA channel 0 transfer select 8: TimerB (TB0CCR2.IFG)
DMA0TSEL_VAL_9* = (0x00000009) # DMA channel 0 transfer select 9: Reserved
DMA0TSEL_VAL_10* = (0x0000000A) # DMA channel 0 transfer select 10: Reserved
DMA0TSEL_VAL_11* = (0x0000000B) # DMA channel 0 transfer select 11: Reserved
DMA0TSEL_VAL_12* = (0x0000000C) # DMA channel 0 transfer select 12: Reserved