i2c_controller.syscfg 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /**
  2. * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
  3. * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
  4. * @cliArgs --device "MSPM0G350X" --part "Default" --package "LQFP-64(PM)" --product "mspm0_sdk@2.03.00.08"
  5. * @v2CliArgs --device "MSPM0G3507" --package "LQFP-64(PM)" --product "mspm0_sdk@2.03.00.08"
  6. * @versions {"tool":"1.22.0+3893"}
  7. */
  8. /**
  9. * Import the modules used in this configuration.
  10. */
  11. const Board = scripting.addModule("/ti/driverlib/Board");
  12. const CRC = scripting.addModule("/ti/driverlib/CRC");
  13. const GPIO = scripting.addModule("/ti/driverlib/GPIO", {}, false);
  14. const GPIO1 = GPIO.addInstance();
  15. const GPIO2 = GPIO.addInstance();
  16. const I2C = scripting.addModule("/ti/driverlib/I2C", {}, false);
  17. const I2C1 = I2C.addInstance();
  18. const I2C2 = I2C.addInstance();
  19. /**
  20. * Write custom configuration values to the imported modules.
  21. */
  22. CRC.polynomial = "16_POLYNOMIAL";
  23. CRC.seed = 0xFFFF;
  24. GPIO1.$name = "GPIO_Battery_Charging";
  25. GPIO1.port = "PORTB";
  26. GPIO1.associatedPins[0].$name = "PIN_PB0";
  27. GPIO1.associatedPins[0].pin.$assign = "PB0";
  28. GPIO2.$name = "GPIO_Battery_Discharging";
  29. GPIO2.port = "PORTB";
  30. GPIO2.associatedPins[0].$name = "PIN_PB8";
  31. GPIO2.associatedPins[0].pin.$assign = "PB8";
  32. I2C1.basicEnableController = true;
  33. I2C1.advControllerTXFIFOTRIG = "BYTES_1";
  34. I2C1.advAnalogGlitchFilter = "DISABLED";
  35. I2C1.intController = ["ARBITRATION_LOST","NACK","RXFIFO_TRIGGER","RX_DONE","TX_DONE"];
  36. I2C1.$name = "I2C_controller";
  37. I2C1.basicTargetAddress = 0x48;
  38. I2C1.peripheral.sdaPin.$assign = "PA16";
  39. I2C1.peripheral.sclPin.$assign = "PA15";
  40. I2C1.sdaPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric0";
  41. I2C1.sdaPinConfig.hideOutputInversion = scripting.forceWrite(false);
  42. I2C1.sdaPinConfig.onlyInternalResistor = scripting.forceWrite(false);
  43. I2C1.sdaPinConfig.passedPeripheralType = scripting.forceWrite("Digital");
  44. I2C1.sdaPinConfig.enableConfig = true;
  45. I2C1.sdaPinConfig.internalResistor = "PULL_UP";
  46. I2C1.sclPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric1";
  47. I2C1.sclPinConfig.hideOutputInversion = scripting.forceWrite(false);
  48. I2C1.sclPinConfig.onlyInternalResistor = scripting.forceWrite(false);
  49. I2C1.sclPinConfig.passedPeripheralType = scripting.forceWrite("Digital");
  50. I2C1.sclPinConfig.enableConfig = true;
  51. I2C1.sclPinConfig.internalResistor = "PULL_UP";
  52. I2C2.$name = "I2C_target";
  53. I2C2.basicEnableTarget = true;
  54. I2C2.enableDMAEvent1 = false;
  55. I2C2.enableDMAEvent2 = false;
  56. I2C2.basicTargetAddress = 0x48;
  57. I2C2.intTarget = ["RXFIFO_TRIGGER","START","STOP","TXFIFO_TRIGGER"];
  58. I2C2.peripheral.$assign = "I2C0";
  59. I2C2.peripheral.sdaPin.$assign = "PA0";
  60. I2C2.peripheral.sclPin.$assign = "PA1";
  61. I2C2.sdaPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric2";
  62. I2C2.sdaPinConfig.hideOutputInversion = scripting.forceWrite(false);
  63. I2C2.sdaPinConfig.onlyInternalResistor = scripting.forceWrite(false);
  64. I2C2.sdaPinConfig.passedPeripheralType = scripting.forceWrite("Digital");
  65. I2C2.sdaPinConfig.enableConfig = true;
  66. I2C2.sclPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric3";
  67. I2C2.sclPinConfig.hideOutputInversion = scripting.forceWrite(false);
  68. I2C2.sclPinConfig.onlyInternalResistor = scripting.forceWrite(false);
  69. I2C2.sclPinConfig.passedPeripheralType = scripting.forceWrite("Digital");
  70. I2C2.sclPinConfig.enableConfig = true;
  71. const SYSCTL = scripting.addModule("/ti/driverlib/SYSCTL", {}, false);
  72. SYSCTL.forceDefaultClkConfig = true;
  73. SYSCTL.clockTreeEn = true;
  74. /**
  75. * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
  76. * version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to
  77. * re-solve from scratch.
  78. */
  79. Board.peripheral.$suggestSolution = "DEBUGSS";
  80. Board.peripheral.swclkPin.$suggestSolution = "PA20";
  81. Board.peripheral.swdioPin.$suggestSolution = "PA19";
  82. I2C1.peripheral.$suggestSolution = "I2C1";