i2c_controller.syscfg 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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 GPIO3 = GPIO.addInstance();
  17. const I2C = scripting.addModule("/ti/driverlib/I2C", {}, false);
  18. const I2C1 = I2C.addInstance();
  19. const I2C2 = I2C.addInstance();
  20. /**
  21. * Write custom configuration values to the imported modules.
  22. */
  23. CRC.polynomial = "16_POLYNOMIAL";
  24. CRC.seed = 0xFFFF;
  25. GPIO1.$name = "GPIO_Battery_Charging";
  26. GPIO1.port = "PORTB";
  27. GPIO1.associatedPins.create(2);
  28. GPIO1.associatedPins[0].$name = "PIN_PB0";
  29. GPIO1.associatedPins[0].pin.$assign = "PB0";
  30. GPIO1.associatedPins[1].$name = "PIN_PB4";
  31. GPIO1.associatedPins[1].pin.$assign = "PB4";
  32. GPIO2.$name = "GPIO_Battery_Discharging";
  33. GPIO2.port = "PORTB";
  34. GPIO2.associatedPins.create(2);
  35. GPIO2.associatedPins[0].$name = "PIN_PB8";
  36. GPIO2.associatedPins[0].pin.$assign = "PB8";
  37. GPIO2.associatedPins[1].$name = "PIN_PB12";
  38. GPIO2.associatedPins[1].pin.$assign = "PB12";
  39. GPIO3.$name = "LDAC_PIN";
  40. GPIO3.port = "PORTA";
  41. GPIO3.associatedPins[0].$name = "PIN_PA8";
  42. GPIO3.associatedPins[0].pin.$assign = "PA8";
  43. I2C1.basicEnableController = true;
  44. I2C1.advControllerTXFIFOTRIG = "BYTES_1";
  45. I2C1.advAnalogGlitchFilter = "DISABLED";
  46. I2C1.intController = ["ARBITRATION_LOST","NACK","RXFIFO_TRIGGER","RX_DONE","TX_DONE"];
  47. I2C1.$name = "I2C_controller";
  48. I2C1.basicTargetAddress = 0x48;
  49. I2C1.peripheral.sdaPin.$assign = "PA16";
  50. I2C1.peripheral.sclPin.$assign = "PA15";
  51. I2C1.sdaPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric0";
  52. I2C1.sdaPinConfig.hideOutputInversion = scripting.forceWrite(false);
  53. I2C1.sdaPinConfig.onlyInternalResistor = scripting.forceWrite(false);
  54. I2C1.sdaPinConfig.passedPeripheralType = scripting.forceWrite("Digital");
  55. I2C1.sdaPinConfig.enableConfig = true;
  56. I2C1.sdaPinConfig.internalResistor = "PULL_UP";
  57. I2C1.sclPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric1";
  58. I2C1.sclPinConfig.hideOutputInversion = scripting.forceWrite(false);
  59. I2C1.sclPinConfig.onlyInternalResistor = scripting.forceWrite(false);
  60. I2C1.sclPinConfig.passedPeripheralType = scripting.forceWrite("Digital");
  61. I2C1.sclPinConfig.enableConfig = true;
  62. I2C1.sclPinConfig.internalResistor = "PULL_UP";
  63. I2C2.$name = "I2C_target";
  64. I2C2.basicEnableTarget = true;
  65. I2C2.enableDMAEvent1 = false;
  66. I2C2.enableDMAEvent2 = false;
  67. I2C2.basicTargetAddress = 0x48;
  68. I2C2.intTarget = ["RXFIFO_TRIGGER","START","STOP","TXFIFO_TRIGGER"];
  69. I2C2.peripheral.$assign = "I2C0";
  70. I2C2.peripheral.sdaPin.$assign = "PA0";
  71. I2C2.peripheral.sclPin.$assign = "PA1";
  72. I2C2.sdaPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric2";
  73. I2C2.sdaPinConfig.hideOutputInversion = scripting.forceWrite(false);
  74. I2C2.sdaPinConfig.onlyInternalResistor = scripting.forceWrite(false);
  75. I2C2.sdaPinConfig.passedPeripheralType = scripting.forceWrite("Digital");
  76. I2C2.sdaPinConfig.enableConfig = true;
  77. I2C2.sclPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric3";
  78. I2C2.sclPinConfig.hideOutputInversion = scripting.forceWrite(false);
  79. I2C2.sclPinConfig.onlyInternalResistor = scripting.forceWrite(false);
  80. I2C2.sclPinConfig.passedPeripheralType = scripting.forceWrite("Digital");
  81. I2C2.sclPinConfig.enableConfig = true;
  82. const SYSCTL = scripting.addModule("/ti/driverlib/SYSCTL", {}, false);
  83. SYSCTL.forceDefaultClkConfig = true;
  84. SYSCTL.clockTreeEn = true;
  85. /**
  86. * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
  87. * version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to
  88. * re-solve from scratch.
  89. */
  90. Board.peripheral.$suggestSolution = "DEBUGSS";
  91. Board.peripheral.swclkPin.$suggestSolution = "PA20";
  92. Board.peripheral.swdioPin.$suggestSolution = "PA19";
  93. I2C1.peripheral.$suggestSolution = "I2C1";