|
@@ -12,6 +12,7 @@
|
|
|
const GPIO = scripting.addModule("/ti/driverlib/GPIO", {}, false);
|
|
const GPIO = scripting.addModule("/ti/driverlib/GPIO", {}, false);
|
|
|
const GPIO1 = GPIO.addInstance();
|
|
const GPIO1 = GPIO.addInstance();
|
|
|
const GPIO2 = GPIO.addInstance();
|
|
const GPIO2 = GPIO.addInstance();
|
|
|
|
|
+const GPIO3 = GPIO.addInstance();
|
|
|
const I2C = scripting.addModule("/ti/driverlib/I2C", {}, false);
|
|
const I2C = scripting.addModule("/ti/driverlib/I2C", {}, false);
|
|
|
const I2C1 = I2C.addInstance();
|
|
const I2C1 = I2C.addInstance();
|
|
|
const I2C2 = I2C.addInstance();
|
|
const I2C2 = I2C.addInstance();
|
|
@@ -36,9 +37,26 @@ GPIO2.$name = "GPIO_Battery_Discharging";
|
|
|
GPIO2.port = "PORTB";
|
|
GPIO2.port = "PORTB";
|
|
|
GPIO2.associatedPins[0].$name = "PIN_PB7";
|
|
GPIO2.associatedPins[0].$name = "PIN_PB7";
|
|
|
|
|
|
|
|
|
|
+GPIO3.port = "PORTA";
|
|
|
|
|
+GPIO3.$name = "GPIO_ADDR_PINS";
|
|
|
|
|
+GPIO3.associatedPins.create(4);
|
|
|
|
|
+GPIO3.associatedPins[0].$name = "ADDR_0";
|
|
|
|
|
+GPIO3.associatedPins[0].direction = "INPUT";
|
|
|
|
|
+GPIO3.associatedPins[0].pin.$assign = "PA14";
|
|
|
|
|
+GPIO3.associatedPins[1].$name = "ADDR_1";
|
|
|
|
|
+GPIO3.associatedPins[1].direction = "INPUT";
|
|
|
|
|
+GPIO3.associatedPins[1].pin.$assign = "PA15";
|
|
|
|
|
+GPIO3.associatedPins[2].$name = "ADDR_2";
|
|
|
|
|
+GPIO3.associatedPins[2].direction = "INPUT";
|
|
|
|
|
+GPIO3.associatedPins[2].pin.$assign = "PA16";
|
|
|
|
|
+GPIO3.associatedPins[3].$name = "ADDR_3";
|
|
|
|
|
+GPIO3.associatedPins[3].direction = "INPUT";
|
|
|
|
|
+GPIO3.associatedPins[3].pin.$assign = "PA17";
|
|
|
|
|
+
|
|
|
I2C1.$name = "I2C_0";
|
|
I2C1.$name = "I2C_0";
|
|
|
I2C1.basicEnableTarget = true;
|
|
I2C1.basicEnableTarget = true;
|
|
|
I2C1.intTarget = ["RXFIFO_TRIGGER","RX_DONE","START","STOP","TXFIFO_TRIGGER","TX_DONE"];
|
|
I2C1.intTarget = ["RXFIFO_TRIGGER","RX_DONE","START","STOP","TXFIFO_TRIGGER","TX_DONE"];
|
|
|
|
|
+I2C1.basicTargetAddress = 0x20;
|
|
|
I2C1.peripheral.$assign = "I2C0";
|
|
I2C1.peripheral.$assign = "I2C0";
|
|
|
I2C1.peripheral.sdaPin.$assign = "PA0";
|
|
I2C1.peripheral.sdaPin.$assign = "PA0";
|
|
|
I2C1.peripheral.sclPin.$assign = "PA1";
|
|
I2C1.peripheral.sclPin.$assign = "PA1";
|