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/Hardware | |
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/Hardware')
22 files changed, 197 insertions, 30 deletions
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; |