/**
 * 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 "AM243x_ALV_beta" --package "ALV" --part "ALV" --context "r5fss0-0" --product "MCU_PLUS_SDK@07.03.01"
 * @versions {"tool":"1.14.0+2667"}
 */

/**
 * Import the modules used in this configuration.
 */
const epwm       = scripting.addModule("/drivers/epwm/epwm", {}, false);
const epwm1      = epwm.addInstance();
const gpio       = scripting.addModule("/drivers/gpio/gpio", {}, 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 gpio7      = gpio.addInstance();
const pruicss    = scripting.addModule("/drivers/pruicss/pruicss", {}, false);
const pruicss1   = pruicss.addInstance();
const debug_log  = scripting.addModule("/kernel/dpl/debug_log");
const mpu_armv7  = scripting.addModule("/kernel/dpl/mpu_armv7", {}, false);
const mpu_armv71 = mpu_armv7.addInstance();
const mpu_armv72 = mpu_armv7.addInstance();
const mpu_armv73 = mpu_armv7.addInstance();
const mpu_armv74 = mpu_armv7.addInstance();
const mpu_armv75 = mpu_armv7.addInstance();
const mpu_armv76 = mpu_armv7.addInstance();

/**
 * Write custom configuration values to the imported modules.
 */
epwm1.$name              = "CONFIG_EPWM0";
epwm1.EPWM.$assign       = "EHRPWM0";
epwm1.EPWM.A.$assign     = "ball.U20";
epwm1.EPWM.B.$assign     = "ball.U18";
epwm1.EPWM.SYNCO.$assign = "ball.U21";
epwm1.EPWM.SYNCI.$used   = false;

gpio1.$name                = "GPIO_MTR_1_PWM_EN";
gpio1.pinDir               = "OUTPUT";
gpio1.GPIO.$assign         = "GPIO0";
gpio1.GPIO.gpioPin.rx      = false;
gpio1.GPIO.gpioPin.$assign = "ball.Y20";

gpio2.$name                    = "GPIO_HIGH_TH_CH0";
gpio2.pinDir                   = "OUTPUT";
gpio2.useMcuDomainPeripherals  = true;
gpio2.MCU_GPIO.$assign         = "MCU_GPIO0";
gpio2.MCU_GPIO.gpioPin.rx      = false;
gpio2.MCU_GPIO.gpioPin.$assign = "ball.B6";

gpio3.$name                    = "GPIO_LOW_TH_CH0";
gpio3.pinDir                   = "OUTPUT";
gpio3.useMcuDomainPeripherals  = true;
gpio3.MCU_GPIO.gpioPin.rx      = false;
gpio3.MCU_GPIO.gpioPin.$assign = "ball.C7";

gpio4.$name                    = "GPIO_HIGH_TH_CH1";
gpio4.pinDir                   = "OUTPUT";
gpio4.useMcuDomainPeripherals  = true;
gpio4.MCU_GPIO.gpioPin.rx      = false;
gpio4.MCU_GPIO.gpioPin.$assign = "ball.A7";

gpio5.$name                    = "GPIO_LOW_TH_CH1";
gpio5.pinDir                   = "OUTPUT";
gpio5.useMcuDomainPeripherals  = true;
gpio5.MCU_GPIO.gpioPin.rx      = false;
gpio5.MCU_GPIO.gpioPin.$assign = "ball.D7";

gpio6.$name                    = "GPIO_HIGH_TH_CH2";
gpio6.pinDir                   = "OUTPUT";
gpio6.useMcuDomainPeripherals  = true;
gpio6.MCU_GPIO.gpioPin.$assign = "ball.C8";

gpio7.$name                    = "GPIO_LOW_TH_CH2";
gpio7.pinDir                   = "OUTPUT";
gpio7.useMcuDomainPeripherals  = true;
gpio7.MCU_GPIO.gpioPin.rx      = false;
gpio7.MCU_GPIO.gpioPin.$assign = "ball.E6";

pruicss1.$name                           = "CONFIG_PRU_ICSS0";
pruicss1.coreClk                         = 300000000;
pruicss1.iepClk                          = 300000000;
pruicss1.AdditionalICSSSettings[0].$name = "CONFIG_PRU_ICSS_IO0";

debug_log.enableUartLog        = true;
debug_log.uartLog.$name        = "CONFIG_UART_CONSOLE";
debug_log.uartLog.UART.$assign = "USART0";

mpu_armv71.$name             = "CONFIG_MPU_REGION0";
mpu_armv71.size              = 31;
mpu_armv71.attributes        = "Device";
mpu_armv71.accessPermissions = "Supervisor RD+WR, User RD";
mpu_armv71.allowExecute      = false;

mpu_armv72.$name             = "CONFIG_MPU_REGION1";
mpu_armv72.size              = 15;
mpu_armv72.accessPermissions = "Supervisor RD+WR, User RD";

mpu_armv73.$name             = "CONFIG_MPU_REGION2";
mpu_armv73.baseAddr          = 0x41010000;
mpu_armv73.size              = 15;
mpu_armv73.accessPermissions = "Supervisor RD+WR, User RD";

mpu_armv74.$name             = "CONFIG_MPU_REGION3";
mpu_armv74.accessPermissions = "Supervisor RD+WR, User RD";
mpu_armv74.baseAddr          = 0x70000000;
mpu_armv74.size              = 21;

mpu_armv75.$name             = "CONFIG_MPU_REGION4";
mpu_armv75.baseAddr          = 0x60000000;
mpu_armv75.size              = 28;
mpu_armv75.accessPermissions = "Supervisor RD, User RD";

mpu_armv76.$name    = "CONFIG_MPU_REGION5";
mpu_armv76.baseAddr = 0x80000000;
mpu_armv76.size     = 31;

/**
 * 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.
 */
gpio3.MCU_GPIO.$suggestSolution             = "MCU_GPIO0";
gpio4.MCU_GPIO.$suggestSolution             = "MCU_GPIO0";
gpio5.MCU_GPIO.$suggestSolution             = "MCU_GPIO0";
gpio6.MCU_GPIO.$suggestSolution             = "MCU_GPIO0";
gpio7.MCU_GPIO.$suggestSolution             = "MCU_GPIO0";
debug_log.uartLog.UART.RXD.$suggestSolution = "ball.D15";
debug_log.uartLog.UART.TXD.$suggestSolution = "ball.C16";
