/** * These arguments were used when this file was generated. They will be automatically applied on subsequent loads * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments. * @cliArgs --device "MSPM0G350X" --package "LQFP-48(PT)" --part "Default" --product "mspm0_sdk@2.01.00.03" * @versions {"tool":"1.19.0+3426"} */ /** * Import the modules used in this configuration. */ const CAPTURE = scripting.addModule("/ti/driverlib/CAPTURE", {}, false); const CAPTURE1 = CAPTURE.addInstance(); const GPIO = scripting.addModule("/ti/driverlib/GPIO", {}, false); const GPIO1 = GPIO.addInstance(); const GPIO2 = GPIO.addInstance(); const I2C = scripting.addModule("/ti/driverlib/I2C", {}, false); const I2C1 = I2C.addInstance(); const MCAN = scripting.addModule("/ti/driverlib/MCAN", {}, false); const MCAN1 = MCAN.addInstance(); const PWM = scripting.addModule("/ti/driverlib/PWM", {}, false); const PWM1 = PWM.addInstance(); const SPI = scripting.addModule("/ti/driverlib/SPI", {}, false); const SPI1 = SPI.addInstance(); const SYSCTL = scripting.addModule("/ti/driverlib/SYSCTL"); const TIMER = scripting.addModule("/ti/driverlib/TIMER", {}, false); const TIMER1 = TIMER.addInstance(); const UART = scripting.addModule("/ti/driverlib/UART", {}, false); const UART1 = UART.addInstance(); const ProjectConfig = scripting.addModule("/ti/project_config/ProjectConfig"); /** * Write custom configuration values to the imported modules. */ const divider2 = system.clockTree["HFCLK4MFPCLKDIV"]; divider2.divideValue = 6; const divider7 = system.clockTree["PLL_PDIV"]; divider7.divideValue = 4; const gate7 = system.clockTree["MFCLKGATE"]; gate7.enable = true; const gate8 = system.clockTree["MFPCLKGATE"]; gate8.enable = true; const multiplier2 = system.clockTree["PLL_QDIV"]; multiplier2.multiplyValue = 10; const mux2 = system.clockTree["CANCLKMUX"]; mux2.inputSelect = "CANCLKMUX_PLLCLK1_OUT"; const mux4 = system.clockTree["EXHFMUX"]; mux4.inputSelect = "EXHFMUX_XTAL"; const pinFunction3 = system.clockTree["HFCLKEXT"]; pinFunction3.inputFreq = 24; const pinFunction4 = system.clockTree["HFXT"]; pinFunction4.inputFreq = 24; pinFunction4.HFXTStartup = 10; pinFunction4.HFCLKMonitor = true; CAPTURE1.$name = "CAPTURE_0"; CAPTURE1.timerClkPrescale = 32; CAPTURE1.timerPeriod = "64.0 ms"; CAPTURE1.captMode = "COMBINED"; CAPTURE1.interrupts = ["CC1_DN","ZERO"]; CAPTURE1.peripheral.$assign = "TIMA0"; CAPTURE1.peripheral.ccp0Pin.$assign = "PB8"; CAPTURE1.ccp0PinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric4"; const Board = scripting.addModule("/ti/driverlib/Board", {}, false); Board.peripheral.$assign = "DEBUGSS"; Board.peripheral.swclkPin.$assign = "PA20"; Board.peripheral.swdioPin.$assign = "PA19"; GPIO1.$name = "GPIO_SPI_CS"; GPIO1.port = "PORTB"; GPIO1.associatedPins[0].$name = "SPI_CS"; GPIO1.associatedPins[0].initialValue = "SET"; GPIO1.associatedPins[0].ioStructure = "SD"; GPIO1.associatedPins[0].assignedPin = "20"; GPIO1.associatedPins[0].assignedPortSegment = "Upper"; GPIO1.associatedPins[0].pin.$assign = "PB20"; GPIO2.$name = "GPIO_CAN_EN"; GPIO2.port = "PORTB"; GPIO2.associatedPins[0].$name = "CAN_EN"; GPIO2.associatedPins[0].ioStructure = "SD"; GPIO2.associatedPins[0].assignedPortSegment = "Lower"; GPIO2.associatedPins[0].assignedPin = "2"; GPIO2.associatedPins[0].initialValue = "SET"; GPIO2.associatedPins[0].pin.$assign = "PB2"; I2C1.$name = "I2C_0"; I2C1.basicEnableController = true; I2C1.advAnalogGlitchFilter = "DISABLED"; I2C1.advControllerTXFIFOTRIG = "BYTES_1"; I2C1.intController = ["ARBITRATION_LOST","NACK","RXFIFO_TRIGGER","RX_DONE","TX_DONE"]; I2C1.peripheral.$assign = "I2C0"; I2C1.peripheral.sdaPin.$assign = "PA10"; I2C1.peripheral.sclPin.$assign = "PA11"; I2C1.sdaPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric7"; I2C1.sclPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric8"; MCAN1.$name = "MCAN0"; MCAN1.fdMode = false; MCAN1.stdFiltElem = "001"; MCAN1.stdFiltType = "00"; MCAN1.stdFiltID2 = 2047; MCAN1.txBufNum = 10; MCAN1.txFIFOSize = 10; MCAN1.txBufElemSize = "DL_MCAN_ELEM_SIZE_8BYTES"; MCAN1.txEventFIFOSize = 10; MCAN1.txEventFIFOWaterMark = 0; MCAN1.txEventFIFOStartAddr = 640; MCAN1.rxBufElemSize = "DL_MCAN_ELEM_SIZE_8BYTES"; MCAN1.rxFIFO0ElemSize = "DL_MCAN_ELEM_SIZE_8BYTES"; MCAN1.rxFIFO1ElemSize = "DL_MCAN_ELEM_SIZE_8BYTES"; MCAN1.enableInterrupt = true; MCAN1.interruptFlags = ["DL_MCAN_INTERRUPT_ARA","DL_MCAN_INTERRUPT_BEU","DL_MCAN_INTERRUPT_BO","DL_MCAN_INTERRUPT_DRX","DL_MCAN_INTERRUPT_ELO","DL_MCAN_INTERRUPT_EP","DL_MCAN_INTERRUPT_EW","DL_MCAN_INTERRUPT_MRAF","DL_MCAN_INTERRUPT_PEA","DL_MCAN_INTERRUPT_PED","DL_MCAN_INTERRUPT_RF0N","DL_MCAN_INTERRUPT_TC","DL_MCAN_INTERRUPT_TEFN","DL_MCAN_INTERRUPT_TOO","DL_MCAN_INTERRUPT_TSW","DL_MCAN_INTERRUPT_WDI"]; MCAN1.interruptLine = ["DL_MCAN_INTR_LINE_NUM_1"]; MCAN1.interruptLine1Flag = ["DL_MCAN_INTR_MASK_ALL"]; MCAN1.m0interrupts = ["DL_MCAN_MSP_INTERRUPT_LINE1"]; MCAN1.rxFIFO0size = 10; MCAN1.rxFIFO0waterMark = 0; MCAN1.rxFIFO1size = 10; MCAN1.rxFIFO1waterMark = 10; MCAN1.txStartAddr = 20; MCAN1.peripheral.$assign = "CANFD0"; MCAN1.peripheral.rxPin.$assign = "PA27"; MCAN1.peripheral.txPin.$assign = "PA26"; MCAN1.txPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric0"; MCAN1.rxPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric1"; PWM1.$name = "PWM_0"; PWM1.clockPrescale = 23; PWM1.ccIndex = [0]; PWM1.peripheral.$assign = "TIMG7"; PWM1.peripheral.ccp0Pin.$assign = "PA28"; PWM1.PWM_CHANNEL_0.$name = "ti_driverlib_pwm_PWMTimerCC0"; PWM1.PWM_CHANNEL_0.dutyCycle = 50; PWM1.ccp0PinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric3"; SPI1.$name = "SPI_0"; SPI1.frameFormat = "MOTO3"; SPI1.targetBitRate = 1000000; SPI1.enabledInterrupts = ["PARITY_ERROR","RX","RX_FULL","RX_OVERFLOW","RX_TIMEOUT","TX_UNDERFLOW"]; SPI1.rxFifoThreshold = "DL_SPI_RX_FIFO_LEVEL_ONE_FRAME"; SPI1.txFifoThreshold = "DL_SPI_TX_FIFO_LEVEL_EMPTY"; SPI1.polarity = "1"; SPI1.phase = "1"; SPI1.peripheral.$assign = "SPI0"; SPI1.peripheral.sclkPin.$assign = "PB18"; SPI1.peripheral.mosiPin.$assign = "PB17"; SPI1.peripheral.misoPin.$assign = "PB19"; SPI1.sclkPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric9"; SPI1.mosiPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric10"; SPI1.misoPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric11"; SYSCTL.forceDefaultClkConfig = true; SYSCTL.clockTreeEn = true; SYSCTL.HFCLK_Freq = 24000000; SYSCTL.HFCLKSource = "HFXT"; SYSCTL.validateClkStatus = true; SYSCTL.HFXTStartup = 10; SYSCTL.HFCLKMonitor = true; SYSCTL.CANCLKSource = "SYSPLLCLK1"; TIMER1.$name = "TIMER_0"; TIMER1.timerClkSrc = "LFCLK"; TIMER1.timerClkPrescale = 33; TIMER1.timerMode = "PERIODIC"; TIMER1.timerPeriod = "500 ms"; TIMER1.interrupts = ["ZERO"]; TIMER1.peripheral.$assign = "TIMG0"; UART1.$name = "UART_1"; UART1.enabledInterrupts = ["BREAK_ERROR","FRAMING_ERROR","NOISE_ERROR","OVERRUN_ERROR","PARITY_ERROR","RX","RX_TIMEOUT_ERROR"]; UART1.peripheral.$assign = "UART1"; UART1.peripheral.rxPin.$assign = "PA9"; UART1.peripheral.txPin.$assign = "PA8"; UART1.txPinConfig.direction = scripting.forceWrite("OUTPUT"); UART1.txPinConfig.hideOutputInversion = scripting.forceWrite(false); UART1.txPinConfig.onlyInternalResistor = scripting.forceWrite(false); UART1.txPinConfig.passedPeripheralType = scripting.forceWrite("Digital"); UART1.txPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric2"; UART1.rxPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric12"; UART1.rxPinConfig.hideOutputInversion = scripting.forceWrite(false); UART1.rxPinConfig.onlyInternalResistor = scripting.forceWrite(false); UART1.rxPinConfig.passedPeripheralType = scripting.forceWrite("Digital"); ProjectConfig.deviceSpin = "MSPM0G3507"; scripting.suppress("Migrating requires going through the Switch Board or Device menu in the Device View section\\.", ProjectConfig, "deviceSpin");