test soft i2c write and read passed

This commit is contained in:
2025-11-18 14:37:42 +08:00
parent 73733da6dd
commit 1d75c96f74
6 changed files with 233 additions and 184 deletions

View File

@@ -29,9 +29,6 @@ const UART1 = UART.addInstance();
const divider7 = system.clockTree["PLL_PDIV"];
divider7.divideValue = 2;
const divider9 = system.clockTree["UDIV"];
divider9.divideValue = 2;
const gate7 = system.clockTree["MFCLKGATE"];
gate7.enable = true;
@@ -41,14 +38,7 @@ multiplier2.multiplyValue = 4;
const mux4 = system.clockTree["EXHFMUX"];
mux4.inputSelect = "EXHFMUX_XTAL";
const mux8 = system.clockTree["HSCLKMUX"];
mux8.inputSelect = "HSCLKMUX_SYSPLL2X";
const mux12 = system.clockTree["SYSPLLMUX"];
mux12.inputSelect = "zSYSPLLMUX_HFCLK";
const pinFunction4 = system.clockTree["HFXT"];
pinFunction4.enable = true;
pinFunction4.inputFreq = 40;
GPIO1.$name = "LED";
@@ -60,18 +50,12 @@ Board.peripheral.$assign = "DEBUGSS";
Board.peripheral.swclkPin.$assign = "PA20";
Board.peripheral.swdioPin.$assign = "PA19";
GPIO2.$name = "SOFT_I2C";
GPIO2.port = "PORTA";
GPIO2.portSegment = "Lower";
GPIO2.$name = "SOFT_I2C";
GPIO2.associatedPins.create(2);
GPIO2.associatedPins[0].initialValue = "SET";
GPIO2.associatedPins[0].$name = "CLK";
GPIO2.associatedPins[0].ioStructure = "HS";
GPIO2.associatedPins[0].pin.$assign = "PA13";
GPIO2.associatedPins[1].initialValue = "SET";
GPIO2.associatedPins[1].ioStructure = "HS";
GPIO2.associatedPins[1].$name = "SDA";
GPIO2.associatedPins[1].pin.$assign = "PA14";
GPIO2.associatedPins[0].$name = "CLK";
GPIO2.associatedPins[0].pin.$assign = "PA8";
GPIO2.associatedPins[1].$name = "SDA";
GPIO2.associatedPins[1].pin.$assign = "PA9";
I2C1.$name = "I2C_1";
I2C1.advAnalogGlitchFilter = "DISABLED";
@@ -153,8 +137,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.
*/
pinFunction4.peripheral.$suggestSolution = "SYSCTL";
pinFunction4.peripheral.hfxInPin.$suggestSolution = "PA5";
pinFunction4.peripheral.hfxOutPin.$suggestSolution = "PA6";
I2C1.peripheral.$suggestSolution = "I2C1";
UART1.DMA_CHANNEL_RX.peripheral.$suggestSolution = "DMA_CH1";
I2C1.peripheral.$suggestSolution = "I2C1";
UART1.DMA_CHANNEL_RX.peripheral.$suggestSolution = "DMA_CH1";