179 lines
5.0 KiB
JavaScript
179 lines
5.0 KiB
JavaScript
|
|
let path = require('path');
|
||
|
|
|
||
|
|
let device = "am263x";
|
||
|
|
|
||
|
|
const files = {
|
||
|
|
common: [
|
||
|
|
/* Project Files */
|
||
|
|
"df22_test.c",
|
||
|
|
"main.c",
|
||
|
|
],
|
||
|
|
};
|
||
|
|
|
||
|
|
const projectspec_files = {
|
||
|
|
common: [
|
||
|
|
"../../../df22_test.h",
|
||
|
|
"../../../data",
|
||
|
|
]
|
||
|
|
}
|
||
|
|
|
||
|
|
/* Relative to where the makefile will be generated
|
||
|
|
* Typically at <example_folder>/<BOARD>/<core_os_combo>/<compiler>
|
||
|
|
*/
|
||
|
|
const filedirs = {
|
||
|
|
common: [
|
||
|
|
"..", /* core_os_combo base */
|
||
|
|
"../../..", /* Example base */
|
||
|
|
],
|
||
|
|
};
|
||
|
|
|
||
|
|
const libdirs_nortos = {
|
||
|
|
common: [
|
||
|
|
"${MOTOR_CONTROL_SDK_PATH}/mcu_plus_sdk/source/kernel/nortos/lib",
|
||
|
|
"${MOTOR_CONTROL_SDK_PATH}/mcu_plus_sdk/source/drivers/lib",
|
||
|
|
"${MOTOR_CONTROL_SDK_PATH}/mcu_plus_sdk/source/board/lib",
|
||
|
|
],
|
||
|
|
};
|
||
|
|
|
||
|
|
const libdirs_freertos = {
|
||
|
|
common: [
|
||
|
|
"${MOTOR_CONTROL_SDK_PATH}/mcu_plus_sdk/source/kernel/freertos/lib",
|
||
|
|
"${MOTOR_CONTROL_SDK_PATH}/mcu_plus_sdk/source/drivers/lib",
|
||
|
|
"${MOTOR_CONTROL_SDK_PATH}/mcu_plus_sdk/source/board/lib",
|
||
|
|
],
|
||
|
|
};
|
||
|
|
|
||
|
|
const includes_nortos_r5f = {
|
||
|
|
common: [
|
||
|
|
"${MOTOR_CONTROL_SDK_PATH}/source/dcl"
|
||
|
|
],
|
||
|
|
};
|
||
|
|
|
||
|
|
const includes_freertos_r5f = {
|
||
|
|
common: [
|
||
|
|
"${MOTOR_CONTROL_SDK_PATH}/mcu_plus_sdk/source/kernel/freertos/FreeRTOS-Kernel/include",
|
||
|
|
"${MOTOR_CONTROL_SDK_PATH}/mcu_plus_sdk/source/kernel/freertos/portable/TI_ARM_CLANG/ARM_CR5F",
|
||
|
|
"${MOTOR_CONTROL_SDK_PATH}/mcu_plus_sdk/source/kernel/freertos/config/am263x/r5f",
|
||
|
|
"${MOTOR_CONTROL_SDK_PATH}/source/dcl"
|
||
|
|
],
|
||
|
|
};
|
||
|
|
|
||
|
|
const libs_nortos_r5f = {
|
||
|
|
common: [
|
||
|
|
"nortos.am263x.r5f.ti-arm-clang.${ConfigName}.lib",
|
||
|
|
"drivers.am263x.r5f.ti-arm-clang.${ConfigName}.lib",
|
||
|
|
"board.am263x.r5f.ti-arm-clang.${ConfigName}.lib",
|
||
|
|
],
|
||
|
|
};
|
||
|
|
|
||
|
|
const libs_freertos_r5f = {
|
||
|
|
common: [
|
||
|
|
"freertos.am263x.r5f.ti-arm-clang.${ConfigName}.lib",
|
||
|
|
"drivers.am263x.r5f.ti-arm-clang.${ConfigName}.lib",
|
||
|
|
"board.am263x.r5f.ti-arm-clang.${ConfigName}.lib",
|
||
|
|
],
|
||
|
|
};
|
||
|
|
|
||
|
|
|
||
|
|
const lnkfiles = {
|
||
|
|
common: [
|
||
|
|
"linker.cmd",
|
||
|
|
"dcl_linker_r5f_am263x_sitara.cmd",
|
||
|
|
]
|
||
|
|
};
|
||
|
|
|
||
|
|
const syscfgfile = "../example.syscfg";
|
||
|
|
|
||
|
|
const readmeDoxygenPageTag = "EXAMPLES_DCL_DF22";
|
||
|
|
|
||
|
|
const templates_nortos_r5f =
|
||
|
|
[
|
||
|
|
{
|
||
|
|
input: ".project/templates/am263x/common/linker_r5f.cmd.xdt",
|
||
|
|
output: "linker.cmd",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
input: ".project/templates/am263x/nortos/main_nortos.c.xdt",
|
||
|
|
output: "../main.c",
|
||
|
|
options: {
|
||
|
|
entryFunction: "dcl_df22_main",
|
||
|
|
},
|
||
|
|
}
|
||
|
|
];
|
||
|
|
|
||
|
|
const templates_freertos_r5f =
|
||
|
|
[
|
||
|
|
{
|
||
|
|
input: ".project/templates/am263x/common/linker_r5f.cmd.xdt",
|
||
|
|
output: "linker.cmd",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
input: ".project/templates/am263x/freertos/main_freertos.c.xdt",
|
||
|
|
output: "../main.c",
|
||
|
|
options: {
|
||
|
|
entryFunction: "dcl_df22_main",
|
||
|
|
},
|
||
|
|
}
|
||
|
|
];
|
||
|
|
|
||
|
|
|
||
|
|
const buildOptionCombos = [
|
||
|
|
{ device: device, cpu: "r5fss0-0", cgt: "ti-arm-clang", board: "am263x-cc", os: "nortos"},
|
||
|
|
{ device: device, cpu: "r5fss0-0", cgt: "ti-arm-clang", board: "am263x-cc", os: "freertos"},
|
||
|
|
{ device: device, cpu: "r5fss0-0", cgt: "ti-arm-clang", board: "am263x-lp", os: "nortos"},
|
||
|
|
{ device: device, cpu: "r5fss0-0", cgt: "ti-arm-clang", board: "am263x-lp", os: "freertos"},
|
||
|
|
];
|
||
|
|
|
||
|
|
function getComponentProperty() {
|
||
|
|
let property = {};
|
||
|
|
|
||
|
|
property.dirPath = path.resolve(__dirname, "..");
|
||
|
|
property.type = "executable";
|
||
|
|
property.name = "dcl_df22";
|
||
|
|
property.isInternal = false;
|
||
|
|
property.tirexResourceSubClass = [ "example.gettingstarted" ];
|
||
|
|
property.description = "A Direct Form 2 2nd order example demonstrating the digital control library (DCL)."
|
||
|
|
property.buildOptionCombos = buildOptionCombos;
|
||
|
|
|
||
|
|
return property;
|
||
|
|
}
|
||
|
|
|
||
|
|
function getComponentBuildProperty(buildOption) {
|
||
|
|
let build_property = {};
|
||
|
|
|
||
|
|
/* The following build property has been modified for dcl usage,
|
||
|
|
specifically - added different includes vars distinguishing no/free rtos
|
||
|
|
added different lnkfiles vars for cpu-specific lnk files
|
||
|
|
*/
|
||
|
|
build_property.files = files;
|
||
|
|
build_property.filedirs = filedirs;
|
||
|
|
build_property.libdirs = libdirs_nortos;
|
||
|
|
build_property.lnkfiles = lnkfiles;
|
||
|
|
build_property.syscfgfile = syscfgfile;
|
||
|
|
build_property.readmeDoxygenPageTag = readmeDoxygenPageTag;
|
||
|
|
build_property.projectspec_files = projectspec_files;
|
||
|
|
|
||
|
|
if(buildOption.cpu.match(/r5f*/)) {
|
||
|
|
if(buildOption.os.match(/freertos*/) )
|
||
|
|
{
|
||
|
|
build_property.includes = includes_freertos_r5f;
|
||
|
|
build_property.libdirs = libdirs_freertos;
|
||
|
|
build_property.libs = libs_freertos_r5f;
|
||
|
|
build_property.templates = templates_freertos_r5f;
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
build_property.includes = includes_nortos_r5f;
|
||
|
|
build_property.libs = libs_nortos_r5f;
|
||
|
|
build_property.templates = templates_nortos_r5f;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return build_property;
|
||
|
|
}
|
||
|
|
|
||
|
|
module.exports = {
|
||
|
|
getComponentProperty,
|
||
|
|
getComponentBuildProperty,
|
||
|
|
};
|