加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ncontroller.syscfg 14.23 KB
一键复制 编辑 原始数据 按行查看 历史
/**
* 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-64(PM)" --part "Default" --product "mspm0_sdk@2.00.01.00"
* @versions {"tool":"1.20.0+3587"}
*/
/**
* Import the modules used in this configuration.
*/
const GPIO = scripting.addModule("/ti/driverlib/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 GPIO8 = GPIO.addInstance();
const I2C = scripting.addModule("/ti/driverlib/I2C", {}, false);
const I2C1 = I2C.addInstance();
const PWM = scripting.addModule("/ti/driverlib/PWM", {}, false);
const PWM1 = PWM.addInstance();
const PWM2 = PWM.addInstance();
const PWM3 = PWM.addInstance();
const SPI = scripting.addModule("/ti/driverlib/SPI", {}, false);
const SPI1 = SPI.addInstance();
const SYSCTL = scripting.addModule("/ti/driverlib/SYSCTL");
const SYSTICK = scripting.addModule("/ti/driverlib/SYSTICK");
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();
const UART2 = UART.addInstance();
const UART3 = UART.addInstance();
const UART4 = 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 = 10;
const divider6 = system.clockTree["PLL_CLK2X_DIV"];
divider6.divideValue = 4;
const divider9 = system.clockTree["UDIV"];
divider9.divideValue = 2;
const gate7 = system.clockTree["MFCLKGATE"];
gate7.enable = true;
const gate8 = system.clockTree["MFPCLKGATE"];
gate8.enable = true;
const multiplier2 = system.clockTree["PLL_QDIV"];
multiplier2.multiplyValue = 4;
const mux4 = system.clockTree["EXHFMUX"];
mux4.inputSelect = "EXHFMUX_XTAL";
const mux8 = system.clockTree["HSCLKMUX"];
mux8.inputSelect = "HSCLKMUX_SYSPLL0";
const mux9 = system.clockTree["LFXTMUX"];
mux9.inputSelect = "LFXTMUX_TRUE";
const mux10 = system.clockTree["MFPCLKMUX"];
mux10.inputSelect = "MFPCLKMUX_HFCLK";
const mux12 = system.clockTree["SYSPLLMUX"];
mux12.inputSelect = "zSYSPLLMUX_HFCLK";
const pinFunction4 = system.clockTree["HFXT"];
pinFunction4.inputFreq = 40;
pinFunction4.enable = true;
pinFunction4.HFCLKMonitor = true;
pinFunction4.HFXTStartup = 20;
pinFunction4.peripheral.$assign = "SYSCTL";
pinFunction4.peripheral.hfxInPin.$assign = "PA5";
pinFunction4.peripheral.hfxOutPin.$assign = "PA6";
const pinFunction6 = system.clockTree["LFXT"];
pinFunction6.inputFreq = 32.768;
pinFunction6.LFCLKMonitorEnable = true;
GPIO1.$name = "GPIO_LEDS";
GPIO1.portSegment = "Lower";
GPIO1.port = "PORTA";
GPIO1.associatedPins[0].$name = "USER_LED_1";
GPIO1.associatedPins[0].initialValue = "SET";
GPIO1.associatedPins[0].assignedPin = "0";
GPIO1.associatedPins[0].pin.$assign = "PA0";
const Board = scripting.addModule("/ti/driverlib/Board", {}, false);
Board.peripheral.$assign = "DEBUGSS";
Board.peripheral.swclkPin.$assign = "PA20";
Board.peripheral.swdioPin.$assign = "PA19";
GPIO2.$name = "USER_GPIO";
GPIO2.port = "PORTA";
GPIO2.portSegment = "Upper";
GPIO2.associatedPins.create(2);
GPIO2.associatedPins[0].$name = "EPM_SCL";
GPIO2.associatedPins[0].initialValue = "SET";
GPIO2.associatedPins[0].assignedPin = "31";
GPIO2.associatedPins[0].ioStructure = "HD";
GPIO2.associatedPins[1].$name = "EPM_SDA";
GPIO2.associatedPins[1].initialValue = "SET";
GPIO2.associatedPins[1].assignedPin = "28";
GPIO2.associatedPins[1].ioStructure = "HD";
GPIO3.$name = "GPIO_RGB";
GPIO3.port = "PORTB";
GPIO3.portSegment = "Upper";
GPIO3.associatedPins.create(3);
GPIO3.associatedPins[0].$name = "RED";
GPIO3.associatedPins[0].assignedPin = "26";
GPIO3.associatedPins[1].$name = "GREEN";
GPIO3.associatedPins[1].assignedPin = "27";
GPIO3.associatedPins[2].$name = "BLUE";
GPIO3.associatedPins[2].assignedPin = "22";
GPIO4.$name = "GPIO_EXP";
GPIO4.port = "PORTB";
GPIO4.portSegment = "Upper";
GPIO4.associatedPins.create(2);
GPIO4.associatedPins[0].$name = "laser_light_1";
GPIO4.associatedPins[1].$name = "laser_light_2";
GPIO5.port = "PORTA";
GPIO5.$name = "KEYA";
GPIO5.portSegment = "Upper";
GPIO5.associatedPins[0].assignedPin = "18";
GPIO5.associatedPins[0].$name = "S2";
GPIO5.associatedPins[0].direction = "INPUT";
GPIO5.associatedPins[0].pin.$assign = "PA18";
GPIO6.$name = "KEYB";
GPIO6.port = "PORTB";
GPIO6.associatedPins[0].assignedPin = "21";
GPIO6.associatedPins[0].internalResistor = "PULL_UP";
GPIO6.associatedPins[0].direction = "INPUT";
GPIO6.associatedPins[0].$name = "S3";
GPIO6.associatedPins[0].pin.$assign = "PB21";
GPIO7.port = "PORTA";
GPIO7.$name = "PORTA";
GPIO7.associatedPins.create(2);
GPIO7.associatedPins[0].initialValue = "SET";
GPIO7.associatedPins[0].$name = "LCD_SCL";
GPIO7.associatedPins[0].pin.$assign = "PA17";
GPIO7.associatedPins[1].$name = "beep";
GPIO7.associatedPins[1].pin.$assign = "PA27";
GPIO8.port = "PORTB";
GPIO8.$name = "PORTB";
GPIO8.associatedPins.create(10);
GPIO8.associatedPins[0].initialValue = "SET";
GPIO8.associatedPins[0].$name = "LCD_SDA";
GPIO8.associatedPins[0].pin.$assign = "PB15";
GPIO8.associatedPins[1].$name = "D3_1";
GPIO8.associatedPins[1].direction = "INPUT";
GPIO8.associatedPins[1].internalResistor = "PULL_UP";
GPIO8.associatedPins[1].pin.$assign = "PB8";
GPIO8.associatedPins[2].$name = "D3_2";
GPIO8.associatedPins[2].direction = "INPUT";
GPIO8.associatedPins[2].internalResistor = "PULL_UP";
GPIO8.associatedPins[2].pin.$assign = "PB9";
GPIO8.associatedPins[3].$name = "D3_3";
GPIO8.associatedPins[3].direction = "INPUT";
GPIO8.associatedPins[3].internalResistor = "PULL_UP";
GPIO8.associatedPins[3].pin.$assign = "PB10";
GPIO8.associatedPins[4].$name = "D3_4";
GPIO8.associatedPins[4].direction = "INPUT";
GPIO8.associatedPins[4].internalResistor = "PULL_UP";
GPIO8.associatedPins[4].pin.$assign = "PB11";
GPIO8.associatedPins[5].$name = "D3_5";
GPIO8.associatedPins[5].internalResistor = "PULL_UP";
GPIO8.associatedPins[5].direction = "INPUT";
GPIO8.associatedPins[5].pin.$assign = "PB12";
GPIO8.associatedPins[6].$name = "W25Q64_CS";
GPIO8.associatedPins[6].internalResistor = "PULL_UP";
GPIO8.associatedPins[6].initialValue = "SET";
GPIO8.associatedPins[6].pin.$assign = "PB25";
GPIO8.associatedPins[7].$name = "LCD_CS";
GPIO8.associatedPins[7].pin.$assign = "PB20";
GPIO8.associatedPins[8].$name = "LCD_RST";
GPIO8.associatedPins[8].pin.$assign = "PB16";
GPIO8.associatedPins[9].$name = "LCD_DC";
GPIO8.associatedPins[9].pin.$assign = "PB17";
I2C1.$name = "I2C_0";
I2C1.basicEnableController = true;
I2C1.peripheral.$assign = "I2C1";
I2C1.peripheral.sdaPin.$assign = "PA30";
I2C1.peripheral.sclPin.$assign = "PA29";
I2C1.sdaPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric19";
I2C1.sclPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric20";
PWM1.$name = "PWM_0";
PWM1.ccIndex = [0,1,2,3];
PWM1.pwmMode = "EDGE_ALIGN_UP";
PWM1.clockDivider = 8;
PWM1.clockPrescale = 10;
PWM1.timerCount = 5000;
PWM1.peripheral.$assign = "TIMA0";
PWM1.PWM_CHANNEL_0.$name = "ti_driverlib_pwm_PWMTimerCC0";
PWM1.PWM_CHANNEL_1.$name = "ti_driverlib_pwm_PWMTimerCC1";
PWM1.ccp0PinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric8";
PWM1.ccp1PinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric9";
PWM1.PWM_CHANNEL_2.$name = "ti_driverlib_pwm_PWMTimerCC4";
PWM1.PWM_CHANNEL_3.$name = "ti_driverlib_pwm_PWMTimerCC5";
PWM1.ccp2PinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric12";
PWM1.ccp3PinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric13";
PWM2.$name = "PWM_1";
PWM2.clockDivider = 8;
PWM2.pwmMode = "EDGE_ALIGN_UP";
PWM2.clockPrescale = 10;
PWM2.timerCount = 5000;
PWM2.peripheral.$assign = "TIMA1";
PWM2.PWM_CHANNEL_0.$name = "ti_driverlib_pwm_PWMTimerCC2";
PWM2.PWM_CHANNEL_1.$name = "ti_driverlib_pwm_PWMTimerCC3";
PWM2.ccp0PinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric10";
PWM2.ccp1PinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric11";
PWM3.$name = "PWM_2";
PWM3.clockDivider = 8;
PWM3.timerCount = 5000;
PWM3.clockPrescale = 10;
PWM3.pwmMode = "EDGE_ALIGN_UP";
PWM3.peripheral.$assign = "TIMG7";
PWM3.PWM_CHANNEL_0.$name = "ti_driverlib_pwm_PWMTimerCC6";
PWM3.PWM_CHANNEL_1.$name = "ti_driverlib_pwm_PWMTimerCC7";
PWM3.ccp0PinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric14";
PWM3.ccp1PinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric15";
SPI1.$name = "SPI_0";
SPI1.targetBitRate = 1000000;
SPI1.chipSelect = [];
SPI1.enableDMAEvent1 = false;
SPI1.enableDMAEvent2 = false;
SPI1.spiClkSrc = "MFCLK";
SPI1.frameFormat = "MOTO3";
SPI1.polarity = "1";
SPI1.phase = "1";
SPI1.peripheral.$assign = "SPI0";
SPI1.peripheral.sclkPin.$assign = "PA12";
SPI1.peripheral.mosiPin.$assign = "PA14";
SPI1.peripheral.misoPin.$assign = "PA13";
SPI1.sclkPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric16";
SPI1.mosiPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric17";
SPI1.misoPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric18";
SYSCTL.validateClkStatus = true;
SYSCTL.HFCLKSource = "HFXT";
SYSCTL.waitState = "1";
SYSCTL.enableSYSOSCFCL = true;
SYSCTL.enableROSC = true;
SYSCTL.forceDefaultClkConfig = true;
SYSCTL.clockTreeEn = true;
SYSTICK.periodEnable = true;
SYSTICK.period = 80000;
SYSTICK.interruptEnable = true;
SYSTICK.systickEnable = true;
TIMER1.$name = "TIMER_1";
TIMER1.interrupts = ["ZERO"];
TIMER1.interruptPriority = "2";
TIMER1.timerPeriod = "5 ms";
TIMER1.timerClkPrescale = 10;
TIMER1.timerMode = "PERIODIC_UP";
TIMER1.peripheral.$assign = "TIMG0";
TIMER2.$name = "TIMER_2";
TIMER2.timerMode = "PERIODIC";
TIMER2.timerPeriod = "0.005";
TIMER2.interrupts = ["ZERO"];
TIMER2.interruptPriority = "2";
TIMER2.timerClkPrescale = 10;
TIMER2.peripheral.$assign = "TIMG6";
UART1.$name = "UART_0";
UART1.interruptPriority = "1";
UART1.targetBaudRate = 1000000;
UART1.enabledInterrupts = ["RX"];
UART1.peripheral.$assign = "UART0";
UART1.peripheral.rxPin.$assign = "PA11";
UART1.peripheral.txPin.$assign = "PA10";
UART1.txPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric0";
UART1.rxPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric1";
UART2.$name = "UART_1";
UART2.enabledInterrupts = ["RX"];
UART2.targetBaudRate = 115200;
UART2.peripheral.$assign = "UART1";
UART2.peripheral.rxPin.$assign = "PA9";
UART2.peripheral.txPin.$assign = "PA8";
UART2.txPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric2";
UART2.rxPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric3";
UART3.$name = "UART_2";
UART3.enabledInterrupts = ["RX"];
UART3.targetBaudRate = 115200;
UART3.peripheral.$assign = "UART2";
UART3.peripheral.rxPin.$assign = "PA22";
UART3.peripheral.txPin.$assign = "PA21";
UART3.txPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric4";
UART3.rxPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric5";
UART4.$name = "UART_3";
UART4.enabledInterrupts = ["RX"];
UART4.targetBaudRate = 115200;
UART4.peripheral.$assign = "UART3";
UART4.peripheral.rxPin.$assign = "PB3";
UART4.peripheral.txPin.$assign = "PB2";
UART4.txPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric6";
UART4.rxPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric7";
ProjectConfig.deviceSpin = "MSPM0G3507";
/**
* 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.
*/
GPIO2.associatedPins[0].pin.$suggestSolution = "PA31";
GPIO2.associatedPins[1].pin.$suggestSolution = "PA28";
GPIO3.associatedPins[0].pin.$suggestSolution = "PB26";
GPIO3.associatedPins[1].pin.$suggestSolution = "PB27";
GPIO3.associatedPins[2].pin.$suggestSolution = "PB22";
GPIO4.associatedPins[0].pin.$suggestSolution = "PB19";
GPIO4.associatedPins[1].pin.$suggestSolution = "PB18";
PWM1.peripheral.ccp0Pin.$suggestSolution = "PB14";
PWM1.peripheral.ccp1Pin.$suggestSolution = "PA1";
PWM1.peripheral.ccp2Pin.$suggestSolution = "PA3";
PWM1.peripheral.ccp3Pin.$suggestSolution = "PA25";
PWM2.peripheral.ccp0Pin.$suggestSolution = "PA15";
PWM2.peripheral.ccp1Pin.$suggestSolution = "PA16";
PWM3.peripheral.ccp0Pin.$suggestSolution = "PA23";
PWM3.peripheral.ccp1Pin.$suggestSolution = "PA2";
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化