瀏覽代碼

ADC Peripheral Configuration added for PA27

namrota ghosh 6 月之前
父節點
當前提交
7bb69f8167
共有 1 個文件被更改,包括 13 次插入1 次删除
  1. 13 1
      main.syscfg

+ 13 - 1
main.syscfg

@@ -9,6 +9,8 @@
 /**
  * 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();
@@ -27,6 +29,15 @@ const ProjectConfig = scripting.addModule("/ti/project_config/ProjectConfig");
 /**
  * Write custom configuration values to the imported modules.
  */
+ADC121.$name                             = "ADC_Controller";
+ADC121.sampClkDiv                        = "DL_ADC12_CLOCK_DIVIDE_8";
+ADC121.powerDownMode                     = "DL_ADC12_POWER_DOWN_MODE_MANUAL";
+ADC121.sampleTime0                       = "12.5 us";
+ADC121.enabledInterrupts                 = ["DL_ADC12_INTERRUPT_MEM0_RESULT_LOADED"];
+ADC121.peripheral.adcPin0.$assign        = "PA27";
+ADC121.adcPin0Config.$name               = "ti_driverlib_gpio_GPIOPinGeneric5";
+ADC121.adcPin0Config.hideOutputInversion = scripting.forceWrite(false);
+
 Board.configureUnused             = true;
 Board.peripheral.$assign          = "DEBUGSS";
 Board.peripheral.swclkPin.$assign = "PA20";
@@ -113,4 +124,5 @@ ProjectConfig.migrationCondition = true;
  * 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.
  */
-PWM1.peripheral.$suggestSolution = "TIMG6";
+ADC121.peripheral.$suggestSolution = "ADC0";
+PWM1.peripheral.$suggestSolution   = "TIMG6";