diff options
author | siddhu8990 | 2016-02-01 11:05:35 +0530 |
---|---|---|
committer | siddhu8990 | 2016-02-01 11:05:35 +0530 |
commit | 3425c4fedbdbc7e1a3440df7502d9af93f466b84 (patch) | |
tree | 55f138b2e4c2133b1d01ce4959996452213e2d18 /2.3-1/macros | |
parent | ef666a6b9ac74d5effe8b34179cc3ad0c247e7c3 (diff) | |
download | Scilab2C-3425c4fedbdbc7e1a3440df7502d9af93f466b84.tar.gz Scilab2C-3425c4fedbdbc7e1a3440df7502d9af93f466b84.tar.bz2 Scilab2C-3425c4fedbdbc7e1a3440df7502d9af93f466b84.zip |
Support for RPi gpios added
Diffstat (limited to '2.3-1/macros')
63 files changed, 442 insertions, 88 deletions
diff --git a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin Binary files differindex d5d2e4ab..ce6f0d68 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin +++ b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin diff --git a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci index f6ae58e7..57f5f930 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci +++ b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci @@ -46,9 +46,9 @@ ReportFileName = FileInfo.Funct(nxtscifunnumber).ReportFileName; Pass1HeaderFileName = FileInfo.Funct(nxtscifunnumber).Pass1HeaderFileName; FunInfoDatDir = FileInfo.FunctionList.FunInfoDatDir; CGblDeclarFileName = FileInfo.Funct(nxtscifunnumber).CGblDeclarFileName; -if(SharedInfo.OutFormat == 'AVR') +if(SharedInfo.Target == 'AVR') PeripheralInitListFile = FileInfo.PeripheralInitListFile; -elseif (SharedInfo.OutFormat == 'Arduino') +elseif (SharedInfo.Target == 'Arduino') SetupListFile = FileInfo.SetupListFile; end diff --git a/2.3-1/macros/CCodeGeneration/C_Funcall.bin b/2.3-1/macros/CCodeGeneration/C_Funcall.bin Binary files differindex fec47128..36823876 100644 --- a/2.3-1/macros/CCodeGeneration/C_Funcall.bin +++ b/2.3-1/macros/CCodeGeneration/C_Funcall.bin diff --git a/2.3-1/macros/CCodeGeneration/C_Funcall.sci b/2.3-1/macros/CCodeGeneration/C_Funcall.sci index 166799e6..3669e54d 100644 --- a/2.3-1/macros/CCodeGeneration/C_Funcall.sci +++ b/2.3-1/macros/CCodeGeneration/C_Funcall.sci @@ -35,7 +35,7 @@ CDeclarationFileName = FileInfo.Funct(nxtscifunnumber).CDeclarationFileName; CInitVarsFileName = FileInfo.Funct(nxtscifunnumber).CInitVarsFileName; IndentLevel = SharedInfo.NIndent; CCall = ''; -OutFormat = SharedInfo.OutFormat; +Target = SharedInfo.Target; // --- Extract Function Info. --- FunctionName = FunInfo.SCIFunctionName; CFunName = FunInfo.CFunctionName; @@ -371,7 +371,7 @@ else if (FlagCall == 0) // Add prototype to the header file - C_InitHeader(CCall+';',HeaderFileName,SharedInfo.Sci2CLibMainHeaderFName,OutFormat); + C_InitHeader(CCall+';',HeaderFileName,SharedInfo.Sci2CLibMainHeaderFName,Target); // Add { at the beginning of the function. PrintStringInfo(' {',ReportFileName,'file','y'); diff --git a/2.3-1/macros/CCodeGeneration/C_GenerateFunName.bin b/2.3-1/macros/CCodeGeneration/C_GenerateFunName.bin Binary files differindex 4f3c5917..9a4af082 100644 --- a/2.3-1/macros/CCodeGeneration/C_GenerateFunName.bin +++ b/2.3-1/macros/CCodeGeneration/C_GenerateFunName.bin diff --git a/2.3-1/macros/CCodeGeneration/C_GenerateFunName.sci b/2.3-1/macros/CCodeGeneration/C_GenerateFunName.sci index 657258a9..54c641f2 100644 --- a/2.3-1/macros/CCodeGeneration/C_GenerateFunName.sci +++ b/2.3-1/macros/CCodeGeneration/C_GenerateFunName.sci @@ -23,9 +23,9 @@ function CFunName = C_GenerateFunName(FunctionName,InArg,NInArg,OutArg,NOutArg) // ------------------------------ SCI2CNInArgCheck(argn(2),5,5); CFunName = ''; -if(IsAVRSupportFunction(FunctionName)) -//If current function is an AVR function, then function name can be just plain -//function name without any input/output arguments types +if((IsAVRSupportFunction(FunctionName)) | (IsRPISupportFunction(FunctionName))) +//If current function is an AVR or RPi function, then function name can be just +//plain function name without any input/output arguments types CFunName = CFunName+FunctionName; diff --git a/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.bin b/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.bin Binary files differindex cf4ea0e4..feff05f8 100644 --- a/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.bin +++ b/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.bin diff --git a/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci b/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci index 320d8035..424c8216 100644 --- a/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci +++ b/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.sci @@ -26,6 +26,8 @@ SCI2CNInArgCheck(argn(2),2,2); // ----------------------- PrintStepInfo('Generating Builder '+FileInfo.MakefileFilename,... FileInfo.GeneralReport,'both'); + +target = SharedInfo.Target; // --------------------------- // --- End Initialization. --- // --------------------------- @@ -41,28 +43,37 @@ PrintStringInfo('# --- DIRECTORIES AND FILES ---',FileInfo.MakefileFilename,'fil makecsrcdir = pathconvert('src/c', %f, %f, 'u'); makehsrcdir = pathconvert('includes', %f, %f, 'u'); makeisrcdir = pathconvert('interfaces', %f, %f, 'u'); +makelibdir = pathconvert('libraries', %f, %f, 'u'); makesci2cdir = FileInfo.CStyleOutCCCodeDir; PrintStringInfo('CSRCDIR = '+makecsrcdir,FileInfo.MakefileFilename,'file','y','y'); PrintStringInfo('HSRCDIR = '+makehsrcdir,FileInfo.MakefileFilename,'file','y','y'); PrintStringInfo('ISRCDIR = '+makeisrcdir,FileInfo.MakefileFilename,'file','y','y'); +PrintStringInfo('LIBDIR = '+makelibdir,FileInfo.MakefileFilename,'file','y','y'); PrintStringInfo('SCI2CDIR = .',FileInfo.MakefileFilename,'file','y','y'); // Compiler definition -PrintStringInfo('CC = gcc',FileInfo.MakefileFilename,'file','y','y'); -PrintStringInfo('CFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR)',FileInfo.MakefileFilename,'file','y','y'); -PrintStringInfo('LDFLAGS = -lblas -llapack -lm',FileInfo.MakefileFilename,'file','y','y'); - +if (target == 'RPi') + PrintStringInfo('CC = arm-linux-gnueabihf-gcc ',FileInfo.MakefileFilename,'file','y','y'); +else + PrintStringInfo('CC = gcc',FileInfo.MakefileFilename,'file','y','y'); +end +PrintStringInfo('CFLAGS = -Wall -pedantic -g -I $(HSRCDIR) -I $(ISRCDIR) -L $(LIBDIR)',FileInfo.MakefileFilename,'file','y','y'); +if (target == 'RPi') + PrintStringInfo('LDFLAGS = -llapack -lrefblas -lgfortran -lm -lbcm2835',FileInfo.MakefileFilename,'file','y','y'); +else + PrintStringInfo('LDFLAGS = -lblas -llapack -lm ',FileInfo.MakefileFilename,'file','y','y'); +end // Binary definition PrintStringInfo('EXEFILENAME = mytest.exe',FileInfo.MakefileFilename,'file','y','y'); PrintStringInfo('EXEFILE = $(SCI2CDIR)/$(EXEFILENAME)', FileInfo.MakefileFilename,'file','y','y'); // Sources //Check the output format selected and insert files according to it -outformat = SharedInfo.OutFormat; +target = SharedInfo.Target; PrintStringInfo('SRC = \\', FileInfo.MakefileFilename,'file','y','y'); -allSources = getAllSources(outformat); +allSources = getAllSources(target); nbSources = size(allSources); for i = 1:(nbSources(1) - 1) [tmppath,tmpfile,tmpext] = fileparts(allSources(i)); diff --git a/2.3-1/macros/CCodeGeneration/C_InitHeader.bin b/2.3-1/macros/CCodeGeneration/C_InitHeader.bin Binary files differindex 642e75c3..957ea506 100644 --- a/2.3-1/macros/CCodeGeneration/C_InitHeader.bin +++ b/2.3-1/macros/CCodeGeneration/C_InitHeader.bin diff --git a/2.3-1/macros/CCodeGeneration/C_InitHeader.sci b/2.3-1/macros/CCodeGeneration/C_InitHeader.sci index dffb9726..bc6f2520 100644 --- a/2.3-1/macros/CCodeGeneration/C_InitHeader.sci +++ b/2.3-1/macros/CCodeGeneration/C_InitHeader.sci @@ -1,4 +1,4 @@ -function C_InitHeader(C_Prototype,HeaderFileName,Sci2CLibMainHeaderFName,OutFormat) +function C_InitHeader(C_Prototype,HeaderFileName,Sci2CLibMainHeaderFName,Target) // function C_InitHeader(C_Prototype,HeaderFileName,Sci2CLibMainHeaderFName) // ----------------------------------------------------------------- // //NUT: add description here @@ -38,7 +38,7 @@ PrintStringInfo('** ------------------- ',HeaderFileName,'file','y'); PrintStringInfo('** ----- Target ------ ',HeaderFileName,'file','y'); PrintStringInfo('** ------------------- ',HeaderFileName,'file','y'); PrintStringInfo('*/',HeaderFileName,'file','y'); -PrintStringInfo('# define ' + OutFormat + '1 1' ,HeaderFileName,'file','y'); +PrintStringInfo('# define ' + Target + '1 1' ,HeaderFileName,'file','y'); PrintStringInfo('/*',HeaderFileName,'file','y'); PrintStringInfo('** ----------------------- ',HeaderFileName,'file','y'); PrintStringInfo('** --- SCI2C Includes. --- ',HeaderFileName,'file','y'); diff --git a/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN_CAT.bin b/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN_CAT.bin Binary files differnew file mode 100644 index 00000000..2373b813 --- /dev/null +++ b/2.3-1/macros/FunctionAnnotation/FA_SZ_ROW_COLUMN_CAT.bin diff --git a/2.3-1/macros/FunctionAnnotation/lib b/2.3-1/macros/FunctionAnnotation/lib Binary files differindex c2025c87..6e93fb38 100644 --- a/2.3-1/macros/FunctionAnnotation/lib +++ b/2.3-1/macros/FunctionAnnotation/lib diff --git a/2.3-1/macros/FunctionAnnotation/names b/2.3-1/macros/FunctionAnnotation/names index d9300d20..a5f862b9 100644 --- a/2.3-1/macros/FunctionAnnotation/names +++ b/2.3-1/macros/FunctionAnnotation/names @@ -37,6 +37,7 @@ FA_SZ_OPPLUSA FA_SZ_OPRC FA_SZ_OPSLASH FA_SZ_OPSTAR +FA_SZ_ROW_COLUMN_CAT FA_SZ_SEL1 FA_SZ_SEL2 FA_TP_C diff --git a/2.3-1/macros/Hardware/AVR/AVRUARTSetup.bin b/2.3-1/macros/Hardware/AVR/AVRUARTSetup.bin Binary files differnew file mode 100644 index 00000000..4a49b861 --- /dev/null +++ b/2.3-1/macros/Hardware/AVR/AVRUARTSetup.bin diff --git a/2.3-1/macros/Hardware/AVR/buildmacros.sce b/2.3-1/macros/Hardware/AVR/buildmacros.sce index 60fd2843..2954a424 100644 --- a/2.3-1/macros/Hardware/AVR/buildmacros.sce +++ b/2.3-1/macros/Hardware/AVR/buildmacros.sce @@ -1,14 +1,3 @@ -// -// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab -// Copyright (C) 2009-2009 - DIGITEO - Bruno JOFRET -// -// This file must be used under the terms of the CeCILL. -// This source file is licensed as described in the file COPYING, which -// you should have received as part of this distribution. The terms -// are also available at -// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt -// -// tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); diff --git a/2.3-1/macros/Hardware/AVR/lib b/2.3-1/macros/Hardware/AVR/lib Binary files differindex b1986824..64d346af 100644 --- a/2.3-1/macros/Hardware/AVR/lib +++ b/2.3-1/macros/Hardware/AVR/lib diff --git a/2.3-1/macros/Hardware/AVR/names b/2.3-1/macros/Hardware/AVR/names index 126da77a..624fee8a 100644 --- a/2.3-1/macros/Hardware/AVR/names +++ b/2.3-1/macros/Hardware/AVR/names @@ -7,6 +7,7 @@ AVRPWMSetDuty AVRPWMSetup AVRReadADC AVRTimerSetup +AVRUARTSetup GetAVRSupportFunctions GetPeripheral InsertPeripheralInList diff --git a/2.3-1/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin b/2.3-1/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin Binary files differnew file mode 100644 index 00000000..5bea6458 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin diff --git a/2.3-1/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci b/2.3-1/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci new file mode 100644 index 00000000..24c2f556 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci @@ -0,0 +1,21 @@ +function AVRSupportFunctions = GetRPISupportFunctions() +// ----------------------------------------------------------------- +// Get list of RPI peripherals supported +// +// Input data: +// None +// +// Output data: +// None +// +// Author: Siddhesh Wani +// ----------------------------------------------------------------- + +AVRSupportFunctions = [ + "RPI_DigitalIn" + "RPI_DigitalOut" + "RPI_DigitalSetup" + "RPI_DelayMilli" + "RPI_DelayMicro"]; + +endfunction diff --git a/2.3-1/macros/Hardware/RasberryPi/IsRPISupportFunction.bin b/2.3-1/macros/Hardware/RasberryPi/IsRPISupportFunction.bin Binary files differnew file mode 100644 index 00000000..728e3d80 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/IsRPISupportFunction.bin diff --git a/2.3-1/macros/Hardware/RasberryPi/IsRPISupportFunction.sci b/2.3-1/macros/Hardware/RasberryPi/IsRPISupportFunction.sci new file mode 100644 index 00000000..647b0c85 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/IsRPISupportFunction.sci @@ -0,0 +1,22 @@ +function Output = IsRPISupportFunction(FunName) +// ----------------------------------------------------------------- +// Check whether input function name is a RPi support function or not. +// +// Input data: +// FunName: Name of the function to be checked +// +// Output data: +// Output: True or False depending whether given function is a RPi +// support functions or not +// +// Author: Siddhesh Wani +// ----------------------------------------------------------------- + +//Get list of supported functions for AVR +RPISupportFunctions = GetRPISupportFunctions(); + +//Check whether input function is present in above list or not +FunNameInRPISupport = members(FunName,RPISupportFunctions); +Output = bool2s(FunNameInRPISupport~=0); + +endfunction diff --git a/2.3-1/macros/Hardware/RasberryPi/RPIDelay.bin b/2.3-1/macros/Hardware/RasberryPi/RPIDelay.bin Binary files differnew file mode 100644 index 00000000..bb8279ec --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/RPIDelay.bin diff --git a/2.3-1/macros/Hardware/RasberryPi/RPIDelay.sci b/2.3-1/macros/Hardware/RasberryPi/RPIDelay.sci new file mode 100644 index 00000000..c5080dd8 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/RPIDelay.sci @@ -0,0 +1,31 @@ +function RPI_DelayMilli(time) +// Function to insert some delay in code execution. +// +// Calling Sequence +// RPI_DelayMilli(time) +// +// Parameters +// time: time(milliseconds) for which execution is to be delayed +// +// Description +// this function can be used for insertig execution delays. 'time' should be +// specified in milliseconds. If more resolution is required, use 'RPI_DelayMicro' +// for inserting delay in microseconds. +// Note: Delay inserted by this function is not accurate, but depedent on +// operating system, other running tasks etc. +// +// Examples +// RPI_DelayMilli(100) //This will delay the execution of next code by 100 ms. +// +// See also +// RPI_DelayMicro +// +// +// Authors +// Siddhesh Wani +// + +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for RPi. + +endfunction diff --git a/2.3-1/macros/Hardware/RasberryPi/RPIDelayMicro.bin b/2.3-1/macros/Hardware/RasberryPi/RPIDelayMicro.bin Binary files differnew file mode 100644 index 00000000..a4d32cb6 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/RPIDelayMicro.bin diff --git a/2.3-1/macros/Hardware/RasberryPi/RPIDelayMicro.sci b/2.3-1/macros/Hardware/RasberryPi/RPIDelayMicro.sci new file mode 100644 index 00000000..730755b7 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/RPIDelayMicro.sci @@ -0,0 +1,30 @@ +function RPI_DelayMicro(time) +// Function to insert some delay in code execution. +// +// Calling Sequence +// RPI_DelayMicro(time) +// +// Parameters +// time: time(microseconds) for which execution is to be delayed +// +// Description +// this function can be used for insertig execution delays. 'time' should be +// specified in microseconds.'time' should be between (1-65536). +// Note: Delay inserted by this function is not accurate, but depedent on +// operating system, other running tasks etc. +// +// Examples +// RPI_DelayMilli(100) //This will delay the execution of next code by 100 ms. +// +// See also +// RPI_DelayMicro +// +// +// Authors +// Siddhesh Wani +// + +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for RPi. + +endfunction diff --git a/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalIn.bin b/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalIn.bin Binary files differnew file mode 100644 index 00000000..a3269a0a --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalIn.bin diff --git a/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalIn.sci b/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalIn.sci new file mode 100644 index 00000000..3ea3bf12 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalIn.sci @@ -0,0 +1,27 @@ +function state = RPI_DigitalIn(pin) +// Function to read current state on digital pins. +// +// Calling Sequence +// state = RPI_DigitalIn(pin) +// +// Parameters +// pin : pin of RPi to be used +// state : current state of the pin (0 -> LOW, 1 -> HIGH) +// +// Description +// This fucntion is used for reading the current state on gpio pins of RPi. 'RPI_DigitalSetup' function must be called before this for setting up pin as input. 'pin' must be specified from list given. 'state' specifies the input state (0 -> Low, 1-> High) +// Examples +// RPI_DigitalIn(RPI_GPIO_P1_03) //Reads the state of pin 3 of header P1. +// +// See also +// RPI_DigitalSetup RPI_DigitalOut +// +// +// Authors +// Siddhesh Wani +// + +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for RPi. + +endfunction diff --git a/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalOut.bin b/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalOut.bin Binary files differnew file mode 100644 index 00000000..d6b6b7bf --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalOut.bin diff --git a/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalOut.sci b/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalOut.sci new file mode 100644 index 00000000..4836f54f --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalOut.sci @@ -0,0 +1,27 @@ +function RPI_DigitalOut(pin, state) +// Function to output desired state on digital pins. +// +// Calling Sequence +// RPI_DigitalOut(pin, state) +// +// Parameters +// pin : pin of RPi to be used +// state : desired state of the pin (0 -> LOW, 1 -> HIGH) +// +// Description +// This fucntion is used for outputting the desired state on gpio pins of RPi. 'RPI_DigitalSetup' function must be called before this for setting up pin as output. 'pin' must be specified from list given. 'state' specifies the output state (0 -> Low, 1-> High) +// Examples +// RPI_DigitalOut(RPI_GPIO_P1_03,0) //Changes the state of pin 3 of header P1 as 'Low'. +// +// See also +// RPI_DigitalSetup RPI_DigitalIn +// +// +// Authors +// Siddhesh Wani +// + +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for RPi. + +endfunction diff --git a/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin b/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin Binary files differnew file mode 100644 index 00000000..46836cd9 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin diff --git a/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci b/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci new file mode 100644 index 00000000..5ce48f0b --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci @@ -0,0 +1,27 @@ +function RPI_DigitalSetup(pin, direction) +// Function to setup digital pins. +// +// Calling Sequence +// RPI_DigitalSetup(pin,direction) +// +// Parameters +// pin : pin of RPi to be used +// direction : direction to be set for pin (0 -> INPUT, 1 -> OUTPUT) +// +// Description +// There are few pins available on RPi as Gpio or digital io. These pins can be used as digital output or input. Pin name must be provided from list provided. Please refer '' for complete list of pins. Direction can be 0 or 1 depending upon desired function (Input/output) +// Examples +// RPI_DigitalSetup(RPI_GPIO_P1_03,0) //Sets pin 3 of header P1 as input +// +// See also +// RPI_DigitalIn RPI_DigitalOut +// +// +// Authors +// Siddhesh Wani +// + +// This is curretly dummy function. It provides no functionality but is required +// for providing support for generating C code for RPi. + +endfunction diff --git a/2.3-1/macros/Hardware/RasberryPi/buildmacros.sce b/2.3-1/macros/Hardware/RasberryPi/buildmacros.sce new file mode 100644 index 00000000..2954a424 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/buildmacros.sce @@ -0,0 +1,4 @@ + +tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); + +clear tbx_build_macros; diff --git a/2.3-1/macros/Hardware/RasberryPi/lib b/2.3-1/macros/Hardware/RasberryPi/lib Binary files differnew file mode 100644 index 00000000..5884511a --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/lib diff --git a/2.3-1/macros/Hardware/RasberryPi/names b/2.3-1/macros/Hardware/RasberryPi/names new file mode 100644 index 00000000..87fe2cd1 --- /dev/null +++ b/2.3-1/macros/Hardware/RasberryPi/names @@ -0,0 +1,7 @@ +GetRPISupportFunctions +IsRPISupportFunction +RPIDelay +RPIDelayMicro +RPI_DigitalIn +RPI_DigitalOut +RPI_DigitalSetup diff --git a/2.3-1/macros/Hardware/buildmacros.sce b/2.3-1/macros/Hardware/buildmacros.sce deleted file mode 100644 index 88f0fb2a..00000000 --- a/2.3-1/macros/Hardware/buildmacros.sce +++ /dev/null @@ -1,19 +0,0 @@ -// This file is released into the public domain - -Directories = [ "AVR" ]; - - -current_path_buildmacros = get_absolute_file_path("buildmacros.sce"); - -for K=1:size(Directories,"*") - myfile = current_path_buildmacros + filesep() + Directories(K) + filesep() + "buildmacros.sce"; - if isfile(myfile) then - exec(myfile); - end -end - -clear current_path_buildmacros; - -tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce')); - -clear tbx_build_macros; diff --git a/2.3-1/macros/Scilab-Arduino/GenerateSetupFunction.bin b/2.3-1/macros/Scilab-Arduino/GenerateSetupFunction.bin Binary files differindex 7a5052dc..ee4b6f95 100644 --- a/2.3-1/macros/Scilab-Arduino/GenerateSetupFunction.bin +++ b/2.3-1/macros/Scilab-Arduino/GenerateSetupFunction.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin Binary files differindex 26530399..a4c9a3fb 100644 --- a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin +++ b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index 629b3ee8..f4490101 100644 --- a/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/2.3-1/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -4301,6 +4301,111 @@ PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file', INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+//------------------------------------
+//---- Class RPI_DigitalSetup --------
+//------------------------------------
+ClassName = 'RPI_DigitalSetup';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''u8''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+//PrintStringInfo('d0d0'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo(''+ArgSeparator+'',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'RPI_DigitalSetup';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class RPI_DigitalOut ----------
+//------------------------------------
+ClassName = 'RPI_DigitalOut';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 2',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''u8''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+//PrintStringInfo('d0d0'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo(''+ArgSeparator+'',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'RPI_DigitalOut';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class RPI_DigitalIn -----------
+//------------------------------------
+ClassName = 'RPI_DigitalIn';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''u8''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+//PrintStringInfo('d0d0'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo(''+ArgSeparator+'',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'RPI_DigitalIn';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+//------------------------------------
+//---- Class RPI_DelayMilli ----------
+//------------------------------------
+ClassName = 'RPI_DelayMilli';
+
+// --- Class Annotation. ---
+PrintStringInfo(' Adding Class: '+ClassName+'.',GeneralReport,'file','y');
+ClassFileName = fullfile(SCI2CLibCAnnClsDir,ClassName+ExtensionCAnnCls);
+PrintStringInfo('NIN= 1',ClassFileName,'file','y');
+PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).TP= ''u8''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y');
+PrintStringInfo('OUT(1).SZ(2)= ''1''',ClassFileName,'file','y');
+
+// --- Function List Class. ---
+ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls);
+//PrintStringInfo('d0d0'+ArgSeparator+'u80',ClassFileName,'file','y');
+PrintStringInfo(''+ArgSeparator+'',ClassFileName,'file','y');
+
+// --- Annotation Function And Function List Function. ---
+FunctionName = 'RPI_DelayMilli';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
+FunctionName = 'RPI_DelayMicro';
+PrintStringInfo(' Adding Function: '+FunctionName+'.',GeneralReport,'file','y');
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCAnnFunDir,ClassName,GeneralReport,ExtensionCAnnFun);
+INIT_GenAnnFLFunctions(FunctionName,SCI2CLibCFLFunDir,ClassName,GeneralReport,ExtensionCFuncListFun);
+
// ////////////////////////////////////////////
// /////PARTE INTRODOTTA DA ALBERTO MOREA
diff --git a/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.bin b/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.bin Binary files differindex 4a82f12a..eed0cd8f 100644 --- a/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.bin +++ b/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.sci b/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.sci index a61eb724..c213db9f 100644 --- a/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.sci +++ b/2.3-1/macros/ToolInitialization/INIT_GenSharedInfo.sci @@ -1,4 +1,4 @@ -function SharedInfo = INIT_GenSharedInfo(RunMode,UserScilabMainFile,TotTempScalarVars,EnableTempVarsReuse,Sci2CLibMainHeaderFName,CopySciCodeIntoCCode,OutFormat)
+function SharedInfo = INIT_GenSharedInfo(RunMode,UserScilabMainFile,TotTempScalarVars,EnableTempVarsReuse,Sci2CLibMainHeaderFName,CopySciCodeIntoCCode,Target)
// function SharedInfo = INIT_GenSharedInfo(WorkingDir,OutCCCodeDir,UserSciFilesPaths,...
// RunMode,UserScilabMainFile,TotTempScalarVars,EnableTempVarsReuse,Sci2CLibMainHeaderFName)
// -----------------------------------------------------------------
@@ -47,7 +47,7 @@ SharedInfo.Sci2CLibMainHeaderFName = pathconvert(Sci2CLibMainHeaderFName, %f, %f SharedInfo.NextSCIFileName = UserScilabMainFile;
[scipath,funname,sciext] = fileparts(UserScilabMainFile);
SharedInfo.SCIMainFunName = funname;
-if (OutFormat == 'Arduino')
+if (Target == 'Arduino')
SharedInfo.CMainFunName = 'loop_arduino';
else
SharedInfo.CMainFunName = 'main';
@@ -120,6 +120,6 @@ SharedInfo.Extension.FuncListClasses = '.lcls'; // Stands for list class // ------------------------
SharedInfo.ResizeApproach = 'NO_RESIZE'; // 'NO_RESIZE', 'RESIZE_ALL', 'RESIZE_TEMP', 'RESIZE_LOCAL', 'RESIZE_GLOBAL', 'REALLOC_ALL_RESIZE_ALL'
-SharedInfo.OutFormat = OutFormat;
+SharedInfo.Target = Target;
endfunction
diff --git a/2.3-1/macros/ToolInitialization/INIT_SCI2C.bin b/2.3-1/macros/ToolInitialization/INIT_SCI2C.bin Binary files differindex c6141d61..91a0d91c 100644 --- a/2.3-1/macros/ToolInitialization/INIT_SCI2C.bin +++ b/2.3-1/macros/ToolInitialization/INIT_SCI2C.bin diff --git a/2.3-1/macros/ToolInitialization/INIT_SCI2C.sci b/2.3-1/macros/ToolInitialization/INIT_SCI2C.sci index 6dde05de..e5ee9758 100644 --- a/2.3-1/macros/ToolInitialization/INIT_SCI2C.sci +++ b/2.3-1/macros/ToolInitialization/INIT_SCI2C.sci @@ -1,5 +1,5 @@ function [FileInfoDatFile,SharedInfoDatFile] = ...
- INIT_SCI2C(UserScilabMainFile, UserSciFilesPaths, SCI2COutputDir, RunMode,OutFormat)
+ INIT_SCI2C(UserScilabMainFile, UserSciFilesPaths, SCI2COutputDir, RunMode,Target)
// function [FileInfoDatFile,SharedInfoDatFile] = INIT_SCI2C(SCI2CInputPrmFile)
// -----------------------------------------------------------------
// #RNU_RES_B
@@ -68,7 +68,7 @@ OutCCCodeDir = SCI2CResultDir; //-- FIXME : MainLibHeader and Verbose mode are (?) configurable
SharedInfo = INIT_GenSharedInfo(RunMode,UserScilabMainFile, ...
- TotTempScalarVars,EnableTempVarsReuse,"sci2clib.h", %t,OutFormat);
+ TotTempScalarVars,EnableTempVarsReuse,"sci2clib.h", %t,Target);
// ----------------------------
// --- Initialize FileInfo. ---
@@ -147,10 +147,10 @@ anscounter = 0; //--------------------------------------------
//---Hardware related initialisation----------
//--------------------------------------------
-if (OutFormat == 'AVR')
+if (Target == 'AVR')
PeripheralList = list();
save(FileInfo.PeripheralInitListFile, 'PeripheralList');
-elseif (OutFormat == 'Arduino')
+elseif (Target == 'Arduino')
SetupList = list();
save(FileInfo.SetupListFile, 'SetupList');
end
diff --git a/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.bin b/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.bin Binary files differindex 16e99c9a..c13904d2 100644 --- a/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.bin +++ b/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.bin diff --git a/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.sci b/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.sci index 253299a3..ed07907f 100644 --- a/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.sci +++ b/2.3-1/macros/ToolInitialization/UpdateSCI2CInfo.sci @@ -61,7 +61,7 @@ FileInfo.Funct(funnumber).PfxP1WhileEpilFileName = fullfile(FileInfo.WorkingDir, FileInfo.Funct(funnumber).CPass1FreeFileName = fullfile(FileInfo.WorkingDir,funname,SharedInfo.NextCFunName+'_pass1free.c'); FileInfo.Funct(funnumber).CPass2FileName = fullfile(FileInfo.WorkingDir,funname,SharedInfo.NextCFunName+'_pass2.c'); FileInfo.Funct(funnumber).Pass1HeaderFileName = fullfile(FileInfo.WorkingDir,funname,SharedInfo.NextCFunName+'.h'); -if (SharedInfo.OutFormat == 'Arduino') +if (SharedInfo.Target == 'Arduino') //In case of "Arduino" target, *.cpp files should be generated, not *.c files. FileInfo.Funct(funnumber).FinalCFileName = fullfile(FileInfo.OutCCCodeDir,SharedInfo.NextCFunName+'.cpp'); else diff --git a/2.3-1/macros/buildmacros.sce b/2.3-1/macros/buildmacros.sce index dfeb4755..91f5a060 100644 --- a/2.3-1/macros/buildmacros.sce +++ b/2.3-1/macros/buildmacros.sce @@ -10,6 +10,7 @@ Directories = [ "ASTManagement", ... "SymbolTable", ... "ToolInitialization"... "Hardware/AVR"... + "Hardware/RasberryPi"... "Scilab-Arduino" ]; diff --git a/2.3-1/macros/cb_sci2c_gui.bin b/2.3-1/macros/cb_sci2c_gui.bin Binary files differindex 3c70ac39..bc691e45 100644 --- a/2.3-1/macros/cb_sci2c_gui.bin +++ b/2.3-1/macros/cb_sci2c_gui.bin diff --git a/2.3-1/macros/cb_sci2c_gui.sci b/2.3-1/macros/cb_sci2c_gui.sci index b6fbd1ac..8f3f92ad 100644 --- a/2.3-1/macros/cb_sci2c_gui.sci +++ b/2.3-1/macros/cb_sci2c_gui.sci @@ -57,12 +57,12 @@ elseif or(get(gcbo, "tag")==["runradioall","runradiotranslate","runradiogenlib"] // --- Output format option --- -elseif or(get(gcbo, "tag")==["outformatradiostalone","outformatradioarduino","outformatradioavr"]) then +elseif or(get(gcbo, "tag")==["outformatradiostalone","outformatradioarduino","outformatradioavr","outformatradiorpi"]) then set(findobj("tag", "outformatradiostalone"), "value", 0); set(findobj("tag", "outformatradioarduino"), "value", 0); set(findobj("tag", "outformatradioavr"), "value", 0); - + set(findobj("tag", "outformatradiorpi"), "value", 0); set(gcbo, "value", 1); @@ -113,11 +113,13 @@ elseif get(gcbo, "tag")=="convertbtn" then end if get(findobj("tag", "outformatradiostalone"), "value") == 1 then - OutFormat = "StandAlone"; + Target = "StandAlone"; elseif get(findobj("tag", "outformatradioarduino"), "value") == 1 then - OutFormat = "Arduino"; + Target = "Arduino"; elseif get(findobj("tag", "outformatradioavr"), "value") == 1 then - OutFormat = "AVR"; + Target = "AVR"; + elseif get(findobj("tag", "outformatradiorpi"), "value") == 1 then + Target = "RPi"; end CopySciCodeIntoCCode = get(findobj("tag", "sciintocradioyes"), "value") == 1; @@ -138,7 +140,7 @@ elseif get(gcbo, "tag")=="convertbtn" then // mprintf("RunMode = {%s}\n", RunMode); // mprintf("CopySciCodeIntoCCode = {%d}\n", bool2s(CopySciCodeIntoCCode)); // mprintf("NativeBuild = {%s}\n", NativeBuild); - scilab2c(UserScilabMainFile, UserSciCodeMainDir, UserSciFilesPaths, RunMode, NativeBuild,OutFormat); + scilab2c(UserScilabMainFile, UserSciCodeMainDir, UserSciFilesPaths, RunMode, NativeBuild,Target); // // --- sci2c help --- // diff --git a/2.3-1/macros/findDeps/getAllHeaders.bin b/2.3-1/macros/findDeps/getAllHeaders.bin Binary files differindex 4ed973e7..0dbfba5e 100644 --- a/2.3-1/macros/findDeps/getAllHeaders.bin +++ b/2.3-1/macros/findDeps/getAllHeaders.bin diff --git a/2.3-1/macros/findDeps/getAllHeaders.sci b/2.3-1/macros/findDeps/getAllHeaders.sci index 7cddce29..0f325bd7 100644 --- a/2.3-1/macros/findDeps/getAllHeaders.sci +++ b/2.3-1/macros/findDeps/getAllHeaders.sci @@ -10,7 +10,7 @@ // // -function allHeaders = getAllHeaders(OutFormat) +function allHeaders = getAllHeaders(Target) //Header files common to all types of output format. Standalone_headers = [ @@ -145,12 +145,20 @@ function allHeaders = getAllHeaders(OutFormat) "src/c/hardware/avr/includes/AVRUtil.h" ]; - if OutFormat == "StandAlone" + RPi_headers = [ + "includes/bcm2835.h" + "src/c/hardware/rasberrypi/includes/RPIPeripheralDigital.h" + "src/c/hardware/rasberrypi/includes/RPIPeripheralUtil.h" + ]; + + if Target == "StandAlone" allHeaders = Standalone_headers; - elseif OutFormat == "Arduino" + elseif Target == "Arduino" allHeaders = cat(1,Standalone_headers, Arduino_headers); - elseif OutFormat == "AVR" + elseif Target == "AVR" allHeaders = cat(1,Standalone_headers, AVR_headers); + elseif Target == "RPi" + allHeaders = cat(1,Standalone_headers, RPi_headers); end endfunction diff --git a/2.3-1/macros/findDeps/getAllInterfaces.bin b/2.3-1/macros/findDeps/getAllInterfaces.bin Binary files differindex 368b84ab..80868ed8 100644 --- a/2.3-1/macros/findDeps/getAllInterfaces.bin +++ b/2.3-1/macros/findDeps/getAllInterfaces.bin diff --git a/2.3-1/macros/findDeps/getAllInterfaces.sci b/2.3-1/macros/findDeps/getAllInterfaces.sci index 65ee1745..e2333537 100644 --- a/2.3-1/macros/findDeps/getAllInterfaces.sci +++ b/2.3-1/macros/findDeps/getAllInterfaces.sci @@ -10,7 +10,7 @@ // // -function allInterfaces = getAllInterfaces(OutFormat) +function allInterfaces = getAllInterfaces(Target) //Interface files common to all types of output format Standalone_interfaces = [ "src/c/auxiliaryFunctions/interfaces/int_rand.h" @@ -139,12 +139,20 @@ function allInterfaces = getAllInterfaces(OutFormat) "src/c/hardware/avr/interfaces/int_AVRUtil.h" ]; - if OutFormat == "StandAlone" + RPI_interfaces = [ + "src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralDigital.h" + "src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralUtil.h" + +]; + + if Target == "StandAlone" allInterfaces = Standalone_interfaces; - elseif OutFormat == "Arduino" + elseif Target == "Arduino" allInterfaces = cat(1,Standalone_interfaces, Arduino_interfaces); - elseif OutFormat == "AVR" + elseif Target == "AVR" allInterfaces = cat(1,Standalone_interfaces, AVR_interfaces); + elseif Target == "RPi" + allInterfaces = cat(1,Standalone_interfaces, RPI_interfaces); end endfunction diff --git a/2.3-1/macros/findDeps/getAllLibraries.bin b/2.3-1/macros/findDeps/getAllLibraries.bin Binary files differnew file mode 100644 index 00000000..e6ddf718 --- /dev/null +++ b/2.3-1/macros/findDeps/getAllLibraries.bin diff --git a/2.3-1/macros/findDeps/getAllLibraries.sci b/2.3-1/macros/findDeps/getAllLibraries.sci new file mode 100644 index 00000000..1d633ea4 --- /dev/null +++ b/2.3-1/macros/findDeps/getAllLibraries.sci @@ -0,0 +1,17 @@ + +function allLibraries = getAllLibraries(Target) + + //Library files required for "RasberryPi" target + RPi_libs = [ + "src/c/hardware/rasberrypi/libraries/libbcm2835.a" + "src/c/hardware/rasberrypi/libraries/libcblas.a" + "src/c/hardware/rasberrypi/libraries/librefblas.a" + "src/c/hardware/rasberrypi/libraries/liblapack.a" + "src/c/hardware/rasberrypi/libraries/libgfortran.a" + ]; + + if Target == "RPi" + allLibraries = RPi_libs; + end + +endfunction diff --git a/2.3-1/macros/findDeps/getAllSources.bin b/2.3-1/macros/findDeps/getAllSources.bin Binary files differindex a81e474e..82a109ac 100644 --- a/2.3-1/macros/findDeps/getAllSources.bin +++ b/2.3-1/macros/findDeps/getAllSources.bin diff --git a/2.3-1/macros/findDeps/getAllSources.sci b/2.3-1/macros/findDeps/getAllSources.sci index 56a8fea0..ca9ac8be 100644 --- a/2.3-1/macros/findDeps/getAllSources.sci +++ b/2.3-1/macros/findDeps/getAllSources.sci @@ -10,7 +10,7 @@ // // -function allSources = getAllSources(OutFormat) +function allSources = getAllSources(Target) //Files common to types of output format Standalone_files = [ "src/c/auxiliaryFunctions/abs/sabsa.c" "src/c/auxiliaryFunctions/abs/sabss.c" @@ -858,13 +858,23 @@ function allSources = getAllSources(OutFormat) "src/c/hardware/avr/util/u16AVRSleeps.c" ]; + RPI_files = [ + "src/c/hardware/rasberrypi/gpio/u8RPIDigitalSetups.c" + "src/c/hardware/rasberrypi/gpio/u8RPIDigitalOuts.c" + "src/c/hardware/rasberrypi/gpio/u8RPIDigitalIns.c" + "src/c/hardware/rasberrypi/util/u16RPIDelayMillis.c" + "src/c/hardware/rasberrypi/util/u16RPIDelayMicros.c" - if OutFormat == "StandAlone" +]; + + if Target == "StandAlone" allSources = Standalone_files; - elseif OutFormat == "Arduino" + elseif Target == "Arduino" allSources = cat(1,Standalone_files, Arduino_files); - elseif OutFormat == "AVR" + elseif Target == "AVR" allSources = cat(1,Standalone_files, AVR_files); + elseif Target == "RPi" + allSources = cat(1,Standalone_files, RPI_files); end endfunction diff --git a/2.3-1/macros/findDeps/lib b/2.3-1/macros/findDeps/lib Binary files differindex 8d3728f0..c1deaa62 100644 --- a/2.3-1/macros/findDeps/lib +++ b/2.3-1/macros/findDeps/lib diff --git a/2.3-1/macros/findDeps/names b/2.3-1/macros/findDeps/names index dc32fef6..2b8c551b 100644 --- a/2.3-1/macros/findDeps/names +++ b/2.3-1/macros/findDeps/names @@ -2,5 +2,6 @@ Scilab2CDeps findDeps getAllHeaders getAllInterfaces +getAllLibraries getAllSources getArduinoFiles diff --git a/2.3-1/macros/runsci2c.bin b/2.3-1/macros/runsci2c.bin Binary files differindex 6c09823e..f6fd2393 100644 --- a/2.3-1/macros/runsci2c.bin +++ b/2.3-1/macros/runsci2c.bin diff --git a/2.3-1/macros/runsci2c.sci b/2.3-1/macros/runsci2c.sci index 4620705c..b55a7a1e 100644 --- a/2.3-1/macros/runsci2c.sci +++ b/2.3-1/macros/runsci2c.sci @@ -1,4 +1,4 @@ -function runsci2c(UserScilabMainFile, UserSciFilesPaths, SCI2COutputPath, Runmode, BuildTool,OutFormat)
+function runsci2c(UserScilabMainFile, UserSciFilesPaths, SCI2COutputPath, Runmode, BuildTool,Target)
// function runsci2c(SCI2CInputPrmFile)
// -----------------------------------------------------------------
// === hArtes/PoliBa/GAP SCI2C tool ===
@@ -51,7 +51,7 @@ disp(RunSci2CMainDir); // --- Initialize the SCI2C tool directories and files. ---
[FileInfoDatFile,SharedInfoDatFile] = INIT_SCI2C(UserScilabMainFile, ...
- UserSciFilesPaths, SCI2COutputPath, RunMode, OutFormat);
+ UserSciFilesPaths, SCI2COutputPath, RunMode, Target);
// -- Load FileInfo and SharedInfo
load(SharedInfoDatFile,'SharedInfo');
@@ -92,14 +92,16 @@ end // ---------------------------
global SCI2CHOME
-allSources = SCI2CHOME + "/" + getAllSources(OutFormat);
-allHeaders = SCI2CHOME + "/" +getAllHeaders(OutFormat);
-allInterfaces = SCI2CHOME + "/" + getAllInterfaces(OutFormat);
+allSources = SCI2CHOME + "/" + getAllSources(Target);
+allHeaders = SCI2CHOME + "/" +getAllHeaders(Target);
+allInterfaces = SCI2CHOME + "/" + getAllInterfaces(Target);
+allLibraries = SCI2CHOME + "/" + getAllLibraries(Target);
mkdir(SCI2COutputPath+"/src/");
mkdir(SCI2COutputPath+"/src/c/");
mkdir(SCI2COutputPath+"/includes/");
mkdir(SCI2COutputPath+"/interfaces/");
+mkdir(SCI2COutputPath+"/libraries/");
// -- Sources
PrintStepInfo('Copying sources', FileInfo.GeneralReport,'both');
@@ -125,6 +127,13 @@ for i = 1:size(allInterfaces, "*") copyfile(allInterfaces(i), SCI2COutputPath+"/interfaces/");
end
+// -- Libraries
+PrintStepInfo('Copying libraries', FileInfo.GeneralReport,'both');
+for i = 1:size(allLibraries, "*")
+ // DEBUG only
+ //disp("Copying "+allInterfaces(i)+" in "+SCI2COutputPath+"/interfaces/");
+ copyfile(allLibraries(i), SCI2COutputPath+"/libraries/");
+end
// --------------------------
// --- Generate Makefile. ---
@@ -132,7 +141,7 @@ end //If output format is chosen as 'Arduino', then copy makefile for arduino from
//default folder, else generate makefile for standalone c code
-if (OutFormat == 'Arduino')
+if (Target == 'Arduino')
GenerateSetupFunction(FileInfo);
mkdir(SCI2COutputPath+"/arduino/");
diff --git a/2.3-1/macros/sci2c_gui.bin b/2.3-1/macros/sci2c_gui.bin Binary files differindex 2e72ec49..57a2f696 100644 --- a/2.3-1/macros/sci2c_gui.bin +++ b/2.3-1/macros/sci2c_gui.bin diff --git a/2.3-1/macros/sci2c_gui.sci b/2.3-1/macros/sci2c_gui.sci index cb75b158..6dbd4628 100644 --- a/2.3-1/macros/sci2c_gui.sci +++ b/2.3-1/macros/sci2c_gui.sci @@ -203,7 +203,7 @@ outformatradiostalone = uicontrol("parent", sci2cfig,... outformatradioarduino = uicontrol("parent", sci2cfig,... "style", "radiobutton",... "string", gettext("Arduino"),... - "position",[2*margin+widgetLabelWidth+2*radiow outformaty radiow widgeth],... + "position",[margin+widgetLabelWidth+2*radiow outformaty radiow widgeth],... "horizontalalignment", "left",... "fontname", defaultfont,... "fontunits", "points",... @@ -217,7 +217,7 @@ outformatradioarduino = uicontrol("parent", sci2cfig,... outformatradioavr = uicontrol("parent", sci2cfig,... "style", "radiobutton",... "string", gettext("AVR"),... - "position",[2*margin+widgetLabelWidth+3*radiow outformaty radiow widgeth],... + "position",[margin+widgetLabelWidth+3*radiow outformaty radiow widgeth],... "horizontalalignment", "left",... "fontname", defaultfont,... "fontunits", "points",... @@ -228,6 +228,20 @@ outformatradioavr = uicontrol("parent", sci2cfig,... "callback", "cb_sci2c_gui",... "tag", "outformatradioavr"); +outformatradiorpi = uicontrol("parent", sci2cfig,... + "style", "radiobutton",... + "string", gettext("Rpi"),... + "position",[margin+widgetLabelWidth+4*radiow outformaty radiow widgeth],... + "horizontalalignment", "left",... + "fontname", defaultfont,... + "fontunits", "points",... + "fontsize", 12,... + "min", 0, ... + "max", 1, ... + "value", 0,... + "callback", "cb_sci2c_gui",... + "tag", "outformatradiorpi"); + // --- Run mode option --- runy = outformaty + margin + widgeth; runlabel = uicontrol("parent", sci2cfig,... diff --git a/2.3-1/macros/scilab2c.bin b/2.3-1/macros/scilab2c.bin Binary files differindex 6defd940..ff634b64 100644 --- a/2.3-1/macros/scilab2c.bin +++ b/2.3-1/macros/scilab2c.bin diff --git a/2.3-1/macros/scilab2c.sci b/2.3-1/macros/scilab2c.sci index 3eab16ee..118232ea 100644 --- a/2.3-1/macros/scilab2c.sci +++ b/2.3-1/macros/scilab2c.sci @@ -35,7 +35,7 @@ function scilab2c(varargin) UserSciFilesPaths = []; RunMode = 'All'; BuildTool = getNativeBuildTool(); - OutFormat = "StandAlone" + Target = "StandAlone" // // scilab2c(UserScilabMainFile, CCodeOutputDir, UserSciFilesPaths) // @@ -55,7 +55,7 @@ function scilab2c(varargin) end RunMode = "All"; BuildTool = getNativeBuildTool(); - OutFormat = "StandAlone" + Target = "StandAlone" // // scilab2c(UserScilabMainFile, CCodeOutputDir, UserSciFilesPaths, RunMode) // @@ -79,7 +79,7 @@ function scilab2c(varargin) end RunMode = varargin(4); BuildTool = getNativeBuildTool(); - OutFormat = "StandAlone" + Target = "StandAlone" case 5 for i = 1:4 if typeof(varargin(i)) <> "string" @@ -104,7 +104,7 @@ function scilab2c(varargin) end RunMode = varargin(4); BuildTool = varargin(5); - OutFormat = "StandAlone" + Target = "StandAlone" case 6 for i = 1:4 if typeof(varargin(i)) <> "string" @@ -120,7 +120,7 @@ function scilab2c(varargin) error(msprintf(gettext("%s: argument #%d must be: ""make"" or ""nmake"".\n"),"scilab2c",5)); return end - if varargin(6) <> "StandAlone" & varargin(6) <> "Arduino" & varargin(6) <> "AVR" + if varargin(6) <> "StandAlone" & varargin(6) <> "Arduino" & varargin(6) <> "AVR" & varargin(6) <> "RPi" error(msprintf(gettext("%s: argument #%d must be: ""StandAlone"" or ""Arduino"" or ""AVR"".\n"),"scilab2c",5)); return end @@ -133,7 +133,7 @@ function scilab2c(varargin) end RunMode = varargin(4); BuildTool = varargin(5); - OutFormat = varargin(6); + Target = varargin(6); else // // Calling scilab2c with more than understood values @@ -143,8 +143,8 @@ error(msprintf(gettext("%s: Wrong number of input argument(s): %d expected.\n"), // --- LAUNCH USER SCI CODE TO TEST IT BEFORE TRANSLATING IT!!! --- -// If OutFormat choosen is 'Standalone' then only execute the code, otherwise directly start conversion. - if OutFormat == "StandAlone" +// If Target choosen is 'Standalone' then only execute the code, otherwise directly start conversion. + if Target == "StandAlone" runscicode(UserScilabMainFile, UserSciFilesPaths); // --- ASK USER FOR CONTINUATION. --- @@ -160,7 +160,7 @@ error(msprintf(gettext("%s: Wrong number of input argument(s): %d expected.\n"), end if (userchoice == 1) // --- LAUNCH SCI2C --- - runsci2c(UserScilabMainFile, UserSciFilesPaths, CCodeOutputDir, RunMode, BuildTool,OutFormat); + runsci2c(UserScilabMainFile, UserSciFilesPaths, CCodeOutputDir, RunMode, BuildTool,Target); end endfunction |