/** * 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 "MSPM0L130X" --package "VSSOP-20(DGS20)" --part "Default" --product "mspm0_sdk@1.20.00.05" * @versions {"tool":"1.18.0+3266"} */ /** * Import the modules used in this configuration. */ const ADC12 = scripting.addModule("/ti/driverlib/ADC12", {}, false); const ADC121 = ADC12.addInstance(); const Board = scripting.addModule("/ti/driverlib/Board"); const GPIO = scripting.addModule("/ti/driverlib/GPIO", {}, false); const GPIO1 = GPIO.addInstance(); const PWM = scripting.addModule("/ti/driverlib/PWM", {}, false); const PWM1 = PWM.addInstance(); const SYSCTL = scripting.addModule("/ti/driverlib/SYSCTL"); const TIMER = scripting.addModule("/ti/driverlib/TIMER", {}, false); const TIMER1 = TIMER.addInstance(); const TIMER2 = TIMER.addInstance(); const UART = scripting.addModule("/ti/driverlib/UART", {}, false); const UART1 = UART.addInstance(); /** * Write custom configuration values to the imported modules. */ const gate6 = system.clockTree["MFCLKGATE"]; gate6.enable = true; const oscillator2 = system.clockTree["SYSOSC"]; oscillator2.frequencySelect = 4; ADC121.$name = "ADC12_0"; ADC121.adcMem1chansel = "DL_ADC12_INPUT_CHAN_1"; ADC121.adcMem2chansel = "DL_ADC12_INPUT_CHAN_2"; ADC121.adcMem3chansel = "DL_ADC12_INPUT_CHAN_3"; ADC121.adcMem0_name = "AI_VBAT_MON"; ADC121.adcMem1_name = "AI_MOTOR_P"; ADC121.adcMem2_name = "AI_MOTOR_N"; ADC121.adcMem3_name = "AI_MOTOR_I"; ADC121.endAdd = 3; ADC121.sampleMode = "DL_ADC12_SAMPLING_SOURCE_MANUAL"; ADC121.interruptPriority = "2"; ADC121.adcMem0avgen = true; ADC121.hwNumerator = "DL_ADC12_HW_AVG_NUM_ACC_8"; ADC121.hwDenominator = "DL_ADC12_HW_AVG_DEN_DIV_BY_8"; ADC121.peripheral.$assign = "ADC0"; ADC121.peripheral.adcPin0.$assign = "PA27"; ADC121.adcPin0Config.$name = "ti_driverlib_gpio_GPIOPinGeneric0"; Board.genPeriphPinFile = true; Board.peripheral.$assign = "DEBUGSS"; Board.genFileMod.$name = "ti_driverlib_BoardPins0"; GPIO1.$name = "GPIO_GRP_0"; GPIO1.associatedPins.create(6); GPIO1.associatedPins[0].$name = "DO_MOTOR_DIR"; GPIO1.associatedPins[0].pin.$assign = "PA6"; GPIO1.associatedPins[1].$name = "DO_MOTOR_EN"; GPIO1.associatedPins[1].pin.$assign = "PA22"; GPIO1.associatedPins[2].$name = "DI_ST_MOTOR"; GPIO1.associatedPins[2].direction = "INPUT"; GPIO1.associatedPins[2].pin.$assign = "PA2"; GPIO1.associatedPins[3].$name = "DI_SW_BWD"; GPIO1.associatedPins[3].direction = "INPUT"; GPIO1.associatedPins[3].interruptPriority = "1"; GPIO1.associatedPins[3].interruptEn = true; GPIO1.associatedPins[3].polarity = "RISE"; GPIO1.associatedPins[3].ioStructure = "OD"; GPIO1.associatedPins[3].pin.$assign = "PA0"; GPIO1.associatedPins[4].$name = "VBAT_SW_EN"; GPIO1.associatedPins[4].pin.$assign = "PA4"; GPIO1.associatedPins[5].$name = "VBAT_MON_EN"; GPIO1.associatedPins[5].pin.$assign = "PA23"; PWM1.$name = "DO_PWM_MOTOR"; PWM1.clockSource = "MFCLK"; PWM1.timerCount = 200; PWM1.ccIndex = [0]; PWM1.peripheral.$assign = "TIMG0"; PWM1.peripheral.ccp0Pin.$assign = "PA16"; PWM1.PWM_CHANNEL_0.$name = "ti_driverlib_pwm_PWMTimerCC0"; PWM1.ccp0PinConfig.direction = scripting.forceWrite("OUTPUT"); PWM1.ccp0PinConfig.hideOutputInversion = scripting.forceWrite(false); PWM1.ccp0PinConfig.onlyInternalResistor = scripting.forceWrite(false); PWM1.ccp0PinConfig.passedPeripheralType = scripting.forceWrite("Digital"); PWM1.ccp0PinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric3"; SYSCTL.clockTreeEn = true; SYSCTL.powerPolicy = "STANDBY0"; TIMER1.$name = "TIMER_WAIT"; TIMER1.timerClkSrc = "MFCLK"; TIMER1.timerClkDiv = 8; TIMER1.timerClkPrescale = 50; TIMER1.timerPeriod = "300 ms"; TIMER1.peripheral.$assign = "TIMG2"; TIMER2.interrupts = ["ZERO"]; TIMER2.timerClkSrc = "LFCLK"; TIMER2.$name = "TIMER_WAKE_UP"; TIMER2.timerPeriod = "99 ms"; TIMER2.peripheral.$assign = "TIMG1"; UART1.$name = "UART_0"; UART1.targetBaudRate = 115200; UART1.enabledInterrupts = ["RX","RXD_NEG_EDGE","RXD_POS_EDGE"]; UART1.uartClkSrc = "MFCLK"; UART1.peripheral.$assign = "UART0"; UART1.peripheral.rxPin.$assign = "PA18"; UART1.peripheral.txPin.$assign = "PA17/OPA1.IN0-"; UART1.txPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric1"; UART1.rxPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric2"; /** * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future * version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to * re-solve from scratch. */ Board.peripheral.swclkPin.$suggestSolution = "PA20"; Board.peripheral.swdioPin.$suggestSolution = "PA19";