34
34
* mcuboot.syscfg
35
35
*/
36
36
37
-
38
- const Board = scripting.addModule("/ti/drivers/Board");
37
+ const Button = scripting.addModule("/ti/drivers/apps/Button");
38
+ const Button1 = Button.addInstance();
39
+ const Button2 = Button.addInstance();
40
+ const LED = scripting.addModule("/ti/drivers/apps/LED");
41
+ const LED1 = LED.addInstance();
42
+ const LED2 = LED.addInstance();
39
43
40
44
/* ======== Board ======== */
41
- var boardName = system.deviceData.board.name ;
45
+ const deviceId = system.deviceData.deviceId ;
42
46
43
47
/**
44
48
* Import the modules used in this configuration.
@@ -50,19 +54,19 @@ for(var setting in ccfgSettings)
50
54
CCFG[setting] = ccfgSettings[setting];
51
55
}
52
56
53
- if (boardName .match(/CC13.2.7|CC26.2.7/))
57
+ if (deviceId .match(/CC13.2.7|CC26.2.7/))
54
58
{
55
59
// mcuboot stored at end of flash alongside CCFG
56
60
CCFG.setFlashVectorTable = true;
57
61
CCFG.addressFlashVectorTable = 0x000AC000;
58
62
}
59
- else if (boardName .match(/CC13.4|CC26.[34]/))
63
+ else if (deviceId .match(/CC13.4|CC26.[34]/))
60
64
{
61
65
// mcuboot stored at the beginning of flash
62
66
CCFG.setFlashVectorTable = true;
63
67
CCFG.addressFlashVectorTable = 0x00000000;
64
68
}
65
- else if (boardName .match(/CC23.0/)) {
69
+ else if (deviceId .match(/CC23.0/)) {
66
70
// Nothing to do. Default pBldrVtor = 0x00000000
67
71
}
68
72
else
73
77
CCFG.ccfgTemplate.$name = "ti_devices_CCFG_CCFGCC26XXTemplate0";
74
78
75
79
/* ======== GPIO ======== */
76
- var GPIO = scripting.addModule("/ti/drivers/GPIO");
77
80
78
- var gpio0 = GPIO.addInstance();
79
- gpio0.$hardware = system.deviceData.board.components.LED0;
80
- gpio0.$name = "CONFIG_GPIO_LED_0";
81
+ Button1.$name = "CONFIG_BTN_LEFT";
82
+ if (deviceId.match(/CC2674R/))
83
+ {
84
+ Button1.button.$assign = "DIO_13";
85
+ }
86
+ else
87
+ {
88
+ Button1.button.$assign = "DIO_15";
89
+ }
90
+ Button1.gpioPin.$name = "CONFIG_GPIO_BTN1";
91
+ Button1.gpioPin.pull = "Pull Up";
92
+ Button1.gpioPin.interruptTrigger = "Falling Edge";
81
93
82
- var gpio1 = GPIO.addInstance();
83
- gpio1.$hardware = system.deviceData.board.components.LED1;
84
- gpio1.$name = "CONFIG_GPIO_LED_1";
94
+ Button2.$name = "CONFIG_BTN_RIGHT";
95
+ Button2.button.$assign = "DIO_14";
96
+ Button2.gpioPin.$name = "CONFIG_GPIO_BTN2";
97
+ Button2.gpioPin.pull = "Pull Up";
98
+ Button2.gpioPin.interruptTrigger = "Falling Edge";
85
99
86
- var gpio2 = GPIO.addInstance() ;
87
- gpio2.$hardware = system.deviceData.board.components.BUTTON0 ;
88
- gpio2. $name = "CONFIG_GPIO_BUTTON_0 ";
100
+ LED1.$name = "CONFIG_LED_RED" ;
101
+ LED1.ledPin.$assign = "DIO_6" ;
102
+ LED1.gpioPin. $name = "CONFIG_GPIO_RLED ";
89
103
90
- var gpio3 = GPIO.addInstance() ;
91
- gpio3.$hardware = system.deviceData.board.components.BUTTON1 ;
92
- gpio3. $name = "CONFIG_GPIO_BUTTON_1 ";
104
+ LED2.$name = "CONFIG_LED_GREEN" ;
105
+ LED2.ledPin.$assign = "DIO_7" ;
106
+ LED2.gpioPin. $name = "CONFIG_GPIO_GLED ";
0 commit comments