-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cfg
83 lines (79 loc) · 3.93 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
/**
* @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');
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;
BCSplus.userInputDCO = 16000.0;
BCSplus.regs.BCSCTL2.DIVS = BCSplus.defs.DIVS_0;
BCSplus.regs.LFXT1CLKHz = 32768.0;
BCSplus.regs.BCSCTL3.LFXT1S = BCSplus.defs.LFXT1S_0;
USCI_A0.toggleButtonUART = true;
USCI_A0.showSelectionPage = false;
USCI_A0.uartRegs.UCA0CTL1.UCSSEL = USCI_A0.uartDefs.UCSSEL_2;
USCI_A0.usciUartPin[0] = 1;
GPIO.regs.P1SEL.Bit1 = GPIO.defs.BIT1;
GPIO.regs.P1SEL2.Bit1 = GPIO.defs.BIT1;
USCI_A0.usciUartPin[1] = 1;
GPIO.regs.P1SEL.Bit2 = GPIO.defs.BIT2;
GPIO.regs.P1SEL2.Bit2 = GPIO.defs.BIT2;
USCI_A0.standardBaudRatesPowerViewUART = USCI_A0.BaudRate_9;
USCI_A0.standardBaudRatesBasicViewUART = USCI_A0.BaudRate_9;
USCI_A0.uartRegs.UCA0BR0 = 138;
USCI_A0.uartRegs.UCA0MCTL.UCBRS = USCI_A0.uartDefs.UCBRS_7;
System.ie2Regs.interruptSource[0].interruptHandler = true;
System.ie2Regs.interruptSource[2].interruptHandler = true;
System.ie2Regs.interruptSource[4].interruptHandler = true;
var USCI_B0 = xdc.module('ti.mcu.msp430.csl.communication.USCI_B0');
USCI_B0.i2cRegs.interruptSource[0].interruptHandler = true;
USCI_B0.i2cRegs.interruptSource[1].interruptHandler = true;
USCI_B0.i2cRegs.interruptSource[2].interruptHandler = true;
USCI_B0.i2cRegs.interruptSource[3].interruptHandler = true;
System.ie2Regs.IE2.UCA0RXIE = System.ie2Defs.UCA0RXIE;
System.ie2Regs.IE2.UCA0TXIE = System.ie2Defs.UCA0TXIE;
System.ie2Regs.interruptSource[1].interruptHandler = true;
System.ie2Regs.interruptSource[3].interruptHandler = true;
System.ie2Regs.interruptSource[5].interruptHandler = true;
System.ie2Regs.interruptSource[6].interruptHandler = true;
System.ie2Regs.interruptSource[7].interruptHandler = true;
CSL.device.vcc = 3.3;
Timer0_A3.regs.TA0CTL.TASSEL = Timer0_A3.defs.TASSEL_2;
Timer0_A3.inputClockToTimer = 16000.0;
Timer0_A3.regs.TA0CTL.MC = Timer0_A3.defs.MC_1;
Timer0_A3.ccr0TimerSelection_PowerUser = xdc.module("ti.mcu.msp430.csl.timer.ITimer").CCR0TimerSelection_PowerUser_Selection_1;
Timer0_A3.ccInputPin[0] = 0;
Timer0_A3.ccr0TimerSelection_BasicView = xdc.module("ti.mcu.msp430.csl.timer.ITimer").CCR0TimerSelection_BasicView_Selection_1;
Timer0_A3.regs.TA0CCR0 = 26999;
Timer0_A3.ccrOutputPin[0] = 0;
var Timer1_A3 = xdc.module('ti.mcu.msp430.csl.timer.Timer1_A3');
Timer1_A3.regs.interruptSource[1].interruptHandler = true;
Timer0_A3.ccrXTimerSelection_PowerUser[1] = xdc.module("ti.mcu.msp430.csl.timer.ITimer").CCRxTimerSelection_PowerUser_Selection_1;
Timer0_A3.ccrXTimerSelection_BasicView[1] = xdc.module("ti.mcu.msp430.csl.timer.ITimer").CCRxTimerSelection_BasicView_Selection_2;
Timer0_A3.regs.TA0CCR1 = 8999;
Timer0_A3.regs.TA0CCTL1.CAP = Timer0_A3.defs.CAP_OFF;
Timer0_A3.regs.TA0CCTL1.SCS = Timer0_A3.defs.SCS_OFF;
Timer0_A3.ccrOutputPin[2] = 0;
Timer0_A3.ccInputPin[2] = 0;
Timer0_A3.ccrOutputPin[1] = 2;
GPIO.regs.P1DIR.Bit6 = GPIO.defs.BIT6;
GPIO.regs.P1SEL.Bit6 = GPIO.defs.BIT6;
Timer0_A3.regs.TA0CCTL1.OUTMOD = Timer0_A3.defs.OUTMOD_7;
Timer0_A3.regs.interruptSource[1].interruptHandler = true;
Timer0_A3.regs.interruptSource[1].interruptEnable = true;
Timer0_A3.regs.TA0CCTL0.CCIE = Timer0_A3.defs.CCIE;
Timer0_A3.regs.TA0CTL.ID = Timer0_A3.defs.ID_3;