/**
 * 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 "F29H85x" --part "F29H85x_256ZEX" --package "256ZEX" --context "CPU1" --product "MCU_SDK_F29H85x@1.01.00.00"
 * @v2CliArgs --device "F29H850TU" --package "256ZEX" --variant "TMS320F29H850TU9" --context "CPU1" --product "MCU_SDK_F29H85x@1.01.00.00"
 * @versions {"tool":"1.23.0+4000"}
 */

/**
 * Import the modules used in this configuration.
 */
const epwm  = scripting.addModule("/driverlib/epwm.js", {}, false);
const epwm1 = epwm.addInstance();
const jtag  = scripting.addModule("/driverlib/jtag.js");

/**
 * Write custom configuration values to the imported modules.
 */
const divider15       = system.clockTree["PLL_REFDIV"];
divider15.divideValue = 1;

const multiplier1         = system.clockTree["PLL_IMULT"];
multiplier1.multiplyValue = 40;

const mux7       = system.clockTree["OSCCLKSRCSEL"];
mux7.inputSelect = "INTOSC2";

epwm1.$name                                                      = "myEPWM1";
epwm1.epwmTimebase_counterMode                                   = "EPWM_COUNTER_MODE_UP_DOWN";
epwm1.epwmTimebase_period                                        = 12000;
epwm1.useCase                                                    = "CUSTOM";
epwm1.useInterfacePins                                           = ["EPWM#_A"];
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA   = "EPWM_AQ_OUTPUT_LOW";
epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPB = "EPWM_AQ_OUTPUT_HIGH";
epwm1.epwmTimebase_hsClockDiv                                    = "EPWM_HSCLOCK_DIVIDER_1";
epwm1.periphClock.$name                                          = "driverlib_perClock0";
epwm1.periphConfig.$name                                         = "driverlib_perConfig0";
epwm1.epwm.$assign                                               = "EPWM1";
epwm1.epwm.epwm_aPin.$assign                                     = "GPIO0";


/**
 * 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.
 */
jtag.JTAG.$suggestSolution        = "JTAG";
jtag.JTAG.tdoPin.$suggestSolution = "GPIO223/TDO";
jtag.JTAG.tdiPin.$suggestSolution = "GPIO222/TDI";
