/** * 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 "F280015x" --part "F280015x_32RHB" --package "32RHB" --context "system" --product "C2000WARE@6.00.01.00" * @v2CliArgs --device "TMS320F2800156-Q1" --package "32RHB" --context "system" --product "C2000WARE@6.00.01.00" * @versions {"tool":"1.26.0+4407"} */ /** * Import the modules used in this configuration. */ const adc = scripting.addModule("/driverlib/adc.js", {}, false); const adc1 = adc.addInstance(); const analog = scripting.addModule("/driverlib/analog.js", {}, false); const analog1 = analog.addInstance(); const asysctl = scripting.addModule("/driverlib/asysctl.js"); const can = scripting.addModule("/driverlib/can.js", {}, false); const can1 = can.addInstance(); const cmpss = scripting.addModule("/driverlib/cmpss.js", {}, false); const cmpss1 = cmpss.addInstance(); const cputimer = scripting.addModule("/driverlib/cputimer.js", {}, false); const cputimer1 = cputimer.addInstance(); const cputimer2 = cputimer.addInstance(); const epwm = scripting.addModule("/driverlib/epwm.js", {}, false); const epwm1 = epwm.addInstance(); const epwm2 = epwm.addInstance(); const gpio = scripting.addModule("/driverlib/gpio.js", {}, false); const gpio1 = gpio.addInstance(); const gpio2 = gpio.addInstance(); const gpio3 = gpio.addInstance(); const gpio4 = gpio.addInstance(); const gpio5 = gpio.addInstance(); const gpio6 = gpio.addInstance(); const i2c = scripting.addModule("/driverlib/i2c.js", {}, false); const i2c1 = i2c.addInstance(); const inputxbar_input = scripting.addModule("/driverlib/inputxbar_input.js", {}, false); const inputxbar_input1 = inputxbar_input.addInstance(); const inputxbar_input2 = inputxbar_input.addInstance(); /** * Write custom configuration values to the imported modules. */ adc1.adcBase = "ADCC_BASE"; adc1.$name = "AnalogMeasurement"; adc1.adcClockPrescaler = "ADC_CLK_DIV_6_0"; can1.enableAutoBusOn = true; can1.bitRate = "250000"; can1.AutoBusOnTimer = 1000000; can1.enableInterrupt = true; can1.registerInterrupts = true; can1.interruptFlags = ["CAN_INT_ERROR","CAN_INT_IE0","CAN_INT_STATUS"]; can1.interruptLine = ["CAN_GLOBAL_INT_CANINT0"]; can1.$name = "CANCH0"; can1.useCase = "CUSTOM"; can1.useInterfacePins = ["CAN@_RX","CAN@_TX"]; can1.msgObjsUsed = [1,2,3,4,5]; can1.can0Int.enableInterrupt = true; can1.msgObj1.$name = "msgObj0"; can1.msgObj1.msgID = 806; can1.msgObj1.flags = ["CAN_MSG_OBJ_RX_INT_ENABLE"]; can1.msgObj2.$name = "msgObj1"; can1.msgObj2.msgID = 954; can1.msgObj2.msgType = "CAN_MSG_OBJ_TYPE_TX"; can1.msgObj2.msgLen = 8; can1.msgObj3.$name = "msgObj2"; can1.msgObj3.msgID = 678; can1.msgObj3.flags = ["CAN_MSG_OBJ_RX_INT_ENABLE"]; can1.msgObj4.$name = "msgObj3"; can1.msgObj4.flags = ["CAN_MSG_OBJ_RX_INT_ENABLE"]; can1.msgObj5.$name = "msgObj4"; can1.msgObj5.msgID = 962; can1.msgObj5.msgType = "CAN_MSG_OBJ_TYPE_TX"; can1.msgObj5.msgLen = 6; const mux5 = system.clockTree["XTAL_OR_X1"]; mux5.inputSelect = "X1"; cmpss1.$name = "DAC_Vref"; cmpss1.enableModule = true; cmpss1.asysCMPLPMXSELValue = "1"; cmpss1.asysCMPHPMXSELValue = "1"; adc1.analog = analog1; analog1.$name = "ADC_Msrmt"; analog1.useCase = "CUSTOM"; analog1.useInterfacePins = ["A0/C15/CMP1_DACL, A1","A11/C0, A5/C2"]; cmpss1.analog = analog1; cputimer1.$name = "Tick1ms"; cputimer1.enableInterrupt = true; cputimer1.registerInterrupts = true; cputimer1.startTimer = true; cputimer1.timerPeriod = 120000; cputimer1.timerInt.enableInterrupt = true; cputimer1.timerInt.interruptHandler = "Tick1ms_ISR"; cputimer2.enableInterrupt = true; cputimer2.registerInterrupts = true; cputimer2.startTimer = true; cputimer2.cputimerBase = "CPUTIMER1_BASE"; cputimer2.$name = "Tick2ms"; cputimer2.timerPeriod = 60000; cputimer2.timerInt.enableInterrupt = true; cputimer2.timerInt.interruptHandler = "Tick2ms_ISR"; epwm1.$name = "DRV1_IN3_IN4_PWM"; epwm1.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN"; epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_shadowMode = true; epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH"; epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW"; epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_HIGH"; epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_DOWN_CMPB = "EPWM_AQ_OUTPUT_LOW"; epwm1.epwmTimebase_period = 3000; epwm1.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_1"; epwm1.epwmCounterCompare_cmpB = 1500; epwm1.epwmCounterCompare_cmpA = 1500; epwm1.epwm.epwm_aPin.$assign = "GPIO0"; epwm1.epwm.epwm_bPin.$assign = "GPIO1"; epwm2.$name = "DRV1_IN1_IN2_PWM"; epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_B_shadowMode = true; epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_shadowMode = true; epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_DOWN_CMPB = "EPWM_AQ_OUTPUT_LOW"; epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW"; epwm2.epwmActionQualifier_t2Source = "EPWM_AQ_TRIGGER_EVENT_TRIG_DCB_1"; epwm2.epwmTimebase_counterMode = "EPWM_COUNTER_MODE_UP_DOWN"; epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_LOW"; epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPB = "EPWM_AQ_OUTPUT_LOW"; epwm2.epwmTimebase_hsClockDiv = "EPWM_HSCLOCK_DIVIDER_1"; epwm2.epwmTimebase_period = 3000; epwm2.epwmCounterCompare_cmpA = 1500; epwm2.epwmCounterCompare_cmpB = 1500; epwm2.epwm.$assign = "EPWM7"; epwm2.epwm.epwm_aPin.$assign = "A16/C16, GPIO28"; epwm2.epwm.epwm_bPin.$assign = "GPIO29"; gpio1.direction = "GPIO_DIR_MODE_OUT"; gpio1.writeInitialValue = true; gpio1.initialValue = 1; gpio1.$name = "DbgLEDandDBMSpin0"; gpio1.gpioPin.$assign = "GPIO32"; gpio1.gpioPin["GPIO#"].$assign = "GPIO32"; gpio2.writeInitialValue = true; gpio2.$name = "CANnSleep"; gpio2.direction = "GPIO_DIR_MODE_OUT"; gpio2.gpioPin.$assign = "GPIO227"; gpio3.$name = "CANTrnsvrStatus"; gpio3.gpioPin.$assign = "GPIO11"; gpio4.$name = "DBMSpin1"; gpio4.writeInitialValue = true; gpio4.initialValue = 1; gpio4.gpioPin.$assign = "GPIO24"; gpio5.$name = "MtrDrvnFault"; gpio5.useInterrupt = true; gpio5.gpioPin.$assign = "GPIO5"; gpio5.gpioPin["GPIO#"].$assign = "GPIO5"; gpio5.xint.enableInt = true; gpio5.xint.registerInterrupts = true; gpio5.xint.xInt.enableInterrupt = true; gpio6.$name = "KSICtrl"; gpio6.direction = "GPIO_DIR_MODE_OUT"; gpio6.writeInitialValue = true; gpio6.gpioPin.$assign = "GPIO3"; gpio6.gpioPin["GPIO#"].$assign = "GPIO3"; i2c1.bitCount = "I2C_BITCOUNT_8"; i2c1.dataCount = 2; i2c1.emulationMode = "I2C_EMULATION_FREE_RUN"; i2c1.duty = "I2C_DUTYCYCLE_50"; i2c1.enabledFIFOInterrupts = ["I2C_INT_RXFF","I2C_INT_TXFF"]; i2c1.$name = "myI2CB"; i2c1.registerInterrupts = true; i2c1.enabledInterrupts = ["I2C_INT_ADDR_TARGET","I2C_INT_ARB_LOST","I2C_INT_NO_ACK","I2C_INT_REG_ACCESS_RDY","I2C_INT_RX_DATA_RDY","I2C_INT_STOP_CONDITION","I2C_INT_TX_DATA_RDY"]; i2c1.txFifo = "I2C_FIFO_TX7"; i2c1.rxFifo = "I2C_FIFO_RX7"; i2c1.targetAddress = 0x35; i2c1.ownAddress = 0x1; i2c1.useFifo = false; i2c1.sdaQual.padConfig = "STD"; i2c1.sclQual.padConfig = "STD"; i2c1.i2cInt.enableInterrupt = false; inputxbar_input1.$name = "myINPUTXBARINPUTCANnSleep"; inputxbar_input1.inputxbarGpio = "GPIO227"; inputxbar_input1.inputxbarInput = "XBAR_INPUT13"; gpio5.xint.inputxbar = inputxbar_input2; inputxbar_input2.$name = "INT_MtrDrvnFault"; inputxbar_input2.inputxbarGpio = "GPIO5"; /** * These are the reserved peripherals and settings in this configuration */ const OTHER1 = scripting.addPeripheral("OTHER"); OTHER1.$name = "OtherFunctionsPins"; OTHER1.ADCSOCAO.$used = false; OTHER1.ADCSOCBO.$used = false; OTHER1.XCLKOUT.$used = false; OTHER1.ERRORSTS.$used = false; OTHER1.TDO.$assignAllowConflicts = "GPIO37/TDO"; OTHER1.TDO.$used = false; OTHER1.TDI.$assignAllowConflicts = "GPIO35/TDI"; OTHER1.TDI.$used = false; /** * 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. */ can1.can.$suggestSolution = "CANA"; can1.can.can_rxPin.$suggestSolution = "A3/C5, GPIO242"; can1.can.can_txPin.$suggestSolution = "GPIO7"; analog1.analog.$suggestSolution = "ANALOG"; analog1.analog["a0/c15/cmp1_dacl, a1Pin"].$suggestSolution = "A0/C15/CMP1_DACL, A1"; analog1.analog["a11/c0, a5/c2Pin"].$suggestSolution = "A11/C0, A5/C2"; epwm1.epwm.$suggestSolution = "EPWM1"; gpio2.gpioPin["GPIO#"].$suggestSolution = "A10/C10, C8/A9, GPIO227, GPIO230"; gpio3.gpioPin["GPIO#"].$suggestSolution = "GPIO11"; gpio4.gpioPin["GPIO#"].$suggestSolution = "GPIO24"; i2c1.i2c.$suggestSolution = "I2CA"; i2c1.i2c.i2c_sdaPin.$suggestSolution = "GPIO35/TDI"; i2c1.i2c.i2c_sclPin.$suggestSolution = "GPIO37/TDO"; OTHER1.$suggestSolution = "OTHER"; OTHER1.X1.$suggestSolution = "GPIO19, X1"; OTHER1.X2.$suggestSolution = "GPIO18, X2";