summaryrefslogtreecommitdiff
path: root/macros/Hardware
diff options
context:
space:
mode:
Diffstat (limited to 'macros/Hardware')
-rw-r--r--macros/Hardware/AVR/AVRUARTSetup.binbin0 -> 3480 bytes
-rw-r--r--macros/Hardware/AVR/buildmacros.sce11
-rw-r--r--macros/Hardware/AVR/libbin932 -> 956 bytes
-rw-r--r--macros/Hardware/AVR/names1
-rw-r--r--macros/Hardware/RasberryPi/GetRPISupportFunctions.binbin0 -> 1604 bytes
-rw-r--r--macros/Hardware/RasberryPi/GetRPISupportFunctions.sci21
-rw-r--r--macros/Hardware/RasberryPi/IsRPISupportFunction.binbin0 -> 2704 bytes
-rw-r--r--macros/Hardware/RasberryPi/IsRPISupportFunction.sci22
-rw-r--r--macros/Hardware/RasberryPi/RPIDelay.binbin0 -> 3528 bytes
-rw-r--r--macros/Hardware/RasberryPi/RPIDelay.sci31
-rw-r--r--macros/Hardware/RasberryPi/RPIDelayMicro.binbin0 -> 3280 bytes
-rw-r--r--macros/Hardware/RasberryPi/RPIDelayMicro.sci30
-rw-r--r--macros/Hardware/RasberryPi/RPI_DigitalIn.binbin0 -> 3400 bytes
-rw-r--r--macros/Hardware/RasberryPi/RPI_DigitalIn.sci27
-rw-r--r--macros/Hardware/RasberryPi/RPI_DigitalOut.binbin0 -> 3480 bytes
-rw-r--r--macros/Hardware/RasberryPi/RPI_DigitalOut.sci27
-rw-r--r--macros/Hardware/RasberryPi/RPI_DigitalSetup.binbin0 -> 3452 bytes
-rw-r--r--macros/Hardware/RasberryPi/RPI_DigitalSetup.sci27
-rw-r--r--macros/Hardware/RasberryPi/buildmacros.sce4
-rw-r--r--macros/Hardware/RasberryPi/libbin0 -> 816 bytes
-rw-r--r--macros/Hardware/RasberryPi/names7
-rw-r--r--macros/Hardware/buildmacros.sce19
22 files changed, 197 insertions, 30 deletions
diff --git a/macros/Hardware/AVR/AVRUARTSetup.bin b/macros/Hardware/AVR/AVRUARTSetup.bin
new file mode 100644
index 0000000..4a49b86
--- /dev/null
+++ b/macros/Hardware/AVR/AVRUARTSetup.bin
Binary files differ
diff --git a/macros/Hardware/AVR/buildmacros.sce b/macros/Hardware/AVR/buildmacros.sce
index 60fd284..2954a42 100644
--- a/macros/Hardware/AVR/buildmacros.sce
+++ b/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/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib
index b198682..64d346a 100644
--- a/macros/Hardware/AVR/lib
+++ b/macros/Hardware/AVR/lib
Binary files differ
diff --git a/macros/Hardware/AVR/names b/macros/Hardware/AVR/names
index 126da77..624fee8 100644
--- a/macros/Hardware/AVR/names
+++ b/macros/Hardware/AVR/names
@@ -7,6 +7,7 @@ AVRPWMSetDuty
AVRPWMSetup
AVRReadADC
AVRTimerSetup
+AVRUARTSetup
GetAVRSupportFunctions
GetPeripheral
InsertPeripheralInList
diff --git a/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin
new file mode 100644
index 0000000..5bea645
--- /dev/null
+++ b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin
Binary files differ
diff --git a/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci b/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci
new file mode 100644
index 0000000..24c2f55
--- /dev/null
+++ b/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/macros/Hardware/RasberryPi/IsRPISupportFunction.bin b/macros/Hardware/RasberryPi/IsRPISupportFunction.bin
new file mode 100644
index 0000000..728e3d8
--- /dev/null
+++ b/macros/Hardware/RasberryPi/IsRPISupportFunction.bin
Binary files differ
diff --git a/macros/Hardware/RasberryPi/IsRPISupportFunction.sci b/macros/Hardware/RasberryPi/IsRPISupportFunction.sci
new file mode 100644
index 0000000..647b0c8
--- /dev/null
+++ b/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/macros/Hardware/RasberryPi/RPIDelay.bin b/macros/Hardware/RasberryPi/RPIDelay.bin
new file mode 100644
index 0000000..bb8279e
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPIDelay.bin
Binary files differ
diff --git a/macros/Hardware/RasberryPi/RPIDelay.sci b/macros/Hardware/RasberryPi/RPIDelay.sci
new file mode 100644
index 0000000..c5080dd
--- /dev/null
+++ b/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/macros/Hardware/RasberryPi/RPIDelayMicro.bin b/macros/Hardware/RasberryPi/RPIDelayMicro.bin
new file mode 100644
index 0000000..a4d32cb
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPIDelayMicro.bin
Binary files differ
diff --git a/macros/Hardware/RasberryPi/RPIDelayMicro.sci b/macros/Hardware/RasberryPi/RPIDelayMicro.sci
new file mode 100644
index 0000000..730755b
--- /dev/null
+++ b/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/macros/Hardware/RasberryPi/RPI_DigitalIn.bin b/macros/Hardware/RasberryPi/RPI_DigitalIn.bin
new file mode 100644
index 0000000..a3269a0
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_DigitalIn.bin
Binary files differ
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalIn.sci b/macros/Hardware/RasberryPi/RPI_DigitalIn.sci
new file mode 100644
index 0000000..3ea3bf1
--- /dev/null
+++ b/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/macros/Hardware/RasberryPi/RPI_DigitalOut.bin b/macros/Hardware/RasberryPi/RPI_DigitalOut.bin
new file mode 100644
index 0000000..d6b6b7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_DigitalOut.bin
Binary files differ
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalOut.sci b/macros/Hardware/RasberryPi/RPI_DigitalOut.sci
new file mode 100644
index 0000000..4836f54
--- /dev/null
+++ b/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/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin b/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin
new file mode 100644
index 0000000..46836cd
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin
Binary files differ
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci b/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
new file mode 100644
index 0000000..5ce48f0
--- /dev/null
+++ b/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/macros/Hardware/RasberryPi/buildmacros.sce b/macros/Hardware/RasberryPi/buildmacros.sce
new file mode 100644
index 0000000..2954a42
--- /dev/null
+++ b/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/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib
new file mode 100644
index 0000000..5884511
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lib
Binary files differ
diff --git a/macros/Hardware/RasberryPi/names b/macros/Hardware/RasberryPi/names
new file mode 100644
index 0000000..87fe2cd
--- /dev/null
+++ b/macros/Hardware/RasberryPi/names
@@ -0,0 +1,7 @@
+GetRPISupportFunctions
+IsRPISupportFunction
+RPIDelay
+RPIDelayMicro
+RPI_DigitalIn
+RPI_DigitalOut
+RPI_DigitalSetup
diff --git a/macros/Hardware/buildmacros.sce b/macros/Hardware/buildmacros.sce
deleted file mode 100644
index 88f0fb2..0000000
--- a/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;