|
@@ -15,13 +15,13 @@ const ADC122 = ADC12.addInstance();
|
|
|
const Board = scripting.addModule("/ti/driverlib/Board");
|
|
|
const COMP = scripting.addModule("/ti/driverlib/COMP", {}, false);
|
|
|
const COMP1 = COMP.addInstance();
|
|
|
-const COMP2 = COMP.addInstance();
|
|
|
-const DAC12 = scripting.addModule("/ti/driverlib/DAC12");
|
|
|
const GPIO = scripting.addModule("/ti/driverlib/GPIO", {}, false);
|
|
|
const GPIO1 = GPIO.addInstance();
|
|
|
const GPIO2 = GPIO.addInstance();
|
|
|
const GPIO3 = GPIO.addInstance();
|
|
|
const GPIO4 = GPIO.addInstance();
|
|
|
+const GPIO5 = GPIO.addInstance();
|
|
|
+const GPIO6 = GPIO.addInstance();
|
|
|
const MATHACL = scripting.addModule("/ti/driverlib/MATHACL");
|
|
|
const MCAN = scripting.addModule("/ti/driverlib/MCAN", {}, false);
|
|
|
const MCAN1 = MCAN.addInstance();
|
|
@@ -31,8 +31,6 @@ const OPA2 = OPA.addInstance();
|
|
|
const PWM = scripting.addModule("/ti/driverlib/PWM", {}, false);
|
|
|
const PWM1 = PWM.addInstance();
|
|
|
const PWM2 = PWM.addInstance();
|
|
|
-const PWM3 = PWM.addInstance();
|
|
|
-const PWM4 = PWM.addInstance();
|
|
|
const SYSCTL = scripting.addModule("/ti/driverlib/SYSCTL");
|
|
|
const SYSTICK = scripting.addModule("/ti/driverlib/SYSTICK");
|
|
|
const TIMER = scripting.addModule("/ti/driverlib/TIMER", {}, false);
|
|
@@ -96,13 +94,16 @@ ADC121.adcMem2chansel = "DL_ADC12_INPUT_CHAN_12";
|
|
|
ADC121.enabledInterrupts = ["DL_ADC12_INTERRUPT_MEM1_RESULT_LOADED"];
|
|
|
ADC121.endAdd = 4;
|
|
|
ADC121.interruptPriority = "2";
|
|
|
+ADC121.adcMem4chansel = "DL_ADC12_INPUT_CHAN_1";
|
|
|
ADC121.peripheral.$assign = "ADC0";
|
|
|
ADC121.peripheral.adcPin6.$assign = "PB20";
|
|
|
ADC121.peripheral.adcPin12.$assign = "PA14";
|
|
|
ADC121.peripheral.adcPin0.$assign = "PA27";
|
|
|
+ADC121.peripheral.adcPin1.$assign = "PA26";
|
|
|
ADC121.adcPin0Config.$name = "ti_driverlib_gpio_GPIOPinGeneric16";
|
|
|
ADC121.adcPin6Config.$name = "ti_driverlib_gpio_GPIOPinGeneric9";
|
|
|
ADC121.adcPin12Config.$name = "ti_driverlib_gpio_GPIOPinGeneric18";
|
|
|
+ADC121.adcPin1Config.$name = "ti_driverlib_gpio_GPIOPinGeneric4";
|
|
|
|
|
|
ADC122.$name = "ADC12_1";
|
|
|
ADC122.adcMem0chansel = "DL_ADC12_INPUT_CHAN_13";
|
|
@@ -116,18 +117,20 @@ ADC122.adcMem3chansel = "DL_ADC12_INPUT_CHAN_4";
|
|
|
ADC122.sampleTime0 = "0.25us";
|
|
|
ADC122.adcMem0stime = "DL_ADC12_SAMPLE_TIMER_SOURCE_SCOMP1";
|
|
|
ADC122.sampleTime1 = "3us";
|
|
|
-ADC122.endAdd = 4;
|
|
|
ADC122.adcMem4chansel = "DL_ADC12_INPUT_CHAN_7";
|
|
|
-ADC122.adcMem4trig = "DL_ADC12_TRIGGER_MODE_TRIGGER_NEXT";
|
|
|
+ADC122.endAdd = 5;
|
|
|
+ADC122.adcMem5trig = "DL_ADC12_TRIGGER_MODE_TRIGGER_NEXT";
|
|
|
ADC122.peripheral.$assign = "ADC1";
|
|
|
ADC122.peripheral.adcPin6.$assign = "PB19";
|
|
|
ADC122.peripheral.adcPin5.$assign = "PB18";
|
|
|
ADC122.peripheral.adcPin4.$assign = "PB17";
|
|
|
ADC122.peripheral.adcPin7.$assign = "PA21";
|
|
|
+ADC122.peripheral.adcPin0.$assign = "PA15";
|
|
|
ADC122.adcPin4Config.$name = "ti_driverlib_gpio_GPIOPinGeneric19";
|
|
|
ADC122.adcPin5Config.$name = "ti_driverlib_gpio_GPIOPinGeneric0";
|
|
|
ADC122.adcPin6Config.$name = "ti_driverlib_gpio_GPIOPinGeneric23";
|
|
|
ADC122.adcPin7Config.$name = "ti_driverlib_gpio_GPIOPinGeneric22";
|
|
|
+ADC122.adcPin0Config.$name = "ti_driverlib_gpio_GPIOPinGeneric7";
|
|
|
|
|
|
Board.peripheral.$assign = "DEBUGSS";
|
|
|
|
|
@@ -144,30 +147,8 @@ COMP1.setDACCode0 = 0x99;
|
|
|
COMP1.peripheral.compPinPos1.$assign = "PB24";
|
|
|
COMP1.compPinPos1Config.$name = "ti_driverlib_gpio_GPIOPinGeneric21";
|
|
|
|
|
|
-COMP2.$name = "COMP_FLEDCHECK";
|
|
|
-COMP2.channelEnable = ["POS"];
|
|
|
-COMP2.vSource = "DL_COMP_REF_SOURCE_VDDA_DAC";
|
|
|
-COMP2.terminalSelect = "DL_COMP_REF_TERMINAL_SELECT_NEG";
|
|
|
-COMP2.controlSelect = "DL_COMP_DAC_CONTROL_SW";
|
|
|
-COMP2.hysteresis = "DL_COMP_HYSTERESIS_10";
|
|
|
-COMP2.setDACCode1 = 0x20;
|
|
|
-COMP2.enableOutputFilter = true;
|
|
|
-COMP2.setDACCode0 = 0xF;
|
|
|
-COMP2.enabledInterrupts = ["DL_COMP_INTERRUPT_OUTPUT_EDGE","DL_COMP_INTERRUPT_OUTPUT_EDGE_INV"];
|
|
|
-COMP2.interruptPriority = "1";
|
|
|
-COMP2.peripheral.$assign = "COMP0";
|
|
|
-COMP2.peripheral.compPinPos0.$assignAllowConflicts = "PA26";
|
|
|
-COMP2.compPinPos0Config.$name = "ti_driverlib_gpio_GPIOPinGeneric24";
|
|
|
-
|
|
|
-DAC12.dacOutputPinEn = true;
|
|
|
-DAC12.dacOutput12 = 2048;
|
|
|
-DAC12.dacAmplifier = "ON";
|
|
|
-DAC12.peripheral.$assign = "DAC0";
|
|
|
-DAC12.peripheral.OutPin.$assign = "PA15";
|
|
|
-DAC12.OutPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric14";
|
|
|
-
|
|
|
GPIO1.$name = "INPUT";
|
|
|
-GPIO1.associatedPins.create(2);
|
|
|
+GPIO1.associatedPins.create(4);
|
|
|
GPIO1.associatedPins[0].$name = "BREAK";
|
|
|
GPIO1.associatedPins[0].direction = "INPUT";
|
|
|
GPIO1.associatedPins[0].assignedPort = "PORTA";
|
|
@@ -177,7 +158,18 @@ GPIO1.associatedPins[0].pin.$assign = "PA28";
|
|
|
GPIO1.associatedPins[1].direction = "INPUT";
|
|
|
GPIO1.associatedPins[1].assignedPort = "PORTA";
|
|
|
GPIO1.associatedPins[1].assignedPin = "9";
|
|
|
-GPIO1.associatedPins[1].$name = "Cadence_in";
|
|
|
+GPIO1.associatedPins[1].$name = "Cadence_Speed";
|
|
|
+GPIO1.associatedPins[1].pin.$assign = "PA9";
|
|
|
+GPIO1.associatedPins[2].direction = "INPUT";
|
|
|
+GPIO1.associatedPins[2].$name = "Cadence_Dir";
|
|
|
+GPIO1.associatedPins[2].assignedPort = "PORTB";
|
|
|
+GPIO1.associatedPins[2].assignedPin = "7";
|
|
|
+GPIO1.associatedPins[2].pin.$assign = "PB7";
|
|
|
+GPIO1.associatedPins[3].$name = "PIN_GEAR";
|
|
|
+GPIO1.associatedPins[3].direction = "INPUT";
|
|
|
+GPIO1.associatedPins[3].assignedPort = "PORTB";
|
|
|
+GPIO1.associatedPins[3].assignedPin = "15";
|
|
|
+GPIO1.associatedPins[3].pin.$assign = "PB15";
|
|
|
|
|
|
GPIO2.$name = "HALL";
|
|
|
GPIO2.associatedPins.create(3);
|
|
@@ -206,27 +198,27 @@ GPIO2.associatedPins[2].pin.$assign = "PB2";
|
|
|
|
|
|
GPIO3.$name = "OUTPUT";
|
|
|
GPIO3.associatedPins[0].$name = "POWER_EN";
|
|
|
-GPIO3.associatedPins[0].assignedPort = "PORTA";
|
|
|
-GPIO3.associatedPins[0].assignedPin = "23";
|
|
|
-GPIO3.associatedPins[0].pin.$assign = "PA23";
|
|
|
+GPIO3.associatedPins[0].assignedPort = "PORTB";
|
|
|
+GPIO3.associatedPins[0].assignedPin = "8";
|
|
|
+GPIO3.associatedPins[0].pin.$assign = "PB8";
|
|
|
|
|
|
GPIO4.$name = "LIGHT_DETECT";
|
|
|
-GPIO4.associatedPins.create(3);
|
|
|
-GPIO4.associatedPins[0].$name = "BACK";
|
|
|
-GPIO4.associatedPins[0].interruptEn = true;
|
|
|
+GPIO4.associatedPins[0].$name = "LEFT";
|
|
|
GPIO4.associatedPins[0].direction = "INPUT";
|
|
|
+GPIO4.associatedPins[0].interruptEn = true;
|
|
|
GPIO4.associatedPins[0].polarity = "RISE";
|
|
|
-GPIO4.associatedPins[0].pin.$assign = "PB15";
|
|
|
-GPIO4.associatedPins[1].$name = "RIGHT";
|
|
|
-GPIO4.associatedPins[1].direction = "INPUT";
|
|
|
-GPIO4.associatedPins[1].interruptEn = true;
|
|
|
-GPIO4.associatedPins[1].polarity = "RISE";
|
|
|
-GPIO4.associatedPins[1].pin.$assign = "PB8";
|
|
|
-GPIO4.associatedPins[2].$name = "LEFT";
|
|
|
-GPIO4.associatedPins[2].direction = "INPUT";
|
|
|
-GPIO4.associatedPins[2].interruptEn = true;
|
|
|
-GPIO4.associatedPins[2].polarity = "RISE";
|
|
|
-GPIO4.associatedPins[2].pin.$assign = "PA3";
|
|
|
+GPIO4.associatedPins[0].pin.$assign = "PA3";
|
|
|
+
|
|
|
+GPIO5.$name = "GPIO_BIKESPEED";
|
|
|
+GPIO5.associatedPins[0].$name = "PIN_speed";
|
|
|
+GPIO5.associatedPins[0].direction = "INPUT";
|
|
|
+
|
|
|
+GPIO6.$name = "GPIO_B_LED";
|
|
|
+GPIO6.associatedPins.create(2);
|
|
|
+GPIO6.associatedPins[0].$name = "PIN_EN";
|
|
|
+GPIO6.associatedPins[0].pin.$assign = "PB6";
|
|
|
+GPIO6.associatedPins[1].$name = "PIN_SEL";
|
|
|
+GPIO6.associatedPins[1].pin.$assign = "PB16";
|
|
|
|
|
|
MCAN1.$name = "MCAN0";
|
|
|
MCAN1.desiredNomRate = 250;
|
|
@@ -378,39 +370,6 @@ PWM2.ccp1PinConfig.passedPeripheralType = scripting.forceWrite("Digital");
|
|
|
PWM2.ccp1PinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric28";
|
|
|
PWM2.PWM_CHANNEL_1.$name = "ti_driverlib_pwm_PWMTimerCC3";
|
|
|
|
|
|
-PWM3.timerCount = 2304;
|
|
|
-PWM3.pwmMode = "EDGE_ALIGN_UP";
|
|
|
-PWM3.$name = "PWM_B_L";
|
|
|
-PWM3.peripheral.$assignAllowConflicts = "TIMG8";
|
|
|
-PWM3.peripheral.ccp0Pin.$assign = "PB6";
|
|
|
-PWM3.peripheral.ccp1Pin.$assign = "PB16";
|
|
|
-PWM3.PWM_CHANNEL_0.$name = "ti_driverlib_pwm_PWMTimerCC1";
|
|
|
-PWM3.PWM_CHANNEL_1.$name = "ti_driverlib_pwm_PWMTimerCC6";
|
|
|
-PWM3.ccp0PinConfig.direction = scripting.forceWrite("OUTPUT");
|
|
|
-PWM3.ccp0PinConfig.hideOutputInversion = scripting.forceWrite(false);
|
|
|
-PWM3.ccp0PinConfig.onlyInternalResistor = scripting.forceWrite(false);
|
|
|
-PWM3.ccp0PinConfig.passedPeripheralType = scripting.forceWrite("Digital");
|
|
|
-PWM3.ccp0PinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric25";
|
|
|
-PWM3.ccp1PinConfig.direction = scripting.forceWrite("OUTPUT");
|
|
|
-PWM3.ccp1PinConfig.hideOutputInversion = scripting.forceWrite(false);
|
|
|
-PWM3.ccp1PinConfig.onlyInternalResistor = scripting.forceWrite(false);
|
|
|
-PWM3.ccp1PinConfig.passedPeripheralType = scripting.forceWrite("Digital");
|
|
|
-PWM3.ccp1PinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric26";
|
|
|
-
|
|
|
-PWM4.$name = "PWM_R";
|
|
|
-PWM4.ccIndex = [1];
|
|
|
-PWM4.clockDivider = 2;
|
|
|
-PWM4.timerCount = 2304;
|
|
|
-PWM4.pwmMode = "EDGE_ALIGN_UP";
|
|
|
-PWM4.peripheral.$assign = "TIMG12";
|
|
|
-PWM4.peripheral.ccp1Pin.$assign = "PA31";
|
|
|
-PWM4.ccp1PinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric7";
|
|
|
-PWM4.ccp1PinConfig.direction = scripting.forceWrite("OUTPUT");
|
|
|
-PWM4.ccp1PinConfig.hideOutputInversion = scripting.forceWrite(false);
|
|
|
-PWM4.ccp1PinConfig.onlyInternalResistor = scripting.forceWrite(false);
|
|
|
-PWM4.ccp1PinConfig.passedPeripheralType = scripting.forceWrite("Digital");
|
|
|
-PWM4.PWM_CHANNEL_1.$name = "ti_driverlib_pwm_PWMTimerCC4";
|
|
|
-
|
|
|
SYSCTL.clockTreeEn = true;
|
|
|
SYSCTL.forceDefaultClkConfig = true;
|
|
|
|
|
@@ -467,4 +426,4 @@ scripting.suppress("Migrating requires going through the Switch Board or Device
|
|
|
Board.peripheral.swclkPin.$suggestSolution = "PA20";
|
|
|
Board.peripheral.swdioPin.$suggestSolution = "PA19";
|
|
|
COMP1.peripheral.$suggestSolution = "COMP1";
|
|
|
-GPIO1.associatedPins[1].pin.$suggestSolution = "PA9";
|
|
|
+GPIO5.associatedPins[0].pin.$suggestSolution = "PA31";
|