/* need to use the CSL module to generate the CSL code */ var CSL = xdc.useModule('ti.mcu.msp430.csl.CSL'); var USCI_B0 = xdc.useModule('ti.mcu.msp430.csl.communication.USCI_B0'); var Timer0_A3 = xdc.useModule('ti.mcu.msp430.csl.timer.Timer0_A3'); CSL.configApiVersion = "1.00.00"; /* these modules should be part of every project */ var WDTplus = xdc.useModule('ti.mcu.msp430.csl.watchdog.WDTplus'); var GPIO = xdc.useModule('ti.mcu.msp430.csl.gpio.GPIO'); var BCSplus = xdc.useModule('ti.mcu.msp430.csl.clock.BCSplus'); var System = xdc.useModule('ti.mcu.msp430.csl.system.System'); /* set stack and heap sizes as appropriate for MSP430 */ Program.sysStack = 0; Program.stack = 64; Program.heap = 0; Program.argSize = 0; GPIO.regs.P1SEL.Bit7 = GPIO.defs.BIT7; GPIO.regs.P1SEL2.Bit7 = GPIO.defs.BIT7; GPIO.regs.P1SEL.Bit5 = GPIO.defs.BIT5; GPIO.regs.P1SEL2.Bit5 = GPIO.defs.BIT5; GPIO.regs.P2DIR.Bit0 = GPIO.defs.BIT0; CSL.device.vcc = 3.6; USCI_B0.toggleButtonSPI = true; USCI_B0.showSelectionPage = false; USCI_B0.spiRegs.UCB0CTL1.UCSSEL = USCI_B0.spiDefs.UCSSEL_2; USCI_B0.spiRegs.UCB0CTL0.UCMST = USCI_B0.spiDefs.UCMST; USCI_B0.usciSpiPin[0] = 1; USCI_B0.usciSpiPin[2] = 1; USCI_B0.spiRegs.UCB0CTL0.UCCKPH = USCI_B0.spiDefs.UCCKPH_OFF; USCI_B0.spiRegs.UCB0CTL0.UCCKPL = USCI_B0.spiDefs.UCCKPL; GPIO.regs.P2DIR.Bit1 = GPIO.defs.BIT1; USCI_B0.spiRegs.UCB0CTL0.UCMSB = USCI_B0.spiDefs.UCMSB; USCI_B0.standardSPIBitRatesPowerView = USCI_B0.SPIBitRate_6; USCI_B0.standardSPIBitRatesBasicView = USCI_B0.SPIBitRate_6; USCI_B0.spiRegs.UCB0BR0 = 32; BCSplus.userInputDCO = 16000.0; BCSplus.regs.LFXT1CLKHz = 32768.0; BCSplus.regs.BCSCTL3.LFXT1S = BCSplus.defs.LFXT1S_0; GPIO.regs.P2SEL.Bit6 = GPIO.defs.BIT6; GPIO.regs.P2SEL.Bit7 = GPIO.defs.BIT7; USCI_B0.spiRegs.UCB0BR1 = 0; USCI_B0.enableUserInputCustomBaudRate = false; BCSplus.regs.BCSCTL3.XCAP = BCSplus.defs.XCAP_3; BCSplus.regs.BCSCTL2.SELM = BCSplus.defs.SELM_0; BCSplus.regs.BCSCTL2.SELS = BCSplus.defs.SELS_OFF; System.srRegs.SR.SCG0 = System.srDefs.SCG0_OFF; BCSplus.regs.BCSCTL2.DIVM = BCSplus.defs.DIVM_0; USCI_B0.usciSpiPin[3] = 0; GPIO.regs.P1SEL.Bit4 = GPIO.defs.BIT4_OFF; GPIO.regs.P1SEL2.Bit4 = GPIO.defs.BIT4_OFF; GPIO.regs.P1DIR.Bit0 = GPIO.defs.BIT0_OFF; GPIO.regs.P1DIR.Bit6 = GPIO.defs.BIT6_OFF; USCI_B0.txIntHandlerOperatingModeOnExit = USCI_B0.KEEP; GPIO.regs.P2IFG.Bit3 = GPIO.defs.BIT3_OFF; GPIO.regs.P2IE.Bit3 = GPIO.defs.BIT3; GPIO.port2IntHandler = "Port2ISRHandler"; Timer0_A3.regs.TA0CTL.TASSEL = Timer0_A3.defs.TASSEL_2; Timer0_A3.inputClockToTimer = 16000.0; Timer0_A3.regs.TA0CTL.ID = Timer0_A3.defs.ID_3; 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_3; Timer0_A3.regs.TA0CCR0 = 101; Timer0_A3.regs.TA0CCTL0.CCIE = Timer0_A3.defs.CCIE; Timer0_A3.ccr0InterruptHandler = "TimerA3_50us"; WDTplus.regs.WDTCTL.WDTHOLD = WDTplus.defs.WDTHOLD_OFF; WDTplus.regs.WDTCTL.WDTTMSEL = WDTplus.defs.WDTTMSEL; WDTplus.regs.WDTCTL.WDTSSEL = WDTplus.defs.WDTSSEL; System.ie1Regs.IE1.WDTIE = System.ie1Defs.WDTIE; WDTplus.wdtHandler = "WDTISRHandler"; WDTplus.wdtOperatingModeOnExit = WDTplus.KEEP; WDTplus.regs.WDTCTL.WDTIS0 = WDTplus.defs.WDTIS0;