浏览代码

mcu target side configuration

namrota ghosh 8 月之前
父节点
当前提交
e3be1fdcb5
共有 3 个文件被更改,包括 202 次插入0 次删除
  1. 77 0
      .theia/launch.json
  2. 103 0
      src/i2c_controller.syscfg
  3. 22 0
      targetConfigs/MSPM0G3507.ccxml

+ 77 - 0
.theia/launch.json

@@ -0,0 +1,77 @@
+{
+    "version": "0.2.0",
+    "configurations": [
+        {
+            "name": "charge_controller_v7",
+            "type": "ccs-debug",
+            "request": "launch",
+            "projectInfo": {
+                "name": "charge_controller_v7",
+                "resourceId": "/charge_controller_v7/i2c_target.c"
+            }
+        },
+        {
+            "name": "charge_controller_v7 (1)",
+            "type": "ccs-debug",
+            "request": "launch",
+            "projectInfo": {
+                "name": "charge_controller_v7",
+                "resourceId": "/charge_controller_v7"
+            }
+        },
+        {
+            "name": "charge_controller_v7 (2)",
+            "type": "ccs-debug",
+            "request": "launch",
+            "projectInfo": {
+                "name": "charge_controller_v7",
+                "resourceId": "/charge_controller_v7/src/hal/i2c_hal.c"
+            }
+        },
+        {
+            "name": "charge_controller_v7 (3)",
+            "type": "ccs-debug",
+            "request": "launch",
+            "projectInfo": {
+                "name": "charge_controller_v7",
+                "resourceId": "/charge_controller_v7/src/mcu_slave.c"
+            }
+        },
+        {
+            "name": "charge_controller_v7 (4)",
+            "type": "ccs-debug",
+            "request": "launch",
+            "projectInfo": {
+                "name": "charge_controller_v7",
+                "resourceId": "/charge_controller_v7/src/i2c_controller.c"
+            }
+        },
+        {
+            "name": "charge_controller_target",
+            "type": "ccs-debug",
+            "request": "launch",
+            "projectInfo": {
+                "name": "charge_controller_target",
+                "resourceId": "/charge_controller_target/i2c_controller.c"
+            }
+        },
+        {
+            "name": "charge_controller_target (1)",
+            "type": "ccs-debug",
+            "request": "launch",
+            "projectInfo": {
+                "name": "charge_controller_target",
+                "resourceId": "/charge_controller_target"
+            }
+        },
+        {
+            "name": "charge_controller_target (2)",
+            "type": "ccs-debug",
+            "request": "launch",
+            "projectInfo": {
+                "name": "charge_controller_target",
+                "resourceId": "/charge_controller_target/src/i2c_controller.c"
+            }
+        }
+    ]
+}

+ 103 - 0
src/i2c_controller.syscfg

