-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cfg
115 lines (111 loc) · 5.23 KB
/
main.cfg
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
/**
* @fileOverview Grace
*/
/* need to use the CSL module to generate the CSL code */
var CSL = xdc.useModule('ti.mcu.msp430.csl.CSL');
var USCI_A0 = xdc.useModule('ti.mcu.msp430.csl.communication.USCI_A0');
var Timer0_A3 = xdc.useModule('ti.mcu.msp430.csl.timer.Timer0_A3');
var USCI_B0 = xdc.useModule('ti.mcu.msp430.csl.communication.USCI_B0');
var Timer1_A3 = xdc.useModule('ti.mcu.msp430.csl.timer.Timer1_A3');
CSL.configApiVersion = "1.20.00";
/* these modules should be part of every project */
var BCSplus = xdc.useModule('ti.mcu.msp430.csl.clock.BCSplus');
var WDTplus = xdc.useModule('ti.mcu.msp430.csl.watchdog.WDTplus');
var System = xdc.useModule('ti.mcu.msp430.csl.system.System');
var GPIO = xdc.useModule('ti.mcu.msp430.csl.gpio.GPIO');
var InterruptVectors = xdc.useModule('ti.mcu.msp430.csl.interrupt_vectors.InterruptVectors');
/* set stack and heap sizes as appropriate for MSP430 */
Program.sysStack = 0;
Program.stack = 64;
Program.heap = 0;
Program.argSize = 0;
/* Enable global interrupt */
System.srRegs.SR.GIE = System.srDefs.GIE;
USCI_A0.toggleButtonSPI = false;
USCI_A0.showSelectionPage = false;
USCI_A0.uartOrSpiMode = false;
USCI_A0.spiRegs.UCA0CTL1.UCSSEL = USCI_A0.spiDefs.UCSSEL_2;
USCI_A0.spiRegs.UCA0BR0 = 2;
USCI_A0.spiRegs.UCA0BR1 = 0;
USCI_A0.spiRegs.UCA0CTL0.UCMST = USCI_A0.spiDefs.UCMST;
USCI_A0.usciSpiPin[0] = 1;
GPIO.regs.P1SEL.Bit4 = GPIO.defs.BIT4;
GPIO.regs.P1SEL2.Bit4 = GPIO.defs.BIT4;
USCI_A0.usciSpiPin[1] = 1;
GPIO.regs.P1SEL.Bit1 = GPIO.defs.BIT1;
GPIO.regs.P1SEL2.Bit1 = GPIO.defs.BIT1;
USCI_A0.usciSpiPin[2] = 1;
GPIO.regs.P1SEL.Bit2 = GPIO.defs.BIT2;
GPIO.regs.P1SEL2.Bit2 = GPIO.defs.BIT2;
USCI_A0.standardSPIBitRatesBasicView = USCI_A0.SPIBitRate_6;
USCI_A0.standardSPIBitRatesPowerView = USCI_A0.SPIBitRate_6;
USCI_A0.spiRegs.UCA0CTL0.UCMSB = USCI_A0.spiDefs.UCMSB;
USCI_A0.spiRegs.UCA0CTL0.UCCKPL = USCI_A0.spiDefs.UCCKPL;
USCI_A0.spiRegs.UCA0CTL0.UCMODE = USCI_A0.spiDefs.UCMODE_2;
System.ie2Regs.interruptSource[2].interruptHandler = true;
System.ie2Regs.interruptSource[0].interruptHandler = true;
System.ie2Regs.interruptSource[4].interruptHandler = true;
System.ie2Regs.IE2.UCA0RXIE = System.ie2Defs.UCA0RXIE;
System.ie2Regs.interruptSource[3].interruptHandler = true;
System.ie2Regs.interruptSource[1].interruptHandler = true;
System.ie2Regs.interruptSource[5].interruptHandler = true;
System.ie2Regs.interruptSource[6].interruptHandler = true;
System.ie2Regs.interruptSource[7].interruptHandler = true;
System.ie2Regs.IE2.UCA0TXIE = System.ie2Defs.UCA0TXIE_OFF;
GPIO.regs.P1DIR.Bit0 = GPIO.defs.BIT0;
Timer0_A3.ccr0TimerSelection_BasicView = xdc.module("ti.mcu.msp430.csl.timer.ITimer").CCR0TimerSelection_BasicView_Selection_1;
Timer0_A3.ccr0TimerSelection_PowerUser = xdc.module("ti.mcu.msp430.csl.timer.ITimer").CCR0TimerSelection_PowerUser_Selection_1;
Timer0_A3.ccInputPin[0] = 0;
Timer0_A3.regs.TA0CTL.MC = Timer0_A3.defs.MC_1;
Timer0_A3.regs.TA0CCR0 = 11999;
Timer0_A3.regs.TA0CTL.TASSEL = Timer0_A3.defs.TASSEL_1;
Timer0_A3.inputClockToTimer = 12.0;
Timer0_A3.regs.interruptSource[1].interruptEnable = true;
Timer0_A3.regs.interruptSource[1].interruptHandler = true;
Timer0_A3.regs.TA0CCTL0.CCIE = Timer0_A3.defs.CCIE;
GPIO.regs.P1SEL.Bit5 = GPIO.defs.BIT5;
GPIO.regs.P1SEL2.Bit5 = GPIO.defs.BIT5;
GPIO.regs.P1SEL.Bit6 = GPIO.defs.BIT6;
GPIO.regs.P1SEL2.Bit6 = GPIO.defs.BIT6;
USCI_A0.toggleButtonUART = true;
USCI_A0.uartRegs.UCA0CTL1.UCSSEL = USCI_A0.uartDefs.UCSSEL_2;
USCI_A0.usciUartPin[0] = 1;
USCI_A0.usciUartPin[1] = 1;
USCI_A0.standardBaudRatesBasicViewUART = USCI_A0.BaudRate_4;
USCI_A0.standardBaudRatesPowerViewUART = USCI_A0.BaudRate_4;
USCI_A0.uartRegs.UCA0BR0 = 130;
USCI_A0.uartRegs.UCA0MCTL.UCBRS = USCI_A0.uartDefs.UCBRS_6;
GPIO.regs.P1SEL.Bit7 = GPIO.defs.BIT7;
GPIO.regs.P1SEL2.Bit7 = GPIO.defs.BIT7;
USCI_B0.toggleButtonSPI = true;
USCI_B0.showSelectionPage = false;
USCI_B0.spiRegs.UCB0CTL1.UCSSEL = USCI_B0.spiDefs.UCSSEL_2;
USCI_B0.usciSpiPin[0] = 1;
USCI_B0.usciSpiPin[1] = 1;
USCI_B0.usciSpiPin[2] = 1;
USCI_B0.spiRegs.UCB0CTL0.UCMST = USCI_B0.spiDefs.UCMST;
USCI_B0.standardSPIBitRatesBasicView = USCI_B0.SPIBitRate_6;
USCI_B0.standardSPIBitRatesPowerView = USCI_B0.SPIBitRate_6;
USCI_B0.spiRegs.UCB0CTL0.UCMSB = USCI_B0.spiDefs.UCMSB;
USCI_B0.spiRegs.UCB0BR0 = 32;
USCI_B0.spiRegs.UCB0CTL0.UCMODE = USCI_B0.spiDefs.UCMODE_0;
USCI_B0.UCMODE_SYNC = USCI_B0.UCMODE_0;
USCI_B0.usciSpiPin[3] = 0;
USCI_B0.spiRegs.UCB0CTL0.UCCKPL = USCI_B0.spiDefs.UCCKPL;
GPIO.regs.P2DIR.Bit5 = GPIO.defs.BIT5;
GPIO.regs.P2OUT.Bit5 = GPIO.defs.BIT5;
USCI_B0.spiRegs.UCB0CTL0.UC7BIT = USCI_B0.spiDefs.UC7BIT_OFF;
USCI_A0.uartRegs.UCA0BR1 = 6;
BCSplus.userInputDCO = 16000.0;
CSL.device.vcc = 2.7;
Timer1_A3.ccr0TimerSelection_BasicView = xdc.module("ti.mcu.msp430.csl.timer.ITimer").CCR0TimerSelection_BasicView_Selection_1;
Timer1_A3.ccr0TimerSelection_PowerUser = xdc.module("ti.mcu.msp430.csl.timer.ITimer").CCR0TimerSelection_PowerUser_Selection_1;
Timer1_A3.ccInputPin[0] = 0;
Timer1_A3.regs.TA1CTL.MC = Timer1_A3.defs.MC_1;
Timer1_A3.regs.TA1CCR0 = 59999;
Timer1_A3.regs.TA1CTL.TASSEL = Timer1_A3.defs.TASSEL_1;
Timer1_A3.inputClockToTimer = 12.0;
Timer1_A3.regs.TA1CTL.ID = Timer1_A3.defs.ID_1;
Timer1_A3.regs.interruptSource[1].interruptEnable = true;
Timer1_A3.regs.interruptSource[1].interruptHandler = true;
Timer1_A3.regs.TA1CCTL0.CCIE = Timer1_A3.defs.CCIE;