diff --git a/.cproject b/.cproject new file mode 100644 index 0000000..eeea291 --- /dev/null +++ b/.cproject @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.gitignore b/.gitignore index cd531cf..8cd76c7 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,4 @@ Module.symvers Mkfile.old dkms.conf +/Debug/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..c5aa385 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "cm_heatsink_emulator"] + path = cm_heatsink_emulator + url = https://gitea.oz1cm.dk/universal_components/cm_heatsink_emulator.git + branch = master diff --git a/.project b/.project new file mode 100644 index 0000000..9396ef5 --- /dev/null +++ b/.project @@ -0,0 +1,26 @@ + + + heatsink_emulator_wip + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml new file mode 100644 index 0000000..3bc1fc0 --- /dev/null +++ b/.settings/language.settings.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.settings/org.eclipse.cdt.managedbuilder.core.prefs b/.settings/org.eclipse.cdt.managedbuilder.core.prefs new file mode 100644 index 0000000..6c369a1 --- /dev/null +++ b/.settings/org.eclipse.cdt.managedbuilder.core.prefs @@ -0,0 +1,11 @@ +eclipse.preferences.version=1 +environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1285400496/CPATH/delimiter=; +environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1285400496/CPATH/operation=remove +environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1285400496/C_INCLUDE_PATH/delimiter=; +environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1285400496/C_INCLUDE_PATH/operation=remove +environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1285400496/append=true +environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1285400496/appendContributed=true +environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.1285400496/LIBRARY_PATH/delimiter=; +environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.1285400496/LIBRARY_PATH/operation=remove +environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.1285400496/append=true +environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.1285400496/appendContributed=true diff --git a/cm_heatsink_emulator b/cm_heatsink_emulator new file mode 160000 index 0000000..a735848 --- /dev/null +++ b/cm_heatsink_emulator @@ -0,0 +1 @@ +Subproject commit a735848834b5a5d50974060d8a0b94f7d50d846b diff --git a/main.c b/main.c new file mode 100644 index 0000000..5aab835 --- /dev/null +++ b/main.c @@ -0,0 +1,34 @@ +/* + * main.c + * + * Created on: 14 Oct 2025 + * Author: Christian L. V. Madsen (OZ1CM) + */ +#include "cm_heatsink_emulator/cm_heatsink_emulator.h" + +#define POWER 600 // Watts +#define AMBIENT_TEMPERATURE 25 // degC +#define C_TH 32688.36649 // Thermal capacity + +cm_heatsink_thermalElement_t thermElements[3] = { + { + .label = "LED To NTC", + .R_th = 0.002021944 + },{ + .label = "NTC To Heat sink", + .R_th = 0.015981191 + },{ + .label = "Heat sink To Ambient", + .R_th = 0.121949843 + }, + +}; + +cm_heatsinkEmul_t thermEmul; +int main(void ){ + + // Init Thermal emulator + cm_heatsinkEmul_init(&thermEmul, thermElements, 1/*(sizeof(thermElements) / sizeof(thermElements[0]))*/, POWER, AMBIENT_TEMPERATURE); + + cm_heatsinkEmul_getRespon(&thermEmul, 0.1); +}