@@ -0,0 +1,103 @@
+/**
+ * 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" --part "Default" --package "LQFP-64(PM)" --product "mspm0_sdk@2.03.00.08"
+ * @v2CliArgs --device "MSPM0G3507" --package "LQFP-64(PM)" --product "mspm0_sdk@2.03.00.08"
+ * @versions {"tool":"1.22.0+3893"}
+ */
+
+/**
+ * Import the modules used in this configuration.
+ */
+const Board = scripting.addModule("/ti/driverlib/Board");
+const CRC   = scripting.addModule("/ti/driverlib/CRC");
+const GPIO  = scripting.addModule("/ti/driverlib/GPIO", {}, false);
+const GPIO1 = GPIO.addInstance();
+const GPIO2 = GPIO.addInstance();
+const GPIO3 = GPIO.addInstance();
+const I2C   = scripting.addModule("/ti/driverlib/I2C", {}, false);
+const I2C1  = I2C.addInstance();
+const I2C2  = I2C.addInstance();
+
+/**
+ * Write custom configuration values to the imported modules.
+ */
+
+CRC.polynomial = "16_POLYNOMIAL";
+CRC.seed       = 0xFFFF;
+
+GPIO1.$name                         = "GPIO_Battery_Charging";
+GPIO1.port                          = "PORTB";
+GPIO1.associatedPins.create(2);
+GPIO1.associatedPins[0].$name       = "PIN_PB0";
+GPIO1.associatedPins[0].pin.$assign = "PB0";
+GPIO1.associatedPins[1].$name       = "PIN_PB4";
+GPIO1.associatedPins[1].pin.$assign = "PB4";
+
+GPIO2.$name                         = "GPIO_Battery_Discharging";
+GPIO2.port                          = "PORTB";
+GPIO2.associatedPins.create(2);
+GPIO2.associatedPins[0].$name       = "PIN_PB8";
+GPIO2.associatedPins[0].pin.$assign = "PB8";
+GPIO2.associatedPins[1].$name       = "PIN_PB12";
+GPIO2.associatedPins[1].pin.$assign = "PB12";
+
+GPIO3.$name                         = "LDAC_PIN";
+GPIO3.port                          = "PORTA";
+GPIO3.associatedPins[0].$name       = "PIN_PA8";
+GPIO3.associatedPins[0].pin.$assign = "PA8";
+
+I2C1.basicEnableController             = true;
+I2C1.advControllerTXFIFOTRIG           = "BYTES_1";
+I2C1.advAnalogGlitchFilter             = "DISABLED";
+I2C1.intController                     = ["ARBITRATION_LOST","NACK","RXFIFO_TRIGGER","RX_DONE","TX_DONE"];
+I2C1.$name                             = "I2C_controller";
+I2C1.basicTargetAddress                = 0x48;
+I2C1.peripheral.sdaPin.$assign         = "PA16";
+I2C1.peripheral.sclPin.$assign         = "PA15";
+I2C1.sdaPinConfig.$name                = "ti_driverlib_gpio_GPIOPinGeneric0";
+I2C1.sdaPinConfig.hideOutputInversion  = scripting.forceWrite(false);
+I2C1.sdaPinConfig.onlyInternalResistor = scripting.forceWrite(false);
+I2C1.sdaPinConfig.passedPeripheralType = scripting.forceWrite("Digital");
+I2C1.sdaPinConfig.enableConfig         = true;
+I2C1.sdaPinConfig.internalResistor     = "PULL_UP";
+I2C1.sclPinConfig.$name                = "ti_driverlib_gpio_GPIOPinGeneric1";
+I2C1.sclPinConfig.hideOutputInversion  = scripting.forceWrite(false);
+I2C1.sclPinConfig.onlyInternalResistor = scripting.forceWrite(false);
+I2C1.sclPinConfig.passedPeripheralType = scripting.forceWrite("Digital");
+I2C1.sclPinConfig.enableConfig         = true;
+I2C1.sclPinConfig.internalResistor     = "PULL_UP";
+
+I2C2.$name                             = "I2C_target";
+I2C2.basicEnableTarget                 = true;
+I2C2.enableDMAEvent1                   = false;
+I2C2.enableDMAEvent2                   = false;
+I2C2.basicTargetAddress                = 0x48;
+I2C2.intTarget                         = ["RXFIFO_TRIGGER","START","STOP","TXFIFO_TRIGGER"];
+I2C2.peripheral.sdaPin.$assign         = "PA0";
+I2C2.peripheral.sclPin.$assign         = "PA1";
+I2C2.sdaPinConfig.$name                = "ti_driverlib_gpio_GPIOPinGeneric2";
+I2C2.sdaPinConfig.hideOutputInversion  = scripting.forceWrite(false);
+I2C2.sdaPinConfig.onlyInternalResistor = scripting.forceWrite(false);
+I2C2.sdaPinConfig.passedPeripheralType = scripting.forceWrite("Digital");
+I2C2.sdaPinConfig.enableConfig         = true;
+I2C2.sclPinConfig.$name                = "ti_driverlib_gpio_GPIOPinGeneric3";
+I2C2.sclPinConfig.hideOutputInversion  = scripting.forceWrite(false);
+I2C2.sclPinConfig.onlyInternalResistor = scripting.forceWrite(false);
+I2C2.sclPinConfig.passedPeripheralType = scripting.forceWrite("Digital");
+I2C2.sclPinConfig.enableConfig         = true;
+
+const SYSCTL                 = scripting.addModule("/ti/driverlib/SYSCTL", {}, false);
+SYSCTL.forceDefaultClkConfig = true;
+SYSCTL.clockTreeEn           = true;
+
+/**
+ * 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.
+ */
+Board.peripheral.$suggestSolution          = "DEBUGSS";
+Board.peripheral.swclkPin.$suggestSolution = "PA20";
+Board.peripheral.swdioPin.$suggestSolution = "PA19";
+I2C1.peripheral.$suggestSolution           = "I2C1";
+I2C2.peripheral.$suggestSolution           = "I2C0";

+ 22 - 0
targetConfigs/MSPM0G3507.ccxml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<configurations XML_version="1.2" id="configurations_0">
+    <configuration XML_version="1.2" id="configuration_0">
+        <instance XML_version="1.2" desc="Texas Instruments XDS110 USB Debug Probe" href="connections/TIXDS110_Connection.xml" id="Texas Instruments XDS110 USB Debug Probe" xml="TIXDS110_Connection.xml" xmlpath="connections"/>
+        <connection XML_version="1.2" id="Texas Instruments XDS110 USB Debug Probe">
+            <instance XML_version="1.2" href="drivers/tixds510cs_dap.xml" id="drivers" xml="tixds510cs_dap.xml" xmlpath="drivers"/>
+            <instance XML_version="1.2" href="drivers/tixds510cortexM0.xml" id="drivers" xml="tixds510cortexM0.xml" xmlpath="drivers"/>
+            <instance XML_version="1.2" href="drivers/tixds510sec_ap.xml" id="drivers" xml="tixds510sec_ap.xml" xmlpath="drivers"/>
+            <property Type="choicelist" Value="1" id="The JTAG TCLK Frequency (MHz)">
+                <choice Name="Fixed with user specified value" value="SPECIFIC">
+                    <property Type="stringfield" Value="1MHz" id="-- Enter a value from 100.0kHz to 2.5MHz"/>
+                </choice>
+            </property>
+            <property Type="choicelist" Value="2" id="SWD Mode Settings">
+                <choice Name="SWD Mode - Aux COM port is target TDO pin" value="nothing"/>
+            </property>
+            <platform XML_version="1.2" id="platform_0">
+                <instance XML_version="1.2" desc="MSPM0G3507" href="devices/MSPM0G3507.xml" id="MSPM0G3507" xml="MSPM0G3507.xml" xmlpath="devices"/>
+            </platform>
+        </connection>
+    </configuration>
+</configurations>