From 88c02bb9dad7d955676fe44f6595f996bde3f07e Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Sat, 28 Nov 2015 11:01:40 +0530
Subject: Intermediate commit aith support added for AVR (GPIO,ADC). Does not
support other targets.
---
macros/Hardware/AVR/AVRADCSetup.sci | 32 +++++++++++++++++++++++++
macros/Hardware/AVR/AVRDigitalOut.bin | Bin 0 -> 3760 bytes
macros/Hardware/AVR/AVRDigitalOut.sci | 32 +++++++++++++++++++++++++
macros/Hardware/AVR/AVRDigitalSetup.bin | Bin 0 -> 3932 bytes
macros/Hardware/AVR/AVRDigitalSetup.sci | 32 +++++++++++++++++++++++++
macros/Hardware/AVR/AVRReadADC.sci | 31 ++++++++++++++++++++++++
macros/Hardware/AVR/GetAVRSupportFunctions.bin | Bin 0 -> 1256 bytes
macros/Hardware/AVR/GetAVRSupportFunctions.sci | 16 +++++++++++++
macros/Hardware/AVR/GetPeripheral.bin | Bin 0 -> 2364 bytes
macros/Hardware/AVR/GetPeripheral.sci | 21 ++++++++++++++++
macros/Hardware/AVR/InsertPeripheralInList.bin | Bin 0 -> 1928 bytes
macros/Hardware/AVR/InsertPeripheralInList.sci | 17 +++++++++++++
macros/Hardware/AVR/IsAVRSupportFunction.bin | Bin 0 -> 2712 bytes
macros/Hardware/AVR/IsAVRSupportFunction.sci | 22 +++++++++++++++++
macros/Hardware/AVR/buildmacros.sce | 15 ++++++++++++
macros/Hardware/AVR/lib | Bin 0 -> 728 bytes
macros/Hardware/AVR/names | 6 +++++
macros/Hardware/buildmacros.sce | 19 +++++++++++++++
18 files changed, 243 insertions(+)
create mode 100644 macros/Hardware/AVR/AVRADCSetup.sci
create mode 100644 macros/Hardware/AVR/AVRDigitalOut.bin
create mode 100644 macros/Hardware/AVR/AVRDigitalOut.sci
create mode 100644 macros/Hardware/AVR/AVRDigitalSetup.bin
create mode 100644 macros/Hardware/AVR/AVRDigitalSetup.sci
create mode 100644 macros/Hardware/AVR/AVRReadADC.sci
create mode 100644 macros/Hardware/AVR/GetAVRSupportFunctions.bin
create mode 100644 macros/Hardware/AVR/GetAVRSupportFunctions.sci
create mode 100644 macros/Hardware/AVR/GetPeripheral.bin
create mode 100644 macros/Hardware/AVR/GetPeripheral.sci
create mode 100644 macros/Hardware/AVR/InsertPeripheralInList.bin
create mode 100644 macros/Hardware/AVR/InsertPeripheralInList.sci
create mode 100644 macros/Hardware/AVR/IsAVRSupportFunction.bin
create mode 100644 macros/Hardware/AVR/IsAVRSupportFunction.sci
create mode 100644 macros/Hardware/AVR/buildmacros.sce
create mode 100644 macros/Hardware/AVR/lib
create mode 100644 macros/Hardware/AVR/names
create mode 100644 macros/Hardware/buildmacros.sce
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/AVRADCSetup.sci b/macros/Hardware/AVR/AVRADCSetup.sci
new file mode 100644
index 00000000..d9897fc3
--- /dev/null
+++ b/macros/Hardware/AVR/AVRADCSetup.sci
@@ -0,0 +1,32 @@
+function AVRADCSetup(prescalar,adc_ref)
+// Function to initialise ADC of AVR
+//
+// Calling Sequence
+// AVRSetupADC(uint8 prescalar, uint8 adc_ref)
+//
+// Parameters
+// prescalar: prescalar to be used for generating ADC clock (0-7)
+// adc_ref : reference voltage to be used for ADC conversion
+// 0 -> Voltage on VREF pin
+// 1 -> Voltage on AVCC pin
+// 2 -> Internal 2.56 reference voltage
+//
+// Description
+// This function initialises ADc of AVR with given parameters. 'prescalar' is
+// needed for deciding ADC clock. ADC clock should be between 50KHz and 200KHz
+// and it given as (MCU clock/2^prescalar). Select appropriate prescalar depending
+// on MCU clock. 'adc_ref' selects one of the available reference voltage sources
+// available
+// Examples
+// AVRADCSetup(128,0)
+
+// See also
+// AVRReadADC
+//
+// Authors
+// Siddhesh Wani
+//
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+endfunction
diff --git a/macros/Hardware/AVR/AVRDigitalOut.bin b/macros/Hardware/AVR/AVRDigitalOut.bin
new file mode 100644
index 00000000..7a09b0d8
Binary files /dev/null and b/macros/Hardware/AVR/AVRDigitalOut.bin differ
diff --git a/macros/Hardware/AVR/AVRDigitalOut.sci b/macros/Hardware/AVR/AVRDigitalOut.sci
new file mode 100644
index 00000000..f17c8a07
--- /dev/null
+++ b/macros/Hardware/AVR/AVRDigitalOut.sci
@@ -0,0 +1,32 @@
+function AVRDigitalOut(port,pin,state)
+// Function to change state (high\low) of a digital output pin on AVR
+//
+// Calling Sequence
+// AVRDigitalOut(port,pin,state)
+//
+// Parameters
+// port : port of microcontroller to be used
+// pin : pin of port (mentioned above) to be used
+// state : state to be outputed on pin (HIGH\LOW)
+//
+// Description
+// Each AVR microcontroller has pins which can be configured as digital
+// outputs. These are normally divided among some 'ports' (group of pins).
+// User has to select one of these port and which pin of that port as
+// digital output. Also, desired output state must be specified as
+// 'HIGH' or 'LOW'.
+//
+// Examples
+// AVRDigitalOut('A',0,HIGH)
+//
+// See also
+// AVRDigitalIn
+//
+//
+// Authors
+// Siddhesh Wani
+//
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+endfunction
diff --git a/macros/Hardware/AVR/AVRDigitalSetup.bin b/macros/Hardware/AVR/AVRDigitalSetup.bin
new file mode 100644
index 00000000..98a592e3
Binary files /dev/null and b/macros/Hardware/AVR/AVRDigitalSetup.bin differ
diff --git a/macros/Hardware/AVR/AVRDigitalSetup.sci b/macros/Hardware/AVR/AVRDigitalSetup.sci
new file mode 100644
index 00000000..3de56c21
--- /dev/null
+++ b/macros/Hardware/AVR/AVRDigitalSetup.sci
@@ -0,0 +1,32 @@
+function AVRDigitalSetup(port,pin,direction)
+// Function to decide direction of a digital pin on AVR
+//
+// Calling Sequence
+// AVRDigitalSetup(port,pin,direction)
+//
+// Parameters
+// port : port of microcontroller to be used
+// pin : pin of port (mentioned above) to be used
+// direction : direction to be set for pin (INPUT\OUTPUT)
+//
+// Description
+// Each AVR microcontroller has pins which can be configured as digital
+// outputs/inputs. These are normally divided among some 'ports' (group of pins).
+// User has to select one of these port and which pin of that port to be
+// used as digital output/input. Also, desired direction must be specified as
+// 'INPUT' or 'OUTPUT'.
+//
+// Examples
+// AVRDigitalSetup('A',0,OUTPUT)
+//
+// See also
+// AVRDigitalIn AVRDigitalOut
+//
+//
+// Authors
+// Siddhesh Wani
+//
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+endfunction
diff --git a/macros/Hardware/AVR/AVRReadADC.sci b/macros/Hardware/AVR/AVRReadADC.sci
new file mode 100644
index 00000000..f9dfdac0
--- /dev/null
+++ b/macros/Hardware/AVR/AVRReadADC.sci
@@ -0,0 +1,31 @@
+function AVRReadADC(channel)
+// Function to get voltage on analog pin on AVR
+//
+// Calling Sequence
+// u8AVRReadADCs(channel)
+//
+// Parameters
+// channel : Select which channel is to be read. Values from 0-7 select one
+// of the pins ADC0-ADC7. For other possible channel values refer
+// datasheet
+// Returns->
+// result : Digital value for the voltage present on channel selected
+//
+// Description
+// This function returns digital value for present on adc pins. 'channel'
+// selects which of the ADC0-ADC7 is to be used for reading analog value.
+// Apart from reading just ADC0-ADC7 other it can also read differential
+// voltages between some pins. For channel values for those options, please
+// refer datasheet.
+//
+// Examples
+// adc_result = u8AVRReadADC(0) //Read ADC0
+//
+// Authors
+// Siddhesh Wani
+//
+
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+endfunction
diff --git a/macros/Hardware/AVR/GetAVRSupportFunctions.bin b/macros/Hardware/AVR/GetAVRSupportFunctions.bin
new file mode 100644
index 00000000..eed8be3b
Binary files /dev/null and b/macros/Hardware/AVR/GetAVRSupportFunctions.bin differ
diff --git a/macros/Hardware/AVR/GetAVRSupportFunctions.sci b/macros/Hardware/AVR/GetAVRSupportFunctions.sci
new file mode 100644
index 00000000..50a913fa
--- /dev/null
+++ b/macros/Hardware/AVR/GetAVRSupportFunctions.sci
@@ -0,0 +1,16 @@
+function AVRSupportFunctions = GetAVRSupportFunctions()
+// -----------------------------------------------------------------
+// Get list of AVR peripherals supported
+//
+// Input data:
+// None
+//
+// Output data:
+// None
+//
+// Author: Siddhesh Wani
+// -----------------------------------------------------------------
+
+AVRSupportFunctions = ["AVRDigitalOut"];
+
+endfunction
diff --git a/macros/Hardware/AVR/GetPeripheral.bin b/macros/Hardware/AVR/GetPeripheral.bin
new file mode 100644
index 00000000..b496bbb0
Binary files /dev/null and b/macros/Hardware/AVR/GetPeripheral.bin differ
diff --git a/macros/Hardware/AVR/GetPeripheral.sci b/macros/Hardware/AVR/GetPeripheral.sci
new file mode 100644
index 00000000..73e9f19e
--- /dev/null
+++ b/macros/Hardware/AVR/GetPeripheral.sci
@@ -0,0 +1,21 @@
+function Peripheral = GetPeripheral(FunName,InArg)
+// -----------------------------------------------------------------
+// Get an acronym for peripheral being used to be inserted in list of
+// used peripherals
+//
+// Input data:
+// FunName: Name of the function to be checked
+// InArg:Input arguements passed to function 'FunName'
+//
+// Output data:
+// Peripheral: Acronym for peripheral to be initialised
+//
+// Author: Siddhesh Wani
+// -----------------------------------------------------------------
+
+//select FunName
+
+//case AVRDigitalOut:
+// Peripheral = list('PORT', InArg(1),InArg(2)];
+//end
+endfunction
diff --git a/macros/Hardware/AVR/InsertPeripheralInList.bin b/macros/Hardware/AVR/InsertPeripheralInList.bin
new file mode 100644
index 00000000..c49f4e04
Binary files /dev/null and b/macros/Hardware/AVR/InsertPeripheralInList.bin differ
diff --git a/macros/Hardware/AVR/InsertPeripheralInList.sci b/macros/Hardware/AVR/InsertPeripheralInList.sci
new file mode 100644
index 00000000..bafc5935
--- /dev/null
+++ b/macros/Hardware/AVR/InsertPeripheralInList.sci
@@ -0,0 +1,17 @@
+function InsertPeripheralInList(Peripheral,PeripheralListFile)
+// -----------------------------------------------------------------
+// Insert input peripheral in peripherals' list
+//
+// Input data:
+// Peripheral: Peripheral of type 'list' to be instertd in list
+// PeripheralListFile: Name of file containing list of peripheral used
+//
+// Output data:
+// None
+//
+// Author: Siddhesh Wani
+// -----------------------------------------------------------------
+
+load(PeripheralListFile,'PheripheralList');
+
+endfunction
diff --git a/macros/Hardware/AVR/IsAVRSupportFunction.bin b/macros/Hardware/AVR/IsAVRSupportFunction.bin
new file mode 100644
index 00000000..e2382308
Binary files /dev/null and b/macros/Hardware/AVR/IsAVRSupportFunction.bin differ
diff --git a/macros/Hardware/AVR/IsAVRSupportFunction.sci b/macros/Hardware/AVR/IsAVRSupportFunction.sci
new file mode 100644
index 00000000..a4cbbc88
--- /dev/null
+++ b/macros/Hardware/AVR/IsAVRSupportFunction.sci
@@ -0,0 +1,22 @@
+function Output = IsAVRSupportFunction(FunName)
+// -----------------------------------------------------------------
+// Check whether input function name is an AVR 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 an AVR
+// support functions or not
+//
+// Author: Siddhesh Wani
+// -----------------------------------------------------------------
+
+//Get list of supported functions for AVR
+AVRSupportFunctions = GetAVRSupportFunctions();
+
+//Check whether input function is present in above list or not
+FunNameInAVRSupport = members(FunName,AVRSupportFunctions);
+Output = bool2s(FunNameInAVRSupport~=0);
+
+endfunction
diff --git a/macros/Hardware/AVR/buildmacros.sce b/macros/Hardware/AVR/buildmacros.sce
new file mode 100644
index 00000000..60fd2843
--- /dev/null
+++ b/macros/Hardware/AVR/buildmacros.sce
@@ -0,0 +1,15 @@
+//
+// 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'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib
new file mode 100644
index 00000000..097a89f0
Binary files /dev/null and b/macros/Hardware/AVR/lib differ
diff --git a/macros/Hardware/AVR/names b/macros/Hardware/AVR/names
new file mode 100644
index 00000000..4b941e9b
--- /dev/null
+++ b/macros/Hardware/AVR/names
@@ -0,0 +1,6 @@
+AVRDigitalOut
+AVRDigitalSetup
+GetAVRSupportFunctions
+GetPeripheral
+InsertPeripheralInList
+IsAVRSupportFunction
diff --git a/macros/Hardware/buildmacros.sce b/macros/Hardware/buildmacros.sce
new file mode 100644
index 00000000..88f0fb2a
--- /dev/null
+++ b/macros/Hardware/buildmacros.sce
@@ -0,0 +1,19 @@
+// 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;
--
cgit
From 56d929da6683ca38ab07870173dba5aadb451403 Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Tue, 8 Dec 2015 11:43:14 +0530
Subject: Modified so that code for all three output formats can be generated
---
macros/Hardware/AVR/AVRADCSetup.bin | Bin 0 -> 4168 bytes
macros/Hardware/AVR/AVRDigitalIn.bin | Bin 0 -> 3688 bytes
macros/Hardware/AVR/AVRDigitalIn.sci | 32 ++++++++++++++++++++++++++++++++
macros/Hardware/AVR/AVRReadADC.bin | Bin 0 -> 4048 bytes
macros/Hardware/AVR/lib | Bin 728 -> 836 bytes
macros/Hardware/AVR/names | 3 +++
6 files changed, 35 insertions(+)
create mode 100644 macros/Hardware/AVR/AVRADCSetup.bin
create mode 100644 macros/Hardware/AVR/AVRDigitalIn.bin
create mode 100644 macros/Hardware/AVR/AVRDigitalIn.sci
create mode 100644 macros/Hardware/AVR/AVRReadADC.bin
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/AVRADCSetup.bin b/macros/Hardware/AVR/AVRADCSetup.bin
new file mode 100644
index 00000000..6cf45dc9
Binary files /dev/null and b/macros/Hardware/AVR/AVRADCSetup.bin differ
diff --git a/macros/Hardware/AVR/AVRDigitalIn.bin b/macros/Hardware/AVR/AVRDigitalIn.bin
new file mode 100644
index 00000000..7ff2c98d
Binary files /dev/null and b/macros/Hardware/AVR/AVRDigitalIn.bin differ
diff --git a/macros/Hardware/AVR/AVRDigitalIn.sci b/macros/Hardware/AVR/AVRDigitalIn.sci
new file mode 100644
index 00000000..ef57564c
--- /dev/null
+++ b/macros/Hardware/AVR/AVRDigitalIn.sci
@@ -0,0 +1,32 @@
+function state = AVRDigitalIn(port,pin)
+// Function to get state (high\low) of a digital input pin on AVR
+//
+// Calling Sequence
+// state=AVRDigitalIn(port,pin)
+//
+// Parameters
+// port : port of microcontroller to be used
+// pin : pin of port (mentioned above) to be used
+// Returns
+// state : state of an input pin (HIGH\LOW)
+//
+// Description
+// Each AVR microcontroller has pins which can be configured as digital
+// inputs. These are normally divided among some 'ports' (group of pins).
+// User has to select one of these port and which pin of that port as
+// digital input.
+//
+// Examples
+// pinA0 = AVRDigitalIn(1,0) //To read state on pin 0 of port A
+//
+// See also
+// AVRDigitalOut AVRDigitalSetup
+//
+//
+// Authors
+// Siddhesh Wani
+//
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+endfunction
diff --git a/macros/Hardware/AVR/AVRReadADC.bin b/macros/Hardware/AVR/AVRReadADC.bin
new file mode 100644
index 00000000..c1067084
Binary files /dev/null and b/macros/Hardware/AVR/AVRReadADC.bin differ
diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib
index 097a89f0..d08afbd3 100644
Binary files a/macros/Hardware/AVR/lib and b/macros/Hardware/AVR/lib differ
diff --git a/macros/Hardware/AVR/names b/macros/Hardware/AVR/names
index 4b941e9b..6e5b61bd 100644
--- a/macros/Hardware/AVR/names
+++ b/macros/Hardware/AVR/names
@@ -1,5 +1,8 @@
+AVRADCSetup
+AVRDigitalIn
AVRDigitalOut
AVRDigitalSetup
+AVRReadADC
GetAVRSupportFunctions
GetPeripheral
InsertPeripheralInList
--
cgit
From 96b51a5ded447676d493be9721e4480065a5ae7e Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Fri, 11 Dec 2015 18:28:43 +0530
Subject: AVR ADC checked after some modifications
---
macros/Hardware/AVR/AVRADCSetup.bin | Bin 4168 -> 4168 bytes
macros/Hardware/AVR/AVRADCSetup.sci | 2 +-
macros/Hardware/AVR/AVRPWMSetup.bin | Bin 0 -> 5760 bytes
macros/Hardware/AVR/AVRPWMSetup.sci | 39 ++++++++++++++++++++++++++++++++++++
macros/Hardware/AVR/lib | Bin 836 -> 860 bytes
macros/Hardware/AVR/names | 1 +
6 files changed, 41 insertions(+), 1 deletion(-)
create mode 100644 macros/Hardware/AVR/AVRPWMSetup.bin
create mode 100644 macros/Hardware/AVR/AVRPWMSetup.sci
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/AVRADCSetup.bin b/macros/Hardware/AVR/AVRADCSetup.bin
index 6cf45dc9..44e3d790 100644
Binary files a/macros/Hardware/AVR/AVRADCSetup.bin and b/macros/Hardware/AVR/AVRADCSetup.bin differ
diff --git a/macros/Hardware/AVR/AVRADCSetup.sci b/macros/Hardware/AVR/AVRADCSetup.sci
index d9897fc3..ce9117d0 100644
--- a/macros/Hardware/AVR/AVRADCSetup.sci
+++ b/macros/Hardware/AVR/AVRADCSetup.sci
@@ -2,7 +2,7 @@ function AVRADCSetup(prescalar,adc_ref)
// Function to initialise ADC of AVR
//
// Calling Sequence
-// AVRSetupADC(uint8 prescalar, uint8 adc_ref)
+// AVRADCSetup(uint8 prescalar, uint8 adc_ref)
//
// Parameters
// prescalar: prescalar to be used for generating ADC clock (0-7)
diff --git a/macros/Hardware/AVR/AVRPWMSetup.bin b/macros/Hardware/AVR/AVRPWMSetup.bin
new file mode 100644
index 00000000..6ae56fda
Binary files /dev/null and b/macros/Hardware/AVR/AVRPWMSetup.bin differ
diff --git a/macros/Hardware/AVR/AVRPWMSetup.sci b/macros/Hardware/AVR/AVRPWMSetup.sci
new file mode 100644
index 00000000..7e1c234f
--- /dev/null
+++ b/macros/Hardware/AVR/AVRPWMSetup.sci
@@ -0,0 +1,39 @@
+function AVRPWMSetup(timer, prescalar, waveform_mode, output_mode)
+// Function to initialise PWM of AVR
+//
+// Calling Sequence
+// AVRSetupADC(timer, prescalar, waveform_mode, output_mode)
+//
+// Parameters
+// timer: timer to be used for PWM generation (0,1,2)
+// prescalar: prescalar to be used for generating PWM waveform (0-7)
+// waveform_mode: decides type of waveform generation
+// 0 -> Normal mode
+// 1 -> Phase correct mode
+// 2 -> CTC mode
+// 3 -> Fase PWM mode
+// output_mode: decides the compare output mode. (0-3)
+// behaviour of the output is different for different inputs
+// depending upon 'waveform_mode' chosen.
+// ***Refer datasheet for more description about above modes
+//
+// Description
+// This function initialises PWM of AVR with given parameters. 'timer'
+// decides which of the three (0,1,2) timers available to be used. The
+// 'prescalar' is needed for deciding PWM clock. Select appropriate prescalar
+// depending on MCU clock. Choose required pwmmode using 'waveform_generation'
+// and 'output_mode'. Please refer datasheet for more description of 'wafefom_mode'
+// and 'output mode'.
+// Examples
+// AVRPWMSetup(0,1,2,2)
+//
+// See also
+// AVRPMWSetDuty
+//
+// Authors
+// Siddhesh Wani
+//
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+endfunction
diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib
index d08afbd3..aa4d6113 100644
Binary files a/macros/Hardware/AVR/lib and b/macros/Hardware/AVR/lib differ
diff --git a/macros/Hardware/AVR/names b/macros/Hardware/AVR/names
index 6e5b61bd..afd171ec 100644
--- a/macros/Hardware/AVR/names
+++ b/macros/Hardware/AVR/names
@@ -2,6 +2,7 @@ AVRADCSetup
AVRDigitalIn
AVRDigitalOut
AVRDigitalSetup
+AVRPWMSetup
AVRReadADC
GetAVRSupportFunctions
GetPeripheral
--
cgit
From 329613eb48542f24bb9014a0a617b05199726e99 Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Thu, 17 Dec 2015 14:48:36 +0530
Subject: Code generation for Arduino changed. DC motor added to Arduino.
---
macros/Hardware/AVR/AVRGetTimerValue.bin | Bin 0 -> 3564 bytes
macros/Hardware/AVR/AVRGetTimerValue.sci | 31 +++++++++++++++++++++++++++++++
macros/Hardware/AVR/AVRPWMSetDuty.bin | Bin 0 -> 2428 bytes
macros/Hardware/AVR/AVRPWMSetDuty.sci | 24 ++++++++++++++++++++++++
macros/Hardware/AVR/AVRPWMSetup.bin | Bin 5760 -> 5760 bytes
macros/Hardware/AVR/AVRPWMSetup.sci | 2 +-
macros/Hardware/AVR/AVRTimerSetup.bin | Bin 0 -> 3552 bytes
macros/Hardware/AVR/AVRTimerSetup.sci | 31 +++++++++++++++++++++++++++++++
macros/Hardware/AVR/lib | Bin 860 -> 932 bytes
macros/Hardware/AVR/names | 3 +++
10 files changed, 90 insertions(+), 1 deletion(-)
create mode 100644 macros/Hardware/AVR/AVRGetTimerValue.bin
create mode 100644 macros/Hardware/AVR/AVRGetTimerValue.sci
create mode 100644 macros/Hardware/AVR/AVRPWMSetDuty.bin
create mode 100644 macros/Hardware/AVR/AVRPWMSetDuty.sci
create mode 100644 macros/Hardware/AVR/AVRTimerSetup.bin
create mode 100644 macros/Hardware/AVR/AVRTimerSetup.sci
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/AVRGetTimerValue.bin b/macros/Hardware/AVR/AVRGetTimerValue.bin
new file mode 100644
index 00000000..26b4b47e
Binary files /dev/null and b/macros/Hardware/AVR/AVRGetTimerValue.bin differ
diff --git a/macros/Hardware/AVR/AVRGetTimerValue.sci b/macros/Hardware/AVR/AVRGetTimerValue.sci
new file mode 100644
index 00000000..ab0146aa
--- /dev/null
+++ b/macros/Hardware/AVR/AVRGetTimerValue.sci
@@ -0,0 +1,31 @@
+function counts = AVRGetTimerValue(timer)
+// Function to set the prescalar for timer.
+//
+// Calling Sequence
+// AVRgetTimerValue(timer, prescalar)
+//
+// Parameters
+// timer: timer to be set up (0,1,2)
+// prescalar: prescalar to be used for generating PWM waveform (0-7)
+// ***Refer datasheet for more description about timer
+//
+// Description
+// This function sets prescalr for timers. 'timer' decides which of the
+// three (0,1,2) timers available to be used. The 'prescalar' is needed for
+// deciding timer clock. Select appropriate prescalar depending on MCU clock
+// and requirement.
+//
+//
+// Examples
+// AVRTimerSetup(0,1) //Timer 0 with no scaling
+//
+// See also
+// AVRGetTimerValue
+//
+// Authors
+// Siddhesh Wani
+//
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+endfunction
diff --git a/macros/Hardware/AVR/AVRPWMSetDuty.bin b/macros/Hardware/AVR/AVRPWMSetDuty.bin
new file mode 100644
index 00000000..f3c9e3e4
Binary files /dev/null and b/macros/Hardware/AVR/AVRPWMSetDuty.bin differ
diff --git a/macros/Hardware/AVR/AVRPWMSetDuty.sci b/macros/Hardware/AVR/AVRPWMSetDuty.sci
new file mode 100644
index 00000000..0042540a
--- /dev/null
+++ b/macros/Hardware/AVR/AVRPWMSetDuty.sci
@@ -0,0 +1,24 @@
+function AVRPWMSetDuty(timer, duty)
+// Function to set duty for PWM of AVR
+//
+// Calling Sequence
+// AVRPWMSetDuty(uint8 timer, uint8 duty)
+//
+// Parameters
+// timer: timer to be used for PWM generation (0,1,2)
+// duty: duty for PWM waveform (0-100)
+//
+// Description
+// This function sets duty for PWM waveform according to given parameters.
+//
+// Examples
+// AVRPWMSetDuty(0,10) //Sets 10% duty for timer 0 output.
+//
+// Authors
+// Siddhesh Wani
+//
+//
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+endfunction
diff --git a/macros/Hardware/AVR/AVRPWMSetup.bin b/macros/Hardware/AVR/AVRPWMSetup.bin
index 6ae56fda..971e43ee 100644
Binary files a/macros/Hardware/AVR/AVRPWMSetup.bin and b/macros/Hardware/AVR/AVRPWMSetup.bin differ
diff --git a/macros/Hardware/AVR/AVRPWMSetup.sci b/macros/Hardware/AVR/AVRPWMSetup.sci
index 7e1c234f..1bee050d 100644
--- a/macros/Hardware/AVR/AVRPWMSetup.sci
+++ b/macros/Hardware/AVR/AVRPWMSetup.sci
@@ -2,7 +2,7 @@ function AVRPWMSetup(timer, prescalar, waveform_mode, output_mode)
// Function to initialise PWM of AVR
//
// Calling Sequence
-// AVRSetupADC(timer, prescalar, waveform_mode, output_mode)
+// AVRPWMSetup(timer, prescalar, waveform_mode, output_mode)
//
// Parameters
// timer: timer to be used for PWM generation (0,1,2)
diff --git a/macros/Hardware/AVR/AVRTimerSetup.bin b/macros/Hardware/AVR/AVRTimerSetup.bin
new file mode 100644
index 00000000..65e8f454
Binary files /dev/null and b/macros/Hardware/AVR/AVRTimerSetup.bin differ
diff --git a/macros/Hardware/AVR/AVRTimerSetup.sci b/macros/Hardware/AVR/AVRTimerSetup.sci
new file mode 100644
index 00000000..6316cdd7
--- /dev/null
+++ b/macros/Hardware/AVR/AVRTimerSetup.sci
@@ -0,0 +1,31 @@
+function AVRTimerSetup(timer, prescalar)
+// Function to set the prescalar for timer.
+//
+// Calling Sequence
+// AVRTimerSetup(timer, prescalar)
+//
+// Parameters
+// timer: timer to be set up (0,1,2)
+// prescalar: prescalar to be used for generating PWM waveform (0-7)
+// ***Refer datasheet for more description about timer
+//
+// Description
+// This function sets prescalr for timers. 'timer' decides which of the
+// three (0,1,2) timers available to be used. The 'prescalar' is needed for
+// deciding timer clock. Select appropriate prescalar depending on MCU clock
+// and requirement.
+//
+//
+// Examples
+// AVRTimerSetup(0,1) //Timer 0 with no scaling
+//
+// See also
+// AVRGetTimerValue
+//
+// Authors
+// Siddhesh Wani
+//
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+endfunction
diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib
index aa4d6113..b1986824 100644
Binary files a/macros/Hardware/AVR/lib and b/macros/Hardware/AVR/lib differ
diff --git a/macros/Hardware/AVR/names b/macros/Hardware/AVR/names
index afd171ec..126da77a 100644
--- a/macros/Hardware/AVR/names
+++ b/macros/Hardware/AVR/names
@@ -2,8 +2,11 @@ AVRADCSetup
AVRDigitalIn
AVRDigitalOut
AVRDigitalSetup
+AVRGetTimerValue
+AVRPWMSetDuty
AVRPWMSetup
AVRReadADC
+AVRTimerSetup
GetAVRSupportFunctions
GetPeripheral
InsertPeripheralInList
--
cgit
From 7cba1cf7d2ee89559239a22c50297a1545de0587 Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Wed, 13 Jan 2016 11:15:17 +0530
Subject: Test commit
---
macros/Hardware/AVR/AVRTimerSetup.bin | Bin 3552 -> 3480 bytes
macros/Hardware/AVR/AVRTimerSetup.sci | 2 +-
macros/Hardware/AVR/AVRUARTSetup.sci | 31 +++++++++++++++++++++++++
macros/Hardware/AVR/GetAVRSupportFunctions.bin | Bin 1256 -> 1888 bytes
macros/Hardware/AVR/GetAVRSupportFunctions.sci | 11 ++++++++-
5 files changed, 42 insertions(+), 2 deletions(-)
create mode 100644 macros/Hardware/AVR/AVRUARTSetup.sci
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/AVRTimerSetup.bin b/macros/Hardware/AVR/AVRTimerSetup.bin
index 65e8f454..4a49b861 100644
Binary files a/macros/Hardware/AVR/AVRTimerSetup.bin and b/macros/Hardware/AVR/AVRTimerSetup.bin differ
diff --git a/macros/Hardware/AVR/AVRTimerSetup.sci b/macros/Hardware/AVR/AVRTimerSetup.sci
index 6316cdd7..1529c347 100644
--- a/macros/Hardware/AVR/AVRTimerSetup.sci
+++ b/macros/Hardware/AVR/AVRTimerSetup.sci
@@ -6,7 +6,7 @@ function AVRTimerSetup(timer, prescalar)
//
// Parameters
// timer: timer to be set up (0,1,2)
-// prescalar: prescalar to be used for generating PWM waveform (0-7)
+// prescalar: prescalar to be used for timer (0-7)
// ***Refer datasheet for more description about timer
//
// Description
diff --git a/macros/Hardware/AVR/AVRUARTSetup.sci b/macros/Hardware/AVR/AVRUARTSetup.sci
new file mode 100644
index 00000000..1529c347
--- /dev/null
+++ b/macros/Hardware/AVR/AVRUARTSetup.sci
@@ -0,0 +1,31 @@
+function AVRTimerSetup(timer, prescalar)
+// Function to set the prescalar for timer.
+//
+// Calling Sequence
+// AVRTimerSetup(timer, prescalar)
+//
+// Parameters
+// timer: timer to be set up (0,1,2)
+// prescalar: prescalar to be used for timer (0-7)
+// ***Refer datasheet for more description about timer
+//
+// Description
+// This function sets prescalr for timers. 'timer' decides which of the
+// three (0,1,2) timers available to be used. The 'prescalar' is needed for
+// deciding timer clock. Select appropriate prescalar depending on MCU clock
+// and requirement.
+//
+//
+// Examples
+// AVRTimerSetup(0,1) //Timer 0 with no scaling
+//
+// See also
+// AVRGetTimerValue
+//
+// Authors
+// Siddhesh Wani
+//
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+endfunction
diff --git a/macros/Hardware/AVR/GetAVRSupportFunctions.bin b/macros/Hardware/AVR/GetAVRSupportFunctions.bin
index eed8be3b..0aa7587f 100644
Binary files a/macros/Hardware/AVR/GetAVRSupportFunctions.bin and b/macros/Hardware/AVR/GetAVRSupportFunctions.bin differ
diff --git a/macros/Hardware/AVR/GetAVRSupportFunctions.sci b/macros/Hardware/AVR/GetAVRSupportFunctions.sci
index 50a913fa..cce49f91 100644
--- a/macros/Hardware/AVR/GetAVRSupportFunctions.sci
+++ b/macros/Hardware/AVR/GetAVRSupportFunctions.sci
@@ -11,6 +11,15 @@ function AVRSupportFunctions = GetAVRSupportFunctions()
// Author: Siddhesh Wani
// -----------------------------------------------------------------
-AVRSupportFunctions = ["AVRDigitalOut"];
+AVRSupportFunctions = [
+ "AVRADCSetup"
+ "AVRDigitalIn"
+ "AVRDigitalOut"
+ "AVRDigitalSetup"
+ "AVRGetTimerValue"
+ "AVRPWMSetDuty"
+ "AVRPWMSetup"
+ "AVRReadADC"
+ "AVRTimerSetup"];
endfunction
--
cgit
From 5df6d1cb2868abdc8df66755f76c997ee36c0b49 Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Mon, 1 Feb 2016 11:05:35 +0530
Subject: Support for RPi gpios added
---
macros/Hardware/AVR/AVRUARTSetup.bin | Bin 0 -> 3480 bytes
macros/Hardware/AVR/buildmacros.sce | 11 --------
macros/Hardware/AVR/lib | Bin 932 -> 956 bytes
macros/Hardware/AVR/names | 1 +
.../Hardware/RasberryPi/GetRPISupportFunctions.bin | Bin 0 -> 1604 bytes
.../Hardware/RasberryPi/GetRPISupportFunctions.sci | 21 ++++++++++++++
.../Hardware/RasberryPi/IsRPISupportFunction.bin | Bin 0 -> 2704 bytes
.../Hardware/RasberryPi/IsRPISupportFunction.sci | 22 +++++++++++++++
macros/Hardware/RasberryPi/RPIDelay.bin | Bin 0 -> 3528 bytes
macros/Hardware/RasberryPi/RPIDelay.sci | 31 +++++++++++++++++++++
macros/Hardware/RasberryPi/RPIDelayMicro.bin | Bin 0 -> 3280 bytes
macros/Hardware/RasberryPi/RPIDelayMicro.sci | 30 ++++++++++++++++++++
macros/Hardware/RasberryPi/RPI_DigitalIn.bin | Bin 0 -> 3400 bytes
macros/Hardware/RasberryPi/RPI_DigitalIn.sci | 27 ++++++++++++++++++
macros/Hardware/RasberryPi/RPI_DigitalOut.bin | Bin 0 -> 3480 bytes
macros/Hardware/RasberryPi/RPI_DigitalOut.sci | 27 ++++++++++++++++++
macros/Hardware/RasberryPi/RPI_DigitalSetup.bin | Bin 0 -> 3452 bytes
macros/Hardware/RasberryPi/RPI_DigitalSetup.sci | 27 ++++++++++++++++++
macros/Hardware/RasberryPi/buildmacros.sce | 4 +++
macros/Hardware/RasberryPi/lib | Bin 0 -> 816 bytes
macros/Hardware/RasberryPi/names | 7 +++++
macros/Hardware/buildmacros.sce | 19 -------------
22 files changed, 197 insertions(+), 30 deletions(-)
create mode 100644 macros/Hardware/AVR/AVRUARTSetup.bin
create mode 100644 macros/Hardware/RasberryPi/GetRPISupportFunctions.bin
create mode 100644 macros/Hardware/RasberryPi/GetRPISupportFunctions.sci
create mode 100644 macros/Hardware/RasberryPi/IsRPISupportFunction.bin
create mode 100644 macros/Hardware/RasberryPi/IsRPISupportFunction.sci
create mode 100644 macros/Hardware/RasberryPi/RPIDelay.bin
create mode 100644 macros/Hardware/RasberryPi/RPIDelay.sci
create mode 100644 macros/Hardware/RasberryPi/RPIDelayMicro.bin
create mode 100644 macros/Hardware/RasberryPi/RPIDelayMicro.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_DigitalIn.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_DigitalIn.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_DigitalOut.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_DigitalOut.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_DigitalSetup.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
create mode 100644 macros/Hardware/RasberryPi/buildmacros.sce
create mode 100644 macros/Hardware/RasberryPi/lib
create mode 100644 macros/Hardware/RasberryPi/names
delete mode 100644 macros/Hardware/buildmacros.sce
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/AVRUARTSetup.bin b/macros/Hardware/AVR/AVRUARTSetup.bin
new file mode 100644
index 00000000..4a49b861
Binary files /dev/null and b/macros/Hardware/AVR/AVRUARTSetup.bin differ
diff --git a/macros/Hardware/AVR/buildmacros.sce b/macros/Hardware/AVR/buildmacros.sce
index 60fd2843..2954a424 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 b1986824..64d346af 100644
Binary files a/macros/Hardware/AVR/lib and b/macros/Hardware/AVR/lib differ
diff --git a/macros/Hardware/AVR/names b/macros/Hardware/AVR/names
index 126da77a..624fee8a 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 00000000..5bea6458
Binary files /dev/null and b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin differ
diff --git a/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci b/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci
new file mode 100644
index 00000000..24c2f556
--- /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 00000000..728e3d80
Binary files /dev/null and b/macros/Hardware/RasberryPi/IsRPISupportFunction.bin differ
diff --git a/macros/Hardware/RasberryPi/IsRPISupportFunction.sci b/macros/Hardware/RasberryPi/IsRPISupportFunction.sci
new file mode 100644
index 00000000..647b0c85
--- /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 00000000..bb8279ec
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPIDelay.bin differ
diff --git a/macros/Hardware/RasberryPi/RPIDelay.sci b/macros/Hardware/RasberryPi/RPIDelay.sci
new file mode 100644
index 00000000..c5080dd8
--- /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 00000000..a4d32cb6
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPIDelayMicro.bin differ
diff --git a/macros/Hardware/RasberryPi/RPIDelayMicro.sci b/macros/Hardware/RasberryPi/RPIDelayMicro.sci
new file mode 100644
index 00000000..730755b7
--- /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 00000000..a3269a0a
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_DigitalIn.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalIn.sci b/macros/Hardware/RasberryPi/RPI_DigitalIn.sci
new file mode 100644
index 00000000..3ea3bf12
--- /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 00000000..d6b6b7bf
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_DigitalOut.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalOut.sci b/macros/Hardware/RasberryPi/RPI_DigitalOut.sci
new file mode 100644
index 00000000..4836f54f
--- /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 00000000..46836cd9
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci b/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
new file mode 100644
index 00000000..5ce48f0b
--- /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 00000000..2954a424
--- /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 00000000..5884511a
Binary files /dev/null and b/macros/Hardware/RasberryPi/lib differ
diff --git a/macros/Hardware/RasberryPi/names b/macros/Hardware/RasberryPi/names
new file mode 100644
index 00000000..87fe2cd1
--- /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 88f0fb2a..00000000
--- 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;
--
cgit
From 169db0082ebd07baea82d00213db6ffd4dee7cf6 Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Mon, 27 Jun 2016 19:16:41 +0530
Subject: test commit
---
.../Hardware/RasberryPi/GetRPISupportFunctions.bin | Bin 1604 -> 1604 bytes
.../Hardware/RasberryPi/GetRPISupportFunctions.sci | 4 +--
macros/Hardware/RasberryPi/RPIDelay.bin | Bin 3528 -> 0 bytes
macros/Hardware/RasberryPi/RPIDelay.sci | 31 ---------------------
macros/Hardware/RasberryPi/RPIDelayMicro.bin | Bin 3280 -> 0 bytes
macros/Hardware/RasberryPi/RPIDelayMicro.sci | 30 --------------------
macros/Hardware/RasberryPi/RPI_DelayMicro.bin | Bin 0 -> 3280 bytes
macros/Hardware/RasberryPi/RPI_DelayMicro.sci | 30 ++++++++++++++++++++
macros/Hardware/RasberryPi/RPI_DelayMilli.bin | Bin 0 -> 3528 bytes
macros/Hardware/RasberryPi/RPI_DelayMilli.sci | 31 +++++++++++++++++++++
macros/Hardware/RasberryPi/RPI_DigitalIn.bin | Bin 3400 -> 4952 bytes
macros/Hardware/RasberryPi/RPI_DigitalIn.sci | 13 +++++++--
macros/Hardware/RasberryPi/RPI_DigitalSetup.bin | Bin 3452 -> 4884 bytes
macros/Hardware/RasberryPi/RPI_DigitalSetup.sci | 15 ++++++----
macros/Hardware/RasberryPi/lib | Bin 816 -> 816 bytes
macros/Hardware/RasberryPi/names | 4 +--
16 files changed, 85 insertions(+), 73 deletions(-)
delete mode 100644 macros/Hardware/RasberryPi/RPIDelay.bin
delete mode 100644 macros/Hardware/RasberryPi/RPIDelay.sci
delete mode 100644 macros/Hardware/RasberryPi/RPIDelayMicro.bin
delete mode 100644 macros/Hardware/RasberryPi/RPIDelayMicro.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_DelayMicro.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_DelayMicro.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_DelayMilli.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_DelayMilli.sci
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin
index 5bea6458..545334ac 100644
Binary files a/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin and b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin differ
diff --git a/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci b/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci
index 24c2f556..61bb6c0d 100644
--- a/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci
+++ b/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci
@@ -1,4 +1,4 @@
-function AVRSupportFunctions = GetRPISupportFunctions()
+function RPiSupportFunctions = GetRPISupportFunctions()
// -----------------------------------------------------------------
// Get list of RPI peripherals supported
//
@@ -11,7 +11,7 @@ function AVRSupportFunctions = GetRPISupportFunctions()
// Author: Siddhesh Wani
// -----------------------------------------------------------------
-AVRSupportFunctions = [
+RPiSupportFunctions = [
"RPI_DigitalIn"
"RPI_DigitalOut"
"RPI_DigitalSetup"
diff --git a/macros/Hardware/RasberryPi/RPIDelay.bin b/macros/Hardware/RasberryPi/RPIDelay.bin
deleted file mode 100644
index bb8279ec..00000000
Binary files a/macros/Hardware/RasberryPi/RPIDelay.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPIDelay.sci b/macros/Hardware/RasberryPi/RPIDelay.sci
deleted file mode 100644
index c5080dd8..00000000
--- a/macros/Hardware/RasberryPi/RPIDelay.sci
+++ /dev/null
@@ -1,31 +0,0 @@
-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
deleted file mode 100644
index a4d32cb6..00000000
Binary files a/macros/Hardware/RasberryPi/RPIDelayMicro.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPIDelayMicro.sci b/macros/Hardware/RasberryPi/RPIDelayMicro.sci
deleted file mode 100644
index 730755b7..00000000
--- a/macros/Hardware/RasberryPi/RPIDelayMicro.sci
+++ /dev/null
@@ -1,30 +0,0 @@
-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_DelayMicro.bin b/macros/Hardware/RasberryPi/RPI_DelayMicro.bin
new file mode 100644
index 00000000..a4d32cb6
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_DelayMicro.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_DelayMicro.sci b/macros/Hardware/RasberryPi/RPI_DelayMicro.sci
new file mode 100644
index 00000000..730755b7
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_DelayMicro.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_DelayMilli.bin b/macros/Hardware/RasberryPi/RPI_DelayMilli.bin
new file mode 100644
index 00000000..bb8279ec
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_DelayMilli.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_DelayMilli.sci b/macros/Hardware/RasberryPi/RPI_DelayMilli.sci
new file mode 100644
index 00000000..c5080dd8
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_DelayMilli.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/RPI_DigitalIn.bin b/macros/Hardware/RasberryPi/RPI_DigitalIn.bin
index a3269a0a..ec8fd0d7 100644
Binary files a/macros/Hardware/RasberryPi/RPI_DigitalIn.bin and b/macros/Hardware/RasberryPi/RPI_DigitalIn.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalIn.sci b/macros/Hardware/RasberryPi/RPI_DigitalIn.sci
index 3ea3bf12..8775e4cd 100644
--- a/macros/Hardware/RasberryPi/RPI_DigitalIn.sci
+++ b/macros/Hardware/RasberryPi/RPI_DigitalIn.sci
@@ -20,8 +20,15 @@ function state = RPI_DigitalIn(pin)
// Authors
// Siddhesh Wani
//
+// -----------------------------------------------------------------
+//Pins of header P1 which can be used as GPIO
+supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26]
+
+PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for RPi.
-
+//If given pin does not support GPIO functionality, raise the error
+if(PinIsGPIO == 0)
+ error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
+end
+state = 1;
endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin b/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin
index 46836cd9..1de4e224 100644
Binary files a/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin and b/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci b/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
index 5ce48f0b..aede0b7a 100644
--- a/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
+++ b/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
@@ -11,7 +11,7 @@ function RPI_DigitalSetup(pin, direction)
// 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
+// RPI_DigitalSetup(3,0) //Sets pin 3 of header P1 as input
//
// See also
// RPI_DigitalIn RPI_DigitalOut
@@ -19,9 +19,14 @@ function RPI_DigitalSetup(pin, direction)
//
// Authors
// Siddhesh Wani
-//
-
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for RPi.
+// -----------------------------------------------------------------
+//Pins of header P1 which can be used as GPIO
+supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26]
+
+PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
+//If given pin does not support GPIO functionality, raise the error
+if(PinIsGPIO == 0)
+ error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
+end
endfunction
diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib
index 5884511a..10317441 100644
Binary files a/macros/Hardware/RasberryPi/lib and b/macros/Hardware/RasberryPi/lib differ
diff --git a/macros/Hardware/RasberryPi/names b/macros/Hardware/RasberryPi/names
index 87fe2cd1..138ac2a5 100644
--- a/macros/Hardware/RasberryPi/names
+++ b/macros/Hardware/RasberryPi/names
@@ -1,7 +1,7 @@
GetRPISupportFunctions
IsRPISupportFunction
-RPIDelay
-RPIDelayMicro
+RPI_DelayMicro
+RPI_DelayMilli
RPI_DigitalIn
RPI_DigitalOut
RPI_DigitalSetup
--
cgit
From 24fbba33153e7758df4a990cb4c21ae8e53e6f3e Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Mon, 25 Jul 2016 15:59:40 +0530
Subject: WiringPi used for RaspberryPi (Gpio, serial, Threads, ISRs)
---
.../Hardware/RasberryPi/GetRPISupportFunctions.bin | Bin 1604 -> 2784 bytes
.../Hardware/RasberryPi/GetRPISupportFunctions.sci | 16 ++++++-
macros/Hardware/RasberryPi/RPI_GetMicros.bin | Bin 0 -> 3568 bytes
macros/Hardware/RasberryPi/RPI_GetMicros.sci | 31 ++++++++++++++
macros/Hardware/RasberryPi/RPI_GetMillis.bin | Bin 0 -> 3556 bytes
macros/Hardware/RasberryPi/RPI_GetMillis.sci | 31 ++++++++++++++
macros/Hardware/RasberryPi/RPI_PinISR.bin | Bin 0 -> 6640 bytes
macros/Hardware/RasberryPi/RPI_PinISR.sci | 47 +++++++++++++++++++++
macros/Hardware/RasberryPi/RPI_SerialClose.bin | Bin 0 -> 2724 bytes
macros/Hardware/RasberryPi/RPI_SerialClose.sci | 25 +++++++++++
macros/Hardware/RasberryPi/RPI_SerialFlush.bin | Bin 0 -> 3120 bytes
macros/Hardware/RasberryPi/RPI_SerialFlush.sci | 26 ++++++++++++
macros/Hardware/RasberryPi/RPI_SerialGetChar.bin | Bin 0 -> 3400 bytes
macros/Hardware/RasberryPi/RPI_SerialGetChar.sci | 28 ++++++++++++
macros/Hardware/RasberryPi/RPI_SerialSendChar.bin | Bin 0 -> 3344 bytes
macros/Hardware/RasberryPi/RPI_SerialSendChar.sci | 29 +++++++++++++
macros/Hardware/RasberryPi/RPI_SerialSendData.bin | Bin 0 -> 3344 bytes
macros/Hardware/RasberryPi/RPI_SerialSendData.sci | 30 +++++++++++++
macros/Hardware/RasberryPi/RPI_SerialSetup.bin | Bin 0 -> 3356 bytes
macros/Hardware/RasberryPi/RPI_SerialSetup.sci | 28 ++++++++++++
macros/Hardware/RasberryPi/lib | Bin 816 -> 1056 bytes
macros/Hardware/RasberryPi/names | 10 +++++
.../Hardware/RasberryPi/u16RPISerialDataAvail.bin | Bin 0 -> 3520 bytes
.../Hardware/RasberryPi/u16RPISerialDataAvail.sci | 29 +++++++++++++
24 files changed, 329 insertions(+), 1 deletion(-)
create mode 100644 macros/Hardware/RasberryPi/RPI_GetMicros.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_GetMicros.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_GetMillis.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_GetMillis.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_PinISR.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_PinISR.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialClose.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialClose.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialFlush.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialFlush.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialGetChar.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialGetChar.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialSendChar.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialSendChar.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialSendData.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialSendData.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialSetup.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialSetup.sci
create mode 100644 macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin
create mode 100644 macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin
index 545334ac..960068e0 100644
Binary files a/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin and b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin differ
diff --git a/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci b/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci
index 61bb6c0d..fe4edb1c 100644
--- a/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci
+++ b/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci
@@ -16,6 +16,20 @@ RPiSupportFunctions = [
"RPI_DigitalOut"
"RPI_DigitalSetup"
"RPI_DelayMilli"
- "RPI_DelayMicro"];
+ "RPI_DelayMicro"
+ "RPI_GetMillis"
+ "RPI_GetMicros"
+ "RPI_SerialSetup"
+ "RPI_SerialClose"
+ "RPI_SerialSendChar"
+ "RPI_SerialFlush"
+ "RPI_SerialGetChar"
+ "RPI_ThreadCreate"
+ "RPI_PinISR"
+ ];
+
+//Note: "RPI_SerialSendData" is removed since distinction between input data
+//types is required
+
endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_GetMicros.bin b/macros/Hardware/RasberryPi/RPI_GetMicros.bin
new file mode 100644
index 00000000..3e6c08fa
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_GetMicros.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_GetMicros.sci b/macros/Hardware/RasberryPi/RPI_GetMicros.sci
new file mode 100644
index 00000000..7f825efd
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_GetMicros.sci
@@ -0,0 +1,31 @@
+function Micros = RPI_GetMicros()
+// Function to get time in Microsecond since first setup function called.
+//
+// Calling Sequence
+// Micros = RPI_GetMicros()
+//
+// Parameters
+// Micros: time in Microseconds since first setup function called
+//
+// Description
+// This function can be used to get time since first setup function called.
+// Note: To use this function atleast one setup function must be called.
+//
+// Examples
+// start = RPI_GetMicros()
+// RPI_DelayMicro(1000) //This will delay the execution of next code by 100 ms.
+// end = RPI_GetMicros()
+// delay = end- start //This should be approximately 1000 us.
+//
+// See also
+// RPI_GetMillis RPI_DelayMilli 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.
+Micros = 0;
+endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_GetMillis.bin b/macros/Hardware/RasberryPi/RPI_GetMillis.bin
new file mode 100644
index 00000000..b9143650
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_GetMillis.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_GetMillis.sci b/macros/Hardware/RasberryPi/RPI_GetMillis.sci
new file mode 100644
index 00000000..b83f5fea
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_GetMillis.sci
@@ -0,0 +1,31 @@
+function Millis = RPI_GetMillis()
+// Function to get time in millisecond since first setup function called.
+//
+// Calling Sequence
+// Millis = RPI_GetMillis()
+//
+// Parameters
+// Millis: time in milliseconds since first setup function called
+//
+// Description
+// This function can be used to get time since first setup function called.
+// Note: To use this function atleast one setup function must be called.
+//
+// Examples
+// start = RPI_GetMillis()
+// RPI_DelayMilli(100) //This will delay the execution of next code by 100 ms.
+// end = RPI_GetMillis()
+// delay = end- start //This should be approximately 100ms.
+//
+// See also
+// RPI_GetMicros RPI_DelayMilli 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.
+Millis = 0;
+endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_PinISR.bin b/macros/Hardware/RasberryPi/RPI_PinISR.bin
new file mode 100644
index 00000000..a6c0bd98
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_PinISR.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_PinISR.sci b/macros/Hardware/RasberryPi/RPI_PinISR.sci
new file mode 100644
index 00000000..2de7d9e8
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_PinISR.sci
@@ -0,0 +1,47 @@
+function RPI_PinISR(pin, edgetype, fn)
+// Function to assign a function to be run when an interrupt occurs on
+// specified pin.
+//
+// Calling Sequence
+// RPI_PinISR(pin, edgetype, fn)
+//
+// Parameters
+// pin : pin whose interrupt is to be configured
+// edgetype: edge on which interrupt is to be monitored
+// 1 -> Falling egde
+// 2 -> Rising egde
+// 3 -> Both egde
+// fn: name of the function to be executed on interrupt occurance
+// Description
+// This functions monitors interrupt on specified pin for specified edge,
+// When that interrupt occurs, function specified by 'fn' is executed.
+// Examples
+// RPI_PinISR(12, 0, Pin12ISR) //executes 'Pin12ISR' on falling edge on
+// pin 12
+// See also
+// RPI_ThreadCreate RPI_DigitalSetup
+//
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for RPi.
+
+//Pins of header P1 which can be used as GPIO
+supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26]
+
+PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
+
+//If given pin does not support GPIO functionality, raise the error
+if(PinIsGPIO == 0)
+ error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
+end
+EdgeTypeSupported = members(edgetype,[1 2 3])
+
+if(EdgeTypeSupported == 0)
+ error(9999, 'SCI2CERROR: Given edgetype is incorrect. Please specify correct edgetype from [1,2,3]')
+end
+
+endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_SerialClose.bin b/macros/Hardware/RasberryPi/RPI_SerialClose.bin
new file mode 100644
index 00000000..dce972dc
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_SerialClose.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialClose.sci b/macros/Hardware/RasberryPi/RPI_SerialClose.sci
new file mode 100644
index 00000000..0d393f39
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_SerialClose.sci
@@ -0,0 +1,25 @@
+function RPI_SerialClose(fd)
+// Function to close serial port specified by file descriptor.
+//
+// Calling Sequence
+// RPI_SerialClose(fd)
+//
+// Parameters
+// fd : file descriptor for opened port
+// Description
+// This functions closes the specified serial port
+// Examples
+// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
+// RPI_SerialClose(serial1)
+// See also
+// RPI_SerialOpen RPI_SerialSendChar
+//
+//
+// 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_SerialFlush.bin b/macros/Hardware/RasberryPi/RPI_SerialFlush.bin
new file mode 100644
index 00000000..2a3704d0
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_SerialFlush.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialFlush.sci b/macros/Hardware/RasberryPi/RPI_SerialFlush.sci
new file mode 100644
index 00000000..ffef70b4
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_SerialFlush.sci
@@ -0,0 +1,26 @@
+function data = RPI_SerialGetChar(fd)
+// Function to read data from specified serial port
+//
+// Calling Sequence
+// RPI_SerialGetCharfd)
+//
+// Parameters
+// fd: file descriptor returned when serial port was opened
+// Description
+// This functions reads character form specified port. In case no
+// character is available, -1 is returned after 10 sec.
+// Examples
+// serial = RPI_SetupSerial("/dev/ttyAMA0", 9600);
+// RPI_SerialFlush(serial);
+// bytes = RPI_SerialDataAvail(serial);
+//
+// See also
+// RPI_SetupSerial RPI_SendData
+//
+// 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_SerialGetChar.bin b/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin
new file mode 100644
index 00000000..9e6dd09a
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci b/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci
new file mode 100644
index 00000000..ce17ea89
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci
@@ -0,0 +1,28 @@
+function data = RPI_SerialGetChar(fd)
+// Function to read data from specified serial port
+//
+// Calling Sequence
+// RPI_SerialGetCharfd)
+//
+// Parameters
+// fd: file descriptor returned when serial port was opened
+// Description
+// This functions reads character form specified port. In case no
+// character is available, -1 is returned after 10 sec.
+// Examples
+// serial = RPI_SetupSerial("/dev/ttyAMA0", 9600);
+// bytes = RPI_SerialDataAvail(serial);
+// if(bytes>0)
+// data = RPI_SerialGetChar(serial) //Reads single character
+// end
+// See also
+// RPI_SetupSerial RPI_SendData
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for RPi.
+data = 0;
+endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSendChar.bin b/macros/Hardware/RasberryPi/RPI_SerialSendChar.bin
new file mode 100644
index 00000000..7614ebcb
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_SerialSendChar.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSendChar.sci b/macros/Hardware/RasberryPi/RPI_SerialSendChar.sci
new file mode 100644
index 00000000..82051d66
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_SerialSendChar.sci
@@ -0,0 +1,29 @@
+function RPI_SerialSendChar(fd, data)
+// Function to send 8-bit char through serial port.
+//
+// Calling Sequence
+// RPI_SerialSendChar(fd, data)
+//
+// Parameters
+// fd : file descriptor for opened port
+// data: 8-bit character data to be sent
+// Description
+// This functions sends input 8-bit character data on specified serial port
+// Examples
+// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
+// RPI_SerialSendChar(serial1, 'H');
+// RPI_SerialSendChar(serial1, 'i');
+// RPI_SerialClose(serial1);
+//
+// See also
+// RPI_SerialOpen RPI_SerialClose
+//
+//
+// 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_SerialSendData.bin b/macros/Hardware/RasberryPi/RPI_SerialSendData.bin
new file mode 100644
index 00000000..a3524a6c
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_SerialSendData.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSendData.sci b/macros/Hardware/RasberryPi/RPI_SerialSendData.sci
new file mode 100644
index 00000000..6bfe80d1
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_SerialSendData.sci
@@ -0,0 +1,30 @@
+function RPI_SerialSendData(fd, data)
+// Function to send data through serial port. Data can be of any datatype and
+// can be scalar or matrix
+//
+// Calling Sequence
+// RPI_SerialSendData(fd, data)
+//
+// Parameters
+// fd : file descriptor for opened port
+// data: data to be sent
+// Description
+// This functions sends input data on specified serial port
+// Examples
+// A = [2 3; 4 5]
+// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
+// RPI_SerialSendData(serial1, A);
+// RPI_SerialClose(serial1);
+//
+// See also
+// RPI_SerialOpen RPI_SerialClose
+//
+//
+// 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_SerialSetup.bin b/macros/Hardware/RasberryPi/RPI_SerialSetup.bin
new file mode 100644
index 00000000..0128c27b
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_SerialSetup.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSetup.sci b/macros/Hardware/RasberryPi/RPI_SerialSetup.sci
new file mode 100644
index 00000000..25a70a38
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_SerialSetup.sci
@@ -0,0 +1,28 @@
+function fd = RPI_SerialSetup(port, baudrate)
+// Function to setup serial port.
+//
+// Calling Sequence
+// RPI_SerialSetup(port, baudrate)
+//
+// Parameters
+// port : port of RPi to be used (eg. )
+// direction : direction to be set for pin (0 -> INPUT, 1 -> OUTPUT)
+// fd : file descriptor for opened port, -1 for error
+// Description
+// This functions opens the specified serial port and returns file descriptor
+// for the same
+// Examples
+// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
+//
+// See also
+// RPI_SerialClose RPI_SerialSendChar
+//
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for RPi.
+fd = 0;
+endfunction
diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib
index 10317441..40a6b049 100644
Binary files a/macros/Hardware/RasberryPi/lib and b/macros/Hardware/RasberryPi/lib differ
diff --git a/macros/Hardware/RasberryPi/names b/macros/Hardware/RasberryPi/names
index 138ac2a5..a97a189a 100644
--- a/macros/Hardware/RasberryPi/names
+++ b/macros/Hardware/RasberryPi/names
@@ -5,3 +5,13 @@ RPI_DelayMilli
RPI_DigitalIn
RPI_DigitalOut
RPI_DigitalSetup
+RPI_GetMicros
+RPI_GetMillis
+RPI_PinISR
+RPI_SerialClose
+RPI_SerialFlush
+RPI_SerialGetChar
+RPI_SerialSendChar
+RPI_SerialSendData
+RPI_SerialSetup
+u16RPISerialDataAvail
diff --git a/macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin b/macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin
new file mode 100644
index 00000000..3789bd6c
Binary files /dev/null and b/macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin differ
diff --git a/macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci b/macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci
new file mode 100644
index 00000000..5a291569
--- /dev/null
+++ b/macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci
@@ -0,0 +1,29 @@
+function bytes = RPI_SerialDataAvail(fd)
+// Function to get number of data bytes available on serial port specified by
+// file descriptor
+// Calling Sequence
+// RPI_SerialDataAvail(fd)
+//
+// Parameters
+// fd : file descriptor for already opened serial port
+// Description
+// This functions returns number of characters available to read,
+// otherwise reads -1 in case of error. This function can be used to check
+// new data is available on serial port
+// Examples
+// serial = RPI_SerialOpen("/dev/ttyAMA0", 9600);
+// charsToRead = RPI_SerialDataAvail(serial);
+// See also
+// RPI_SerialOpen RPI_SerialGetChar
+//
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for RPi.
+
+bytes = 0;
+
+endfunction
\ No newline at end of file
--
cgit
From c8fd6991786ccddb44547b619178bb391f3f9b96 Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Thu, 18 Aug 2016 15:47:18 +0530
Subject: RPi-PWM and basic imaage processing
---
.../Hardware/RasberryPi/GetRPISupportFunctions.bin | Bin 2784 -> 3184 bytes
.../Hardware/RasberryPi/GetRPISupportFunctions.sci | 4 +++
macros/Hardware/RasberryPi/RPI_DigitalSetup.bin | Bin 4884 -> 4964 bytes
macros/Hardware/RasberryPi/RPI_DigitalSetup.sci | 3 +-
macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin | Bin 0 -> 3488 bytes
macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci | 27 ++++++++++++++++++
macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin | Bin 0 -> 2448 bytes
macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci | 24 ++++++++++++++++
macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin | Bin 0 -> 3340 bytes
macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci | 27 ++++++++++++++++++
macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin | Bin 0 -> 4628 bytes
macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci | 31 +++++++++++++++++++++
macros/Hardware/RasberryPi/RPI_SerialGetChar.bin | Bin 3400 -> 3404 bytes
macros/Hardware/RasberryPi/RPI_SerialGetChar.sci | 2 +-
macros/Hardware/RasberryPi/lib | Bin 1056 -> 1152 bytes
macros/Hardware/RasberryPi/names | 4 +++
16 files changed, 120 insertions(+), 2 deletions(-)
create mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin
index 960068e0..0c64927f 100644
Binary files a/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin and b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin differ
diff --git a/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci b/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci
index fe4edb1c..a791f1e7 100644
--- a/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci
+++ b/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci
@@ -26,6 +26,10 @@ RPiSupportFunctions = [
"RPI_SerialGetChar"
"RPI_ThreadCreate"
"RPI_PinISR"
+ "RPI_HardPWMWrite"
+ "RPI_HardPWMSetRange"
+ "RPI_HardPWMSetClock"
+ "RPI_HardPWMSetMode"
];
//Note: "RPI_SerialSendData" is removed since distinction between input data
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin b/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin
index 1de4e224..1f20deb2 100644
Binary files a/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin and b/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci b/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
index aede0b7a..460a4174 100644
--- a/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
+++ b/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
@@ -6,7 +6,8 @@ function RPI_DigitalSetup(pin, direction)
//
// Parameters
// pin : pin of RPi to be used
-// direction : direction to be set for pin (0 -> INPUT, 1 -> OUTPUT)
+// direction : direction to be set for pin
+// 0 -> INPUT, 1 -> OUTPUT, 2->PWM 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)
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin b/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin
new file mode 100644
index 00000000..1efe0803
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci b/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci
new file mode 100644
index 00000000..3c050306
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci
@@ -0,0 +1,27 @@
+function RPI_HardPWMSetClock(clock_divisor)
+// Function to set PWM clock. PWM clock frequency is 19.2MHz, which can be reduced
+// using suitable clock_divisor (1 to 2048, powers of 2)
+//
+// Calling Sequence
+// RPI_HardPWMSetClock(clock_divisor)
+//
+// Parameters
+// clock_divisor: Value can be from 1 to 2048, powers of 2.
+// Description
+// This function decides pwm clock.
+// PWM frequency = (PWM Clock frequency/Clock divisor/range)
+// PWM clock frequency = 19.2 MHz
+// clock divisor is setup using RPI_HardPWMSetClock
+// range is setup using RPI_HardPWMSetRange
+// Examples
+//
+// See also
+// RPI_HardPWMSetWrite RPI_HardPWMSetRange
+//
+// 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_HardPWMSetMode.bin b/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin
new file mode 100644
index 00000000..075d6e60
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci b/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci
new file mode 100644
index 00000000..2ab697bc
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci
@@ -0,0 +1,24 @@
+function RPI_HardPWMSetMode(pwm_mode)
+// Function to set PWM mode. Two modes are available - balanced and mark/space
+//
+// Calling Sequence
+// RPI_HardPWMSetMode(pwm_mode)
+//
+// Parameters
+// pwm_mode: decides pwm mode
+// 0 -> balanced
+// 1 -> mark/space
+// Description
+// This function decides pwm mode
+// Examples
+//
+// See also
+// RPI_HardPWMSetWrite RPI_HardPWMSetRange
+//
+// 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_HardPWMSetRange.bin b/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin
new file mode 100644
index 00000000..8ded2709
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci b/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci
new file mode 100644
index 00000000..cb7dd67d
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci
@@ -0,0 +1,27 @@
+function RPI_HardPWMSetRange(range_val)
+// Function to set range value for PWM. Range value along with clock divisor
+// decides pwm frequency. Range value must be less than 1024
+//
+// Calling Sequence
+// RPI_HardPWMSetRange(range_val)
+//
+// Parameters
+// range_val: range for pwm
+// Description
+// This function decides range for pwm.
+// PWM frequency = (PWM Clock frequency/Clock divisor/range)
+// PWM clock frequency = 19.2 MHz
+// clock divisor is setup using RPI_HardPWMSetClock
+// range is setup using RPI_HardPWMSetRange
+// Examples
+//
+// See also
+// RPI_HardPWMSetClock RPI_HardPWMWrite
+//
+// 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_HardPWMWrite.bin b/macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin
new file mode 100644
index 00000000..9957f3a4
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci b/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci
new file mode 100644
index 00000000..9f9f7977
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci
@@ -0,0 +1,31 @@
+function RPI_HardPWMWrite(pin,value)
+// Function to change pwm duty on specified pin. Hardware PWM is available
+// only on pin 12. So, only '12' should be provided as pin
+//
+// Calling Sequence
+// RPI_HardPWMWrite(12,512) //Value must be smaller than the range set
+// using RPI_HARDPWMSetRange
+//
+// Parameters
+// pin: pin no on which pwm value is to be changed. Currently only 12 is allowed
+// value: pwm value for given pin. This must be less than range value set
+// Description
+// This function changes pwm duty on specified pin. As for RPi, only one pin
+// (pin 12) is available for hardware PWM.
+// PWM frequency = (PWM Clock frequency/Clock divisor/range)
+// PWM clock frequency = 19.2 MHz
+// clock divisor is setup using RPI_HardPWMSetClock
+// range is setup using RPI_HardPWMSetRange
+// Actual PWM duty = value/range
+// Examples
+//
+// See also
+// RPI_HardPWMSetClock RPI_HardPWMSetRange
+//
+// 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_SerialGetChar.bin b/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin
index 9e6dd09a..928f28a3 100644
Binary files a/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin and b/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci b/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci
index ce17ea89..0271449d 100644
--- a/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci
+++ b/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci
@@ -2,7 +2,7 @@ function data = RPI_SerialGetChar(fd)
// Function to read data from specified serial port
//
// Calling Sequence
-// RPI_SerialGetCharfd)
+// RPI_SerialGetChar(fd)
//
// Parameters
// fd: file descriptor returned when serial port was opened
diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib
index 40a6b049..d25d9440 100644
Binary files a/macros/Hardware/RasberryPi/lib and b/macros/Hardware/RasberryPi/lib differ
diff --git a/macros/Hardware/RasberryPi/names b/macros/Hardware/RasberryPi/names
index a97a189a..fa647761 100644
--- a/macros/Hardware/RasberryPi/names
+++ b/macros/Hardware/RasberryPi/names
@@ -7,6 +7,10 @@ RPI_DigitalOut
RPI_DigitalSetup
RPI_GetMicros
RPI_GetMillis
+RPI_HardPWMSetClock
+RPI_HardPWMSetMode
+RPI_HardPWMSetRange
+RPI_HardPWMWrite
RPI_PinISR
RPI_SerialClose
RPI_SerialFlush
--
cgit
From aceeb1fe05a8ff6c126ea9ba166a19249488dbd1 Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Thu, 13 Apr 2017 10:42:02 +0530
Subject: Functions added - balance,rcond,obscont
---
macros/Hardware/RasberryPi/RPI_DigitalIn.bin | Bin 4952 -> 5264 bytes
macros/Hardware/RasberryPi/RPI_DigitalIn.sci | 3 ++-
2 files changed, 2 insertions(+), 1 deletion(-)
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalIn.bin b/macros/Hardware/RasberryPi/RPI_DigitalIn.bin
index ec8fd0d7..f4c16f39 100644
Binary files a/macros/Hardware/RasberryPi/RPI_DigitalIn.bin and b/macros/Hardware/RasberryPi/RPI_DigitalIn.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalIn.sci b/macros/Hardware/RasberryPi/RPI_DigitalIn.sci
index 8775e4cd..4df03f67 100644
--- a/macros/Hardware/RasberryPi/RPI_DigitalIn.sci
+++ b/macros/Hardware/RasberryPi/RPI_DigitalIn.sci
@@ -22,7 +22,8 @@ function state = RPI_DigitalIn(pin)
//
// -----------------------------------------------------------------
//Pins of header P1 which can be used as GPIO
-supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26]
+supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
+ 31,31,33,35,36,37,38,40];
PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
--
cgit
From 453598b49cb3d4a62b1797dbc90f0e3dd4521329 Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Wed, 19 Apr 2017 11:56:09 +0530
Subject: Copyright message updated in added files and libraries separated in
'thirdparty' folder
---
.../Hardware/RasberryPi/GetRPISupportFunctions.bin | Bin 3184 -> 4760 bytes
.../Hardware/RasberryPi/GetRPISupportFunctions.sci | 11 ++++++++++-
.../Hardware/RasberryPi/IsRPISupportFunction.bin | Bin 2704 -> 4292 bytes
.../Hardware/RasberryPi/IsRPISupportFunction.sci | 12 +++++++++++-
macros/Hardware/RasberryPi/RPI_DelayMicro.sci | 8 ++++++++
macros/Hardware/RasberryPi/RPI_DelayMilli.bin | Bin 3528 -> 3596 bytes
macros/Hardware/RasberryPi/RPI_DelayMilli.sci | 12 ++++++++++--
macros/Hardware/RasberryPi/RPI_DigitalIn.sci | 8 ++++++++
macros/Hardware/RasberryPi/RPI_DigitalOut.bin | Bin 3480 -> 5352 bytes
macros/Hardware/RasberryPi/RPI_DigitalOut.sci | 21 +++++++++++++++++++--
macros/Hardware/RasberryPi/RPI_DigitalSetup.bin | Bin 4964 -> 5336 bytes
macros/Hardware/RasberryPi/RPI_DigitalSetup.sci | 5 ++++-
macros/Hardware/RasberryPi/RPI_GetMicros.sci | 8 ++++++++
macros/Hardware/RasberryPi/RPI_GetMillis.sci | 8 ++++++++
macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci | 8 ++++++++
macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci | 8 ++++++++
macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci | 8 ++++++++
macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci | 8 ++++++++
macros/Hardware/RasberryPi/RPI_PinISR.bin | Bin 6640 -> 6952 bytes
macros/Hardware/RasberryPi/RPI_PinISR.sci | 13 +++++++++++--
macros/Hardware/RasberryPi/RPI_SerialClose.sci | 8 ++++++++
macros/Hardware/RasberryPi/RPI_SerialFlush.sci | 8 ++++++++
macros/Hardware/RasberryPi/RPI_SerialGetChar.sci | 8 ++++++++
macros/Hardware/RasberryPi/RPI_SerialSendChar.sci | 8 ++++++++
macros/Hardware/RasberryPi/RPI_SerialSendData.sci | 8 ++++++++
macros/Hardware/RasberryPi/RPI_SerialSetup.sci | 8 ++++++++
.../Hardware/RasberryPi/u16RPISerialDataAvail.sci | 8 ++++++++
27 files changed, 185 insertions(+), 9 deletions(-)
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin
index 0c64927f..a70999c0 100644
Binary files a/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin and b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin differ
diff --git a/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci b/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci
index a791f1e7..3e6397b2 100644
--- a/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci
+++ b/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci
@@ -7,8 +7,17 @@ function RPiSupportFunctions = GetRPISupportFunctions()
//
// Output data:
// None
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
//
-// Author: Siddhesh Wani
// -----------------------------------------------------------------
RPiSupportFunctions = [
diff --git a/macros/Hardware/RasberryPi/IsRPISupportFunction.bin b/macros/Hardware/RasberryPi/IsRPISupportFunction.bin
index 728e3d80..11533d3e 100644
Binary files a/macros/Hardware/RasberryPi/IsRPISupportFunction.bin and b/macros/Hardware/RasberryPi/IsRPISupportFunction.bin differ
diff --git a/macros/Hardware/RasberryPi/IsRPISupportFunction.sci b/macros/Hardware/RasberryPi/IsRPISupportFunction.sci
index 647b0c85..c6a2c365 100644
--- a/macros/Hardware/RasberryPi/IsRPISupportFunction.sci
+++ b/macros/Hardware/RasberryPi/IsRPISupportFunction.sci
@@ -9,7 +9,17 @@ function Output = IsRPISupportFunction(FunName)
// Output: True or False depending whether given function is a RPi
// support functions or not
//
-// Author: Siddhesh Wani
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+//
// -----------------------------------------------------------------
//Get list of supported functions for AVR
diff --git a/macros/Hardware/RasberryPi/RPI_DelayMicro.sci b/macros/Hardware/RasberryPi/RPI_DelayMicro.sci
index 730755b7..bbb0bb3b 100644
--- a/macros/Hardware/RasberryPi/RPI_DelayMicro.sci
+++ b/macros/Hardware/RasberryPi/RPI_DelayMicro.sci
@@ -1,3 +1,11 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function RPI_DelayMicro(time)
// Function to insert some delay in code execution.
//
diff --git a/macros/Hardware/RasberryPi/RPI_DelayMilli.bin b/macros/Hardware/RasberryPi/RPI_DelayMilli.bin
index bb8279ec..b6eeb30b 100644
Binary files a/macros/Hardware/RasberryPi/RPI_DelayMilli.bin and b/macros/Hardware/RasberryPi/RPI_DelayMilli.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_DelayMilli.sci b/macros/Hardware/RasberryPi/RPI_DelayMilli.sci
index c5080dd8..13b79625 100644
--- a/macros/Hardware/RasberryPi/RPI_DelayMilli.sci
+++ b/macros/Hardware/RasberryPi/RPI_DelayMilli.sci
@@ -1,5 +1,13 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function RPI_DelayMilli(time)
-// Function to insert some delay in code execution.
+// Function to insert some delay in milli seconds in code execution.
//
// Calling Sequence
// RPI_DelayMilli(time)
@@ -8,7 +16,7 @@ function RPI_DelayMilli(time)
// time: time(milliseconds) for which execution is to be delayed
//
// Description
-// this function can be used for insertig execution delays. 'time' should be
+// 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
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalIn.sci b/macros/Hardware/RasberryPi/RPI_DigitalIn.sci
index 4df03f67..781c49c8 100644
--- a/macros/Hardware/RasberryPi/RPI_DigitalIn.sci
+++ b/macros/Hardware/RasberryPi/RPI_DigitalIn.sci
@@ -1,3 +1,11 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function state = RPI_DigitalIn(pin)
// Function to read current state on digital pins.
//
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalOut.bin b/macros/Hardware/RasberryPi/RPI_DigitalOut.bin
index d6b6b7bf..b7ad06e5 100644
Binary files a/macros/Hardware/RasberryPi/RPI_DigitalOut.bin and b/macros/Hardware/RasberryPi/RPI_DigitalOut.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalOut.sci b/macros/Hardware/RasberryPi/RPI_DigitalOut.sci
index 4836f54f..dde3c934 100644
--- a/macros/Hardware/RasberryPi/RPI_DigitalOut.sci
+++ b/macros/Hardware/RasberryPi/RPI_DigitalOut.sci
@@ -1,3 +1,11 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function RPI_DigitalOut(pin, state)
// Function to output desired state on digital pins.
//
@@ -20,8 +28,17 @@ function RPI_DigitalOut(pin, state)
// Authors
// Siddhesh Wani
//
+// -----------------------------------------------------------------
+//Pins of header P1 which can be used as GPIO
+supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
+ 31,31,33,35,36,37,38,40];
+
+PinIsGPIO = members(pin, supported_pins); //Check if output pin supports GPIO
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for RPi.
+//If given pin does not support GPIO functionality, raise the error
+if(PinIsGPIO == 0)
+ error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
+end
+state = 1;
endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin b/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin
index 1f20deb2..1ac5b582 100644
Binary files a/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin and b/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci b/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
index 460a4174..01d6e07d 100644
--- a/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
+++ b/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
@@ -22,7 +22,8 @@ function RPI_DigitalSetup(pin, direction)
// Siddhesh Wani
// -----------------------------------------------------------------
//Pins of header P1 which can be used as GPIO
-supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26]
+supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
+ 31,31,33,35,36,37,38,40];
PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
@@ -30,4 +31,6 @@ PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
if(PinIsGPIO == 0)
error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
end
+state = 1;
+
endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_GetMicros.sci b/macros/Hardware/RasberryPi/RPI_GetMicros.sci
index 7f825efd..6c4db57a 100644
--- a/macros/Hardware/RasberryPi/RPI_GetMicros.sci
+++ b/macros/Hardware/RasberryPi/RPI_GetMicros.sci
@@ -1,3 +1,11 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function Micros = RPI_GetMicros()
// Function to get time in Microsecond since first setup function called.
//
diff --git a/macros/Hardware/RasberryPi/RPI_GetMillis.sci b/macros/Hardware/RasberryPi/RPI_GetMillis.sci
index b83f5fea..c034a705 100644
--- a/macros/Hardware/RasberryPi/RPI_GetMillis.sci
+++ b/macros/Hardware/RasberryPi/RPI_GetMillis.sci
@@ -1,3 +1,11 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function Millis = RPI_GetMillis()
// Function to get time in millisecond since first setup function called.
//
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci b/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci
index 3c050306..8448d364 100644
--- a/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci
+++ b/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci
@@ -1,3 +1,11 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function RPI_HardPWMSetClock(clock_divisor)
// Function to set PWM clock. PWM clock frequency is 19.2MHz, which can be reduced
// using suitable clock_divisor (1 to 2048, powers of 2)
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci b/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci
index 2ab697bc..57b82601 100644
--- a/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci
+++ b/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci
@@ -1,3 +1,11 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function RPI_HardPWMSetMode(pwm_mode)
// Function to set PWM mode. Two modes are available - balanced and mark/space
//
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci b/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci
index cb7dd67d..c2075e2d 100644
--- a/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci
+++ b/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci
@@ -1,3 +1,11 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function RPI_HardPWMSetRange(range_val)
// Function to set range value for PWM. Range value along with clock divisor
// decides pwm frequency. Range value must be less than 1024
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci b/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci
index 9f9f7977..dba5e674 100644
--- a/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci
+++ b/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci
@@ -1,3 +1,11 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function RPI_HardPWMWrite(pin,value)
// Function to change pwm duty on specified pin. Hardware PWM is available
// only on pin 12. So, only '12' should be provided as pin
diff --git a/macros/Hardware/RasberryPi/RPI_PinISR.bin b/macros/Hardware/RasberryPi/RPI_PinISR.bin
index a6c0bd98..ddeff684 100644
Binary files a/macros/Hardware/RasberryPi/RPI_PinISR.bin and b/macros/Hardware/RasberryPi/RPI_PinISR.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_PinISR.sci b/macros/Hardware/RasberryPi/RPI_PinISR.sci
index 2de7d9e8..c2354c1f 100644
--- a/macros/Hardware/RasberryPi/RPI_PinISR.sci
+++ b/macros/Hardware/RasberryPi/RPI_PinISR.sci
@@ -1,3 +1,11 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function RPI_PinISR(pin, edgetype, fn)
// Function to assign a function to be run when an interrupt occurs on
// specified pin.
@@ -30,7 +38,8 @@ function RPI_PinISR(pin, edgetype, fn)
// for providing support for generating C code for RPi.
//Pins of header P1 which can be used as GPIO
-supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26]
+supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
+ 31,31,33,35,36,37,38,40];
PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
@@ -38,7 +47,7 @@ PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
if(PinIsGPIO == 0)
error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
end
-EdgeTypeSupported = members(edgetype,[1 2 3])
+EdgeTypeSupported = members(edgetype,[1 2 3]);
if(EdgeTypeSupported == 0)
error(9999, 'SCI2CERROR: Given edgetype is incorrect. Please specify correct edgetype from [1,2,3]')
diff --git a/macros/Hardware/RasberryPi/RPI_SerialClose.sci b/macros/Hardware/RasberryPi/RPI_SerialClose.sci
index 0d393f39..f27dd432 100644
--- a/macros/Hardware/RasberryPi/RPI_SerialClose.sci
+++ b/macros/Hardware/RasberryPi/RPI_SerialClose.sci
@@ -1,3 +1,11 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function RPI_SerialClose(fd)
// Function to close serial port specified by file descriptor.
//
diff --git a/macros/Hardware/RasberryPi/RPI_SerialFlush.sci b/macros/Hardware/RasberryPi/RPI_SerialFlush.sci
index ffef70b4..9bab386f 100644
--- a/macros/Hardware/RasberryPi/RPI_SerialFlush.sci
+++ b/macros/Hardware/RasberryPi/RPI_SerialFlush.sci
@@ -1,3 +1,11 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function data = RPI_SerialGetChar(fd)
// Function to read data from specified serial port
//
diff --git a/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci b/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci
index 0271449d..a26e5b97 100644
--- a/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci
+++ b/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci
@@ -1,3 +1,11 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function data = RPI_SerialGetChar(fd)
// Function to read data from specified serial port
//
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSendChar.sci b/macros/Hardware/RasberryPi/RPI_SerialSendChar.sci
index 82051d66..769b21d2 100644
--- a/macros/Hardware/RasberryPi/RPI_SerialSendChar.sci
+++ b/macros/Hardware/RasberryPi/RPI_SerialSendChar.sci
@@ -1,3 +1,11 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function RPI_SerialSendChar(fd, data)
// Function to send 8-bit char through serial port.
//
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSendData.sci b/macros/Hardware/RasberryPi/RPI_SerialSendData.sci
index 6bfe80d1..c05852b1 100644
--- a/macros/Hardware/RasberryPi/RPI_SerialSendData.sci
+++ b/macros/Hardware/RasberryPi/RPI_SerialSendData.sci
@@ -1,3 +1,11 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function RPI_SerialSendData(fd, data)
// Function to send data through serial port. Data can be of any datatype and
// can be scalar or matrix
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSetup.sci b/macros/Hardware/RasberryPi/RPI_SerialSetup.sci
index 25a70a38..0f266610 100644
--- a/macros/Hardware/RasberryPi/RPI_SerialSetup.sci
+++ b/macros/Hardware/RasberryPi/RPI_SerialSetup.sci
@@ -1,3 +1,11 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function fd = RPI_SerialSetup(port, baudrate)
// Function to setup serial port.
//
diff --git a/macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci b/macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci
index 5a291569..6eb29a1c 100644
--- a/macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci
+++ b/macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci
@@ -1,3 +1,11 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function bytes = RPI_SerialDataAvail(fd)
// Function to get number of data bytes available on serial port specified by
// file descriptor
--
cgit
From 9e506f48291533cba7b4c555b0d2e98f234bfbe3 Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Wed, 19 Apr 2017 14:28:34 +0530
Subject: Merged Ashish's work
---
macros/Hardware/AVR/AVRADCSetup.bin | Bin 4168 -> 5156 bytes
macros/Hardware/AVR/AVRADCSetup.sci | 31 +++++++---
macros/Hardware/AVR/AVRDigitalIn.bin | Bin 3688 -> 4808 bytes
macros/Hardware/AVR/AVRDigitalIn.sci | 22 ++++++-
macros/Hardware/AVR/AVRDigitalOut.bin | Bin 3760 -> 5320 bytes
macros/Hardware/AVR/AVRDigitalOut.sci | 23 ++++++-
macros/Hardware/AVR/AVRDigitalPortSetup.bin | Bin 0 -> 5132 bytes
macros/Hardware/AVR/AVRDigitalPortSetup.sci | 47 +++++++++++++++
macros/Hardware/AVR/AVRDigitalSetup.bin | Bin 3932 -> 5528 bytes
macros/Hardware/AVR/AVRDigitalSetup.sci | 25 +++++++-
macros/Hardware/AVR/AVRGetTimerValue.bin | Bin 3564 -> 3256 bytes
macros/Hardware/AVR/AVRGetTimerValue.sci | 41 ++++++++-----
macros/Hardware/AVR/AVRPWM0SetDuty.bin | Bin 0 -> 3536 bytes
macros/Hardware/AVR/AVRPWM0SetDuty.sci | 35 +++++++++++
macros/Hardware/AVR/AVRPWM0Setup.bin | Bin 0 -> 8196 bytes
macros/Hardware/AVR/AVRPWM0Setup.sci | 68 +++++++++++++++++++++
macros/Hardware/AVR/AVRPWM1SetDuty.bin | Bin 0 -> 6764 bytes
macros/Hardware/AVR/AVRPWM1SetDuty.sci | 52 ++++++++++++++++
macros/Hardware/AVR/AVRPWM1Setup.bin | Bin 0 -> 10600 bytes
macros/Hardware/AVR/AVRPWM1Setup.sci | 79 +++++++++++++++++++++++++
macros/Hardware/AVR/AVRPWM2SetDuty.bin | Bin 0 -> 3580 bytes
macros/Hardware/AVR/AVRPWM2SetDuty.sci | 38 ++++++++++++
macros/Hardware/AVR/AVRPWM2Setup.bin | Bin 0 -> 8464 bytes
macros/Hardware/AVR/AVRPWM2Setup.sci | 69 +++++++++++++++++++++
macros/Hardware/AVR/AVRPWMSetDuty.bin | Bin 2428 -> 0 bytes
macros/Hardware/AVR/AVRPWMSetDuty.sci | 24 --------
macros/Hardware/AVR/AVRPWMSetup.bin | Bin 5760 -> 0 bytes
macros/Hardware/AVR/AVRPWMSetup.sci | 39 ------------
macros/Hardware/AVR/AVRReadADC.bin | Bin 4048 -> 4840 bytes
macros/Hardware/AVR/AVRReadADC.sci | 21 +++++--
macros/Hardware/AVR/AVRSleep.bin | Bin 0 -> 88 bytes
macros/Hardware/AVR/AVRSleep.sci | 4 ++
macros/Hardware/AVR/AVRTimerSetup.bin | Bin 3480 -> 7880 bytes
macros/Hardware/AVR/AVRTimerSetup.sci | 75 +++++++++++++++--------
macros/Hardware/AVR/AVRUARTReceive.bin | Bin 0 -> 2504 bytes
macros/Hardware/AVR/AVRUARTReceive.sci | 30 ++++++++++
macros/Hardware/AVR/AVRUARTSetup.bin | Bin 3480 -> 8212 bytes
macros/Hardware/AVR/AVRUARTSetup.sci | 70 +++++++++++++++-------
macros/Hardware/AVR/AVRUARTTransmit.bin | Bin 0 -> 2756 bytes
macros/Hardware/AVR/AVRUARTTransmit.sci | 33 +++++++++++
macros/Hardware/AVR/GetAVRSupportFunctions.bin | Bin 1888 -> 2460 bytes
macros/Hardware/AVR/GetAVRSupportFunctions.sci | 26 ++++++--
macros/Hardware/AVR/GetPeripheral.sci | 10 ++++
macros/Hardware/AVR/InsertPeripheralInList.sci | 10 ++++
macros/Hardware/AVR/IsAVRSupportFunction.sci | 10 ++++
macros/Hardware/AVR/lib | Bin 956 -> 1012 bytes
macros/Hardware/AVR/names | 12 +++-
macros/Hardware/RasberryPi/lib | Bin 1152 -> 1312 bytes
48 files changed, 745 insertions(+), 149 deletions(-)
create mode 100644 macros/Hardware/AVR/AVRDigitalPortSetup.bin
create mode 100644 macros/Hardware/AVR/AVRDigitalPortSetup.sci
create mode 100644 macros/Hardware/AVR/AVRPWM0SetDuty.bin
create mode 100644 macros/Hardware/AVR/AVRPWM0SetDuty.sci
create mode 100644 macros/Hardware/AVR/AVRPWM0Setup.bin
create mode 100644 macros/Hardware/AVR/AVRPWM0Setup.sci
create mode 100644 macros/Hardware/AVR/AVRPWM1SetDuty.bin
create mode 100644 macros/Hardware/AVR/AVRPWM1SetDuty.sci
create mode 100644 macros/Hardware/AVR/AVRPWM1Setup.bin
create mode 100644 macros/Hardware/AVR/AVRPWM1Setup.sci
create mode 100644 macros/Hardware/AVR/AVRPWM2SetDuty.bin
create mode 100644 macros/Hardware/AVR/AVRPWM2SetDuty.sci
create mode 100644 macros/Hardware/AVR/AVRPWM2Setup.bin
create mode 100644 macros/Hardware/AVR/AVRPWM2Setup.sci
delete mode 100644 macros/Hardware/AVR/AVRPWMSetDuty.bin
delete mode 100644 macros/Hardware/AVR/AVRPWMSetDuty.sci
delete mode 100644 macros/Hardware/AVR/AVRPWMSetup.bin
delete mode 100644 macros/Hardware/AVR/AVRPWMSetup.sci
create mode 100644 macros/Hardware/AVR/AVRSleep.bin
create mode 100644 macros/Hardware/AVR/AVRSleep.sci
create mode 100644 macros/Hardware/AVR/AVRUARTReceive.bin
create mode 100644 macros/Hardware/AVR/AVRUARTReceive.sci
create mode 100644 macros/Hardware/AVR/AVRUARTTransmit.bin
create mode 100644 macros/Hardware/AVR/AVRUARTTransmit.sci
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/AVRADCSetup.bin b/macros/Hardware/AVR/AVRADCSetup.bin
index 44e3d790..25352e51 100644
Binary files a/macros/Hardware/AVR/AVRADCSetup.bin and b/macros/Hardware/AVR/AVRADCSetup.bin differ
diff --git a/macros/Hardware/AVR/AVRADCSetup.sci b/macros/Hardware/AVR/AVRADCSetup.sci
index ce9117d0..264062bc 100644
--- a/macros/Hardware/AVR/AVRADCSetup.sci
+++ b/macros/Hardware/AVR/AVRADCSetup.sci
@@ -1,32 +1,47 @@
-function AVRADCSetup(prescalar,adc_ref)
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRADCSetup(prescaler,adc_ref)
// Function to initialise ADC of AVR
//
// Calling Sequence
-// AVRADCSetup(uint8 prescalar, uint8 adc_ref)
+// AVRADCSetup(uint8 prescaler, uint8 adc_ref)
//
// Parameters
-// prescalar: prescalar to be used for generating ADC clock (0-7)
+// prescaler: prescaler to be used for generating ADC clock (0-7)
// adc_ref : reference voltage to be used for ADC conversion
// 0 -> Voltage on VREF pin
// 1 -> Voltage on AVCC pin
// 2 -> Internal 2.56 reference voltage
//
// Description
-// This function initialises ADc of AVR with given parameters. 'prescalar' is
+// This function initialises ADc of AVR with given parameters. 'prescaler' is
// needed for deciding ADC clock. ADC clock should be between 50KHz and 200KHz
-// and it given as (MCU clock/2^prescalar). Select appropriate prescalar depending
+// and it given as (MCU clock/2^prescaler). Select appropriate prescaler depending
// on MCU clock. 'adc_ref' selects one of the available reference voltage sources
// available
// Examples
// AVRADCSetup(128,0)
-
// See also
// AVRReadADC
//
// Authors
-// Siddhesh Wani
+// Siddhesh Wani Ashish Kamble
//
-
// This is curretly dummy function. It provides no functionality but is required
// for providing support for generating C code for AVR.
+
+if(prescaler>=8)
+disp("Error : Invalid input argument ''prescaler'' in AVRADCSetup function.");
+end
+if(adc_ref>=3) then
+disp("Error : Invalid input argument ''adc_ref'' in AVRADCSetup function.");
+end
endfunction
diff --git a/macros/Hardware/AVR/AVRDigitalIn.bin b/macros/Hardware/AVR/AVRDigitalIn.bin
index 7ff2c98d..e88f6a63 100644
Binary files a/macros/Hardware/AVR/AVRDigitalIn.bin and b/macros/Hardware/AVR/AVRDigitalIn.bin differ
diff --git a/macros/Hardware/AVR/AVRDigitalIn.sci b/macros/Hardware/AVR/AVRDigitalIn.sci
index ef57564c..54eb327b 100644
--- a/macros/Hardware/AVR/AVRDigitalIn.sci
+++ b/macros/Hardware/AVR/AVRDigitalIn.sci
@@ -1,3 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+
function state = AVRDigitalIn(port,pin)
// Function to get state (high\low) of a digital input pin on AVR
//
@@ -24,9 +35,16 @@ function state = AVRDigitalIn(port,pin)
//
//
// Authors
-// Siddhesh Wani
+// Siddhesh Wani Ashish Kamble
//
-
// This is curretly dummy function. It provides no functionality but is required
// for providing support for generating C code for AVR.
+
+if((port==0)|(port>=5)) then
+disp("Error : Inavalid input argument ''port'' in AVRDigitalIn function.");
+end
+if(pin>=8) then
+disp("Error : Inavalid input argument ''pin'' in AVRDigitalIn function.");
+end
+state = 0;
endfunction
diff --git a/macros/Hardware/AVR/AVRDigitalOut.bin b/macros/Hardware/AVR/AVRDigitalOut.bin
index 7a09b0d8..d0dcb553 100644
Binary files a/macros/Hardware/AVR/AVRDigitalOut.bin and b/macros/Hardware/AVR/AVRDigitalOut.bin differ
diff --git a/macros/Hardware/AVR/AVRDigitalOut.sci b/macros/Hardware/AVR/AVRDigitalOut.sci
index f17c8a07..a86a5aa9 100644
--- a/macros/Hardware/AVR/AVRDigitalOut.sci
+++ b/macros/Hardware/AVR/AVRDigitalOut.sci
@@ -1,3 +1,13 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function AVRDigitalOut(port,pin,state)
// Function to change state (high\low) of a digital output pin on AVR
//
@@ -24,9 +34,18 @@ function AVRDigitalOut(port,pin,state)
//
//
// Authors
-// Siddhesh Wani
+// Siddhesh Wani Ashish Kamble
//
-
// This is curretly dummy function. It provides no functionality but is required
// for providing support for generating C code for AVR.
+
+if((port==0)|(port>=8)) then
+disp("Error : Inavalid input argument ''port'' in AVRDigitalOut function.");
+end
+if(pin>=8) then
+disp("Error : Invalid input argument ''pin'' in AVRDigitalOut function.");
+end
+if(state>=2) then
+disp("Error : Invalid input argument ''state'' in AVRDigitalOut function.");
+end
endfunction
diff --git a/macros/Hardware/AVR/AVRDigitalPortSetup.bin b/macros/Hardware/AVR/AVRDigitalPortSetup.bin
new file mode 100644
index 00000000..dacf6a34
Binary files /dev/null and b/macros/Hardware/AVR/AVRDigitalPortSetup.bin differ
diff --git a/macros/Hardware/AVR/AVRDigitalPortSetup.sci b/macros/Hardware/AVR/AVRDigitalPortSetup.sci
new file mode 100644
index 00000000..5f0b9671
--- /dev/null
+++ b/macros/Hardware/AVR/AVRDigitalPortSetup.sci
@@ -0,0 +1,47 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRDigitalPortSetup(port,direction)
+// Function to decide direction of port on AVR
+//
+// Calling Sequence
+// AVRDigitalPortSetup(port,direction)
+//
+// Parameters
+// port : port of microcontroller to be used(1 for PORTA, 2 for PORTB,...)
+// direction : direction to be set for pin (0 for INPUT, 1 for OUTPUT)
+//
+// Description
+// Each AVR microcontroller has pins which can be configured as digital
+// outputs/inputs. These are normally divided among some 'ports' (group of pins).
+// User has to select one of these port and which pin of that port to be
+// used as digital output/input. Also, desired direction must be specified as
+// 'INPUT' or 'OUTPUT'.
+//
+// Examples
+// AVRDigitalPortSetup(1,0); //This function will make PortA as input port
+//
+// See also
+// AVRDigitalIn AVRDigitalOut
+//
+//
+// Authors
+// Siddhesh Wani Ashish Kamble
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+
+if((port==0)|(port>=5)) then
+disp("Error : Invalid input argument ''port'' in AVRDigitalPortSetup function.");
+end
+if(direction>=2) then
+disp("Error : Invalid input argument ''direction'' in AVRDigitalPortSetup function.");
+end
+endfunction
diff --git a/macros/Hardware/AVR/AVRDigitalSetup.bin b/macros/Hardware/AVR/AVRDigitalSetup.bin
index 98a592e3..60b07497 100644
Binary files a/macros/Hardware/AVR/AVRDigitalSetup.bin and b/macros/Hardware/AVR/AVRDigitalSetup.bin differ
diff --git a/macros/Hardware/AVR/AVRDigitalSetup.sci b/macros/Hardware/AVR/AVRDigitalSetup.sci
index 3de56c21..e707d4fa 100644
--- a/macros/Hardware/AVR/AVRDigitalSetup.sci
+++ b/macros/Hardware/AVR/AVRDigitalSetup.sci
@@ -1,9 +1,19 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function AVRDigitalSetup(port,pin,direction)
// Function to decide direction of a digital pin on AVR
//
// Calling Sequence
// AVRDigitalSetup(port,pin,direction)
-//
+//
// Parameters
// port : port of microcontroller to be used
// pin : pin of port (mentioned above) to be used
@@ -24,9 +34,18 @@ function AVRDigitalSetup(port,pin,direction)
//
//
// Authors
-// Siddhesh Wani
+// Siddhesh Wani Ashish Kamble
//
-
// This is curretly dummy function. It provides no functionality but is required
// for providing support for generating C code for AVR.
+
+if((port==0)|(port>=5)) then
+disp("Error : Invalid input argument ''port'' in AVRDigitalSetup function.");
+end
+if(pin>=8) then
+disp("Error : Invalid input argument ''pin'' in AVRDigitalSetup function.");
+end
+if(direction>=2) then
+disp("Error : Invalid input argument ''direction'' in AVRDigitalSetup function.");
+end
endfunction
diff --git a/macros/Hardware/AVR/AVRGetTimerValue.bin b/macros/Hardware/AVR/AVRGetTimerValue.bin
index 26b4b47e..82f8ed42 100644
Binary files a/macros/Hardware/AVR/AVRGetTimerValue.bin and b/macros/Hardware/AVR/AVRGetTimerValue.bin differ
diff --git a/macros/Hardware/AVR/AVRGetTimerValue.sci b/macros/Hardware/AVR/AVRGetTimerValue.sci
index ab0146aa..afb47ac8 100644
--- a/macros/Hardware/AVR/AVRGetTimerValue.sci
+++ b/macros/Hardware/AVR/AVRGetTimerValue.sci
@@ -1,31 +1,40 @@
-function counts = AVRGetTimerValue(timer)
-// Function to set the prescalar for timer.
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
//
-// Calling Sequence
-// AVRgetTimerValue(timer, prescalar)
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function count = AVRGetTimerValue(timer)
+// Function to get timer count
//
// Parameters
-// timer: timer to be set up (0,1,2)
-// prescalar: prescalar to be used for generating PWM waveform (0-7)
-// ***Refer datasheet for more description about timer
+// timer : timer whose current count is to be returned
+// 0 for timer0
+// 1 for timer1
+// 2 for timer2
//
// Description
-// This function sets prescalr for timers. 'timer' decides which of the
-// three (0,1,2) timers available to be used. The 'prescalar' is needed for
-// deciding timer clock. Select appropriate prescalar depending on MCU clock
-// and requirement.
-//
+// This function returns the count value of a desired timer.By knowing the count value
+// certain interrupt action can be taken.
//
// Examples
-// AVRTimerSetup(0,1) //Timer 0 with no scaling
+// AVRGetTimerValue(0); //returns present count of the TCNT0 counter
//
// See also
-// AVRGetTimerValue
+// AVRTimerSetup
//
// Authors
-// Siddhesh Wani
+// Ashish Kamble
//
-
// This is curretly dummy function. It provides no functionality but is required
// for providing support for generating C code for AVR.
+
+if(timer>=3) then
+disp("Error : Invalid input argument ''timer'' in AVRGetTimerValue function.");
+end
+count = 0;
endfunction
diff --git a/macros/Hardware/AVR/AVRPWM0SetDuty.bin b/macros/Hardware/AVR/AVRPWM0SetDuty.bin
new file mode 100644
index 00000000..bc15dd38
Binary files /dev/null and b/macros/Hardware/AVR/AVRPWM0SetDuty.bin differ
diff --git a/macros/Hardware/AVR/AVRPWM0SetDuty.sci b/macros/Hardware/AVR/AVRPWM0SetDuty.sci
new file mode 100644
index 00000000..604d2f40
--- /dev/null
+++ b/macros/Hardware/AVR/AVRPWM0SetDuty.sci
@@ -0,0 +1,35 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRPWM0SetDuty(duty)
+//Function to Set Duty cycle of PWM Output generated by Timer0 at OC0 pin.
+//Parameters
+// duty : It holds an integer value from 0 to 100 which sets the percentage
+// of time for which signal is active.
+//Description
+// Each Micro controller has PWM output pins which can generate varying voltage
+// from 0V-5V.In this function by varying the duty cycle, varying voltage can be
+// produced.
+//Example
+// AVRPWM0SetDuty(50); //Produces 2.5V at OC0 pin
+// AVRPWM0SetDuty(0); //Produces 0V at OC0 pin
+//See also
+// AVRPWM0Setup
+//
+//Authors
+// Ashish Kamble
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+
+if(duty>100) then
+disp("Error : Invalid input argument ''duty'' in AVRPWM0SetDuty function.");
+end
+endfunction
diff --git a/macros/Hardware/AVR/AVRPWM0Setup.bin b/macros/Hardware/AVR/AVRPWM0Setup.bin
new file mode 100644
index 00000000..08867048
Binary files /dev/null and b/macros/Hardware/AVR/AVRPWM0Setup.bin differ
diff --git a/macros/Hardware/AVR/AVRPWM0Setup.sci b/macros/Hardware/AVR/AVRPWM0Setup.sci
new file mode 100644
index 00000000..39861c86
--- /dev/null
+++ b/macros/Hardware/AVR/AVRPWM0Setup.sci
@@ -0,0 +1,68 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRPWM0Setup(waveform_mode,output_mode)
+//Function to Setup OC0 pin for required PWM mode
+//Description
+// Every Micro controller has PWM pins which can generate varying voltages
+// from 0V-5V.This function helps to use OC0 pin to produce required
+// output waveform by setting the waveform mode and otput mode.
+//
+//Parameters
+// waveform_mode:
+// 0 for Phase correct PWM Mode
+// 1 for Fast PWM Mode
+// 2 for CTC Mode
+// output_mode:
+// For Phase Correct PWM Mode:
+// 0 for Clear OC0 on compare match when up-counting. Set OC0 on compare
+// match when down-counting.
+// 1 for Set OC0 on compare match when up-counting. Clear OC0 on compare
+// match when down-counting.
+//
+// For Fast PWM Mode:
+// 0 for non-inverted output i.e Clear OC0 on compare match, set OC0 at BOTTOM.
+// 1 for inverted output i.e Set OC0 on compare match, clear OC0 at BOTTOM.
+//
+// For CTC Mode:
+// 0 to Clear OC0 on compare match
+// 1 to Set OC0 on compare match
+// 2 to toggle OC0 on compare match
+//
+//Example
+// AVRPWM0Setup(2,0); //This function will select CTC waveform mode and will clear OC0 on
+// compare match
+//See also
+// AVRPWM0SetDuty
+//
+//Authors
+// Ashish Kamble
+//
+//This is curretly dummy function. It provides no functionality but is required
+//for providing support for generating C code for AVR.
+
+if(waveform_mode>=3) then
+disp("Error : Invalid input argument ''waveform_mode'' in AVRPWM0Setup function.");
+end
+
+if((waveform_mode==0)|(waveform_mode==1)) then
+ if(output_mode>=2) then
+ disp("Error : Invalid input argument ''output_mode'' in AVRPWM0Setup function.");
+ end
+end
+
+
+if(waveform_mode==2) then
+ if(output_mode>=3) then
+ disp("Error : Invalid input argument ''output_mode'' in AVRPWM0Setup function.");
+ end
+end
+
+endfunction
diff --git a/macros/Hardware/AVR/AVRPWM1SetDuty.bin b/macros/Hardware/AVR/AVRPWM1SetDuty.bin
new file mode 100644
index 00000000..36567dbf
Binary files /dev/null and b/macros/Hardware/AVR/AVRPWM1SetDuty.bin differ
diff --git a/macros/Hardware/AVR/AVRPWM1SetDuty.sci b/macros/Hardware/AVR/AVRPWM1SetDuty.sci
new file mode 100644
index 00000000..60dc0a9f
--- /dev/null
+++ b/macros/Hardware/AVR/AVRPWM1SetDuty.sci
@@ -0,0 +1,52 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRPWM1SetDuty(output_pin,duty,Top_Value)
+//Function to Set Duty cycle of PWM Output generated by Timer1 at OC1A or OC1B pin.
+//Parameters
+// ouput_pin:
+// 0 for selecting OC1A as output pin
+// 1 for selecting OC1B as output pin
+//
+// duty: It holds an integer value from 0 to 100 which sets the percentage
+// of time for which signal is active.
+//
+// Top_Value: It holds an integer value from 0 to 65535.This value sets the Top
+// value of the counter TCNT1 i.e ICR.(for more info refer datasheet)
+//
+//Description
+// Each Micro controller has PWM output pins which can generate varying voltage
+// from 0V-5V.This function Sets the duty cycle of output PWM signal.Also this function
+// decides the Top Vale of TCNT1 and the output pin to output PWM signal.
+//
+//Example
+// AVRPWM1SetDuty(0,50,40000); //This function will produce PWM signal of 50% duty
+// cycle on OC1A pin and TCNT1 will reset at 40000 instead
+// at 65535.
+//
+//See also
+// AVRPWM1Setup
+//
+//Authors
+// Ashish Kamble
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+
+if(output_pin>=2) then
+disp("Error : Invalid input argument ''output_pin'' in AVRPWM1SetDuty function.");
+end
+if(duty>100) then
+disp("Error : Invalid input argument ''duty'' in AVRPWM1SetDuty function.");
+end
+if(Top_Value>65535) then
+disp("Error : Invalid input argument ''Top_Value'' in AVRPWM1Setduty function.");
+end
+endfunction
diff --git a/macros/Hardware/AVR/AVRPWM1Setup.bin b/macros/Hardware/AVR/AVRPWM1Setup.bin
new file mode 100644
index 00000000..d0b17c24
Binary files /dev/null and b/macros/Hardware/AVR/AVRPWM1Setup.bin differ
diff --git a/macros/Hardware/AVR/AVRPWM1Setup.sci b/macros/Hardware/AVR/AVRPWM1Setup.sci
new file mode 100644
index 00000000..51aa25b1
--- /dev/null
+++ b/macros/Hardware/AVR/AVRPWM1Setup.sci
@@ -0,0 +1,79 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRPWM1Setup(waveform_mode,output_mode,output_pin)
+//Function to Setup OC1A or OC1B pin for required PWM mode
+//Description
+// Every Micro controller has PWM pins which can generate varying voltages
+// from 0V-5V.This function helps to use OC1A or OC1B pin to produces required
+// output waveform by setting the waveform mode and otput mode.
+//
+//Parameters
+// waveform_mode:
+// 0 for Phase correct PWM Mode
+// 1 for Fast PWM Mode
+// 2 for CTC Mode
+//
+// output_mode:
+// For Phase Correct PWM Mode:
+// 0 for Clear OC1A or OC1B on compare match when up-counting. Set OC1A or OC1B
+// on compare match when down-counting.
+// 1 for Set OC1A or OC1B on compare match when up-counting. Clear OC1A or OC1B
+// on compare match when down-counting.
+//
+// For Fast PWM Mode:
+// 0 for non-inverted output i.e Clear OC1A or OC1B on compare match, set OC1A
+// OC1B at BOTTOM.
+// 1 for inverted output i.e Set OC1A or OC1B on compare match, clear OC1A or OC1B
+// at BOTTOM.
+//
+// For CTC Mode:
+// 0 to Clear OC1A or OC1B on compare match
+// 1 to Set OC1A or OC1B on compare match
+// 2 to toggle OC1A or OC1B on compare match
+//
+// output_pin:
+// 0 for selecting OC1A as output pin
+// 1 for selecting OC1B as output pin
+//
+//Example
+// AVRPWM1Setup(2,0,0); //This function will select CTC mode and will clear OC1A or OC1B
+// on compare match.Also as defined the output will be produced at
+// 0C1A pin.
+//See also
+// AVRPWM1SetDuty
+//
+//Authors
+// Ashish Kamble
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+
+if(waveform_mode>=3) then
+disp("Error : Invalid input argument ''waveform_mode'' in AVRPWM1Setup function.");
+end
+if(waveform_mode==0|waveform_mode==1) then
+{
+ //if((type(output_mode)~=8)|(output_mode>=2)) then
+ //disp("Error : Invalid input argument ''output_mode'' in AVRPWM1Setup function.");
+ //end
+}
+end
+if(waveform_mode==2) then
+{
+ if((type(output_mode)~=8)|(output_mode>=3)) then
+ disp("Error : Invalid input argument ''output_mode'' in AVRPWM1Setup function.");
+ end
+}
+end
+if(output_pin>=2) then
+disp("Error : Invalid input argument ''output_pin'' in AVRPWM1Setup function.");
+end
+endfunction
diff --git a/macros/Hardware/AVR/AVRPWM2SetDuty.bin b/macros/Hardware/AVR/AVRPWM2SetDuty.bin
new file mode 100644
index 00000000..47fb5321
Binary files /dev/null and b/macros/Hardware/AVR/AVRPWM2SetDuty.bin differ
diff --git a/macros/Hardware/AVR/AVRPWM2SetDuty.sci b/macros/Hardware/AVR/AVRPWM2SetDuty.sci
new file mode 100644
index 00000000..929c1a0a
--- /dev/null
+++ b/macros/Hardware/AVR/AVRPWM2SetDuty.sci
@@ -0,0 +1,38 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRPWM2SetDuty(duty)
+//Function to Set Duty cycle of PWM Output generated by Timer2 at OC2 pin.
+//Description
+// Each Micro controller has PWM output pins which can generate varying voltage
+// from 0V-5V.In this function by varying the duty cycle, varying voltage can be
+// produced.
+//
+//Parameters
+// duty : It holds an integer value from 0 to 100 which sets the percentage
+// of time for which signal is active.
+//
+//Example
+// AVRPWM2SetDuty(50); //Produces 2.5V at OC2 pin
+// AVRPWM2SetDuty(0); //Produces 0V at OC2 pin
+//
+//See also
+// AVRPWM2Setup
+//
+//Authors
+// Ashish Kamble
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+
+if(duty>100) then
+disp("Error : Invalid input argument ''duty'' in AVRPWM2SetDuty function.");
+end
+endfunction
diff --git a/macros/Hardware/AVR/AVRPWM2Setup.bin b/macros/Hardware/AVR/AVRPWM2Setup.bin
new file mode 100644
index 00000000..66996c08
Binary files /dev/null and b/macros/Hardware/AVR/AVRPWM2Setup.bin differ
diff --git a/macros/Hardware/AVR/AVRPWM2Setup.sci b/macros/Hardware/AVR/AVRPWM2Setup.sci
new file mode 100644
index 00000000..d4bc74a6
--- /dev/null
+++ b/macros/Hardware/AVR/AVRPWM2Setup.sci
@@ -0,0 +1,69 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRPWM2Setup(waveform_mode,output_mode)
+//Function to Setup OC2 pin for required PWM mode
+//Description
+// Every Micro controller has PWM pins which can generate varying voltages
+// from 0V-5V.This function helps to use OC2 pin to produces required
+// output waveform by setting the waveform mode and otput mode.
+//
+//Parameters
+// waveform_mode:
+// 0 for Phase correct PWM Mode
+// 1 for Fast PWM Mode
+// 2 for CTC Mode
+//output_mode:
+// For Phase Correct PWM Mode:
+// 0 for Clear OC2 on compare match when up-counting. Set OC2 on compare
+// match when down-counting.
+// 1 for Set OC2 on compare match when up-counting. Clear OC2 on compare
+// match when down-counting.
+//
+// For Fast PWM Mode:
+// 0 for non-inverted output i.e Clear OC2 on compare match, set OC2 at BOTTOM.
+// 1 for inverted output i.e Set OC2 on compare match, clear OC2 at BOTTOM.
+//
+// For CTC Mode:
+// 0 to Clear OC2 on compare match
+// 1 to Set OC2 on compare match
+// 2 to toggle OC2 on compare match
+//
+//Example
+// AVRPWM2Setup(2,0); //This function will select CTC waveform mode and will clear OC2 on
+// compare match
+//See also
+// AVRPWM2SetDuty
+//
+//Authors
+// Ashish Kamble
+//
+//This is curretly dummy function. It provides no functionality but is required
+//for providing support for generating C code for AVR.
+
+if(waveform_mode>=3) then
+disp("Error : Invalid input argument ''waveform_mode'' in AVRPWM2Setup function.");
+end
+if((waveform_mode==0)|(waveform_mode==1)) then
+{
+ //if((type(output_mode)~=8)|(output_mode>=2)) then
+ //disp("Error : Invalid input argument ''output_mode'' in AVRPWM2Setup function.");
+ //end
+}
+end
+if(waveform_mode==2) then
+{
+ if((type(output_mode)~=8)|(output_mode>=3)) then
+ disp("Error : Invalid input argument ''output_mode'' in AVRPWM2Setup function.");
+ end
+}
+end
+
+endfunction
diff --git a/macros/Hardware/AVR/AVRPWMSetDuty.bin b/macros/Hardware/AVR/AVRPWMSetDuty.bin
deleted file mode 100644
index f3c9e3e4..00000000
Binary files a/macros/Hardware/AVR/AVRPWMSetDuty.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRPWMSetDuty.sci b/macros/Hardware/AVR/AVRPWMSetDuty.sci
deleted file mode 100644
index 0042540a..00000000
--- a/macros/Hardware/AVR/AVRPWMSetDuty.sci
+++ /dev/null
@@ -1,24 +0,0 @@
-function AVRPWMSetDuty(timer, duty)
-// Function to set duty for PWM of AVR
-//
-// Calling Sequence
-// AVRPWMSetDuty(uint8 timer, uint8 duty)
-//
-// Parameters
-// timer: timer to be used for PWM generation (0,1,2)
-// duty: duty for PWM waveform (0-100)
-//
-// Description
-// This function sets duty for PWM waveform according to given parameters.
-//
-// Examples
-// AVRPWMSetDuty(0,10) //Sets 10% duty for timer 0 output.
-//
-// Authors
-// Siddhesh Wani
-//
-//
-
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
-endfunction
diff --git a/macros/Hardware/AVR/AVRPWMSetup.bin b/macros/Hardware/AVR/AVRPWMSetup.bin
deleted file mode 100644
index 971e43ee..00000000
Binary files a/macros/Hardware/AVR/AVRPWMSetup.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRPWMSetup.sci b/macros/Hardware/AVR/AVRPWMSetup.sci
deleted file mode 100644
index 1bee050d..00000000
--- a/macros/Hardware/AVR/AVRPWMSetup.sci
+++ /dev/null
@@ -1,39 +0,0 @@
-function AVRPWMSetup(timer, prescalar, waveform_mode, output_mode)
-// Function to initialise PWM of AVR
-//
-// Calling Sequence
-// AVRPWMSetup(timer, prescalar, waveform_mode, output_mode)
-//
-// Parameters
-// timer: timer to be used for PWM generation (0,1,2)
-// prescalar: prescalar to be used for generating PWM waveform (0-7)
-// waveform_mode: decides type of waveform generation
-// 0 -> Normal mode
-// 1 -> Phase correct mode
-// 2 -> CTC mode
-// 3 -> Fase PWM mode
-// output_mode: decides the compare output mode. (0-3)
-// behaviour of the output is different for different inputs
-// depending upon 'waveform_mode' chosen.
-// ***Refer datasheet for more description about above modes
-//
-// Description
-// This function initialises PWM of AVR with given parameters. 'timer'
-// decides which of the three (0,1,2) timers available to be used. The
-// 'prescalar' is needed for deciding PWM clock. Select appropriate prescalar
-// depending on MCU clock. Choose required pwmmode using 'waveform_generation'
-// and 'output_mode'. Please refer datasheet for more description of 'wafefom_mode'
-// and 'output mode'.
-// Examples
-// AVRPWMSetup(0,1,2,2)
-//
-// See also
-// AVRPMWSetDuty
-//
-// Authors
-// Siddhesh Wani
-//
-
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
-endfunction
diff --git a/macros/Hardware/AVR/AVRReadADC.bin b/macros/Hardware/AVR/AVRReadADC.bin
index c1067084..37350973 100644
Binary files a/macros/Hardware/AVR/AVRReadADC.bin and b/macros/Hardware/AVR/AVRReadADC.bin differ
diff --git a/macros/Hardware/AVR/AVRReadADC.sci b/macros/Hardware/AVR/AVRReadADC.sci
index f9dfdac0..7fd3e67e 100644
--- a/macros/Hardware/AVR/AVRReadADC.sci
+++ b/macros/Hardware/AVR/AVRReadADC.sci
@@ -1,4 +1,14 @@
-function AVRReadADC(channel)
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function adc_result = AVRReadADC(channel)
// Function to get voltage on analog pin on AVR
//
// Calling Sequence
@@ -22,10 +32,13 @@ function AVRReadADC(channel)
// adc_result = u8AVRReadADC(0) //Read ADC0
//
// Authors
-// Siddhesh Wani
+// Siddhesh Wani Ashish Kamble
//
-
-
// This is curretly dummy function. It provides no functionality but is required
// for providing support for generating C code for AVR.
+
+if(channel>=8) then
+disp("Error : Inavlid input argument ''channel'' in AVRReadADC function.");
+end
+adc_result = 0; //adc_result has been initialised to avoid runtime error.
endfunction
diff --git a/macros/Hardware/AVR/AVRSleep.bin b/macros/Hardware/AVR/AVRSleep.bin
new file mode 100644
index 00000000..e4b10d83
Binary files /dev/null and b/macros/Hardware/AVR/AVRSleep.bin differ
diff --git a/macros/Hardware/AVR/AVRSleep.sci b/macros/Hardware/AVR/AVRSleep.sci
new file mode 100644
index 00000000..a1b6add2
--- /dev/null
+++ b/macros/Hardware/AVR/AVRSleep.sci
@@ -0,0 +1,4 @@
+function AVRSleep(delay)
+
+
+endfunction
diff --git a/macros/Hardware/AVR/AVRTimerSetup.bin b/macros/Hardware/AVR/AVRTimerSetup.bin
index 4a49b861..d7d8c427 100644
Binary files a/macros/Hardware/AVR/AVRTimerSetup.bin and b/macros/Hardware/AVR/AVRTimerSetup.bin differ
diff --git a/macros/Hardware/AVR/AVRTimerSetup.sci b/macros/Hardware/AVR/AVRTimerSetup.sci
index 1529c347..7c5dd1da 100644
--- a/macros/Hardware/AVR/AVRTimerSetup.sci
+++ b/macros/Hardware/AVR/AVRTimerSetup.sci
@@ -1,31 +1,56 @@
-function AVRTimerSetup(timer, prescalar)
-// Function to set the prescalar for timer.
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
//
-// Calling Sequence
-// AVRTimerSetup(timer, prescalar)
-//
-// Parameters
-// timer: timer to be set up (0,1,2)
-// prescalar: prescalar to be used for timer (0-7)
-// ***Refer datasheet for more description about timer
-//
-// Description
-// This function sets prescalr for timers. 'timer' decides which of the
-// three (0,1,2) timers available to be used. The 'prescalar' is needed for
-// deciding timer clock. Select appropriate prescalar depending on MCU clock
-// and requirement.
-//
-//
-// Examples
-// AVRTimerSetup(0,1) //Timer 0 with no scaling
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRTimerSetup(timer,prescaler,clock_source)
+//Function to setup Timers in ATmega16
+//Descrpition:
+// This function tells the micro controller which clock source you will be using.
+// The timer value and prescaler value passed in this function setup the timer as per
+// your requirement.
//
-// See also
-// AVRGetTimerValue
+//Parameters:
+// timer : It is an integer value.
+// 0 to setup timer0
+// 1 to setup timer1
+// 2 to setup timer2
+// prescaler : It is an integer value.
+// 1 for no prescaling i.e clock will run at max 16Hz frequency
+// 8 for prescaling clock by 8 i.e new clock frequency will be (clk/8)
+// 64 for prescaling clock by 64 i.e new clock frequency will be (clk/64)
+// 256 for prescaling clock by 256 i.e new clock frequency will be (clk/256)
+// 1024 for prescaling clock by 1024 i.e new clock frequency will be (clk/1024)
+// clock_source : It is an integer value.
+// 0 if you are using internal clock source
+// 1 if you are using external clock source
+//Example
+// AVRTimerSetup(0,64,0); //This function will select timer0 with timer running as per
+// internal clock source and prescaled by 64.
+//
+//See also
+// AVRGetTimerValues
//
-// Authors
-// Siddhesh Wani
+//Authors
+// Ashish Kamble
//
+//This is curretly dummy function. It provides no functionality but is required
+//for providing support for generating C code for AVR.
+
+if(timer>=3) then
+disp("Error : Invalid input argument ''timer'' in AVRTimerSetup function.");
+end
+
+if(~((prescaler==1)|(prescaler==8)|(prescaler==64)|(prescaler==256)|(prescaler==1024))) then
+disp("Error : Invalid input argument ''prescaler'' in AVRTimerSetup function.");
+end
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
+if(clock_source>=2) then
+disp("Error : Invalid input argument ''clock_source'' in AVRTimerSetup function.");
+end
endfunction
diff --git a/macros/Hardware/AVR/AVRUARTReceive.bin b/macros/Hardware/AVR/AVRUARTReceive.bin
new file mode 100644
index 00000000..013036e3
Binary files /dev/null and b/macros/Hardware/AVR/AVRUARTReceive.bin differ
diff --git a/macros/Hardware/AVR/AVRUARTReceive.sci b/macros/Hardware/AVR/AVRUARTReceive.sci
new file mode 100644
index 00000000..790894fb
--- /dev/null
+++ b/macros/Hardware/AVR/AVRUARTReceive.sci
@@ -0,0 +1,30 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function received = AVRUARTReceive()
+// Function to Receive Char value send to ATmega16 using UART or USART.
+// Description
+// This function Receives Char as 8 bit value.This value is stored in UDR at receiving
+// end.
+//
+//Examples
+// state = AVRUARTReceive(); //This function will Receive char and return the entire value
+//
+//See also
+// AVRUARTSetup
+// AVRUARTTransmit
+//
+// Authors
+// Ashish Kamble
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+received = 0; // received has been initialised to avoid runtime error.
+endfunction
diff --git a/macros/Hardware/AVR/AVRUARTSetup.bin b/macros/Hardware/AVR/AVRUARTSetup.bin
index 4a49b861..82ec2911 100644
Binary files a/macros/Hardware/AVR/AVRUARTSetup.bin and b/macros/Hardware/AVR/AVRUARTSetup.bin differ
diff --git a/macros/Hardware/AVR/AVRUARTSetup.sci b/macros/Hardware/AVR/AVRUARTSetup.sci
index 1529c347..32e5db86 100644
--- a/macros/Hardware/AVR/AVRUARTSetup.sci
+++ b/macros/Hardware/AVR/AVRUARTSetup.sci
@@ -1,31 +1,61 @@
-function AVRTimerSetup(timer, prescalar)
-// Function to set the prescalar for timer.
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
//
-// Calling Sequence
-// AVRTimerSetup(timer, prescalar)
-//
-// Parameters
-// timer: timer to be set up (0,1,2)
-// prescalar: prescalar to be used for timer (0-7)
-// ***Refer datasheet for more description about timer
-//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRUARTSetup(mode, baudrate, stopbits, parity)
+// Function to Setup Serial Communication i.e UART or USART in ATmega16.
// Description
-// This function sets prescalr for timers. 'timer' decides which of the
-// three (0,1,2) timers available to be used. The 'prescalar' is needed for
-// deciding timer clock. Select appropriate prescalar depending on MCU clock
-// and requirement.
-//
+// This function Setup the UART or USART for Serial Communicaion between ATmega16
+// and different micro controllers or between ATmega16 and Computer.
+//
+// Parameters
+// mode :
+// 0 for Asynchronous Normal mode
+// 1 for Asynchronous Double Speed mode
+// 2 for Synchronous mode
+//
+// baudrate : Enter one of the following available baudrates
+// 2400 , 4800 , 9600 , 14400 , 19200 , 28800 , 38400 , 57600 ,
+// 768000 , 115200 , 230400 , 250000 , 1000000 .
//
-// Examples
-// AVRTimerSetup(0,1) //Timer 0 with no scaling
+// stopbits :
+// 0 for one stopbit
+// 1 for two stopbits
//
+// parity :
+// 0 for parity disabled
+// 1 for even parity
+// 2 for odd parity
+//
+//Examples
+// AVRUARTSetup(0,9600,0,0); //This function will enable UART Communication for ATmega16
+// with 9600 as baudrate,one stop bit and parity disabled
// See also
-// AVRGetTimerValue
+// AVRUARTTransmit
+// AVRUARTReceive
//
// Authors
-// Siddhesh Wani
+// Ashish Kamble
//
-
// This is curretly dummy function. It provides no functionality but is required
// for providing support for generating C code for AVR.
+if(mode>=3) then
+disp("Error : Invalid input argument ''mode'' in AVRUARTSetup function.");
+end
+
+if((baudrate <> 2400)&(baudrate <> 4800)&(baudrate <> 9600)&(baudrate <> 14400)&(baudrate <> 28800)&(baudrate <> 38400)&(baudrate <> 57600)&(baudrate <> 768000)&(baudrate <> 115200)&(baudrate <> 230400)&(baudrate <> 250000)& (baudrate <> 1000000)) then
+disp("Error : Invalid input argument ''baudrate'' in AVRUARTSetup function.");
+end
+if(stopbits>=2) then
+disp("Error : Invalid input argument ''stopbits'' in AVRUARTSetup function.");
+end
+if(parity>=3) then
+disp("Error : Invalid input argument ''parity'' in AVRUARTSetup function.");
+end
endfunction
diff --git a/macros/Hardware/AVR/AVRUARTTransmit.bin b/macros/Hardware/AVR/AVRUARTTransmit.bin
new file mode 100644
index 00000000..9e53d9a6
Binary files /dev/null and b/macros/Hardware/AVR/AVRUARTTransmit.bin differ
diff --git a/macros/Hardware/AVR/AVRUARTTransmit.sci b/macros/Hardware/AVR/AVRUARTTransmit.sci
new file mode 100644
index 00000000..eb358499
--- /dev/null
+++ b/macros/Hardware/AVR/AVRUARTTransmit.sci
@@ -0,0 +1,33 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRUARTTransmit(data)
+// Function to Transmit data using UART or USART.
+// Description
+// This function Tranmits data over UART or USART.The data to be transmitted can
+// be a Char , String , Unsigned Int, Signed Int.
+//
+// Parameter
+// data :
+// The data to be transmitted can be a Char,String,Unsigned Int,Signed Int.
+//
+//Examples
+// AVRUARTTransmit("This is example"); //This function will transmit the entered string.
+//
+//See also
+// AVRUARTSetup
+// AVRUARTReceive
+//
+// Authors
+// Ashish Kamble
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+endfunction
diff --git a/macros/Hardware/AVR/GetAVRSupportFunctions.bin b/macros/Hardware/AVR/GetAVRSupportFunctions.bin
index 0aa7587f..ba847830 100644
Binary files a/macros/Hardware/AVR/GetAVRSupportFunctions.bin and b/macros/Hardware/AVR/GetAVRSupportFunctions.bin differ
diff --git a/macros/Hardware/AVR/GetAVRSupportFunctions.sci b/macros/Hardware/AVR/GetAVRSupportFunctions.sci
index cce49f91..99c6242f 100644
--- a/macros/Hardware/AVR/GetAVRSupportFunctions.sci
+++ b/macros/Hardware/AVR/GetAVRSupportFunctions.sci
@@ -1,3 +1,13 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function AVRSupportFunctions = GetAVRSupportFunctions()
// -----------------------------------------------------------------
// Get list of AVR peripherals supported
@@ -8,7 +18,7 @@ function AVRSupportFunctions = GetAVRSupportFunctions()
// Output data:
// None
//
-// Author: Siddhesh Wani
+// Author: Siddhesh Wani Ashish Kamble
// -----------------------------------------------------------------
AVRSupportFunctions = [
@@ -16,10 +26,18 @@ AVRSupportFunctions = [
"AVRDigitalIn"
"AVRDigitalOut"
"AVRDigitalSetup"
+ "AVRDigitalPortSetup"
+ "AVRTimerSetup"
"AVRGetTimerValue"
- "AVRPWMSetDuty"
- "AVRPWMSetup"
+ "AVRPWM0Setup"
+ "AVRPWM0SetDuty"
+ "AVRPWM1Setup"
+ "AVRPWM1SetDuty"
+ "AVRPWM2Setup"
+ "AVRPWM2SetDuty"
"AVRReadADC"
- "AVRTimerSetup"];
+ "AVRSleep"
+ "AVRUARTSetup"
+ ];
endfunction
diff --git a/macros/Hardware/AVR/GetPeripheral.sci b/macros/Hardware/AVR/GetPeripheral.sci
index 73e9f19e..ac909deb 100644
--- a/macros/Hardware/AVR/GetPeripheral.sci
+++ b/macros/Hardware/AVR/GetPeripheral.sci
@@ -1,3 +1,13 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function Peripheral = GetPeripheral(FunName,InArg)
// -----------------------------------------------------------------
// Get an acronym for peripheral being used to be inserted in list of
diff --git a/macros/Hardware/AVR/InsertPeripheralInList.sci b/macros/Hardware/AVR/InsertPeripheralInList.sci
index bafc5935..198ea1da 100644
--- a/macros/Hardware/AVR/InsertPeripheralInList.sci
+++ b/macros/Hardware/AVR/InsertPeripheralInList.sci
@@ -1,3 +1,13 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function InsertPeripheralInList(Peripheral,PeripheralListFile)
// -----------------------------------------------------------------
// Insert input peripheral in peripherals' list
diff --git a/macros/Hardware/AVR/IsAVRSupportFunction.sci b/macros/Hardware/AVR/IsAVRSupportFunction.sci
index a4cbbc88..94f4af7c 100644
--- a/macros/Hardware/AVR/IsAVRSupportFunction.sci
+++ b/macros/Hardware/AVR/IsAVRSupportFunction.sci
@@ -1,3 +1,13 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
function Output = IsAVRSupportFunction(FunName)
// -----------------------------------------------------------------
// Check whether input function name is an AVR support function or not.
diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib
index 64d346af..f07c4e6b 100644
Binary files a/macros/Hardware/AVR/lib and b/macros/Hardware/AVR/lib differ
diff --git a/macros/Hardware/AVR/names b/macros/Hardware/AVR/names
index 624fee8a..8fcfdb75 100644
--- a/macros/Hardware/AVR/names
+++ b/macros/Hardware/AVR/names
@@ -1,13 +1,21 @@
AVRADCSetup
AVRDigitalIn
AVRDigitalOut
+AVRDigitalPortSetup
AVRDigitalSetup
AVRGetTimerValue
-AVRPWMSetDuty
-AVRPWMSetup
+AVRPWM0SetDuty
+AVRPWM0Setup
+AVRPWM1SetDuty
+AVRPWM1Setup
+AVRPWM2SetDuty
+AVRPWM2Setup
AVRReadADC
+AVRSleep
AVRTimerSetup
+AVRUARTReceive
AVRUARTSetup
+AVRUARTTransmit
GetAVRSupportFunctions
GetPeripheral
InsertPeripheralInList
diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib
index d25d9440..2426bc1a 100644
Binary files a/macros/Hardware/RasberryPi/lib and b/macros/Hardware/RasberryPi/lib differ
--
cgit
From 1fd0dce8d72c4d5869ce5ff4025ac09af603bc0f Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Wed, 19 Apr 2017 14:57:49 +0530
Subject: Merged Shamik's work
---
macros/Hardware/AVR/lib | Bin 1012 -> 1338 bytes
macros/Hardware/RasberryPi/names | 2 ++
2 files changed, 2 insertions(+)
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib
index f07c4e6b..3e6de60e 100644
Binary files a/macros/Hardware/AVR/lib and b/macros/Hardware/AVR/lib differ
diff --git a/macros/Hardware/RasberryPi/names b/macros/Hardware/RasberryPi/names
index fa647761..39cb5432 100644
--- a/macros/Hardware/RasberryPi/names
+++ b/macros/Hardware/RasberryPi/names
@@ -2,6 +2,8 @@ GetRPISupportFunctions
IsRPISupportFunction
RPI_DelayMicro
RPI_DelayMilli
+RPI_DelayMicro
+RPI_DelayMilli
RPI_DigitalIn
RPI_DigitalOut
RPI_DigitalSetup
--
cgit
From c7e9597db39140c1d982f796a8e1f03bb54e7905 Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Mon, 24 Apr 2017 14:08:37 +0530
Subject: Fixed float.h issue. OpenCV with built libraries working for linux
x64
---
macros/Hardware/AVR/AVRADCSetup.bin | Bin 5156 -> 0 bytes
macros/Hardware/AVR/AVRDigitalIn.bin | Bin 4808 -> 0 bytes
macros/Hardware/AVR/AVRDigitalOut.bin | Bin 5320 -> 0 bytes
macros/Hardware/AVR/AVRDigitalPortSetup.bin | Bin 5132 -> 0 bytes
macros/Hardware/AVR/AVRDigitalSetup.bin | Bin 5528 -> 0 bytes
macros/Hardware/AVR/AVRGetTimerValue.bin | Bin 3256 -> 0 bytes
macros/Hardware/AVR/AVRPWM0SetDuty.bin | Bin 3536 -> 0 bytes
macros/Hardware/AVR/AVRPWM0Setup.bin | Bin 8196 -> 0 bytes
macros/Hardware/AVR/AVRPWM1SetDuty.bin | Bin 6764 -> 0 bytes
macros/Hardware/AVR/AVRPWM1Setup.bin | Bin 10600 -> 0 bytes
macros/Hardware/AVR/AVRPWM2SetDuty.bin | Bin 3580 -> 0 bytes
macros/Hardware/AVR/AVRPWM2Setup.bin | Bin 8464 -> 0 bytes
macros/Hardware/AVR/AVRReadADC.bin | Bin 4840 -> 0 bytes
macros/Hardware/AVR/AVRSleep.bin | Bin 88 -> 0 bytes
macros/Hardware/AVR/AVRTimerSetup.bin | Bin 7880 -> 0 bytes
macros/Hardware/AVR/AVRUARTReceive.bin | Bin 2504 -> 0 bytes
macros/Hardware/AVR/AVRUARTSetup.bin | Bin 8212 -> 0 bytes
macros/Hardware/AVR/AVRUARTTransmit.bin | Bin 2756 -> 0 bytes
macros/Hardware/AVR/GetAVRSupportFunctions.bin | Bin 2460 -> 0 bytes
macros/Hardware/AVR/GetPeripheral.bin | Bin 2364 -> 0 bytes
macros/Hardware/AVR/InsertPeripheralInList.bin | Bin 1928 -> 0 bytes
macros/Hardware/AVR/IsAVRSupportFunction.bin | Bin 2712 -> 0 bytes
macros/Hardware/AVR/lib | Bin 1338 -> 0 bytes
macros/Hardware/AVR/names | 22 --------------------
.../Hardware/RasberryPi/GetRPISupportFunctions.bin | Bin 4760 -> 0 bytes
.../Hardware/RasberryPi/IsRPISupportFunction.bin | Bin 4292 -> 0 bytes
macros/Hardware/RasberryPi/RPI_DelayMicro.bin | Bin 3280 -> 0 bytes
macros/Hardware/RasberryPi/RPI_DelayMilli.bin | Bin 3596 -> 0 bytes
macros/Hardware/RasberryPi/RPI_DigitalIn.bin | Bin 5264 -> 0 bytes
macros/Hardware/RasberryPi/RPI_DigitalOut.bin | Bin 5352 -> 0 bytes
macros/Hardware/RasberryPi/RPI_DigitalSetup.bin | Bin 5336 -> 0 bytes
macros/Hardware/RasberryPi/RPI_GetMicros.bin | Bin 3568 -> 0 bytes
macros/Hardware/RasberryPi/RPI_GetMillis.bin | Bin 3556 -> 0 bytes
macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin | Bin 3488 -> 0 bytes
macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin | Bin 2448 -> 0 bytes
macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin | Bin 3340 -> 0 bytes
macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin | Bin 4628 -> 0 bytes
macros/Hardware/RasberryPi/RPI_PinISR.bin | Bin 6952 -> 0 bytes
macros/Hardware/RasberryPi/RPI_SerialClose.bin | Bin 2724 -> 0 bytes
macros/Hardware/RasberryPi/RPI_SerialFlush.bin | Bin 3120 -> 0 bytes
macros/Hardware/RasberryPi/RPI_SerialGetChar.bin | Bin 3404 -> 0 bytes
macros/Hardware/RasberryPi/RPI_SerialSendChar.bin | Bin 3344 -> 0 bytes
macros/Hardware/RasberryPi/RPI_SerialSendData.bin | Bin 3344 -> 0 bytes
macros/Hardware/RasberryPi/RPI_SerialSetup.bin | Bin 3356 -> 0 bytes
macros/Hardware/RasberryPi/lib | Bin 1312 -> 0 bytes
macros/Hardware/RasberryPi/names | 23 ---------------------
.../Hardware/RasberryPi/u16RPISerialDataAvail.bin | Bin 3520 -> 0 bytes
47 files changed, 45 deletions(-)
delete mode 100644 macros/Hardware/AVR/AVRADCSetup.bin
delete mode 100644 macros/Hardware/AVR/AVRDigitalIn.bin
delete mode 100644 macros/Hardware/AVR/AVRDigitalOut.bin
delete mode 100644 macros/Hardware/AVR/AVRDigitalPortSetup.bin
delete mode 100644 macros/Hardware/AVR/AVRDigitalSetup.bin
delete mode 100644 macros/Hardware/AVR/AVRGetTimerValue.bin
delete mode 100644 macros/Hardware/AVR/AVRPWM0SetDuty.bin
delete mode 100644 macros/Hardware/AVR/AVRPWM0Setup.bin
delete mode 100644 macros/Hardware/AVR/AVRPWM1SetDuty.bin
delete mode 100644 macros/Hardware/AVR/AVRPWM1Setup.bin
delete mode 100644 macros/Hardware/AVR/AVRPWM2SetDuty.bin
delete mode 100644 macros/Hardware/AVR/AVRPWM2Setup.bin
delete mode 100644 macros/Hardware/AVR/AVRReadADC.bin
delete mode 100644 macros/Hardware/AVR/AVRSleep.bin
delete mode 100644 macros/Hardware/AVR/AVRTimerSetup.bin
delete mode 100644 macros/Hardware/AVR/AVRUARTReceive.bin
delete mode 100644 macros/Hardware/AVR/AVRUARTSetup.bin
delete mode 100644 macros/Hardware/AVR/AVRUARTTransmit.bin
delete mode 100644 macros/Hardware/AVR/GetAVRSupportFunctions.bin
delete mode 100644 macros/Hardware/AVR/GetPeripheral.bin
delete mode 100644 macros/Hardware/AVR/InsertPeripheralInList.bin
delete mode 100644 macros/Hardware/AVR/IsAVRSupportFunction.bin
delete mode 100644 macros/Hardware/AVR/lib
delete mode 100644 macros/Hardware/AVR/names
delete mode 100644 macros/Hardware/RasberryPi/GetRPISupportFunctions.bin
delete mode 100644 macros/Hardware/RasberryPi/IsRPISupportFunction.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_DelayMicro.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_DelayMilli.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_DigitalIn.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_DigitalOut.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_DigitalSetup.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_GetMicros.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_GetMillis.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_PinISR.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_SerialClose.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_SerialFlush.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_SerialGetChar.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_SerialSendChar.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_SerialSendData.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_SerialSetup.bin
delete mode 100644 macros/Hardware/RasberryPi/lib
delete mode 100644 macros/Hardware/RasberryPi/names
delete mode 100644 macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/AVRADCSetup.bin b/macros/Hardware/AVR/AVRADCSetup.bin
deleted file mode 100644
index 25352e51..00000000
Binary files a/macros/Hardware/AVR/AVRADCSetup.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRDigitalIn.bin b/macros/Hardware/AVR/AVRDigitalIn.bin
deleted file mode 100644
index e88f6a63..00000000
Binary files a/macros/Hardware/AVR/AVRDigitalIn.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRDigitalOut.bin b/macros/Hardware/AVR/AVRDigitalOut.bin
deleted file mode 100644
index d0dcb553..00000000
Binary files a/macros/Hardware/AVR/AVRDigitalOut.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRDigitalPortSetup.bin b/macros/Hardware/AVR/AVRDigitalPortSetup.bin
deleted file mode 100644
index dacf6a34..00000000
Binary files a/macros/Hardware/AVR/AVRDigitalPortSetup.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRDigitalSetup.bin b/macros/Hardware/AVR/AVRDigitalSetup.bin
deleted file mode 100644
index 60b07497..00000000
Binary files a/macros/Hardware/AVR/AVRDigitalSetup.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRGetTimerValue.bin b/macros/Hardware/AVR/AVRGetTimerValue.bin
deleted file mode 100644
index 82f8ed42..00000000
Binary files a/macros/Hardware/AVR/AVRGetTimerValue.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRPWM0SetDuty.bin b/macros/Hardware/AVR/AVRPWM0SetDuty.bin
deleted file mode 100644
index bc15dd38..00000000
Binary files a/macros/Hardware/AVR/AVRPWM0SetDuty.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRPWM0Setup.bin b/macros/Hardware/AVR/AVRPWM0Setup.bin
deleted file mode 100644
index 08867048..00000000
Binary files a/macros/Hardware/AVR/AVRPWM0Setup.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRPWM1SetDuty.bin b/macros/Hardware/AVR/AVRPWM1SetDuty.bin
deleted file mode 100644
index 36567dbf..00000000
Binary files a/macros/Hardware/AVR/AVRPWM1SetDuty.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRPWM1Setup.bin b/macros/Hardware/AVR/AVRPWM1Setup.bin
deleted file mode 100644
index d0b17c24..00000000
Binary files a/macros/Hardware/AVR/AVRPWM1Setup.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRPWM2SetDuty.bin b/macros/Hardware/AVR/AVRPWM2SetDuty.bin
deleted file mode 100644
index 47fb5321..00000000
Binary files a/macros/Hardware/AVR/AVRPWM2SetDuty.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRPWM2Setup.bin b/macros/Hardware/AVR/AVRPWM2Setup.bin
deleted file mode 100644
index 66996c08..00000000
Binary files a/macros/Hardware/AVR/AVRPWM2Setup.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRReadADC.bin b/macros/Hardware/AVR/AVRReadADC.bin
deleted file mode 100644
index 37350973..00000000
Binary files a/macros/Hardware/AVR/AVRReadADC.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRSleep.bin b/macros/Hardware/AVR/AVRSleep.bin
deleted file mode 100644
index e4b10d83..00000000
Binary files a/macros/Hardware/AVR/AVRSleep.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRTimerSetup.bin b/macros/Hardware/AVR/AVRTimerSetup.bin
deleted file mode 100644
index d7d8c427..00000000
Binary files a/macros/Hardware/AVR/AVRTimerSetup.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRUARTReceive.bin b/macros/Hardware/AVR/AVRUARTReceive.bin
deleted file mode 100644
index 013036e3..00000000
Binary files a/macros/Hardware/AVR/AVRUARTReceive.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRUARTSetup.bin b/macros/Hardware/AVR/AVRUARTSetup.bin
deleted file mode 100644
index 82ec2911..00000000
Binary files a/macros/Hardware/AVR/AVRUARTSetup.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRUARTTransmit.bin b/macros/Hardware/AVR/AVRUARTTransmit.bin
deleted file mode 100644
index 9e53d9a6..00000000
Binary files a/macros/Hardware/AVR/AVRUARTTransmit.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/GetAVRSupportFunctions.bin b/macros/Hardware/AVR/GetAVRSupportFunctions.bin
deleted file mode 100644
index ba847830..00000000
Binary files a/macros/Hardware/AVR/GetAVRSupportFunctions.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/GetPeripheral.bin b/macros/Hardware/AVR/GetPeripheral.bin
deleted file mode 100644
index b496bbb0..00000000
Binary files a/macros/Hardware/AVR/GetPeripheral.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/InsertPeripheralInList.bin b/macros/Hardware/AVR/InsertPeripheralInList.bin
deleted file mode 100644
index c49f4e04..00000000
Binary files a/macros/Hardware/AVR/InsertPeripheralInList.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/IsAVRSupportFunction.bin b/macros/Hardware/AVR/IsAVRSupportFunction.bin
deleted file mode 100644
index e2382308..00000000
Binary files a/macros/Hardware/AVR/IsAVRSupportFunction.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib
deleted file mode 100644
index 3e6de60e..00000000
Binary files a/macros/Hardware/AVR/lib and /dev/null differ
diff --git a/macros/Hardware/AVR/names b/macros/Hardware/AVR/names
deleted file mode 100644
index 8fcfdb75..00000000
--- a/macros/Hardware/AVR/names
+++ /dev/null
@@ -1,22 +0,0 @@
-AVRADCSetup
-AVRDigitalIn
-AVRDigitalOut
-AVRDigitalPortSetup
-AVRDigitalSetup
-AVRGetTimerValue
-AVRPWM0SetDuty
-AVRPWM0Setup
-AVRPWM1SetDuty
-AVRPWM1Setup
-AVRPWM2SetDuty
-AVRPWM2Setup
-AVRReadADC
-AVRSleep
-AVRTimerSetup
-AVRUARTReceive
-AVRUARTSetup
-AVRUARTTransmit
-GetAVRSupportFunctions
-GetPeripheral
-InsertPeripheralInList
-IsAVRSupportFunction
diff --git a/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin
deleted file mode 100644
index a70999c0..00000000
Binary files a/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/IsRPISupportFunction.bin b/macros/Hardware/RasberryPi/IsRPISupportFunction.bin
deleted file mode 100644
index 11533d3e..00000000
Binary files a/macros/Hardware/RasberryPi/IsRPISupportFunction.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_DelayMicro.bin b/macros/Hardware/RasberryPi/RPI_DelayMicro.bin
deleted file mode 100644
index a4d32cb6..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_DelayMicro.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_DelayMilli.bin b/macros/Hardware/RasberryPi/RPI_DelayMilli.bin
deleted file mode 100644
index b6eeb30b..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_DelayMilli.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalIn.bin b/macros/Hardware/RasberryPi/RPI_DigitalIn.bin
deleted file mode 100644
index f4c16f39..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_DigitalIn.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalOut.bin b/macros/Hardware/RasberryPi/RPI_DigitalOut.bin
deleted file mode 100644
index b7ad06e5..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_DigitalOut.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin b/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin
deleted file mode 100644
index 1ac5b582..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_GetMicros.bin b/macros/Hardware/RasberryPi/RPI_GetMicros.bin
deleted file mode 100644
index 3e6c08fa..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_GetMicros.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_GetMillis.bin b/macros/Hardware/RasberryPi/RPI_GetMillis.bin
deleted file mode 100644
index b9143650..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_GetMillis.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin b/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin
deleted file mode 100644
index 1efe0803..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin b/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin
deleted file mode 100644
index 075d6e60..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin b/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin
deleted file mode 100644
index 8ded2709..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin b/macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin
deleted file mode 100644
index 9957f3a4..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_PinISR.bin b/macros/Hardware/RasberryPi/RPI_PinISR.bin
deleted file mode 100644
index ddeff684..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_PinISR.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialClose.bin b/macros/Hardware/RasberryPi/RPI_SerialClose.bin
deleted file mode 100644
index dce972dc..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_SerialClose.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialFlush.bin b/macros/Hardware/RasberryPi/RPI_SerialFlush.bin
deleted file mode 100644
index 2a3704d0..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_SerialFlush.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin b/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin
deleted file mode 100644
index 928f28a3..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSendChar.bin b/macros/Hardware/RasberryPi/RPI_SerialSendChar.bin
deleted file mode 100644
index 7614ebcb..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_SerialSendChar.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSendData.bin b/macros/Hardware/RasberryPi/RPI_SerialSendData.bin
deleted file mode 100644
index a3524a6c..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_SerialSendData.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSetup.bin b/macros/Hardware/RasberryPi/RPI_SerialSetup.bin
deleted file mode 100644
index 0128c27b..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_SerialSetup.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib
deleted file mode 100644
index 2426bc1a..00000000
Binary files a/macros/Hardware/RasberryPi/lib and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/names b/macros/Hardware/RasberryPi/names
deleted file mode 100644
index 39cb5432..00000000
--- a/macros/Hardware/RasberryPi/names
+++ /dev/null
@@ -1,23 +0,0 @@
-GetRPISupportFunctions
-IsRPISupportFunction
-RPI_DelayMicro
-RPI_DelayMilli
-RPI_DelayMicro
-RPI_DelayMilli
-RPI_DigitalIn
-RPI_DigitalOut
-RPI_DigitalSetup
-RPI_GetMicros
-RPI_GetMillis
-RPI_HardPWMSetClock
-RPI_HardPWMSetMode
-RPI_HardPWMSetRange
-RPI_HardPWMWrite
-RPI_PinISR
-RPI_SerialClose
-RPI_SerialFlush
-RPI_SerialGetChar
-RPI_SerialSendChar
-RPI_SerialSendData
-RPI_SerialSetup
-u16RPISerialDataAvail
diff --git a/macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin b/macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin
deleted file mode 100644
index 3789bd6c..00000000
Binary files a/macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin and /dev/null differ
--
cgit
From e36eac94dd517bb69d3e5782516ee58942451991 Mon Sep 17 00:00:00 2001
From: Siddhesh Wani
Date: Thu, 4 May 2017 16:15:18 +0530
Subject: Basic functions and image processing working with MSVC on windows x64
---
macros/Hardware/AVR/lib | Bin 0 -> 984 bytes
macros/Hardware/AVR/names | 22 ++++++++++++++++++++++
macros/Hardware/RasberryPi/lib | Bin 0 -> 988 bytes
macros/Hardware/RasberryPi/names | 21 +++++++++++++++++++++
4 files changed, 43 insertions(+)
create mode 100644 macros/Hardware/AVR/lib
create mode 100644 macros/Hardware/AVR/names
create mode 100644 macros/Hardware/RasberryPi/lib
create mode 100644 macros/Hardware/RasberryPi/names
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib
new file mode 100644
index 00000000..16d9e3ea
Binary files /dev/null and b/macros/Hardware/AVR/lib differ
diff --git a/macros/Hardware/AVR/names b/macros/Hardware/AVR/names
new file mode 100644
index 00000000..8fcfdb75
--- /dev/null
+++ b/macros/Hardware/AVR/names
@@ -0,0 +1,22 @@
+AVRADCSetup
+AVRDigitalIn
+AVRDigitalOut
+AVRDigitalPortSetup
+AVRDigitalSetup
+AVRGetTimerValue
+AVRPWM0SetDuty
+AVRPWM0Setup
+AVRPWM1SetDuty
+AVRPWM1Setup
+AVRPWM2SetDuty
+AVRPWM2Setup
+AVRReadADC
+AVRSleep
+AVRTimerSetup
+AVRUARTReceive
+AVRUARTSetup
+AVRUARTTransmit
+GetAVRSupportFunctions
+GetPeripheral
+InsertPeripheralInList
+IsAVRSupportFunction
diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib
new file mode 100644
index 00000000..b92a6ea7
Binary files /dev/null and b/macros/Hardware/RasberryPi/lib differ
diff --git a/macros/Hardware/RasberryPi/names b/macros/Hardware/RasberryPi/names
new file mode 100644
index 00000000..fa647761
--- /dev/null
+++ b/macros/Hardware/RasberryPi/names
@@ -0,0 +1,21 @@
+GetRPISupportFunctions
+IsRPISupportFunction
+RPI_DelayMicro
+RPI_DelayMilli
+RPI_DigitalIn
+RPI_DigitalOut
+RPI_DigitalSetup
+RPI_GetMicros
+RPI_GetMillis
+RPI_HardPWMSetClock
+RPI_HardPWMSetMode
+RPI_HardPWMSetRange
+RPI_HardPWMWrite
+RPI_PinISR
+RPI_SerialClose
+RPI_SerialFlush
+RPI_SerialGetChar
+RPI_SerialSendChar
+RPI_SerialSendData
+RPI_SerialSetup
+u16RPISerialDataAvail
--
cgit
From f0e074cc43f04f58aafe00742b9748a09f77894f Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Thu, 4 May 2017 20:07:20 +0530
Subject: Toolbox working with scilab 6.0
---
macros/Hardware/AVR/lib | Bin 0 -> 1148 bytes
macros/Hardware/AVR/names | 22 ++++++++++++++++++++++
macros/Hardware/RasberryPi/lib | Bin 0 -> 1152 bytes
macros/Hardware/RasberryPi/names | 21 +++++++++++++++++++++
4 files changed, 43 insertions(+)
create mode 100644 macros/Hardware/AVR/lib
create mode 100644 macros/Hardware/AVR/names
create mode 100644 macros/Hardware/RasberryPi/lib
create mode 100644 macros/Hardware/RasberryPi/names
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib
new file mode 100644
index 00000000..170d3211
Binary files /dev/null and b/macros/Hardware/AVR/lib differ
diff --git a/macros/Hardware/AVR/names b/macros/Hardware/AVR/names
new file mode 100644
index 00000000..8fcfdb75
--- /dev/null
+++ b/macros/Hardware/AVR/names
@@ -0,0 +1,22 @@
+AVRADCSetup
+AVRDigitalIn
+AVRDigitalOut
+AVRDigitalPortSetup
+AVRDigitalSetup
+AVRGetTimerValue
+AVRPWM0SetDuty
+AVRPWM0Setup
+AVRPWM1SetDuty
+AVRPWM1Setup
+AVRPWM2SetDuty
+AVRPWM2Setup
+AVRReadADC
+AVRSleep
+AVRTimerSetup
+AVRUARTReceive
+AVRUARTSetup
+AVRUARTTransmit
+GetAVRSupportFunctions
+GetPeripheral
+InsertPeripheralInList
+IsAVRSupportFunction
diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib
new file mode 100644
index 00000000..d25d9440
Binary files /dev/null and b/macros/Hardware/RasberryPi/lib differ
diff --git a/macros/Hardware/RasberryPi/names b/macros/Hardware/RasberryPi/names
new file mode 100644
index 00000000..fa647761
--- /dev/null
+++ b/macros/Hardware/RasberryPi/names
@@ -0,0 +1,21 @@
+GetRPISupportFunctions
+IsRPISupportFunction
+RPI_DelayMicro
+RPI_DelayMilli
+RPI_DigitalIn
+RPI_DigitalOut
+RPI_DigitalSetup
+RPI_GetMicros
+RPI_GetMillis
+RPI_HardPWMSetClock
+RPI_HardPWMSetMode
+RPI_HardPWMSetRange
+RPI_HardPWMWrite
+RPI_PinISR
+RPI_SerialClose
+RPI_SerialFlush
+RPI_SerialGetChar
+RPI_SerialSendChar
+RPI_SerialSendData
+RPI_SerialSetup
+u16RPISerialDataAvail
--
cgit
From 369c257b9ae0320621b43ca75b38ff66cc13f37b Mon Sep 17 00:00:00 2001
From: yash1112
Date: Mon, 19 Jun 2017 05:40:46 +0530
Subject: 1.3 new scilab-arduino functions added2. all functions have been
tested on hardware 3. 5 i2c library functions added 4. Now generates code for
27 Boards(arduino and lilypad). 5. New GUI
---
macros/Hardware/AVR/AVRADCSetup.bin | Bin 0 -> 5212 bytes
macros/Hardware/AVR/AVRDigitalIn.bin | Bin 0 -> 4864 bytes
macros/Hardware/AVR/AVRDigitalOut.bin | Bin 0 -> 5376 bytes
macros/Hardware/AVR/AVRDigitalPortSetup.bin | Bin 0 -> 5188 bytes
macros/Hardware/AVR/AVRDigitalSetup.bin | Bin 0 -> 5584 bytes
macros/Hardware/AVR/AVRGetTimerValue.bin | Bin 0 -> 3256 bytes
macros/Hardware/AVR/AVRPWM0SetDuty.bin | Bin 0 -> 3536 bytes
macros/Hardware/AVR/AVRPWM0Setup.bin | Bin 0 -> 8196 bytes
macros/Hardware/AVR/AVRPWM1SetDuty.bin | Bin 0 -> 6764 bytes
macros/Hardware/AVR/AVRPWM1Setup.bin | Bin 0 -> 10604 bytes
macros/Hardware/AVR/AVRPWM2SetDuty.bin | Bin 0 -> 3580 bytes
macros/Hardware/AVR/AVRPWM2Setup.bin | Bin 0 -> 8464 bytes
macros/Hardware/AVR/AVRReadADC.bin | Bin 0 -> 4896 bytes
macros/Hardware/AVR/AVRSleep.bin | Bin 0 -> 88 bytes
macros/Hardware/AVR/AVRTimerSetup.bin | Bin 0 -> 7880 bytes
macros/Hardware/AVR/AVRUARTReceive.bin | Bin 0 -> 2504 bytes
macros/Hardware/AVR/AVRUARTSetup.bin | Bin 0 -> 8212 bytes
macros/Hardware/AVR/AVRUARTTransmit.bin | Bin 0 -> 2756 bytes
macros/Hardware/AVR/GetAVRSupportFunctions.bin | Bin 0 -> 2516 bytes
macros/Hardware/AVR/GetPeripheral.bin | Bin 0 -> 2364 bytes
macros/Hardware/AVR/InsertPeripheralInList.bin | Bin 0 -> 1928 bytes
macros/Hardware/AVR/IsAVRSupportFunction.bin | Bin 0 -> 2712 bytes
macros/Hardware/AVR/lib | Bin 2265 -> 1008 bytes
macros/Hardware/RasberryPi/GetRPISupportFunctions.bin | Bin 0 -> 4760 bytes
macros/Hardware/RasberryPi/IsRPISupportFunction.bin | Bin 0 -> 4292 bytes
macros/Hardware/RasberryPi/RPI_DelayMicro.bin | Bin 0 -> 3280 bytes
macros/Hardware/RasberryPi/RPI_DelayMilli.bin | Bin 0 -> 3596 bytes
macros/Hardware/RasberryPi/RPI_DigitalIn.bin | Bin 0 -> 5264 bytes
macros/Hardware/RasberryPi/RPI_DigitalOut.bin | Bin 0 -> 5352 bytes
macros/Hardware/RasberryPi/RPI_DigitalSetup.bin | Bin 0 -> 5336 bytes
macros/Hardware/RasberryPi/RPI_GetMicros.bin | Bin 0 -> 3568 bytes
macros/Hardware/RasberryPi/RPI_GetMillis.bin | Bin 0 -> 3556 bytes
macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin | Bin 0 -> 3488 bytes
macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin | Bin 0 -> 2448 bytes
macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin | Bin 0 -> 3340 bytes
macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin | Bin 0 -> 4628 bytes
macros/Hardware/RasberryPi/RPI_PinISR.bin | Bin 0 -> 6952 bytes
macros/Hardware/RasberryPi/RPI_SerialClose.bin | Bin 0 -> 2724 bytes
macros/Hardware/RasberryPi/RPI_SerialFlush.bin | Bin 0 -> 3120 bytes
macros/Hardware/RasberryPi/RPI_SerialGetChar.bin | Bin 0 -> 3404 bytes
macros/Hardware/RasberryPi/RPI_SerialSendChar.bin | Bin 0 -> 3344 bytes
macros/Hardware/RasberryPi/RPI_SerialSendData.bin | Bin 0 -> 3344 bytes
macros/Hardware/RasberryPi/RPI_SerialSetup.bin | Bin 0 -> 3356 bytes
macros/Hardware/RasberryPi/lib | Bin 2037 -> 1012 bytes
macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin | Bin 0 -> 3520 bytes
45 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 macros/Hardware/AVR/AVRADCSetup.bin
create mode 100644 macros/Hardware/AVR/AVRDigitalIn.bin
create mode 100644 macros/Hardware/AVR/AVRDigitalOut.bin
create mode 100644 macros/Hardware/AVR/AVRDigitalPortSetup.bin
create mode 100644 macros/Hardware/AVR/AVRDigitalSetup.bin
create mode 100644 macros/Hardware/AVR/AVRGetTimerValue.bin
create mode 100644 macros/Hardware/AVR/AVRPWM0SetDuty.bin
create mode 100644 macros/Hardware/AVR/AVRPWM0Setup.bin
create mode 100644 macros/Hardware/AVR/AVRPWM1SetDuty.bin
create mode 100644 macros/Hardware/AVR/AVRPWM1Setup.bin
create mode 100644 macros/Hardware/AVR/AVRPWM2SetDuty.bin
create mode 100644 macros/Hardware/AVR/AVRPWM2Setup.bin
create mode 100644 macros/Hardware/AVR/AVRReadADC.bin
create mode 100644 macros/Hardware/AVR/AVRSleep.bin
create mode 100644 macros/Hardware/AVR/AVRTimerSetup.bin
create mode 100644 macros/Hardware/AVR/AVRUARTReceive.bin
create mode 100644 macros/Hardware/AVR/AVRUARTSetup.bin
create mode 100644 macros/Hardware/AVR/AVRUARTTransmit.bin
create mode 100644 macros/Hardware/AVR/GetAVRSupportFunctions.bin
create mode 100644 macros/Hardware/AVR/GetPeripheral.bin
create mode 100644 macros/Hardware/AVR/InsertPeripheralInList.bin
create mode 100644 macros/Hardware/AVR/IsAVRSupportFunction.bin
create mode 100644 macros/Hardware/RasberryPi/GetRPISupportFunctions.bin
create mode 100644 macros/Hardware/RasberryPi/IsRPISupportFunction.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_DelayMicro.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_DelayMilli.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_DigitalIn.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_DigitalOut.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_DigitalSetup.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_GetMicros.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_GetMillis.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_PinISR.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialClose.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialFlush.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialGetChar.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialSendChar.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialSendData.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialSetup.bin
create mode 100644 macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/AVRADCSetup.bin b/macros/Hardware/AVR/AVRADCSetup.bin
new file mode 100644
index 00000000..a1cbcf3c
Binary files /dev/null and b/macros/Hardware/AVR/AVRADCSetup.bin differ
diff --git a/macros/Hardware/AVR/AVRDigitalIn.bin b/macros/Hardware/AVR/AVRDigitalIn.bin
new file mode 100644
index 00000000..0fdfab82
Binary files /dev/null and b/macros/Hardware/AVR/AVRDigitalIn.bin differ
diff --git a/macros/Hardware/AVR/AVRDigitalOut.bin b/macros/Hardware/AVR/AVRDigitalOut.bin
new file mode 100644
index 00000000..7e56e466
Binary files /dev/null and b/macros/Hardware/AVR/AVRDigitalOut.bin differ
diff --git a/macros/Hardware/AVR/AVRDigitalPortSetup.bin b/macros/Hardware/AVR/AVRDigitalPortSetup.bin
new file mode 100644
index 00000000..cf96fbb1
Binary files /dev/null and b/macros/Hardware/AVR/AVRDigitalPortSetup.bin differ
diff --git a/macros/Hardware/AVR/AVRDigitalSetup.bin b/macros/Hardware/AVR/AVRDigitalSetup.bin
new file mode 100644
index 00000000..dec6eb2a
Binary files /dev/null and b/macros/Hardware/AVR/AVRDigitalSetup.bin differ
diff --git a/macros/Hardware/AVR/AVRGetTimerValue.bin b/macros/Hardware/AVR/AVRGetTimerValue.bin
new file mode 100644
index 00000000..1b883131
Binary files /dev/null and b/macros/Hardware/AVR/AVRGetTimerValue.bin differ
diff --git a/macros/Hardware/AVR/AVRPWM0SetDuty.bin b/macros/Hardware/AVR/AVRPWM0SetDuty.bin
new file mode 100644
index 00000000..1518222d
Binary files /dev/null and b/macros/Hardware/AVR/AVRPWM0SetDuty.bin differ
diff --git a/macros/Hardware/AVR/AVRPWM0Setup.bin b/macros/Hardware/AVR/AVRPWM0Setup.bin
new file mode 100644
index 00000000..08867048
Binary files /dev/null and b/macros/Hardware/AVR/AVRPWM0Setup.bin differ
diff --git a/macros/Hardware/AVR/AVRPWM1SetDuty.bin b/macros/Hardware/AVR/AVRPWM1SetDuty.bin
new file mode 100644
index 00000000..79e4ab62
Binary files /dev/null and b/macros/Hardware/AVR/AVRPWM1SetDuty.bin differ
diff --git a/macros/Hardware/AVR/AVRPWM1Setup.bin b/macros/Hardware/AVR/AVRPWM1Setup.bin
new file mode 100644
index 00000000..235cdba2
Binary files /dev/null and b/macros/Hardware/AVR/AVRPWM1Setup.bin differ
diff --git a/macros/Hardware/AVR/AVRPWM2SetDuty.bin b/macros/Hardware/AVR/AVRPWM2SetDuty.bin
new file mode 100644
index 00000000..a1c7f3b2
Binary files /dev/null and b/macros/Hardware/AVR/AVRPWM2SetDuty.bin differ
diff --git a/macros/Hardware/AVR/AVRPWM2Setup.bin b/macros/Hardware/AVR/AVRPWM2Setup.bin
new file mode 100644
index 00000000..66996c08
Binary files /dev/null and b/macros/Hardware/AVR/AVRPWM2Setup.bin differ
diff --git a/macros/Hardware/AVR/AVRReadADC.bin b/macros/Hardware/AVR/AVRReadADC.bin
new file mode 100644
index 00000000..25b45a83
Binary files /dev/null and b/macros/Hardware/AVR/AVRReadADC.bin differ
diff --git a/macros/Hardware/AVR/AVRSleep.bin b/macros/Hardware/AVR/AVRSleep.bin
new file mode 100644
index 00000000..e4b10d83
Binary files /dev/null and b/macros/Hardware/AVR/AVRSleep.bin differ
diff --git a/macros/Hardware/AVR/AVRTimerSetup.bin b/macros/Hardware/AVR/AVRTimerSetup.bin
new file mode 100644
index 00000000..775d718a
Binary files /dev/null and b/macros/Hardware/AVR/AVRTimerSetup.bin differ
diff --git a/macros/Hardware/AVR/AVRUARTReceive.bin b/macros/Hardware/AVR/AVRUARTReceive.bin
new file mode 100644
index 00000000..013036e3
Binary files /dev/null and b/macros/Hardware/AVR/AVRUARTReceive.bin differ
diff --git a/macros/Hardware/AVR/AVRUARTSetup.bin b/macros/Hardware/AVR/AVRUARTSetup.bin
new file mode 100644
index 00000000..82ec2911
Binary files /dev/null and b/macros/Hardware/AVR/AVRUARTSetup.bin differ
diff --git a/macros/Hardware/AVR/AVRUARTTransmit.bin b/macros/Hardware/AVR/AVRUARTTransmit.bin
new file mode 100644
index 00000000..9e53d9a6
Binary files /dev/null and b/macros/Hardware/AVR/AVRUARTTransmit.bin differ
diff --git a/macros/Hardware/AVR/GetAVRSupportFunctions.bin b/macros/Hardware/AVR/GetAVRSupportFunctions.bin
new file mode 100644
index 00000000..48ab5cd8
Binary files /dev/null and b/macros/Hardware/AVR/GetAVRSupportFunctions.bin differ
diff --git a/macros/Hardware/AVR/GetPeripheral.bin b/macros/Hardware/AVR/GetPeripheral.bin
new file mode 100644
index 00000000..b496bbb0
Binary files /dev/null and b/macros/Hardware/AVR/GetPeripheral.bin differ
diff --git a/macros/Hardware/AVR/InsertPeripheralInList.bin b/macros/Hardware/AVR/InsertPeripheralInList.bin
new file mode 100644
index 00000000..c49f4e04
Binary files /dev/null and b/macros/Hardware/AVR/InsertPeripheralInList.bin differ
diff --git a/macros/Hardware/AVR/IsAVRSupportFunction.bin b/macros/Hardware/AVR/IsAVRSupportFunction.bin
new file mode 100644
index 00000000..e2382308
Binary files /dev/null and b/macros/Hardware/AVR/IsAVRSupportFunction.bin differ
diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib
index 5c8f0da2..7631c354 100644
Binary files a/macros/Hardware/AVR/lib and b/macros/Hardware/AVR/lib differ
diff --git a/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin
new file mode 100644
index 00000000..a70999c0
Binary files /dev/null and b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin differ
diff --git a/macros/Hardware/RasberryPi/IsRPISupportFunction.bin b/macros/Hardware/RasberryPi/IsRPISupportFunction.bin
new file mode 100644
index 00000000..11533d3e
Binary files /dev/null and b/macros/Hardware/RasberryPi/IsRPISupportFunction.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_DelayMicro.bin b/macros/Hardware/RasberryPi/RPI_DelayMicro.bin
new file mode 100644
index 00000000..a4d32cb6
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_DelayMicro.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_DelayMilli.bin b/macros/Hardware/RasberryPi/RPI_DelayMilli.bin
new file mode 100644
index 00000000..b6eeb30b
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_DelayMilli.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalIn.bin b/macros/Hardware/RasberryPi/RPI_DigitalIn.bin
new file mode 100644
index 00000000..f4c16f39
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_DigitalIn.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalOut.bin b/macros/Hardware/RasberryPi/RPI_DigitalOut.bin
new file mode 100644
index 00000000..b7ad06e5
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_DigitalOut.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin b/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin
new file mode 100644
index 00000000..1ac5b582
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_GetMicros.bin b/macros/Hardware/RasberryPi/RPI_GetMicros.bin
new file mode 100644
index 00000000..3e6c08fa
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_GetMicros.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_GetMillis.bin b/macros/Hardware/RasberryPi/RPI_GetMillis.bin
new file mode 100644
index 00000000..b9143650
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_GetMillis.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin b/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin
new file mode 100644
index 00000000..1efe0803
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin b/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin
new file mode 100644
index 00000000..075d6e60
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin b/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin
new file mode 100644
index 00000000..8ded2709
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin b/macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin
new file mode 100644
index 00000000..9957f3a4
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_PinISR.bin b/macros/Hardware/RasberryPi/RPI_PinISR.bin
new file mode 100644
index 00000000..ddeff684
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_PinISR.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialClose.bin b/macros/Hardware/RasberryPi/RPI_SerialClose.bin
new file mode 100644
index 00000000..dce972dc
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_SerialClose.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialFlush.bin b/macros/Hardware/RasberryPi/RPI_SerialFlush.bin
new file mode 100644
index 00000000..2a3704d0
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_SerialFlush.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin b/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin
new file mode 100644
index 00000000..928f28a3
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSendChar.bin b/macros/Hardware/RasberryPi/RPI_SerialSendChar.bin
new file mode 100644
index 00000000..7614ebcb
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_SerialSendChar.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSendData.bin b/macros/Hardware/RasberryPi/RPI_SerialSendData.bin
new file mode 100644
index 00000000..a3524a6c
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_SerialSendData.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSetup.bin b/macros/Hardware/RasberryPi/RPI_SerialSetup.bin
new file mode 100644
index 00000000..0128c27b
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_SerialSetup.bin differ
diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib
index 9afd77da..c238317e 100644
Binary files a/macros/Hardware/RasberryPi/lib and b/macros/Hardware/RasberryPi/lib differ
diff --git a/macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin b/macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin
new file mode 100644
index 00000000..3789bd6c
Binary files /dev/null and b/macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin differ
--
cgit
From 8e235230a4c16a042d2620fa7b58a9b0f4ba1914 Mon Sep 17 00:00:00 2001
From: ukashanoor
Date: Mon, 19 Jun 2017 10:42:03 +0530
Subject: after if and for
---
macros/Hardware/AVR/AVRADCSetup.bin | Bin 0 -> 5212 bytes
macros/Hardware/AVR/AVRDigitalIn.bin | Bin 0 -> 4864 bytes
macros/Hardware/AVR/AVRDigitalOut.bin | Bin 0 -> 5376 bytes
macros/Hardware/AVR/AVRDigitalPortSetup.bin | Bin 0 -> 5188 bytes
macros/Hardware/AVR/AVRDigitalSetup.bin | Bin 0 -> 5584 bytes
macros/Hardware/AVR/AVRGetTimerValue.bin | Bin 0 -> 3256 bytes
macros/Hardware/AVR/AVRPWM0SetDuty.bin | Bin 0 -> 3536 bytes
macros/Hardware/AVR/AVRPWM0Setup.bin | Bin 0 -> 8196 bytes
macros/Hardware/AVR/AVRPWM1SetDuty.bin | Bin 0 -> 6764 bytes
macros/Hardware/AVR/AVRPWM1Setup.bin | Bin 0 -> 10604 bytes
macros/Hardware/AVR/AVRPWM2SetDuty.bin | Bin 0 -> 3580 bytes
macros/Hardware/AVR/AVRPWM2Setup.bin | Bin 0 -> 8464 bytes
macros/Hardware/AVR/AVRReadADC.bin | Bin 0 -> 4896 bytes
macros/Hardware/AVR/AVRSleep.bin | Bin 0 -> 88 bytes
macros/Hardware/AVR/AVRTimerSetup.bin | Bin 0 -> 7880 bytes
macros/Hardware/AVR/AVRUARTReceive.bin | Bin 0 -> 2504 bytes
macros/Hardware/AVR/AVRUARTSetup.bin | Bin 0 -> 8212 bytes
macros/Hardware/AVR/AVRUARTTransmit.bin | Bin 0 -> 2756 bytes
macros/Hardware/AVR/GetAVRSupportFunctions.bin | Bin 0 -> 2516 bytes
macros/Hardware/AVR/GetPeripheral.bin | Bin 0 -> 2364 bytes
macros/Hardware/AVR/InsertPeripheralInList.bin | Bin 0 -> 1928 bytes
macros/Hardware/AVR/IsAVRSupportFunction.bin | Bin 0 -> 2712 bytes
macros/Hardware/AVR/lib | Bin 2265 -> 876 bytes
macros/Hardware/RasberryPi/GetRPISupportFunctions.bin | Bin 0 -> 4760 bytes
macros/Hardware/RasberryPi/IsRPISupportFunction.bin | Bin 0 -> 4292 bytes
macros/Hardware/RasberryPi/RPI_DelayMicro.bin | Bin 0 -> 3280 bytes
macros/Hardware/RasberryPi/RPI_DelayMilli.bin | Bin 0 -> 3596 bytes
macros/Hardware/RasberryPi/RPI_DigitalIn.bin | Bin 0 -> 5264 bytes
macros/Hardware/RasberryPi/RPI_DigitalOut.bin | Bin 0 -> 5352 bytes
macros/Hardware/RasberryPi/RPI_DigitalSetup.bin | Bin 0 -> 5336 bytes
macros/Hardware/RasberryPi/RPI_GetMicros.bin | Bin 0 -> 3568 bytes
macros/Hardware/RasberryPi/RPI_GetMillis.bin | Bin 0 -> 3556 bytes
macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin | Bin 0 -> 3488 bytes
macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin | Bin 0 -> 2448 bytes
macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin | Bin 0 -> 3340 bytes
macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin | Bin 0 -> 4628 bytes
macros/Hardware/RasberryPi/RPI_PinISR.bin | Bin 0 -> 6952 bytes
macros/Hardware/RasberryPi/RPI_SerialClose.bin | Bin 0 -> 2724 bytes
macros/Hardware/RasberryPi/RPI_SerialFlush.bin | Bin 0 -> 3120 bytes
macros/Hardware/RasberryPi/RPI_SerialGetChar.bin | Bin 0 -> 3404 bytes
macros/Hardware/RasberryPi/RPI_SerialSendChar.bin | Bin 0 -> 3344 bytes
macros/Hardware/RasberryPi/RPI_SerialSendData.bin | Bin 0 -> 3344 bytes
macros/Hardware/RasberryPi/RPI_SerialSetup.bin | Bin 0 -> 3356 bytes
macros/Hardware/RasberryPi/lib | Bin 2037 -> 880 bytes
macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin | Bin 0 -> 3520 bytes
45 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 macros/Hardware/AVR/AVRADCSetup.bin
create mode 100644 macros/Hardware/AVR/AVRDigitalIn.bin
create mode 100644 macros/Hardware/AVR/AVRDigitalOut.bin
create mode 100644 macros/Hardware/AVR/AVRDigitalPortSetup.bin
create mode 100644 macros/Hardware/AVR/AVRDigitalSetup.bin
create mode 100644 macros/Hardware/AVR/AVRGetTimerValue.bin
create mode 100644 macros/Hardware/AVR/AVRPWM0SetDuty.bin
create mode 100644 macros/Hardware/AVR/AVRPWM0Setup.bin
create mode 100644 macros/Hardware/AVR/AVRPWM1SetDuty.bin
create mode 100644 macros/Hardware/AVR/AVRPWM1Setup.bin
create mode 100644 macros/Hardware/AVR/AVRPWM2SetDuty.bin
create mode 100644 macros/Hardware/AVR/AVRPWM2Setup.bin
create mode 100644 macros/Hardware/AVR/AVRReadADC.bin
create mode 100644 macros/Hardware/AVR/AVRSleep.bin
create mode 100644 macros/Hardware/AVR/AVRTimerSetup.bin
create mode 100644 macros/Hardware/AVR/AVRUARTReceive.bin
create mode 100644 macros/Hardware/AVR/AVRUARTSetup.bin
create mode 100644 macros/Hardware/AVR/AVRUARTTransmit.bin
create mode 100644 macros/Hardware/AVR/GetAVRSupportFunctions.bin
create mode 100644 macros/Hardware/AVR/GetPeripheral.bin
create mode 100644 macros/Hardware/AVR/InsertPeripheralInList.bin
create mode 100644 macros/Hardware/AVR/IsAVRSupportFunction.bin
create mode 100644 macros/Hardware/RasberryPi/GetRPISupportFunctions.bin
create mode 100644 macros/Hardware/RasberryPi/IsRPISupportFunction.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_DelayMicro.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_DelayMilli.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_DigitalIn.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_DigitalOut.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_DigitalSetup.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_GetMicros.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_GetMillis.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_PinISR.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialClose.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialFlush.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialGetChar.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialSendChar.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialSendData.bin
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialSetup.bin
create mode 100644 macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/AVRADCSetup.bin b/macros/Hardware/AVR/AVRADCSetup.bin
new file mode 100644
index 00000000..a1cbcf3c
Binary files /dev/null and b/macros/Hardware/AVR/AVRADCSetup.bin differ
diff --git a/macros/Hardware/AVR/AVRDigitalIn.bin b/macros/Hardware/AVR/AVRDigitalIn.bin
new file mode 100644
index 00000000..0fdfab82
Binary files /dev/null and b/macros/Hardware/AVR/AVRDigitalIn.bin differ
diff --git a/macros/Hardware/AVR/AVRDigitalOut.bin b/macros/Hardware/AVR/AVRDigitalOut.bin
new file mode 100644
index 00000000..7e56e466
Binary files /dev/null and b/macros/Hardware/AVR/AVRDigitalOut.bin differ
diff --git a/macros/Hardware/AVR/AVRDigitalPortSetup.bin b/macros/Hardware/AVR/AVRDigitalPortSetup.bin
new file mode 100644
index 00000000..cf96fbb1
Binary files /dev/null and b/macros/Hardware/AVR/AVRDigitalPortSetup.bin differ
diff --git a/macros/Hardware/AVR/AVRDigitalSetup.bin b/macros/Hardware/AVR/AVRDigitalSetup.bin
new file mode 100644
index 00000000..dec6eb2a
Binary files /dev/null and b/macros/Hardware/AVR/AVRDigitalSetup.bin differ
diff --git a/macros/Hardware/AVR/AVRGetTimerValue.bin b/macros/Hardware/AVR/AVRGetTimerValue.bin
new file mode 100644
index 00000000..1b883131
Binary files /dev/null and b/macros/Hardware/AVR/AVRGetTimerValue.bin differ
diff --git a/macros/Hardware/AVR/AVRPWM0SetDuty.bin b/macros/Hardware/AVR/AVRPWM0SetDuty.bin
new file mode 100644
index 00000000..1518222d
Binary files /dev/null and b/macros/Hardware/AVR/AVRPWM0SetDuty.bin differ
diff --git a/macros/Hardware/AVR/AVRPWM0Setup.bin b/macros/Hardware/AVR/AVRPWM0Setup.bin
new file mode 100644
index 00000000..08867048
Binary files /dev/null and b/macros/Hardware/AVR/AVRPWM0Setup.bin differ
diff --git a/macros/Hardware/AVR/AVRPWM1SetDuty.bin b/macros/Hardware/AVR/AVRPWM1SetDuty.bin
new file mode 100644
index 00000000..79e4ab62
Binary files /dev/null and b/macros/Hardware/AVR/AVRPWM1SetDuty.bin differ
diff --git a/macros/Hardware/AVR/AVRPWM1Setup.bin b/macros/Hardware/AVR/AVRPWM1Setup.bin
new file mode 100644
index 00000000..235cdba2
Binary files /dev/null and b/macros/Hardware/AVR/AVRPWM1Setup.bin differ
diff --git a/macros/Hardware/AVR/AVRPWM2SetDuty.bin b/macros/Hardware/AVR/AVRPWM2SetDuty.bin
new file mode 100644
index 00000000..a1c7f3b2
Binary files /dev/null and b/macros/Hardware/AVR/AVRPWM2SetDuty.bin differ
diff --git a/macros/Hardware/AVR/AVRPWM2Setup.bin b/macros/Hardware/AVR/AVRPWM2Setup.bin
new file mode 100644
index 00000000..66996c08
Binary files /dev/null and b/macros/Hardware/AVR/AVRPWM2Setup.bin differ
diff --git a/macros/Hardware/AVR/AVRReadADC.bin b/macros/Hardware/AVR/AVRReadADC.bin
new file mode 100644
index 00000000..25b45a83
Binary files /dev/null and b/macros/Hardware/AVR/AVRReadADC.bin differ
diff --git a/macros/Hardware/AVR/AVRSleep.bin b/macros/Hardware/AVR/AVRSleep.bin
new file mode 100644
index 00000000..e4b10d83
Binary files /dev/null and b/macros/Hardware/AVR/AVRSleep.bin differ
diff --git a/macros/Hardware/AVR/AVRTimerSetup.bin b/macros/Hardware/AVR/AVRTimerSetup.bin
new file mode 100644
index 00000000..775d718a
Binary files /dev/null and b/macros/Hardware/AVR/AVRTimerSetup.bin differ
diff --git a/macros/Hardware/AVR/AVRUARTReceive.bin b/macros/Hardware/AVR/AVRUARTReceive.bin
new file mode 100644
index 00000000..013036e3
Binary files /dev/null and b/macros/Hardware/AVR/AVRUARTReceive.bin differ
diff --git a/macros/Hardware/AVR/AVRUARTSetup.bin b/macros/Hardware/AVR/AVRUARTSetup.bin
new file mode 100644
index 00000000..82ec2911
Binary files /dev/null and b/macros/Hardware/AVR/AVRUARTSetup.bin differ
diff --git a/macros/Hardware/AVR/AVRUARTTransmit.bin b/macros/Hardware/AVR/AVRUARTTransmit.bin
new file mode 100644
index 00000000..9e53d9a6
Binary files /dev/null and b/macros/Hardware/AVR/AVRUARTTransmit.bin differ
diff --git a/macros/Hardware/AVR/GetAVRSupportFunctions.bin b/macros/Hardware/AVR/GetAVRSupportFunctions.bin
new file mode 100644
index 00000000..48ab5cd8
Binary files /dev/null and b/macros/Hardware/AVR/GetAVRSupportFunctions.bin differ
diff --git a/macros/Hardware/AVR/GetPeripheral.bin b/macros/Hardware/AVR/GetPeripheral.bin
new file mode 100644
index 00000000..b496bbb0
Binary files /dev/null and b/macros/Hardware/AVR/GetPeripheral.bin differ
diff --git a/macros/Hardware/AVR/InsertPeripheralInList.bin b/macros/Hardware/AVR/InsertPeripheralInList.bin
new file mode 100644
index 00000000..c49f4e04
Binary files /dev/null and b/macros/Hardware/AVR/InsertPeripheralInList.bin differ
diff --git a/macros/Hardware/AVR/IsAVRSupportFunction.bin b/macros/Hardware/AVR/IsAVRSupportFunction.bin
new file mode 100644
index 00000000..e2382308
Binary files /dev/null and b/macros/Hardware/AVR/IsAVRSupportFunction.bin differ
diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib
index 5c8f0da2..2b6d33d4 100644
Binary files a/macros/Hardware/AVR/lib and b/macros/Hardware/AVR/lib differ
diff --git a/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin
new file mode 100644
index 00000000..a70999c0
Binary files /dev/null and b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin differ
diff --git a/macros/Hardware/RasberryPi/IsRPISupportFunction.bin b/macros/Hardware/RasberryPi/IsRPISupportFunction.bin
new file mode 100644
index 00000000..11533d3e
Binary files /dev/null and b/macros/Hardware/RasberryPi/IsRPISupportFunction.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_DelayMicro.bin b/macros/Hardware/RasberryPi/RPI_DelayMicro.bin
new file mode 100644
index 00000000..a4d32cb6
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_DelayMicro.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_DelayMilli.bin b/macros/Hardware/RasberryPi/RPI_DelayMilli.bin
new file mode 100644
index 00000000..b6eeb30b
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_DelayMilli.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalIn.bin b/macros/Hardware/RasberryPi/RPI_DigitalIn.bin
new file mode 100644
index 00000000..f4c16f39
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_DigitalIn.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalOut.bin b/macros/Hardware/RasberryPi/RPI_DigitalOut.bin
new file mode 100644
index 00000000..b7ad06e5
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_DigitalOut.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin b/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin
new file mode 100644
index 00000000..1ac5b582
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_GetMicros.bin b/macros/Hardware/RasberryPi/RPI_GetMicros.bin
new file mode 100644
index 00000000..3e6c08fa
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_GetMicros.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_GetMillis.bin b/macros/Hardware/RasberryPi/RPI_GetMillis.bin
new file mode 100644
index 00000000..b9143650
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_GetMillis.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin b/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin
new file mode 100644
index 00000000..1efe0803
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin b/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin
new file mode 100644
index 00000000..075d6e60
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin b/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin
new file mode 100644
index 00000000..8ded2709
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin b/macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin
new file mode 100644
index 00000000..9957f3a4
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_PinISR.bin b/macros/Hardware/RasberryPi/RPI_PinISR.bin
new file mode 100644
index 00000000..ddeff684
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_PinISR.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialClose.bin b/macros/Hardware/RasberryPi/RPI_SerialClose.bin
new file mode 100644
index 00000000..dce972dc
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_SerialClose.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialFlush.bin b/macros/Hardware/RasberryPi/RPI_SerialFlush.bin
new file mode 100644
index 00000000..2a3704d0
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_SerialFlush.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin b/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin
new file mode 100644
index 00000000..928f28a3
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSendChar.bin b/macros/Hardware/RasberryPi/RPI_SerialSendChar.bin
new file mode 100644
index 00000000..7614ebcb
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_SerialSendChar.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSendData.bin b/macros/Hardware/RasberryPi/RPI_SerialSendData.bin
new file mode 100644
index 00000000..a3524a6c
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_SerialSendData.bin differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSetup.bin b/macros/Hardware/RasberryPi/RPI_SerialSetup.bin
new file mode 100644
index 00000000..0128c27b
Binary files /dev/null and b/macros/Hardware/RasberryPi/RPI_SerialSetup.bin differ
diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib
index 9afd77da..c15f8e8b 100644
Binary files a/macros/Hardware/RasberryPi/lib and b/macros/Hardware/RasberryPi/lib differ
diff --git a/macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin b/macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin
new file mode 100644
index 00000000..3789bd6c
Binary files /dev/null and b/macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin differ
--
cgit
From 785e19f097f7ca1964edaf159c9adfe2eda733b5 Mon Sep 17 00:00:00 2001
From: ukashanoor
Date: Wed, 21 Jun 2017 11:54:14 +0530
Subject: inter commit
---
macros/Hardware/AVR/AVRADCSetup.bin | Bin 5212 -> 0 bytes
macros/Hardware/AVR/AVRDigitalIn.bin | Bin 4864 -> 0 bytes
macros/Hardware/AVR/AVRDigitalOut.bin | Bin 5376 -> 0 bytes
macros/Hardware/AVR/AVRDigitalPortSetup.bin | Bin 5188 -> 0 bytes
macros/Hardware/AVR/AVRDigitalSetup.bin | Bin 5584 -> 0 bytes
macros/Hardware/AVR/AVRGetTimerValue.bin | Bin 3256 -> 0 bytes
macros/Hardware/AVR/AVRPWM0SetDuty.bin | Bin 3536 -> 0 bytes
macros/Hardware/AVR/AVRPWM0Setup.bin | Bin 8196 -> 0 bytes
macros/Hardware/AVR/AVRPWM1SetDuty.bin | Bin 6764 -> 0 bytes
macros/Hardware/AVR/AVRPWM1Setup.bin | Bin 10604 -> 0 bytes
macros/Hardware/AVR/AVRPWM2SetDuty.bin | Bin 3580 -> 0 bytes
macros/Hardware/AVR/AVRPWM2Setup.bin | Bin 8464 -> 0 bytes
macros/Hardware/AVR/AVRReadADC.bin | Bin 4896 -> 0 bytes
macros/Hardware/AVR/AVRSleep.bin | Bin 88 -> 0 bytes
macros/Hardware/AVR/AVRTimerSetup.bin | Bin 7880 -> 0 bytes
macros/Hardware/AVR/AVRUARTReceive.bin | Bin 2504 -> 0 bytes
macros/Hardware/AVR/AVRUARTSetup.bin | Bin 8212 -> 0 bytes
macros/Hardware/AVR/AVRUARTTransmit.bin | Bin 2756 -> 0 bytes
macros/Hardware/AVR/GetAVRSupportFunctions.bin | Bin 2516 -> 0 bytes
macros/Hardware/AVR/GetPeripheral.bin | Bin 2364 -> 0 bytes
macros/Hardware/AVR/InsertPeripheralInList.bin | Bin 1928 -> 0 bytes
macros/Hardware/AVR/IsAVRSupportFunction.bin | Bin 2712 -> 0 bytes
macros/Hardware/RasberryPi/GetRPISupportFunctions.bin | Bin 4760 -> 0 bytes
macros/Hardware/RasberryPi/IsRPISupportFunction.bin | Bin 4292 -> 0 bytes
macros/Hardware/RasberryPi/RPI_DelayMicro.bin | Bin 3280 -> 0 bytes
macros/Hardware/RasberryPi/RPI_DelayMilli.bin | Bin 3596 -> 0 bytes
macros/Hardware/RasberryPi/RPI_DigitalIn.bin | Bin 5264 -> 0 bytes
macros/Hardware/RasberryPi/RPI_DigitalOut.bin | Bin 5352 -> 0 bytes
macros/Hardware/RasberryPi/RPI_DigitalSetup.bin | Bin 5336 -> 0 bytes
macros/Hardware/RasberryPi/RPI_GetMicros.bin | Bin 3568 -> 0 bytes
macros/Hardware/RasberryPi/RPI_GetMillis.bin | Bin 3556 -> 0 bytes
macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin | Bin 3488 -> 0 bytes
macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin | Bin 2448 -> 0 bytes
macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin | Bin 3340 -> 0 bytes
macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin | Bin 4628 -> 0 bytes
macros/Hardware/RasberryPi/RPI_PinISR.bin | Bin 6952 -> 0 bytes
macros/Hardware/RasberryPi/RPI_SerialClose.bin | Bin 2724 -> 0 bytes
macros/Hardware/RasberryPi/RPI_SerialFlush.bin | Bin 3120 -> 0 bytes
macros/Hardware/RasberryPi/RPI_SerialGetChar.bin | Bin 3404 -> 0 bytes
macros/Hardware/RasberryPi/RPI_SerialSendChar.bin | Bin 3344 -> 0 bytes
macros/Hardware/RasberryPi/RPI_SerialSendData.bin | Bin 3344 -> 0 bytes
macros/Hardware/RasberryPi/RPI_SerialSetup.bin | Bin 3356 -> 0 bytes
macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin | Bin 3520 -> 0 bytes
43 files changed, 0 insertions(+), 0 deletions(-)
delete mode 100644 macros/Hardware/AVR/AVRADCSetup.bin
delete mode 100644 macros/Hardware/AVR/AVRDigitalIn.bin
delete mode 100644 macros/Hardware/AVR/AVRDigitalOut.bin
delete mode 100644 macros/Hardware/AVR/AVRDigitalPortSetup.bin
delete mode 100644 macros/Hardware/AVR/AVRDigitalSetup.bin
delete mode 100644 macros/Hardware/AVR/AVRGetTimerValue.bin
delete mode 100644 macros/Hardware/AVR/AVRPWM0SetDuty.bin
delete mode 100644 macros/Hardware/AVR/AVRPWM0Setup.bin
delete mode 100644 macros/Hardware/AVR/AVRPWM1SetDuty.bin
delete mode 100644 macros/Hardware/AVR/AVRPWM1Setup.bin
delete mode 100644 macros/Hardware/AVR/AVRPWM2SetDuty.bin
delete mode 100644 macros/Hardware/AVR/AVRPWM2Setup.bin
delete mode 100644 macros/Hardware/AVR/AVRReadADC.bin
delete mode 100644 macros/Hardware/AVR/AVRSleep.bin
delete mode 100644 macros/Hardware/AVR/AVRTimerSetup.bin
delete mode 100644 macros/Hardware/AVR/AVRUARTReceive.bin
delete mode 100644 macros/Hardware/AVR/AVRUARTSetup.bin
delete mode 100644 macros/Hardware/AVR/AVRUARTTransmit.bin
delete mode 100644 macros/Hardware/AVR/GetAVRSupportFunctions.bin
delete mode 100644 macros/Hardware/AVR/GetPeripheral.bin
delete mode 100644 macros/Hardware/AVR/InsertPeripheralInList.bin
delete mode 100644 macros/Hardware/AVR/IsAVRSupportFunction.bin
delete mode 100644 macros/Hardware/RasberryPi/GetRPISupportFunctions.bin
delete mode 100644 macros/Hardware/RasberryPi/IsRPISupportFunction.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_DelayMicro.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_DelayMilli.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_DigitalIn.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_DigitalOut.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_DigitalSetup.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_GetMicros.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_GetMillis.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_PinISR.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_SerialClose.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_SerialFlush.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_SerialGetChar.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_SerialSendChar.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_SerialSendData.bin
delete mode 100644 macros/Hardware/RasberryPi/RPI_SerialSetup.bin
delete mode 100644 macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/AVRADCSetup.bin b/macros/Hardware/AVR/AVRADCSetup.bin
deleted file mode 100644
index a1cbcf3c..00000000
Binary files a/macros/Hardware/AVR/AVRADCSetup.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRDigitalIn.bin b/macros/Hardware/AVR/AVRDigitalIn.bin
deleted file mode 100644
index 0fdfab82..00000000
Binary files a/macros/Hardware/AVR/AVRDigitalIn.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRDigitalOut.bin b/macros/Hardware/AVR/AVRDigitalOut.bin
deleted file mode 100644
index 7e56e466..00000000
Binary files a/macros/Hardware/AVR/AVRDigitalOut.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRDigitalPortSetup.bin b/macros/Hardware/AVR/AVRDigitalPortSetup.bin
deleted file mode 100644
index cf96fbb1..00000000
Binary files a/macros/Hardware/AVR/AVRDigitalPortSetup.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRDigitalSetup.bin b/macros/Hardware/AVR/AVRDigitalSetup.bin
deleted file mode 100644
index dec6eb2a..00000000
Binary files a/macros/Hardware/AVR/AVRDigitalSetup.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRGetTimerValue.bin b/macros/Hardware/AVR/AVRGetTimerValue.bin
deleted file mode 100644
index 1b883131..00000000
Binary files a/macros/Hardware/AVR/AVRGetTimerValue.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRPWM0SetDuty.bin b/macros/Hardware/AVR/AVRPWM0SetDuty.bin
deleted file mode 100644
index 1518222d..00000000
Binary files a/macros/Hardware/AVR/AVRPWM0SetDuty.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRPWM0Setup.bin b/macros/Hardware/AVR/AVRPWM0Setup.bin
deleted file mode 100644
index 08867048..00000000
Binary files a/macros/Hardware/AVR/AVRPWM0Setup.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRPWM1SetDuty.bin b/macros/Hardware/AVR/AVRPWM1SetDuty.bin
deleted file mode 100644
index 79e4ab62..00000000
Binary files a/macros/Hardware/AVR/AVRPWM1SetDuty.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRPWM1Setup.bin b/macros/Hardware/AVR/AVRPWM1Setup.bin
deleted file mode 100644
index 235cdba2..00000000
Binary files a/macros/Hardware/AVR/AVRPWM1Setup.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRPWM2SetDuty.bin b/macros/Hardware/AVR/AVRPWM2SetDuty.bin
deleted file mode 100644
index a1c7f3b2..00000000
Binary files a/macros/Hardware/AVR/AVRPWM2SetDuty.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRPWM2Setup.bin b/macros/Hardware/AVR/AVRPWM2Setup.bin
deleted file mode 100644
index 66996c08..00000000
Binary files a/macros/Hardware/AVR/AVRPWM2Setup.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRReadADC.bin b/macros/Hardware/AVR/AVRReadADC.bin
deleted file mode 100644
index 25b45a83..00000000
Binary files a/macros/Hardware/AVR/AVRReadADC.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRSleep.bin b/macros/Hardware/AVR/AVRSleep.bin
deleted file mode 100644
index e4b10d83..00000000
Binary files a/macros/Hardware/AVR/AVRSleep.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRTimerSetup.bin b/macros/Hardware/AVR/AVRTimerSetup.bin
deleted file mode 100644
index 775d718a..00000000
Binary files a/macros/Hardware/AVR/AVRTimerSetup.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRUARTReceive.bin b/macros/Hardware/AVR/AVRUARTReceive.bin
deleted file mode 100644
index 013036e3..00000000
Binary files a/macros/Hardware/AVR/AVRUARTReceive.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRUARTSetup.bin b/macros/Hardware/AVR/AVRUARTSetup.bin
deleted file mode 100644
index 82ec2911..00000000
Binary files a/macros/Hardware/AVR/AVRUARTSetup.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/AVRUARTTransmit.bin b/macros/Hardware/AVR/AVRUARTTransmit.bin
deleted file mode 100644
index 9e53d9a6..00000000
Binary files a/macros/Hardware/AVR/AVRUARTTransmit.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/GetAVRSupportFunctions.bin b/macros/Hardware/AVR/GetAVRSupportFunctions.bin
deleted file mode 100644
index 48ab5cd8..00000000
Binary files a/macros/Hardware/AVR/GetAVRSupportFunctions.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/GetPeripheral.bin b/macros/Hardware/AVR/GetPeripheral.bin
deleted file mode 100644
index b496bbb0..00000000
Binary files a/macros/Hardware/AVR/GetPeripheral.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/InsertPeripheralInList.bin b/macros/Hardware/AVR/InsertPeripheralInList.bin
deleted file mode 100644
index c49f4e04..00000000
Binary files a/macros/Hardware/AVR/InsertPeripheralInList.bin and /dev/null differ
diff --git a/macros/Hardware/AVR/IsAVRSupportFunction.bin b/macros/Hardware/AVR/IsAVRSupportFunction.bin
deleted file mode 100644
index e2382308..00000000
Binary files a/macros/Hardware/AVR/IsAVRSupportFunction.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin b/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin
deleted file mode 100644
index a70999c0..00000000
Binary files a/macros/Hardware/RasberryPi/GetRPISupportFunctions.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/IsRPISupportFunction.bin b/macros/Hardware/RasberryPi/IsRPISupportFunction.bin
deleted file mode 100644
index 11533d3e..00000000
Binary files a/macros/Hardware/RasberryPi/IsRPISupportFunction.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_DelayMicro.bin b/macros/Hardware/RasberryPi/RPI_DelayMicro.bin
deleted file mode 100644
index a4d32cb6..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_DelayMicro.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_DelayMilli.bin b/macros/Hardware/RasberryPi/RPI_DelayMilli.bin
deleted file mode 100644
index b6eeb30b..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_DelayMilli.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalIn.bin b/macros/Hardware/RasberryPi/RPI_DigitalIn.bin
deleted file mode 100644
index f4c16f39..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_DigitalIn.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalOut.bin b/macros/Hardware/RasberryPi/RPI_DigitalOut.bin
deleted file mode 100644
index b7ad06e5..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_DigitalOut.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin b/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin
deleted file mode 100644
index 1ac5b582..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_DigitalSetup.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_GetMicros.bin b/macros/Hardware/RasberryPi/RPI_GetMicros.bin
deleted file mode 100644
index 3e6c08fa..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_GetMicros.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_GetMillis.bin b/macros/Hardware/RasberryPi/RPI_GetMillis.bin
deleted file mode 100644
index b9143650..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_GetMillis.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin b/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin
deleted file mode 100644
index 1efe0803..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin b/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin
deleted file mode 100644
index 075d6e60..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin b/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin
deleted file mode 100644
index 8ded2709..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin b/macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin
deleted file mode 100644
index 9957f3a4..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_HardPWMWrite.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_PinISR.bin b/macros/Hardware/RasberryPi/RPI_PinISR.bin
deleted file mode 100644
index ddeff684..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_PinISR.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialClose.bin b/macros/Hardware/RasberryPi/RPI_SerialClose.bin
deleted file mode 100644
index dce972dc..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_SerialClose.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialFlush.bin b/macros/Hardware/RasberryPi/RPI_SerialFlush.bin
deleted file mode 100644
index 2a3704d0..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_SerialFlush.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin b/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin
deleted file mode 100644
index 928f28a3..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_SerialGetChar.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSendChar.bin b/macros/Hardware/RasberryPi/RPI_SerialSendChar.bin
deleted file mode 100644
index 7614ebcb..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_SerialSendChar.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSendData.bin b/macros/Hardware/RasberryPi/RPI_SerialSendData.bin
deleted file mode 100644
index a3524a6c..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_SerialSendData.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSetup.bin b/macros/Hardware/RasberryPi/RPI_SerialSetup.bin
deleted file mode 100644
index 0128c27b..00000000
Binary files a/macros/Hardware/RasberryPi/RPI_SerialSetup.bin and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin b/macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin
deleted file mode 100644
index 3789bd6c..00000000
Binary files a/macros/Hardware/RasberryPi/u16RPISerialDataAvail.bin and /dev/null differ
--
cgit
From aef4e8398f2b1848b0e4cdd9580dbbe93e4006f9 Mon Sep 17 00:00:00 2001
From: Jorawar Singh
Date: Fri, 30 Jun 2017 11:28:58 +0530
Subject: Help files, modified Raspberry Pi code conversion
---
macros/Hardware/AVR/AVRADCSetup.sci | 24 ++++++------
macros/Hardware/AVR/AVRDigitalIn.sci | 12 +++---
macros/Hardware/AVR/AVRDigitalOut.sci | 10 ++---
macros/Hardware/AVR/AVRDigitalPortSetup.sci | 11 +++---
macros/Hardware/AVR/AVRDigitalSetup.sci | 13 ++++---
macros/Hardware/AVR/AVRGetTimerValue.sci | 16 +++++---
macros/Hardware/AVR/AVRPWM0SetDuty.sci | 17 +++++----
macros/Hardware/AVR/AVRPWM0Setup.sci | 57 +++++++++++++++-------------
macros/Hardware/AVR/AVRPWM1SetDuty.sci | 20 ++++------
macros/Hardware/AVR/AVRPWM1Setup.sci | 54 +++++++++++++-------------
macros/Hardware/AVR/AVRPWM2SetDuty.sci | 11 +++---
macros/Hardware/AVR/AVRPWM2Setup.sci | 48 +++++++++++++----------
macros/Hardware/AVR/AVRReadADC.sci | 15 +++-----
macros/Hardware/AVR/AVRSleep.sci | 19 +++++++++-
macros/Hardware/AVR/AVRTimerSetup.sci | 45 ++++++++++++----------
macros/Hardware/AVR/AVRUARTReceive.sci | 9 +++--
macros/Hardware/AVR/AVRUARTSetup.sci | 44 +++++++++++----------
macros/Hardware/AVR/AVRUARTTransmit.sci | 16 ++++----
macros/Hardware/AVR/lib | Bin 2265 -> 972 bytes
macros/Hardware/RasberryPi/lib | Bin 2037 -> 892 bytes
20 files changed, 241 insertions(+), 200 deletions(-)
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/AVRADCSetup.sci b/macros/Hardware/AVR/AVRADCSetup.sci
index 264062bc..603873b3 100644
--- a/macros/Hardware/AVR/AVRADCSetup.sci
+++ b/macros/Hardware/AVR/AVRADCSetup.sci
@@ -17,26 +17,28 @@ function AVRADCSetup(prescaler,adc_ref)
// Parameters
// prescaler: prescaler to be used for generating ADC clock (0-7)
// adc_ref : reference voltage to be used for ADC conversion
-// 0 -> Voltage on VREF pin
-// 1 -> Voltage on AVCC pin
-// 2 -> Internal 2.56 reference voltage
//
// Description
-// This function initialises ADc of AVR with given parameters. 'prescaler' is
-// needed for deciding ADC clock. ADC clock should be between 50KHz and 200KHz
-// and it given as (MCU clock/2^prescaler). Select appropriate prescaler depending
-// on MCU clock. 'adc_ref' selects one of the available reference voltage sources
-// available
+// This function initialises ADc of AVR with given parameters. 'prescaler' is needed for deciding ADC clock. ADC clock should be between 50KHz and 200KHz and it given as (MCU clock/2^prescaler). Select appropriate prescaler depending on MCU clock. 'adc_ref' selects one of the available reference voltage sources available.
+//
+// The adc_ref can take the following values-
+//
+// 0 -> Voltage on VREF pin
+// 1 -> Voltage on AVCC pin
+// 2 -> Internal 2.56 reference voltage
+//
+//
+// This is curretly dummy function. It provides no functionality but is required for providing support for generating C code for AVR.
+//
// Examples
// AVRADCSetup(128,0)
// See also
// AVRReadADC
//
// Authors
-// Siddhesh Wani Ashish Kamble
+// Siddhesh Wani
+// Ashish Kamble
//
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
if(prescaler>=8)
disp("Error : Invalid input argument ''prescaler'' in AVRADCSetup function.");
diff --git a/macros/Hardware/AVR/AVRDigitalIn.sci b/macros/Hardware/AVR/AVRDigitalIn.sci
index 54eb327b..7addd663 100644
--- a/macros/Hardware/AVR/AVRDigitalIn.sci
+++ b/macros/Hardware/AVR/AVRDigitalIn.sci
@@ -18,8 +18,6 @@ function state = AVRDigitalIn(port,pin)
// Parameters
// port : port of microcontroller to be used
// pin : pin of port (mentioned above) to be used
-// Returns
-// state : state of an input pin (HIGH\LOW)
//
// Description
// Each AVR microcontroller has pins which can be configured as digital
@@ -27,18 +25,18 @@ function state = AVRDigitalIn(port,pin)
// User has to select one of these port and which pin of that port as
// digital input.
//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+//
// Examples
// pinA0 = AVRDigitalIn(1,0) //To read state on pin 0 of port A
-//
// See also
// AVRDigitalOut AVRDigitalSetup
//
-//
// Authors
-// Siddhesh Wani Ashish Kamble
+// Siddhesh Wani
+// Ashish Kamble
//
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
if((port==0)|(port>=5)) then
disp("Error : Inavalid input argument ''port'' in AVRDigitalIn function.");
diff --git a/macros/Hardware/AVR/AVRDigitalOut.sci b/macros/Hardware/AVR/AVRDigitalOut.sci
index a86a5aa9..0efc927b 100644
--- a/macros/Hardware/AVR/AVRDigitalOut.sci
+++ b/macros/Hardware/AVR/AVRDigitalOut.sci
@@ -26,18 +26,18 @@ function AVRDigitalOut(port,pin,state)
// digital output. Also, desired output state must be specified as
// 'HIGH' or 'LOW'.
//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+//
// Examples
// AVRDigitalOut('A',0,HIGH)
-//
// See also
// AVRDigitalIn
//
-//
// Authors
-// Siddhesh Wani Ashish Kamble
+// Siddhesh Wani
+// Ashish Kamble
//
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
if((port==0)|(port>=8)) then
disp("Error : Inavalid input argument ''port'' in AVRDigitalOut function.");
diff --git a/macros/Hardware/AVR/AVRDigitalPortSetup.sci b/macros/Hardware/AVR/AVRDigitalPortSetup.sci
index 5f0b9671..65e8494a 100644
--- a/macros/Hardware/AVR/AVRDigitalPortSetup.sci
+++ b/macros/Hardware/AVR/AVRDigitalPortSetup.sci
@@ -15,7 +15,7 @@ function AVRDigitalPortSetup(port,direction)
// AVRDigitalPortSetup(port,direction)
//
// Parameters
-// port : port of microcontroller to be used(1 for PORTA, 2 for PORTB,...)
+// port : port of microcontroller to be used(1 for PORTA, 2 for PORTB,...)
// direction : direction to be set for pin (0 for INPUT, 1 for OUTPUT)
//
// Description
@@ -25,18 +25,19 @@ function AVRDigitalPortSetup(port,direction)
// used as digital output/input. Also, desired direction must be specified as
// 'INPUT' or 'OUTPUT'.
//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+//
// Examples
// AVRDigitalPortSetup(1,0); //This function will make PortA as input port
//
// See also
// AVRDigitalIn AVRDigitalOut
//
-//
// Authors
-// Siddhesh Wani Ashish Kamble
+// Siddhesh Wani
+// Ashish Kamble
//
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
if((port==0)|(port>=5)) then
disp("Error : Invalid input argument ''port'' in AVRDigitalPortSetup function.");
diff --git a/macros/Hardware/AVR/AVRDigitalSetup.sci b/macros/Hardware/AVR/AVRDigitalSetup.sci
index e707d4fa..ed6cf306 100644
--- a/macros/Hardware/AVR/AVRDigitalSetup.sci
+++ b/macros/Hardware/AVR/AVRDigitalSetup.sci
@@ -15,8 +15,8 @@ function AVRDigitalSetup(port,pin,direction)
// AVRDigitalSetup(port,pin,direction)
//
// Parameters
-// port : port of microcontroller to be used
-// pin : pin of port (mentioned above) to be used
+// port : port of microcontroller to be used
+// pin : pin of port (mentioned above) to be used
// direction : direction to be set for pin (INPUT\OUTPUT)
//
// Description
@@ -26,18 +26,19 @@ function AVRDigitalSetup(port,pin,direction)
// used as digital output/input. Also, desired direction must be specified as
// 'INPUT' or 'OUTPUT'.
//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+//
// Examples
// AVRDigitalSetup('A',0,OUTPUT)
//
// See also
// AVRDigitalIn AVRDigitalOut
//
-//
// Authors
-// Siddhesh Wani Ashish Kamble
+// Siddhesh Wani
+// Ashish Kamble
//
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
if((port==0)|(port>=5)) then
disp("Error : Invalid input argument ''port'' in AVRDigitalSetup function.");
diff --git a/macros/Hardware/AVR/AVRGetTimerValue.sci b/macros/Hardware/AVR/AVRGetTimerValue.sci
index afb47ac8..05919b38 100644
--- a/macros/Hardware/AVR/AVRGetTimerValue.sci
+++ b/macros/Hardware/AVR/AVRGetTimerValue.sci
@@ -18,20 +18,26 @@ function count = AVRGetTimerValue(timer)
// 2 for timer2
//
// Description
-// This function returns the count value of a desired timer.By knowing the count value
-// certain interrupt action can be taken.
+// This function returns the count value of a desired timer.By knowing the count value certain interrupt action can be taken.
+//
+// Timer can take the following values
+//
+// 0 -> for timer0
+// 1 -> for timer1
+// 2 -> for timer2
+//
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
//
// Examples
// AVRGetTimerValue(0); //returns present count of the TCNT0 counter
-//
// See also
// AVRTimerSetup
//
// Authors
// Ashish Kamble
//
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
if(timer>=3) then
disp("Error : Invalid input argument ''timer'' in AVRGetTimerValue function.");
diff --git a/macros/Hardware/AVR/AVRPWM0SetDuty.sci b/macros/Hardware/AVR/AVRPWM0SetDuty.sci
index 604d2f40..c3815d10 100644
--- a/macros/Hardware/AVR/AVRPWM0SetDuty.sci
+++ b/macros/Hardware/AVR/AVRPWM0SetDuty.sci
@@ -9,15 +9,18 @@
// Email: toolbox@scilab.in
function AVRPWM0SetDuty(duty)
-//Function to Set Duty cycle of PWM Output generated by Timer0 at OC0 pin.
+//Function to Set Duty cycle of PWM Output generated by Timer0 at OC0 pin.
+//
//Parameters
-// duty : It holds an integer value from 0 to 100 which sets the percentage
-// of time for which signal is active.
+// duty : It holds an integer value from 0 to 100 which sets the percentage of time for which signal is active.
+//
//Description
// Each Micro controller has PWM output pins which can generate varying voltage
-// from 0V-5V.In this function by varying the duty cycle, varying voltage can be
-// produced.
-//Example
+// from 0V-5V.In this function by varying the duty cycle, varying voltage can be produced.
+//
+// This is curretly dummy function. It provides no functionality but is required for providing support for generating C code for AVR.
+//
+//Examples
// AVRPWM0SetDuty(50); //Produces 2.5V at OC0 pin
// AVRPWM0SetDuty(0); //Produces 0V at OC0 pin
//See also
@@ -26,8 +29,6 @@ function AVRPWM0SetDuty(duty)
//Authors
// Ashish Kamble
//
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
if(duty>100) then
disp("Error : Invalid input argument ''duty'' in AVRPWM0SetDuty function.");
diff --git a/macros/Hardware/AVR/AVRPWM0Setup.sci b/macros/Hardware/AVR/AVRPWM0Setup.sci
index 39861c86..c391f71e 100644
--- a/macros/Hardware/AVR/AVRPWM0Setup.sci
+++ b/macros/Hardware/AVR/AVRPWM0Setup.sci
@@ -10,43 +10,48 @@
function AVRPWM0Setup(waveform_mode,output_mode)
//Function to Setup OC0 pin for required PWM mode
+//
+//Parameters
+// waveform_mode: integer, from 0 to 2
+// output_mode: integer, from 0 to 1 (or 2) depending on the waveform_mode
+//
//Description
// Every Micro controller has PWM pins which can generate varying voltages
// from 0V-5V.This function helps to use OC0 pin to produce required
// output waveform by setting the waveform mode and otput mode.
//
-//Parameters
-// waveform_mode:
-// 0 for Phase correct PWM Mode
-// 1 for Fast PWM Mode
-// 2 for CTC Mode
-// output_mode:
-// For Phase Correct PWM Mode:
-// 0 for Clear OC0 on compare match when up-counting. Set OC0 on compare
-// match when down-counting.
-// 1 for Set OC0 on compare match when up-counting. Clear OC0 on compare
-// match when down-counting.
-//
-// For Fast PWM Mode:
-// 0 for non-inverted output i.e Clear OC0 on compare match, set OC0 at BOTTOM.
-// 1 for inverted output i.e Set OC0 on compare match, clear OC0 at BOTTOM.
-//
-// For CTC Mode:
-// 0 to Clear OC0 on compare match
-// 1 to Set OC0 on compare match
-// 2 to toggle OC0 on compare match
-//
-//Example
-// AVRPWM0Setup(2,0); //This function will select CTC waveform mode and will clear OC0 on
-// compare match
+// waveform_mode can take values-
+//
+// 0 -> for Phase correct PWM Mode
+// 1 -> for Fast PWM Mode
+// 2 -> for CTC Mode
+//
+//
+// output_mode can take values-
+//
+// For Phase correct PWM Mode:
+// 0 for Clear OC0 on compare match when up-counting. Set OC0 on compare match when down-counting.
+// 1 for Set OC0 on compare match when up-counting. Clear OC0 on compare match when down-counting.
+// For Fast PWM Mode:
+// 0 for non-inverted output i.e Clear OC0 on compare match, set OC0 at BOTTOM.
+// 1 for inverted output i.e Set OC0 on compare match, clear OC0 at BOTTOM.
+// For CTC Mode:
+// 0 to Clear OC0 on compare match
+// 1 to Set OC0 on compare match
+// 2 to toggle OC0 on compare match
+//
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+//
+//Examples
+// AVRPWM0Setup(2,0); //This function will select CTC waveform mode and will clear OC0 on compare match
//See also
// AVRPWM0SetDuty
//
//Authors
// Ashish Kamble
//
-//This is curretly dummy function. It provides no functionality but is required
-//for providing support for generating C code for AVR.
if(waveform_mode>=3) then
disp("Error : Invalid input argument ''waveform_mode'' in AVRPWM0Setup function.");
diff --git a/macros/Hardware/AVR/AVRPWM1SetDuty.sci b/macros/Hardware/AVR/AVRPWM1SetDuty.sci
index 60dc0a9f..fd6e7baf 100644
--- a/macros/Hardware/AVR/AVRPWM1SetDuty.sci
+++ b/macros/Hardware/AVR/AVRPWM1SetDuty.sci
@@ -11,34 +11,28 @@
function AVRPWM1SetDuty(output_pin,duty,Top_Value)
//Function to Set Duty cycle of PWM Output generated by Timer1 at OC1A or OC1B pin.
//Parameters
-// ouput_pin:
-// 0 for selecting OC1A as output pin
-// 1 for selecting OC1B as output pin
+// ouput_pin: integer, 0 (for OC1A) or 1 (for OC1B)
//
-// duty: It holds an integer value from 0 to 100 which sets the percentage
-// of time for which signal is active.
+// duty: It holds an integer value from 0 to 100 which sets the percentage of time for which signal is active.
//
-// Top_Value: It holds an integer value from 0 to 65535.This value sets the Top
-// value of the counter TCNT1 i.e ICR.(for more info refer datasheet)
+// Top_Value: It holds an integer value from 0 to 65535.This value sets the Top value of the counter TCNT1 i.e ICR.(for more info refer datasheet)
//
//Description
// Each Micro controller has PWM output pins which can generate varying voltage
// from 0V-5V.This function Sets the duty cycle of output PWM signal.Also this function
// decides the Top Vale of TCNT1 and the output pin to output PWM signal.
//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+//
//Example
-// AVRPWM1SetDuty(0,50,40000); //This function will produce PWM signal of 50% duty
-// cycle on OC1A pin and TCNT1 will reset at 40000 instead
-// at 65535.
-//
+// AVRPWM1SetDuty(0,50,40000); //This function will produce PWM signal of 50% duty cycle on OC1A pin and TCNT1 will reset at 40000 instead at 65535.
//See also
// AVRPWM1Setup
//
//Authors
// Ashish Kamble
//
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
if(output_pin>=2) then
disp("Error : Invalid input argument ''output_pin'' in AVRPWM1SetDuty function.");
diff --git a/macros/Hardware/AVR/AVRPWM1Setup.sci b/macros/Hardware/AVR/AVRPWM1Setup.sci
index 51aa25b1..fbd96ce3 100644
--- a/macros/Hardware/AVR/AVRPWM1Setup.sci
+++ b/macros/Hardware/AVR/AVRPWM1Setup.sci
@@ -10,38 +10,40 @@
function AVRPWM1Setup(waveform_mode,output_mode,output_pin)
//Function to Setup OC1A or OC1B pin for required PWM mode
+//
+//Parameters
+// waveform_mode: integer, from 0 to 2
+// output_mode: integer, from 0 to 1 (or 2) depending on the waveform_mode
+// output_pin: 0 (for OC1A) or 1 for (OC1B)
+//
//Description
// Every Micro controller has PWM pins which can generate varying voltages
// from 0V-5V.This function helps to use OC1A or OC1B pin to produces required
// output waveform by setting the waveform mode and otput mode.
//
-//Parameters
-// waveform_mode:
-// 0 for Phase correct PWM Mode
-// 1 for Fast PWM Mode
-// 2 for CTC Mode
+// waveform_mode can take values-
+//
+// 0 -> for Phase correct PWM Mode
+// 1 -> for Fast PWM Mode
+// 2 -> for CTC Mode
+//
//
-// output_mode:
-// For Phase Correct PWM Mode:
-// 0 for Clear OC1A or OC1B on compare match when up-counting. Set OC1A or OC1B
-// on compare match when down-counting.
-// 1 for Set OC1A or OC1B on compare match when up-counting. Clear OC1A or OC1B
-// on compare match when down-counting.
-//
-// For Fast PWM Mode:
-// 0 for non-inverted output i.e Clear OC1A or OC1B on compare match, set OC1A
-// OC1B at BOTTOM.
-// 1 for inverted output i.e Set OC1A or OC1B on compare match, clear OC1A or OC1B
-// at BOTTOM.
-//
-// For CTC Mode:
-// 0 to Clear OC1A or OC1B on compare match
-// 1 to Set OC1A or OC1B on compare match
-// 2 to toggle OC1A or OC1B on compare match
+// output_mode can take values-
+//
+// For Phase correct PWM Mode:
+// 0 for Clear OC1A or OC1B on compare match when up-counting. Set OC1A or OC1B on compare match when down-counting.
+// 1 for Set OC1A or OC1B on compare match when up-counting. Clear OC1A or OC1B on compare match when down-counting.
+// For Fast PWM Mode:
+// 0 for non-inverted output i.e Clear OC1A or OC1B on compare match, set OC1A or OC1B at BOTTOM.
+// 1 for inverted output i.e Set OC1A or OC1B on compare match, clear OC1A or OC1B at BOTTOM.
+// For CTC Mode:
+// 0 to Clear OC1A or OC1B on compare match
+// 1 to Set OC1A or OC1B on compare match
+// 2 to toggle OC1A or OC1B on compare match
+//
//
-// output_pin:
-// 0 for selecting OC1A as output pin
-// 1 for selecting OC1B as output pin
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
//
//Example
// AVRPWM1Setup(2,0,0); //This function will select CTC mode and will clear OC1A or OC1B
@@ -53,8 +55,6 @@ function AVRPWM1Setup(waveform_mode,output_mode,output_pin)
//Authors
// Ashish Kamble
//
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
if(waveform_mode>=3) then
disp("Error : Invalid input argument ''waveform_mode'' in AVRPWM1Setup function.");
diff --git a/macros/Hardware/AVR/AVRPWM2SetDuty.sci b/macros/Hardware/AVR/AVRPWM2SetDuty.sci
index 929c1a0a..81d1761e 100644
--- a/macros/Hardware/AVR/AVRPWM2SetDuty.sci
+++ b/macros/Hardware/AVR/AVRPWM2SetDuty.sci
@@ -10,14 +10,17 @@
function AVRPWM2SetDuty(duty)
//Function to Set Duty cycle of PWM Output generated by Timer2 at OC2 pin.
+//
+//Parameters
+// duty : It holds an integer value from 0 to 100 which sets the percentage of time for which signal is active.
+//
//Description
// Each Micro controller has PWM output pins which can generate varying voltage
// from 0V-5V.In this function by varying the duty cycle, varying voltage can be
// produced.
//
-//Parameters
-// duty : It holds an integer value from 0 to 100 which sets the percentage
-// of time for which signal is active.
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
//
//Example
// AVRPWM2SetDuty(50); //Produces 2.5V at OC2 pin
@@ -29,8 +32,6 @@ function AVRPWM2SetDuty(duty)
//Authors
// Ashish Kamble
//
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
if(duty>100) then
disp("Error : Invalid input argument ''duty'' in AVRPWM2SetDuty function.");
diff --git a/macros/Hardware/AVR/AVRPWM2Setup.sci b/macros/Hardware/AVR/AVRPWM2Setup.sci
index d4bc74a6..11d9b019 100644
--- a/macros/Hardware/AVR/AVRPWM2Setup.sci
+++ b/macros/Hardware/AVR/AVRPWM2Setup.sci
@@ -10,32 +10,40 @@
function AVRPWM2Setup(waveform_mode,output_mode)
//Function to Setup OC2 pin for required PWM mode
+//
+//Parameters
+// waveform_mode: integer, from 0 to 2
+// output_mode: integer, from 0 to 1 (or 2) depending on the waveform_mode
+//
//Description
// Every Micro controller has PWM pins which can generate varying voltages
// from 0V-5V.This function helps to use OC2 pin to produces required
// output waveform by setting the waveform mode and otput mode.
//
-//Parameters
-// waveform_mode:
-// 0 for Phase correct PWM Mode
-// 1 for Fast PWM Mode
-// 2 for CTC Mode
-//output_mode:
-// For Phase Correct PWM Mode:
-// 0 for Clear OC2 on compare match when up-counting. Set OC2 on compare
-// match when down-counting.
-// 1 for Set OC2 on compare match when up-counting. Clear OC2 on compare
-// match when down-counting.
-//
+// waveform_mode can take values-
+//
+// 0 -> for Phase correct PWM Mode
+// 1 -> for Fast PWM Mode
+// 2 -> for CTC Mode
+//
+//
+// output_mode can take values-
+//
+// For Phase correct PWM Mode:
+// 0 for Clear OC2 on compare match when up-counting. Set OC2 on compare match when down-counting.
+// 1 for Set OC2 on compare match when up-counting. Clear OC2 on compare match when down-counting.
// For Fast PWM Mode:
-// 0 for non-inverted output i.e Clear OC2 on compare match, set OC2 at BOTTOM.
-// 1 for inverted output i.e Set OC2 on compare match, clear OC2 at BOTTOM.
-//
+// 0 for non-inverted output i.e Clear OC2 on compare match, set OC2 at BOTTOM.
+// 1 for inverted output i.e Set OC2 on compare match, clear OC2 at BOTTOM.
// For CTC Mode:
-// 0 to Clear OC2 on compare match
-// 1 to Set OC2 on compare match
-// 2 to toggle OC2 on compare match
-//
+// 0 to Clear OC2 on compare match
+// 1 to Set OC2 on compare match
+// 2 to toggle OC2 on compare match
+//
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+//
//Example
// AVRPWM2Setup(2,0); //This function will select CTC waveform mode and will clear OC2 on
// compare match
@@ -45,8 +53,6 @@ function AVRPWM2Setup(waveform_mode,output_mode)
//Authors
// Ashish Kamble
//
-//This is curretly dummy function. It provides no functionality but is required
-//for providing support for generating C code for AVR.
if(waveform_mode>=3) then
disp("Error : Invalid input argument ''waveform_mode'' in AVRPWM2Setup function.");
diff --git a/macros/Hardware/AVR/AVRReadADC.sci b/macros/Hardware/AVR/AVRReadADC.sci
index 7fd3e67e..71cafa7e 100644
--- a/macros/Hardware/AVR/AVRReadADC.sci
+++ b/macros/Hardware/AVR/AVRReadADC.sci
@@ -15,11 +15,7 @@ function adc_result = AVRReadADC(channel)
// u8AVRReadADCs(channel)
//
// Parameters
-// channel : Select which channel is to be read. Values from 0-7 select one
-// of the pins ADC0-ADC7. For other possible channel values refer
-// datasheet
-// Returns->
-// result : Digital value for the voltage present on channel selected
+// channel : Select which channel is to be read. Values from 0-7 select one of the pins ADC0-ADC7. For other possible channel values refer datasheet
//
// Description
// This function returns digital value for present on adc pins. 'channel'
@@ -28,14 +24,15 @@ function adc_result = AVRReadADC(channel)
// voltages between some pins. For channel values for those options, please
// refer datasheet.
//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+//
// Examples
// adc_result = u8AVRReadADC(0) //Read ADC0
-//
// Authors
-// Siddhesh Wani Ashish Kamble
+// Siddhesh Wani
+// Ashish Kamble
//
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
if(channel>=8) then
disp("Error : Inavlid input argument ''channel'' in AVRReadADC function.");
diff --git a/macros/Hardware/AVR/AVRSleep.sci b/macros/Hardware/AVR/AVRSleep.sci
index a1b6add2..eec6e5a2 100644
--- a/macros/Hardware/AVR/AVRSleep.sci
+++ b/macros/Hardware/AVR/AVRSleep.sci
@@ -1,4 +1,21 @@
function AVRSleep(delay)
-
+// Function to pause the execution for the given time.
+//
+// Parameter
+// delay : The time, in milliseconds, for which the execution is to be paused
+//
+// Description
+// This function causes the execution to stop for the given amount of time.
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+//
+//Examples
+// AVRSleep(5000);
+//See also
+//
+// Authors
+// Jorawar Singh
+//
endfunction
diff --git a/macros/Hardware/AVR/AVRTimerSetup.sci b/macros/Hardware/AVR/AVRTimerSetup.sci
index 7c5dd1da..55fd55fa 100644
--- a/macros/Hardware/AVR/AVRTimerSetup.sci
+++ b/macros/Hardware/AVR/AVRTimerSetup.sci
@@ -10,37 +10,44 @@
function AVRTimerSetup(timer,prescaler,clock_source)
//Function to setup Timers in ATmega16
+//
+//Parameters:
+// timer : integer, from 0 to 2
+// prescaler : integer.
+// clock_source : integer, 0 (for internal) or 1 (for external)
+//
//Descrpition:
// This function tells the micro controller which clock source you will be using.
// The timer value and prescaler value passed in this function setup the timer as per
// your requirement.
//
-//Parameters:
-// timer : It is an integer value.
-// 0 to setup timer0
-// 1 to setup timer1
-// 2 to setup timer2
-// prescaler : It is an integer value.
-// 1 for no prescaling i.e clock will run at max 16Hz frequency
-// 8 for prescaling clock by 8 i.e new clock frequency will be (clk/8)
-// 64 for prescaling clock by 64 i.e new clock frequency will be (clk/64)
-// 256 for prescaling clock by 256 i.e new clock frequency will be (clk/256)
-// 1024 for prescaling clock by 1024 i.e new clock frequency will be (clk/1024)
-// clock_source : It is an integer value.
-// 0 if you are using internal clock source
-// 1 if you are using external clock source
+// timer can take values-
+//
+// 0 -> for timer0
+// 1 -> for timer1
+// 2 -> for timer2
+//
+//
+// prescaler can take values-
+//
+// 1 for no prescaling i.e clock will run at max 16Hz frequency
+// 8 for prescaling clock by 8 i.e new clock frequency will be (clk/8)
+// 64 for prescaling clock by 64 i.e new clock frequency will be (clk/64)
+// 256 for prescaling clock by 256 i.e new clock frequency will be (clk/256)
+// 1024 for prescaling clock by 1024 i.e new clock frequency will be (clk/1024)
+//
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+//
//Example
-// AVRTimerSetup(0,64,0); //This function will select timer0 with timer running as per
-// internal clock source and prescaled by 64.
-//
+// AVRTimerSetup(0,64,0); //This function will select timer0 with timer running as per internal clock source and prescaled by 64.
//See also
// AVRGetTimerValues
//
//Authors
// Ashish Kamble
//
-//This is curretly dummy function. It provides no functionality but is required
-//for providing support for generating C code for AVR.
if(timer>=3) then
disp("Error : Invalid input argument ''timer'' in AVRTimerSetup function.");
diff --git a/macros/Hardware/AVR/AVRUARTReceive.sci b/macros/Hardware/AVR/AVRUARTReceive.sci
index 790894fb..7fdf6f05 100644
--- a/macros/Hardware/AVR/AVRUARTReceive.sci
+++ b/macros/Hardware/AVR/AVRUARTReceive.sci
@@ -10,13 +10,16 @@
function received = AVRUARTReceive()
// Function to Receive Char value send to ATmega16 using UART or USART.
+//
// Description
// This function Receives Char as 8 bit value.This value is stored in UDR at receiving
// end.
//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+//
//Examples
-// state = AVRUARTReceive(); //This function will Receive char and return the entire value
-//
+// state = AVRUARTReceive(); //This function will Receive char and return the entire value
//See also
// AVRUARTSetup
// AVRUARTTransmit
@@ -24,7 +27,5 @@ function received = AVRUARTReceive()
// Authors
// Ashish Kamble
//
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
received = 0; // received has been initialised to avoid runtime error.
endfunction
diff --git a/macros/Hardware/AVR/AVRUARTSetup.sci b/macros/Hardware/AVR/AVRUARTSetup.sci
index 32e5db86..6ecf2a07 100644
--- a/macros/Hardware/AVR/AVRUARTSetup.sci
+++ b/macros/Hardware/AVR/AVRUARTSetup.sci
@@ -10,29 +10,34 @@
function AVRUARTSetup(mode, baudrate, stopbits, parity)
// Function to Setup Serial Communication i.e UART or USART in ATmega16.
+//
+// Parameters
+// mode : integer, from 0 to 2
+// baudrate : Enter one of the following available baudrates (2400 , 4800 , 9600 , 14400 , 19200 , 28800 , 38400 , 57600 , 768000 , 115200 , 230400 , 250000 , 1000000)
+// stopbits : integer, (0 for one stopbit) or (1 for two stopbits)
+// parity : integer, from 0 to 2
+//
// Description
// This function Setup the UART or USART for Serial Communicaion between ATmega16
// and different micro controllers or between ATmega16 and Computer.
-//
-// Parameters
-// mode :
-// 0 for Asynchronous Normal mode
-// 1 for Asynchronous Double Speed mode
-// 2 for Synchronous mode
-//
-// baudrate : Enter one of the following available baudrates
-// 2400 , 4800 , 9600 , 14400 , 19200 , 28800 , 38400 , 57600 ,
-// 768000 , 115200 , 230400 , 250000 , 1000000 .
//
-// stopbits :
-// 0 for one stopbit
-// 1 for two stopbits
+// mode can take values:
+//
+// 0 for Asynchronous Normal mode
+// 1 for Asynchronous Double Speed mode
+// 2 for Synchronous mode
+//
+//
+// parity can take values:
+//
+// 0 for parity disabled
+// 1 for even parity
+// 2 for odd parity
+//
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
//
-// parity :
-// 0 for parity disabled
-// 1 for even parity
-// 2 for odd parity
-//
//Examples
// AVRUARTSetup(0,9600,0,0); //This function will enable UART Communication for ATmega16
// with 9600 as baudrate,one stop bit and parity disabled
@@ -43,8 +48,7 @@ function AVRUARTSetup(mode, baudrate, stopbits, parity)
// Authors
// Ashish Kamble
//
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
+
if(mode>=3) then
disp("Error : Invalid input argument ''mode'' in AVRUARTSetup function.");
end
diff --git a/macros/Hardware/AVR/AVRUARTTransmit.sci b/macros/Hardware/AVR/AVRUARTTransmit.sci
index eb358499..695c708d 100644
--- a/macros/Hardware/AVR/AVRUARTTransmit.sci
+++ b/macros/Hardware/AVR/AVRUARTTransmit.sci
@@ -10,17 +10,19 @@
function AVRUARTTransmit(data)
// Function to Transmit data using UART or USART.
+//
+// Parameter
+// data : The data to be transmitted can be a Char,String,Unsigned Int,Signed Int.
+//
// Description
// This function Tranmits data over UART or USART.The data to be transmitted can
// be a Char , String , Unsigned Int, Signed Int.
-//
-// Parameter
-// data :
-// The data to be transmitted can be a Char,String,Unsigned Int,Signed Int.
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
//
//Examples
-// AVRUARTTransmit("This is example"); //This function will transmit the entered string.
-//
+// AVRUARTTransmit("This is example"); //This function will transmit the entered string.
//See also
// AVRUARTSetup
// AVRUARTReceive
@@ -28,6 +30,4 @@ function AVRUARTTransmit(data)
// Authors
// Ashish Kamble
//
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
endfunction
diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib
index 5c8f0da2..7ca99340 100644
Binary files a/macros/Hardware/AVR/lib and b/macros/Hardware/AVR/lib differ
diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib
index 9afd77da..ef9e942d 100644
Binary files a/macros/Hardware/RasberryPi/lib and b/macros/Hardware/RasberryPi/lib differ
--
cgit
From a3dfa2a4069740517ca6e83f99dd4e0dbb71c377 Mon Sep 17 00:00:00 2001
From: siddhu8990
Date: Sat, 1 Jul 2017 06:52:51 +0530
Subject: Merged Jorawer's work, Help files, RPi-scilab2c
---
macros/Hardware/AVR/lib | Bin 2265 -> 1148 bytes
macros/Hardware/RasberryPi/lib | Bin 2037 -> 1152 bytes
2 files changed, 0 insertions(+), 0 deletions(-)
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib
index 5c8f0da2..170d3211 100644
Binary files a/macros/Hardware/AVR/lib and b/macros/Hardware/AVR/lib differ
diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib
index 9afd77da..d25d9440 100644
Binary files a/macros/Hardware/RasberryPi/lib and b/macros/Hardware/RasberryPi/lib differ
--
cgit
From 121b455e1e46617c670a8b9dfa77bbb1aa97a51a Mon Sep 17 00:00:00 2001
From: Jorawar Singh
Date: Tue, 4 Jul 2017 15:14:46 +0530
Subject: Fixed standalone conversion errors with RPi files
---
macros/Hardware/AVR/lib | Bin 1148 -> 908 bytes
macros/Hardware/RasberryPi/lib | Bin 1152 -> 912 bytes
2 files changed, 0 insertions(+), 0 deletions(-)
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib
index 170d3211..a3d9e10c 100644
Binary files a/macros/Hardware/AVR/lib and b/macros/Hardware/AVR/lib differ
diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib
index d25d9440..ac87d042 100644
Binary files a/macros/Hardware/RasberryPi/lib and b/macros/Hardware/RasberryPi/lib differ
--
cgit
From de14a5628ad439e20770d10733ebdac46562a860 Mon Sep 17 00:00:00 2001
From: Jorawar Singh
Date: Fri, 7 Jul 2017 13:00:37 +0530
Subject: Raspberry Pi function changes and minor gui changes
---
macros/Hardware/AVR/lib | Bin 908 -> 0 bytes
macros/Hardware/RasberryPi/lib | Bin 912 -> 0 bytes
2 files changed, 0 insertions(+), 0 deletions(-)
delete mode 100644 macros/Hardware/AVR/lib
delete mode 100644 macros/Hardware/RasberryPi/lib
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib
deleted file mode 100644
index a3d9e10c..00000000
Binary files a/macros/Hardware/AVR/lib and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib
deleted file mode 100644
index ac87d042..00000000
Binary files a/macros/Hardware/RasberryPi/lib and /dev/null differ
--
cgit
From 3f52712f806fbd80d66dfdcaff401e5cf94dcca4 Mon Sep 17 00:00:00 2001
From: yash1112
Date: Fri, 7 Jul 2017 21:20:49 +0530
Subject: sci2c arduino updated
---
macros/Hardware/AVR/AVRADCSetup.sci | 47 ++++++++++++
macros/Hardware/AVR/AVRDigitalIn.sci | 50 +++++++++++++
macros/Hardware/AVR/AVRDigitalOut.sci | 51 +++++++++++++
macros/Hardware/AVR/AVRDigitalPortSetup.sci | 47 ++++++++++++
macros/Hardware/AVR/AVRDigitalSetup.sci | 51 +++++++++++++
macros/Hardware/AVR/AVRGetTimerValue.sci | 40 +++++++++++
macros/Hardware/AVR/AVRPWM0SetDuty.sci | 35 +++++++++
macros/Hardware/AVR/AVRPWM0Setup.sci | 68 ++++++++++++++++++
macros/Hardware/AVR/AVRPWM1SetDuty.sci | 52 ++++++++++++++
macros/Hardware/AVR/AVRPWM1Setup.sci | 79 +++++++++++++++++++++
macros/Hardware/AVR/AVRPWM2SetDuty.sci | 38 ++++++++++
macros/Hardware/AVR/AVRPWM2Setup.sci | 69 ++++++++++++++++++
macros/Hardware/AVR/AVRReadADC.sci | 44 ++++++++++++
macros/Hardware/AVR/AVRSleep.sci | 4 ++
macros/Hardware/AVR/AVRTimerSetup.sci | 56 +++++++++++++++
macros/Hardware/AVR/AVRUARTReceive.sci | 30 ++++++++
macros/Hardware/AVR/AVRUARTSetup.sci | 61 ++++++++++++++++
macros/Hardware/AVR/AVRUARTTransmit.sci | 33 +++++++++
macros/Hardware/AVR/GetAVRSupportFunctions.sci | 43 +++++++++++
macros/Hardware/AVR/GetPeripheral.sci | 31 ++++++++
macros/Hardware/AVR/InsertPeripheralInList.sci | 27 +++++++
macros/Hardware/AVR/IsAVRSupportFunction.sci | 32 +++++++++
macros/Hardware/AVR/buildmacros.sce | 4 ++
macros/Hardware/AVR/lib | Bin 0 -> 1008 bytes
macros/Hardware/AVR/names | 22 ++++++
.../Hardware/RasberryPi/GetRPISupportFunctions.sci | 48 +++++++++++++
.../Hardware/RasberryPi/IsRPISupportFunction.sci | 32 +++++++++
macros/Hardware/RasberryPi/RPI_DelayMicro.sci | 38 ++++++++++
macros/Hardware/RasberryPi/RPI_DelayMilli.sci | 39 ++++++++++
macros/Hardware/RasberryPi/RPI_DigitalIn.sci | 43 +++++++++++
macros/Hardware/RasberryPi/RPI_DigitalOut.sci | 44 ++++++++++++
macros/Hardware/RasberryPi/RPI_DigitalSetup.sci | 36 ++++++++++
macros/Hardware/RasberryPi/RPI_GetMicros.sci | 39 ++++++++++
macros/Hardware/RasberryPi/RPI_GetMillis.sci | 39 ++++++++++
macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci | 35 +++++++++
macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci | 32 +++++++++
macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci | 35 +++++++++
macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci | 39 ++++++++++
macros/Hardware/RasberryPi/RPI_PinISR.sci | 56 +++++++++++++++
macros/Hardware/RasberryPi/RPI_SerialClose.sci | 33 +++++++++
macros/Hardware/RasberryPi/RPI_SerialFlush.sci | 34 +++++++++
macros/Hardware/RasberryPi/RPI_SerialGetChar.sci | 36 ++++++++++
macros/Hardware/RasberryPi/RPI_SerialSendChar.sci | 37 ++++++++++
macros/Hardware/RasberryPi/RPI_SerialSendData.sci | 38 ++++++++++
macros/Hardware/RasberryPi/RPI_SerialSetup.sci | 36 ++++++++++
macros/Hardware/RasberryPi/buildmacros.sce | 4 ++
macros/Hardware/RasberryPi/lib | Bin 0 -> 1012 bytes
macros/Hardware/RasberryPi/names | 21 ++++++
.../Hardware/RasberryPi/u16RPISerialDataAvail.sci | 37 ++++++++++
49 files changed, 1845 insertions(+)
create mode 100644 macros/Hardware/AVR/AVRADCSetup.sci
create mode 100644 macros/Hardware/AVR/AVRDigitalIn.sci
create mode 100644 macros/Hardware/AVR/AVRDigitalOut.sci
create mode 100644 macros/Hardware/AVR/AVRDigitalPortSetup.sci
create mode 100644 macros/Hardware/AVR/AVRDigitalSetup.sci
create mode 100644 macros/Hardware/AVR/AVRGetTimerValue.sci
create mode 100644 macros/Hardware/AVR/AVRPWM0SetDuty.sci
create mode 100644 macros/Hardware/AVR/AVRPWM0Setup.sci
create mode 100644 macros/Hardware/AVR/AVRPWM1SetDuty.sci
create mode 100644 macros/Hardware/AVR/AVRPWM1Setup.sci
create mode 100644 macros/Hardware/AVR/AVRPWM2SetDuty.sci
create mode 100644 macros/Hardware/AVR/AVRPWM2Setup.sci
create mode 100644 macros/Hardware/AVR/AVRReadADC.sci
create mode 100644 macros/Hardware/AVR/AVRSleep.sci
create mode 100644 macros/Hardware/AVR/AVRTimerSetup.sci
create mode 100644 macros/Hardware/AVR/AVRUARTReceive.sci
create mode 100644 macros/Hardware/AVR/AVRUARTSetup.sci
create mode 100644 macros/Hardware/AVR/AVRUARTTransmit.sci
create mode 100644 macros/Hardware/AVR/GetAVRSupportFunctions.sci
create mode 100644 macros/Hardware/AVR/GetPeripheral.sci
create mode 100644 macros/Hardware/AVR/InsertPeripheralInList.sci
create mode 100644 macros/Hardware/AVR/IsAVRSupportFunction.sci
create mode 100644 macros/Hardware/AVR/buildmacros.sce
create mode 100644 macros/Hardware/AVR/lib
create mode 100644 macros/Hardware/AVR/names
create mode 100644 macros/Hardware/RasberryPi/GetRPISupportFunctions.sci
create mode 100644 macros/Hardware/RasberryPi/IsRPISupportFunction.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_DelayMicro.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_DelayMilli.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_DigitalIn.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_DigitalOut.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_GetMicros.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_GetMillis.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_PinISR.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialClose.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialFlush.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialGetChar.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialSendChar.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialSendData.sci
create mode 100644 macros/Hardware/RasberryPi/RPI_SerialSetup.sci
create mode 100644 macros/Hardware/RasberryPi/buildmacros.sce
create mode 100644 macros/Hardware/RasberryPi/lib
create mode 100644 macros/Hardware/RasberryPi/names
create mode 100644 macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/AVRADCSetup.sci b/macros/Hardware/AVR/AVRADCSetup.sci
new file mode 100644
index 00000000..264062bc
--- /dev/null
+++ b/macros/Hardware/AVR/AVRADCSetup.sci
@@ -0,0 +1,47 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRADCSetup(prescaler,adc_ref)
+// Function to initialise ADC of AVR
+//
+// Calling Sequence
+// AVRADCSetup(uint8 prescaler, uint8 adc_ref)
+//
+// Parameters
+// prescaler: prescaler to be used for generating ADC clock (0-7)
+// adc_ref : reference voltage to be used for ADC conversion
+// 0 -> Voltage on VREF pin
+// 1 -> Voltage on AVCC pin
+// 2 -> Internal 2.56 reference voltage
+//
+// Description
+// This function initialises ADc of AVR with given parameters. 'prescaler' is
+// needed for deciding ADC clock. ADC clock should be between 50KHz and 200KHz
+// and it given as (MCU clock/2^prescaler). Select appropriate prescaler depending
+// on MCU clock. 'adc_ref' selects one of the available reference voltage sources
+// available
+// Examples
+// AVRADCSetup(128,0)
+// See also
+// AVRReadADC
+//
+// Authors
+// Siddhesh Wani Ashish Kamble
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+
+if(prescaler>=8)
+disp("Error : Invalid input argument ''prescaler'' in AVRADCSetup function.");
+end
+if(adc_ref>=3) then
+disp("Error : Invalid input argument ''adc_ref'' in AVRADCSetup function.");
+end
+endfunction
diff --git a/macros/Hardware/AVR/AVRDigitalIn.sci b/macros/Hardware/AVR/AVRDigitalIn.sci
new file mode 100644
index 00000000..54eb327b
--- /dev/null
+++ b/macros/Hardware/AVR/AVRDigitalIn.sci
@@ -0,0 +1,50 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+
+function state = AVRDigitalIn(port,pin)
+// Function to get state (high\low) of a digital input pin on AVR
+//
+// Calling Sequence
+// state=AVRDigitalIn(port,pin)
+//
+// Parameters
+// port : port of microcontroller to be used
+// pin : pin of port (mentioned above) to be used
+// Returns
+// state : state of an input pin (HIGH\LOW)
+//
+// Description
+// Each AVR microcontroller has pins which can be configured as digital
+// inputs. These are normally divided among some 'ports' (group of pins).
+// User has to select one of these port and which pin of that port as
+// digital input.
+//
+// Examples
+// pinA0 = AVRDigitalIn(1,0) //To read state on pin 0 of port A
+//
+// See also
+// AVRDigitalOut AVRDigitalSetup
+//
+//
+// Authors
+// Siddhesh Wani Ashish Kamble
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+
+if((port==0)|(port>=5)) then
+disp("Error : Inavalid input argument ''port'' in AVRDigitalIn function.");
+end
+if(pin>=8) then
+disp("Error : Inavalid input argument ''pin'' in AVRDigitalIn function.");
+end
+state = 0;
+endfunction
diff --git a/macros/Hardware/AVR/AVRDigitalOut.sci b/macros/Hardware/AVR/AVRDigitalOut.sci
new file mode 100644
index 00000000..a86a5aa9
--- /dev/null
+++ b/macros/Hardware/AVR/AVRDigitalOut.sci
@@ -0,0 +1,51 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRDigitalOut(port,pin,state)
+// Function to change state (high\low) of a digital output pin on AVR
+//
+// Calling Sequence
+// AVRDigitalOut(port,pin,state)
+//
+// Parameters
+// port : port of microcontroller to be used
+// pin : pin of port (mentioned above) to be used
+// state : state to be outputed on pin (HIGH\LOW)
+//
+// Description
+// Each AVR microcontroller has pins which can be configured as digital
+// outputs. These are normally divided among some 'ports' (group of pins).
+// User has to select one of these port and which pin of that port as
+// digital output. Also, desired output state must be specified as
+// 'HIGH' or 'LOW'.
+//
+// Examples
+// AVRDigitalOut('A',0,HIGH)
+//
+// See also
+// AVRDigitalIn
+//
+//
+// Authors
+// Siddhesh Wani Ashish Kamble
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+
+if((port==0)|(port>=8)) then
+disp("Error : Inavalid input argument ''port'' in AVRDigitalOut function.");
+end
+if(pin>=8) then
+disp("Error : Invalid input argument ''pin'' in AVRDigitalOut function.");
+end
+if(state>=2) then
+disp("Error : Invalid input argument ''state'' in AVRDigitalOut function.");
+end
+endfunction
diff --git a/macros/Hardware/AVR/AVRDigitalPortSetup.sci b/macros/Hardware/AVR/AVRDigitalPortSetup.sci
new file mode 100644
index 00000000..5f0b9671
--- /dev/null
+++ b/macros/Hardware/AVR/AVRDigitalPortSetup.sci
@@ -0,0 +1,47 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRDigitalPortSetup(port,direction)
+// Function to decide direction of port on AVR
+//
+// Calling Sequence
+// AVRDigitalPortSetup(port,direction)
+//
+// Parameters
+// port : port of microcontroller to be used(1 for PORTA, 2 for PORTB,...)
+// direction : direction to be set for pin (0 for INPUT, 1 for OUTPUT)
+//
+// Description
+// Each AVR microcontroller has pins which can be configured as digital
+// outputs/inputs. These are normally divided among some 'ports' (group of pins).
+// User has to select one of these port and which pin of that port to be
+// used as digital output/input. Also, desired direction must be specified as
+// 'INPUT' or 'OUTPUT'.
+//
+// Examples
+// AVRDigitalPortSetup(1,0); //This function will make PortA as input port
+//
+// See also
+// AVRDigitalIn AVRDigitalOut
+//
+//
+// Authors
+// Siddhesh Wani Ashish Kamble
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+
+if((port==0)|(port>=5)) then
+disp("Error : Invalid input argument ''port'' in AVRDigitalPortSetup function.");
+end
+if(direction>=2) then
+disp("Error : Invalid input argument ''direction'' in AVRDigitalPortSetup function.");
+end
+endfunction
diff --git a/macros/Hardware/AVR/AVRDigitalSetup.sci b/macros/Hardware/AVR/AVRDigitalSetup.sci
new file mode 100644
index 00000000..e707d4fa
--- /dev/null
+++ b/macros/Hardware/AVR/AVRDigitalSetup.sci
@@ -0,0 +1,51 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRDigitalSetup(port,pin,direction)
+// Function to decide direction of a digital pin on AVR
+//
+// Calling Sequence
+// AVRDigitalSetup(port,pin,direction)
+//
+// Parameters
+// port : port of microcontroller to be used
+// pin : pin of port (mentioned above) to be used
+// direction : direction to be set for pin (INPUT\OUTPUT)
+//
+// Description
+// Each AVR microcontroller has pins which can be configured as digital
+// outputs/inputs. These are normally divided among some 'ports' (group of pins).
+// User has to select one of these port and which pin of that port to be
+// used as digital output/input. Also, desired direction must be specified as
+// 'INPUT' or 'OUTPUT'.
+//
+// Examples
+// AVRDigitalSetup('A',0,OUTPUT)
+//
+// See also
+// AVRDigitalIn AVRDigitalOut
+//
+//
+// Authors
+// Siddhesh Wani Ashish Kamble
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+
+if((port==0)|(port>=5)) then
+disp("Error : Invalid input argument ''port'' in AVRDigitalSetup function.");
+end
+if(pin>=8) then
+disp("Error : Invalid input argument ''pin'' in AVRDigitalSetup function.");
+end
+if(direction>=2) then
+disp("Error : Invalid input argument ''direction'' in AVRDigitalSetup function.");
+end
+endfunction
diff --git a/macros/Hardware/AVR/AVRGetTimerValue.sci b/macros/Hardware/AVR/AVRGetTimerValue.sci
new file mode 100644
index 00000000..afb47ac8
--- /dev/null
+++ b/macros/Hardware/AVR/AVRGetTimerValue.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function count = AVRGetTimerValue(timer)
+// Function to get timer count
+//
+// Parameters
+// timer : timer whose current count is to be returned
+// 0 for timer0
+// 1 for timer1
+// 2 for timer2
+//
+// Description
+// This function returns the count value of a desired timer.By knowing the count value
+// certain interrupt action can be taken.
+//
+// Examples
+// AVRGetTimerValue(0); //returns present count of the TCNT0 counter
+//
+// See also
+// AVRTimerSetup
+//
+// Authors
+// Ashish Kamble
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+
+if(timer>=3) then
+disp("Error : Invalid input argument ''timer'' in AVRGetTimerValue function.");
+end
+count = 0;
+endfunction
diff --git a/macros/Hardware/AVR/AVRPWM0SetDuty.sci b/macros/Hardware/AVR/AVRPWM0SetDuty.sci
new file mode 100644
index 00000000..604d2f40
--- /dev/null
+++ b/macros/Hardware/AVR/AVRPWM0SetDuty.sci
@@ -0,0 +1,35 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRPWM0SetDuty(duty)
+//Function to Set Duty cycle of PWM Output generated by Timer0 at OC0 pin.
+//Parameters
+// duty : It holds an integer value from 0 to 100 which sets the percentage
+// of time for which signal is active.
+//Description
+// Each Micro controller has PWM output pins which can generate varying voltage
+// from 0V-5V.In this function by varying the duty cycle, varying voltage can be
+// produced.
+//Example
+// AVRPWM0SetDuty(50); //Produces 2.5V at OC0 pin
+// AVRPWM0SetDuty(0); //Produces 0V at OC0 pin
+//See also
+// AVRPWM0Setup
+//
+//Authors
+// Ashish Kamble
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+
+if(duty>100) then
+disp("Error : Invalid input argument ''duty'' in AVRPWM0SetDuty function.");
+end
+endfunction
diff --git a/macros/Hardware/AVR/AVRPWM0Setup.sci b/macros/Hardware/AVR/AVRPWM0Setup.sci
new file mode 100644
index 00000000..39861c86
--- /dev/null
+++ b/macros/Hardware/AVR/AVRPWM0Setup.sci
@@ -0,0 +1,68 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRPWM0Setup(waveform_mode,output_mode)
+//Function to Setup OC0 pin for required PWM mode
+//Description
+// Every Micro controller has PWM pins which can generate varying voltages
+// from 0V-5V.This function helps to use OC0 pin to produce required
+// output waveform by setting the waveform mode and otput mode.
+//
+//Parameters
+// waveform_mode:
+// 0 for Phase correct PWM Mode
+// 1 for Fast PWM Mode
+// 2 for CTC Mode
+// output_mode:
+// For Phase Correct PWM Mode:
+// 0 for Clear OC0 on compare match when up-counting. Set OC0 on compare
+// match when down-counting.
+// 1 for Set OC0 on compare match when up-counting. Clear OC0 on compare
+// match when down-counting.
+//
+// For Fast PWM Mode:
+// 0 for non-inverted output i.e Clear OC0 on compare match, set OC0 at BOTTOM.
+// 1 for inverted output i.e Set OC0 on compare match, clear OC0 at BOTTOM.
+//
+// For CTC Mode:
+// 0 to Clear OC0 on compare match
+// 1 to Set OC0 on compare match
+// 2 to toggle OC0 on compare match
+//
+//Example
+// AVRPWM0Setup(2,0); //This function will select CTC waveform mode and will clear OC0 on
+// compare match
+//See also
+// AVRPWM0SetDuty
+//
+//Authors
+// Ashish Kamble
+//
+//This is curretly dummy function. It provides no functionality but is required
+//for providing support for generating C code for AVR.
+
+if(waveform_mode>=3) then
+disp("Error : Invalid input argument ''waveform_mode'' in AVRPWM0Setup function.");
+end
+
+if((waveform_mode==0)|(waveform_mode==1)) then
+ if(output_mode>=2) then
+ disp("Error : Invalid input argument ''output_mode'' in AVRPWM0Setup function.");
+ end
+end
+
+
+if(waveform_mode==2) then
+ if(output_mode>=3) then
+ disp("Error : Invalid input argument ''output_mode'' in AVRPWM0Setup function.");
+ end
+end
+
+endfunction
diff --git a/macros/Hardware/AVR/AVRPWM1SetDuty.sci b/macros/Hardware/AVR/AVRPWM1SetDuty.sci
new file mode 100644
index 00000000..60dc0a9f
--- /dev/null
+++ b/macros/Hardware/AVR/AVRPWM1SetDuty.sci
@@ -0,0 +1,52 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRPWM1SetDuty(output_pin,duty,Top_Value)
+//Function to Set Duty cycle of PWM Output generated by Timer1 at OC1A or OC1B pin.
+//Parameters
+// ouput_pin:
+// 0 for selecting OC1A as output pin
+// 1 for selecting OC1B as output pin
+//
+// duty: It holds an integer value from 0 to 100 which sets the percentage
+// of time for which signal is active.
+//
+// Top_Value: It holds an integer value from 0 to 65535.This value sets the Top
+// value of the counter TCNT1 i.e ICR.(for more info refer datasheet)
+//
+//Description
+// Each Micro controller has PWM output pins which can generate varying voltage
+// from 0V-5V.This function Sets the duty cycle of output PWM signal.Also this function
+// decides the Top Vale of TCNT1 and the output pin to output PWM signal.
+//
+//Example
+// AVRPWM1SetDuty(0,50,40000); //This function will produce PWM signal of 50% duty
+// cycle on OC1A pin and TCNT1 will reset at 40000 instead
+// at 65535.
+//
+//See also
+// AVRPWM1Setup
+//
+//Authors
+// Ashish Kamble
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+
+if(output_pin>=2) then
+disp("Error : Invalid input argument ''output_pin'' in AVRPWM1SetDuty function.");
+end
+if(duty>100) then
+disp("Error : Invalid input argument ''duty'' in AVRPWM1SetDuty function.");
+end
+if(Top_Value>65535) then
+disp("Error : Invalid input argument ''Top_Value'' in AVRPWM1Setduty function.");
+end
+endfunction
diff --git a/macros/Hardware/AVR/AVRPWM1Setup.sci b/macros/Hardware/AVR/AVRPWM1Setup.sci
new file mode 100644
index 00000000..51aa25b1
--- /dev/null
+++ b/macros/Hardware/AVR/AVRPWM1Setup.sci
@@ -0,0 +1,79 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRPWM1Setup(waveform_mode,output_mode,output_pin)
+//Function to Setup OC1A or OC1B pin for required PWM mode
+//Description
+// Every Micro controller has PWM pins which can generate varying voltages
+// from 0V-5V.This function helps to use OC1A or OC1B pin to produces required
+// output waveform by setting the waveform mode and otput mode.
+//
+//Parameters
+// waveform_mode:
+// 0 for Phase correct PWM Mode
+// 1 for Fast PWM Mode
+// 2 for CTC Mode
+//
+// output_mode:
+// For Phase Correct PWM Mode:
+// 0 for Clear OC1A or OC1B on compare match when up-counting. Set OC1A or OC1B
+// on compare match when down-counting.
+// 1 for Set OC1A or OC1B on compare match when up-counting. Clear OC1A or OC1B
+// on compare match when down-counting.
+//
+// For Fast PWM Mode:
+// 0 for non-inverted output i.e Clear OC1A or OC1B on compare match, set OC1A
+// OC1B at BOTTOM.
+// 1 for inverted output i.e Set OC1A or OC1B on compare match, clear OC1A or OC1B
+// at BOTTOM.
+//
+// For CTC Mode:
+// 0 to Clear OC1A or OC1B on compare match
+// 1 to Set OC1A or OC1B on compare match
+// 2 to toggle OC1A or OC1B on compare match
+//
+// output_pin:
+// 0 for selecting OC1A as output pin
+// 1 for selecting OC1B as output pin
+//
+//Example
+// AVRPWM1Setup(2,0,0); //This function will select CTC mode and will clear OC1A or OC1B
+// on compare match.Also as defined the output will be produced at
+// 0C1A pin.
+//See also
+// AVRPWM1SetDuty
+//
+//Authors
+// Ashish Kamble
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+
+if(waveform_mode>=3) then
+disp("Error : Invalid input argument ''waveform_mode'' in AVRPWM1Setup function.");
+end
+if(waveform_mode==0|waveform_mode==1) then
+{
+ //if((type(output_mode)~=8)|(output_mode>=2)) then
+ //disp("Error : Invalid input argument ''output_mode'' in AVRPWM1Setup function.");
+ //end
+}
+end
+if(waveform_mode==2) then
+{
+ if((type(output_mode)~=8)|(output_mode>=3)) then
+ disp("Error : Invalid input argument ''output_mode'' in AVRPWM1Setup function.");
+ end
+}
+end
+if(output_pin>=2) then
+disp("Error : Invalid input argument ''output_pin'' in AVRPWM1Setup function.");
+end
+endfunction
diff --git a/macros/Hardware/AVR/AVRPWM2SetDuty.sci b/macros/Hardware/AVR/AVRPWM2SetDuty.sci
new file mode 100644
index 00000000..929c1a0a
--- /dev/null
+++ b/macros/Hardware/AVR/AVRPWM2SetDuty.sci
@@ -0,0 +1,38 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRPWM2SetDuty(duty)
+//Function to Set Duty cycle of PWM Output generated by Timer2 at OC2 pin.
+//Description
+// Each Micro controller has PWM output pins which can generate varying voltage
+// from 0V-5V.In this function by varying the duty cycle, varying voltage can be
+// produced.
+//
+//Parameters
+// duty : It holds an integer value from 0 to 100 which sets the percentage
+// of time for which signal is active.
+//
+//Example
+// AVRPWM2SetDuty(50); //Produces 2.5V at OC2 pin
+// AVRPWM2SetDuty(0); //Produces 0V at OC2 pin
+//
+//See also
+// AVRPWM2Setup
+//
+//Authors
+// Ashish Kamble
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+
+if(duty>100) then
+disp("Error : Invalid input argument ''duty'' in AVRPWM2SetDuty function.");
+end
+endfunction
diff --git a/macros/Hardware/AVR/AVRPWM2Setup.sci b/macros/Hardware/AVR/AVRPWM2Setup.sci
new file mode 100644
index 00000000..d4bc74a6
--- /dev/null
+++ b/macros/Hardware/AVR/AVRPWM2Setup.sci
@@ -0,0 +1,69 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRPWM2Setup(waveform_mode,output_mode)
+//Function to Setup OC2 pin for required PWM mode
+//Description
+// Every Micro controller has PWM pins which can generate varying voltages
+// from 0V-5V.This function helps to use OC2 pin to produces required
+// output waveform by setting the waveform mode and otput mode.
+//
+//Parameters
+// waveform_mode:
+// 0 for Phase correct PWM Mode
+// 1 for Fast PWM Mode
+// 2 for CTC Mode
+//output_mode:
+// For Phase Correct PWM Mode:
+// 0 for Clear OC2 on compare match when up-counting. Set OC2 on compare
+// match when down-counting.
+// 1 for Set OC2 on compare match when up-counting. Clear OC2 on compare
+// match when down-counting.
+//
+// For Fast PWM Mode:
+// 0 for non-inverted output i.e Clear OC2 on compare match, set OC2 at BOTTOM.
+// 1 for inverted output i.e Set OC2 on compare match, clear OC2 at BOTTOM.
+//
+// For CTC Mode:
+// 0 to Clear OC2 on compare match
+// 1 to Set OC2 on compare match
+// 2 to toggle OC2 on compare match
+//
+//Example
+// AVRPWM2Setup(2,0); //This function will select CTC waveform mode and will clear OC2 on
+// compare match
+//See also
+// AVRPWM2SetDuty
+//
+//Authors
+// Ashish Kamble
+//
+//This is curretly dummy function. It provides no functionality but is required
+//for providing support for generating C code for AVR.
+
+if(waveform_mode>=3) then
+disp("Error : Invalid input argument ''waveform_mode'' in AVRPWM2Setup function.");
+end
+if((waveform_mode==0)|(waveform_mode==1)) then
+{
+ //if((type(output_mode)~=8)|(output_mode>=2)) then
+ //disp("Error : Invalid input argument ''output_mode'' in AVRPWM2Setup function.");
+ //end
+}
+end
+if(waveform_mode==2) then
+{
+ if((type(output_mode)~=8)|(output_mode>=3)) then
+ disp("Error : Invalid input argument ''output_mode'' in AVRPWM2Setup function.");
+ end
+}
+end
+
+endfunction
diff --git a/macros/Hardware/AVR/AVRReadADC.sci b/macros/Hardware/AVR/AVRReadADC.sci
new file mode 100644
index 00000000..7fd3e67e
--- /dev/null
+++ b/macros/Hardware/AVR/AVRReadADC.sci
@@ -0,0 +1,44 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function adc_result = AVRReadADC(channel)
+// Function to get voltage on analog pin on AVR
+//
+// Calling Sequence
+// u8AVRReadADCs(channel)
+//
+// Parameters
+// channel : Select which channel is to be read. Values from 0-7 select one
+// of the pins ADC0-ADC7. For other possible channel values refer
+// datasheet
+// Returns->
+// result : Digital value for the voltage present on channel selected
+//
+// Description
+// This function returns digital value for present on adc pins. 'channel'
+// selects which of the ADC0-ADC7 is to be used for reading analog value.
+// Apart from reading just ADC0-ADC7 other it can also read differential
+// voltages between some pins. For channel values for those options, please
+// refer datasheet.
+//
+// Examples
+// adc_result = u8AVRReadADC(0) //Read ADC0
+//
+// Authors
+// Siddhesh Wani Ashish Kamble
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+
+if(channel>=8) then
+disp("Error : Inavlid input argument ''channel'' in AVRReadADC function.");
+end
+adc_result = 0; //adc_result has been initialised to avoid runtime error.
+endfunction
diff --git a/macros/Hardware/AVR/AVRSleep.sci b/macros/Hardware/AVR/AVRSleep.sci
new file mode 100644
index 00000000..a1b6add2
--- /dev/null
+++ b/macros/Hardware/AVR/AVRSleep.sci
@@ -0,0 +1,4 @@
+function AVRSleep(delay)
+
+
+endfunction
diff --git a/macros/Hardware/AVR/AVRTimerSetup.sci b/macros/Hardware/AVR/AVRTimerSetup.sci
new file mode 100644
index 00000000..7c5dd1da
--- /dev/null
+++ b/macros/Hardware/AVR/AVRTimerSetup.sci
@@ -0,0 +1,56 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRTimerSetup(timer,prescaler,clock_source)
+//Function to setup Timers in ATmega16
+//Descrpition:
+// This function tells the micro controller which clock source you will be using.
+// The timer value and prescaler value passed in this function setup the timer as per
+// your requirement.
+//
+//Parameters:
+// timer : It is an integer value.
+// 0 to setup timer0
+// 1 to setup timer1
+// 2 to setup timer2
+// prescaler : It is an integer value.
+// 1 for no prescaling i.e clock will run at max 16Hz frequency
+// 8 for prescaling clock by 8 i.e new clock frequency will be (clk/8)
+// 64 for prescaling clock by 64 i.e new clock frequency will be (clk/64)
+// 256 for prescaling clock by 256 i.e new clock frequency will be (clk/256)
+// 1024 for prescaling clock by 1024 i.e new clock frequency will be (clk/1024)
+// clock_source : It is an integer value.
+// 0 if you are using internal clock source
+// 1 if you are using external clock source
+//Example
+// AVRTimerSetup(0,64,0); //This function will select timer0 with timer running as per
+// internal clock source and prescaled by 64.
+//
+//See also
+// AVRGetTimerValues
+//
+//Authors
+// Ashish Kamble
+//
+//This is curretly dummy function. It provides no functionality but is required
+//for providing support for generating C code for AVR.
+
+if(timer>=3) then
+disp("Error : Invalid input argument ''timer'' in AVRTimerSetup function.");
+end
+
+if(~((prescaler==1)|(prescaler==8)|(prescaler==64)|(prescaler==256)|(prescaler==1024))) then
+disp("Error : Invalid input argument ''prescaler'' in AVRTimerSetup function.");
+end
+
+if(clock_source>=2) then
+disp("Error : Invalid input argument ''clock_source'' in AVRTimerSetup function.");
+end
+endfunction
diff --git a/macros/Hardware/AVR/AVRUARTReceive.sci b/macros/Hardware/AVR/AVRUARTReceive.sci
new file mode 100644
index 00000000..790894fb
--- /dev/null
+++ b/macros/Hardware/AVR/AVRUARTReceive.sci
@@ -0,0 +1,30 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function received = AVRUARTReceive()
+// Function to Receive Char value send to ATmega16 using UART or USART.
+// Description
+// This function Receives Char as 8 bit value.This value is stored in UDR at receiving
+// end.
+//
+//Examples
+// state = AVRUARTReceive(); //This function will Receive char and return the entire value
+//
+//See also
+// AVRUARTSetup
+// AVRUARTTransmit
+//
+// Authors
+// Ashish Kamble
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+received = 0; // received has been initialised to avoid runtime error.
+endfunction
diff --git a/macros/Hardware/AVR/AVRUARTSetup.sci b/macros/Hardware/AVR/AVRUARTSetup.sci
new file mode 100644
index 00000000..32e5db86
--- /dev/null
+++ b/macros/Hardware/AVR/AVRUARTSetup.sci
@@ -0,0 +1,61 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRUARTSetup(mode, baudrate, stopbits, parity)
+// Function to Setup Serial Communication i.e UART or USART in ATmega16.
+// Description
+// This function Setup the UART or USART for Serial Communicaion between ATmega16
+// and different micro controllers or between ATmega16 and Computer.
+//
+// Parameters
+// mode :
+// 0 for Asynchronous Normal mode
+// 1 for Asynchronous Double Speed mode
+// 2 for Synchronous mode
+//
+// baudrate : Enter one of the following available baudrates
+// 2400 , 4800 , 9600 , 14400 , 19200 , 28800 , 38400 , 57600 ,
+// 768000 , 115200 , 230400 , 250000 , 1000000 .
+//
+// stopbits :
+// 0 for one stopbit
+// 1 for two stopbits
+//
+// parity :
+// 0 for parity disabled
+// 1 for even parity
+// 2 for odd parity
+//
+//Examples
+// AVRUARTSetup(0,9600,0,0); //This function will enable UART Communication for ATmega16
+// with 9600 as baudrate,one stop bit and parity disabled
+// See also
+// AVRUARTTransmit
+// AVRUARTReceive
+//
+// Authors
+// Ashish Kamble
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+if(mode>=3) then
+disp("Error : Invalid input argument ''mode'' in AVRUARTSetup function.");
+end
+
+if((baudrate <> 2400)&(baudrate <> 4800)&(baudrate <> 9600)&(baudrate <> 14400)&(baudrate <> 28800)&(baudrate <> 38400)&(baudrate <> 57600)&(baudrate <> 768000)&(baudrate <> 115200)&(baudrate <> 230400)&(baudrate <> 250000)& (baudrate <> 1000000)) then
+disp("Error : Invalid input argument ''baudrate'' in AVRUARTSetup function.");
+end
+if(stopbits>=2) then
+disp("Error : Invalid input argument ''stopbits'' in AVRUARTSetup function.");
+end
+if(parity>=3) then
+disp("Error : Invalid input argument ''parity'' in AVRUARTSetup function.");
+end
+endfunction
diff --git a/macros/Hardware/AVR/AVRUARTTransmit.sci b/macros/Hardware/AVR/AVRUARTTransmit.sci
new file mode 100644
index 00000000..eb358499
--- /dev/null
+++ b/macros/Hardware/AVR/AVRUARTTransmit.sci
@@ -0,0 +1,33 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRUARTTransmit(data)
+// Function to Transmit data using UART or USART.
+// Description
+// This function Tranmits data over UART or USART.The data to be transmitted can
+// be a Char , String , Unsigned Int, Signed Int.
+//
+// Parameter
+// data :
+// The data to be transmitted can be a Char,String,Unsigned Int,Signed Int.
+//
+//Examples
+// AVRUARTTransmit("This is example"); //This function will transmit the entered string.
+//
+//See also
+// AVRUARTSetup
+// AVRUARTReceive
+//
+// Authors
+// Ashish Kamble
+//
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for AVR.
+endfunction
diff --git a/macros/Hardware/AVR/GetAVRSupportFunctions.sci b/macros/Hardware/AVR/GetAVRSupportFunctions.sci
new file mode 100644
index 00000000..99c6242f
--- /dev/null
+++ b/macros/Hardware/AVR/GetAVRSupportFunctions.sci
@@ -0,0 +1,43 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function AVRSupportFunctions = GetAVRSupportFunctions()
+// -----------------------------------------------------------------
+// Get list of AVR peripherals supported
+//
+// Input data:
+// None
+//
+// Output data:
+// None
+//
+// Author: Siddhesh Wani Ashish Kamble
+// -----------------------------------------------------------------
+
+AVRSupportFunctions = [
+ "AVRADCSetup"
+ "AVRDigitalIn"
+ "AVRDigitalOut"
+ "AVRDigitalSetup"
+ "AVRDigitalPortSetup"
+ "AVRTimerSetup"
+ "AVRGetTimerValue"
+ "AVRPWM0Setup"
+ "AVRPWM0SetDuty"
+ "AVRPWM1Setup"
+ "AVRPWM1SetDuty"
+ "AVRPWM2Setup"
+ "AVRPWM2SetDuty"
+ "AVRReadADC"
+ "AVRSleep"
+ "AVRUARTSetup"
+ ];
+
+endfunction
diff --git a/macros/Hardware/AVR/GetPeripheral.sci b/macros/Hardware/AVR/GetPeripheral.sci
new file mode 100644
index 00000000..ac909deb
--- /dev/null
+++ b/macros/Hardware/AVR/GetPeripheral.sci
@@ -0,0 +1,31 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function Peripheral = GetPeripheral(FunName,InArg)
+// -----------------------------------------------------------------
+// Get an acronym for peripheral being used to be inserted in list of
+// used peripherals
+//
+// Input data:
+// FunName: Name of the function to be checked
+// InArg:Input arguements passed to function 'FunName'
+//
+// Output data:
+// Peripheral: Acronym for peripheral to be initialised
+//
+// Author: Siddhesh Wani
+// -----------------------------------------------------------------
+
+//select FunName
+
+//case AVRDigitalOut:
+// Peripheral = list('PORT', InArg(1),InArg(2)];
+//end
+endfunction
diff --git a/macros/Hardware/AVR/InsertPeripheralInList.sci b/macros/Hardware/AVR/InsertPeripheralInList.sci
new file mode 100644
index 00000000..198ea1da
--- /dev/null
+++ b/macros/Hardware/AVR/InsertPeripheralInList.sci
@@ -0,0 +1,27 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function InsertPeripheralInList(Peripheral,PeripheralListFile)
+// -----------------------------------------------------------------
+// Insert input peripheral in peripherals' list
+//
+// Input data:
+// Peripheral: Peripheral of type 'list' to be instertd in list
+// PeripheralListFile: Name of file containing list of peripheral used
+//
+// Output data:
+// None
+//
+// Author: Siddhesh Wani
+// -----------------------------------------------------------------
+
+load(PeripheralListFile,'PheripheralList');
+
+endfunction
diff --git a/macros/Hardware/AVR/IsAVRSupportFunction.sci b/macros/Hardware/AVR/IsAVRSupportFunction.sci
new file mode 100644
index 00000000..94f4af7c
--- /dev/null
+++ b/macros/Hardware/AVR/IsAVRSupportFunction.sci
@@ -0,0 +1,32 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function Output = IsAVRSupportFunction(FunName)
+// -----------------------------------------------------------------
+// Check whether input function name is an AVR 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 an AVR
+// support functions or not
+//
+// Author: Siddhesh Wani
+// -----------------------------------------------------------------
+
+//Get list of supported functions for AVR
+AVRSupportFunctions = GetAVRSupportFunctions();
+
+//Check whether input function is present in above list or not
+FunNameInAVRSupport = members(FunName,AVRSupportFunctions);
+Output = bool2s(FunNameInAVRSupport~=0);
+
+endfunction
diff --git a/macros/Hardware/AVR/buildmacros.sce b/macros/Hardware/AVR/buildmacros.sce
new file mode 100644
index 00000000..2954a424
--- /dev/null
+++ b/macros/Hardware/AVR/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/AVR/lib b/macros/Hardware/AVR/lib
new file mode 100644
index 00000000..7631c354
Binary files /dev/null and b/macros/Hardware/AVR/lib differ
diff --git a/macros/Hardware/AVR/names b/macros/Hardware/AVR/names
new file mode 100644
index 00000000..8fcfdb75
--- /dev/null
+++ b/macros/Hardware/AVR/names
@@ -0,0 +1,22 @@
+AVRADCSetup
+AVRDigitalIn
+AVRDigitalOut
+AVRDigitalPortSetup
+AVRDigitalSetup
+AVRGetTimerValue
+AVRPWM0SetDuty
+AVRPWM0Setup
+AVRPWM1SetDuty
+AVRPWM1Setup
+AVRPWM2SetDuty
+AVRPWM2Setup
+AVRReadADC
+AVRSleep
+AVRTimerSetup
+AVRUARTReceive
+AVRUARTSetup
+AVRUARTTransmit
+GetAVRSupportFunctions
+GetPeripheral
+InsertPeripheralInList
+IsAVRSupportFunction
diff --git a/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci b/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci
new file mode 100644
index 00000000..3e6397b2
--- /dev/null
+++ b/macros/Hardware/RasberryPi/GetRPISupportFunctions.sci
@@ -0,0 +1,48 @@
+function RPiSupportFunctions = GetRPISupportFunctions()
+// -----------------------------------------------------------------
+// Get list of RPI peripherals supported
+//
+// Input data:
+// None
+//
+// Output data:
+// None
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+//
+// -----------------------------------------------------------------
+
+RPiSupportFunctions = [
+ "RPI_DigitalIn"
+ "RPI_DigitalOut"
+ "RPI_DigitalSetup"
+ "RPI_DelayMilli"
+ "RPI_DelayMicro"
+ "RPI_GetMillis"
+ "RPI_GetMicros"
+ "RPI_SerialSetup"
+ "RPI_SerialClose"
+ "RPI_SerialSendChar"
+ "RPI_SerialFlush"
+ "RPI_SerialGetChar"
+ "RPI_ThreadCreate"
+ "RPI_PinISR"
+ "RPI_HardPWMWrite"
+ "RPI_HardPWMSetRange"
+ "RPI_HardPWMSetClock"
+ "RPI_HardPWMSetMode"
+ ];
+
+//Note: "RPI_SerialSendData" is removed since distinction between input data
+//types is required
+
+
+endfunction
diff --git a/macros/Hardware/RasberryPi/IsRPISupportFunction.sci b/macros/Hardware/RasberryPi/IsRPISupportFunction.sci
new file mode 100644
index 00000000..c6a2c365
--- /dev/null
+++ b/macros/Hardware/RasberryPi/IsRPISupportFunction.sci
@@ -0,0 +1,32 @@
+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
+//
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+//
+// -----------------------------------------------------------------
+
+//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/RPI_DelayMicro.sci b/macros/Hardware/RasberryPi/RPI_DelayMicro.sci
new file mode 100644
index 00000000..bbb0bb3b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_DelayMicro.sci
@@ -0,0 +1,38 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+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_DelayMilli.sci b/macros/Hardware/RasberryPi/RPI_DelayMilli.sci
new file mode 100644
index 00000000..13b79625
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_DelayMilli.sci
@@ -0,0 +1,39 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_DelayMilli(time)
+// Function to insert some delay in milli seconds 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/RPI_DigitalIn.sci b/macros/Hardware/RasberryPi/RPI_DigitalIn.sci
new file mode 100644
index 00000000..781c49c8
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_DigitalIn.sci
@@ -0,0 +1,43 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+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
+//
+// -----------------------------------------------------------------
+//Pins of header P1 which can be used as GPIO
+supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
+ 31,31,33,35,36,37,38,40];
+
+PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
+
+//If given pin does not support GPIO functionality, raise the error
+if(PinIsGPIO == 0)
+ error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
+end
+state = 1;
+endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalOut.sci b/macros/Hardware/RasberryPi/RPI_DigitalOut.sci
new file mode 100644
index 00000000..dde3c934
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_DigitalOut.sci
@@ -0,0 +1,44 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+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
+//
+// -----------------------------------------------------------------
+//Pins of header P1 which can be used as GPIO
+supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
+ 31,31,33,35,36,37,38,40];
+
+PinIsGPIO = members(pin, supported_pins); //Check if output pin supports GPIO
+
+//If given pin does not support GPIO functionality, raise the error
+if(PinIsGPIO == 0)
+ error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
+end
+state = 1;
+
+endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci b/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
new file mode 100644
index 00000000..01d6e07d
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
@@ -0,0 +1,36 @@
+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, 2->PWM 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(3,0) //Sets pin 3 of header P1 as input
+//
+// See also
+// RPI_DigitalIn RPI_DigitalOut
+//
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+//Pins of header P1 which can be used as GPIO
+supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
+ 31,31,33,35,36,37,38,40];
+
+PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
+
+//If given pin does not support GPIO functionality, raise the error
+if(PinIsGPIO == 0)
+ error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
+end
+state = 1;
+
+endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_GetMicros.sci b/macros/Hardware/RasberryPi/RPI_GetMicros.sci
new file mode 100644
index 00000000..6c4db57a
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_GetMicros.sci
@@ -0,0 +1,39 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function Micros = RPI_GetMicros()
+// Function to get time in Microsecond since first setup function called.
+//
+// Calling Sequence
+// Micros = RPI_GetMicros()
+//
+// Parameters
+// Micros: time in Microseconds since first setup function called
+//
+// Description
+// This function can be used to get time since first setup function called.
+// Note: To use this function atleast one setup function must be called.
+//
+// Examples
+// start = RPI_GetMicros()
+// RPI_DelayMicro(1000) //This will delay the execution of next code by 100 ms.
+// end = RPI_GetMicros()
+// delay = end- start //This should be approximately 1000 us.
+//
+// See also
+// RPI_GetMillis RPI_DelayMilli 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.
+Micros = 0;
+endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_GetMillis.sci b/macros/Hardware/RasberryPi/RPI_GetMillis.sci
new file mode 100644
index 00000000..c034a705
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_GetMillis.sci
@@ -0,0 +1,39 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function Millis = RPI_GetMillis()
+// Function to get time in millisecond since first setup function called.
+//
+// Calling Sequence
+// Millis = RPI_GetMillis()
+//
+// Parameters
+// Millis: time in milliseconds since first setup function called
+//
+// Description
+// This function can be used to get time since first setup function called.
+// Note: To use this function atleast one setup function must be called.
+//
+// Examples
+// start = RPI_GetMillis()
+// RPI_DelayMilli(100) //This will delay the execution of next code by 100 ms.
+// end = RPI_GetMillis()
+// delay = end- start //This should be approximately 100ms.
+//
+// See also
+// RPI_GetMicros RPI_DelayMilli 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.
+Millis = 0;
+endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci b/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci
new file mode 100644
index 00000000..8448d364
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci
@@ -0,0 +1,35 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_HardPWMSetClock(clock_divisor)
+// Function to set PWM clock. PWM clock frequency is 19.2MHz, which can be reduced
+// using suitable clock_divisor (1 to 2048, powers of 2)
+//
+// Calling Sequence
+// RPI_HardPWMSetClock(clock_divisor)
+//
+// Parameters
+// clock_divisor: Value can be from 1 to 2048, powers of 2.
+// Description
+// This function decides pwm clock.
+// PWM frequency = (PWM Clock frequency/Clock divisor/range)
+// PWM clock frequency = 19.2 MHz
+// clock divisor is setup using RPI_HardPWMSetClock
+// range is setup using RPI_HardPWMSetRange
+// Examples
+//
+// See also
+// RPI_HardPWMSetWrite RPI_HardPWMSetRange
+//
+// 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_HardPWMSetMode.sci b/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci
new file mode 100644
index 00000000..57b82601
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci
@@ -0,0 +1,32 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_HardPWMSetMode(pwm_mode)
+// Function to set PWM mode. Two modes are available - balanced and mark/space
+//
+// Calling Sequence
+// RPI_HardPWMSetMode(pwm_mode)
+//
+// Parameters
+// pwm_mode: decides pwm mode
+// 0 -> balanced
+// 1 -> mark/space
+// Description
+// This function decides pwm mode
+// Examples
+//
+// See also
+// RPI_HardPWMSetWrite RPI_HardPWMSetRange
+//
+// 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_HardPWMSetRange.sci b/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci
new file mode 100644
index 00000000..c2075e2d
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci
@@ -0,0 +1,35 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_HardPWMSetRange(range_val)
+// Function to set range value for PWM. Range value along with clock divisor
+// decides pwm frequency. Range value must be less than 1024
+//
+// Calling Sequence
+// RPI_HardPWMSetRange(range_val)
+//
+// Parameters
+// range_val: range for pwm
+// Description
+// This function decides range for pwm.
+// PWM frequency = (PWM Clock frequency/Clock divisor/range)
+// PWM clock frequency = 19.2 MHz
+// clock divisor is setup using RPI_HardPWMSetClock
+// range is setup using RPI_HardPWMSetRange
+// Examples
+//
+// See also
+// RPI_HardPWMSetClock RPI_HardPWMWrite
+//
+// 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_HardPWMWrite.sci b/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci
new file mode 100644
index 00000000..dba5e674
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci
@@ -0,0 +1,39 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_HardPWMWrite(pin,value)
+// Function to change pwm duty on specified pin. Hardware PWM is available
+// only on pin 12. So, only '12' should be provided as pin
+//
+// Calling Sequence
+// RPI_HardPWMWrite(12,512) //Value must be smaller than the range set
+// using RPI_HARDPWMSetRange
+//
+// Parameters
+// pin: pin no on which pwm value is to be changed. Currently only 12 is allowed
+// value: pwm value for given pin. This must be less than range value set
+// Description
+// This function changes pwm duty on specified pin. As for RPi, only one pin
+// (pin 12) is available for hardware PWM.
+// PWM frequency = (PWM Clock frequency/Clock divisor/range)
+// PWM clock frequency = 19.2 MHz
+// clock divisor is setup using RPI_HardPWMSetClock
+// range is setup using RPI_HardPWMSetRange
+// Actual PWM duty = value/range
+// Examples
+//
+// See also
+// RPI_HardPWMSetClock RPI_HardPWMSetRange
+//
+// 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_PinISR.sci b/macros/Hardware/RasberryPi/RPI_PinISR.sci
new file mode 100644
index 00000000..c2354c1f
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_PinISR.sci
@@ -0,0 +1,56 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_PinISR(pin, edgetype, fn)
+// Function to assign a function to be run when an interrupt occurs on
+// specified pin.
+//
+// Calling Sequence
+// RPI_PinISR(pin, edgetype, fn)
+//
+// Parameters
+// pin : pin whose interrupt is to be configured
+// edgetype: edge on which interrupt is to be monitored
+// 1 -> Falling egde
+// 2 -> Rising egde
+// 3 -> Both egde
+// fn: name of the function to be executed on interrupt occurance
+// Description
+// This functions monitors interrupt on specified pin for specified edge,
+// When that interrupt occurs, function specified by 'fn' is executed.
+// Examples
+// RPI_PinISR(12, 0, Pin12ISR) //executes 'Pin12ISR' on falling edge on
+// pin 12
+// See also
+// RPI_ThreadCreate RPI_DigitalSetup
+//
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for RPi.
+
+//Pins of header P1 which can be used as GPIO
+supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
+ 31,31,33,35,36,37,38,40];
+
+PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
+
+//If given pin does not support GPIO functionality, raise the error
+if(PinIsGPIO == 0)
+ error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
+end
+EdgeTypeSupported = members(edgetype,[1 2 3]);
+
+if(EdgeTypeSupported == 0)
+ error(9999, 'SCI2CERROR: Given edgetype is incorrect. Please specify correct edgetype from [1,2,3]')
+end
+
+endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_SerialClose.sci b/macros/Hardware/RasberryPi/RPI_SerialClose.sci
new file mode 100644
index 00000000..f27dd432
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_SerialClose.sci
@@ -0,0 +1,33 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_SerialClose(fd)
+// Function to close serial port specified by file descriptor.
+//
+// Calling Sequence
+// RPI_SerialClose(fd)
+//
+// Parameters
+// fd : file descriptor for opened port
+// Description
+// This functions closes the specified serial port
+// Examples
+// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
+// RPI_SerialClose(serial1)
+// See also
+// RPI_SerialOpen RPI_SerialSendChar
+//
+//
+// 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_SerialFlush.sci b/macros/Hardware/RasberryPi/RPI_SerialFlush.sci
new file mode 100644
index 00000000..9bab386f
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_SerialFlush.sci
@@ -0,0 +1,34 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function data = RPI_SerialGetChar(fd)
+// Function to read data from specified serial port
+//
+// Calling Sequence
+// RPI_SerialGetCharfd)
+//
+// Parameters
+// fd: file descriptor returned when serial port was opened
+// Description
+// This functions reads character form specified port. In case no
+// character is available, -1 is returned after 10 sec.
+// Examples
+// serial = RPI_SetupSerial("/dev/ttyAMA0", 9600);
+// RPI_SerialFlush(serial);
+// bytes = RPI_SerialDataAvail(serial);
+//
+// See also
+// RPI_SetupSerial RPI_SendData
+//
+// 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_SerialGetChar.sci b/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci
new file mode 100644
index 00000000..a26e5b97
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci
@@ -0,0 +1,36 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function data = RPI_SerialGetChar(fd)
+// Function to read data from specified serial port
+//
+// Calling Sequence
+// RPI_SerialGetChar(fd)
+//
+// Parameters
+// fd: file descriptor returned when serial port was opened
+// Description
+// This functions reads character form specified port. In case no
+// character is available, -1 is returned after 10 sec.
+// Examples
+// serial = RPI_SetupSerial("/dev/ttyAMA0", 9600);
+// bytes = RPI_SerialDataAvail(serial);
+// if(bytes>0)
+// data = RPI_SerialGetChar(serial) //Reads single character
+// end
+// See also
+// RPI_SetupSerial RPI_SendData
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for RPi.
+data = 0;
+endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSendChar.sci b/macros/Hardware/RasberryPi/RPI_SerialSendChar.sci
new file mode 100644
index 00000000..769b21d2
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_SerialSendChar.sci
@@ -0,0 +1,37 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_SerialSendChar(fd, data)
+// Function to send 8-bit char through serial port.
+//
+// Calling Sequence
+// RPI_SerialSendChar(fd, data)
+//
+// Parameters
+// fd : file descriptor for opened port
+// data: 8-bit character data to be sent
+// Description
+// This functions sends input 8-bit character data on specified serial port
+// Examples
+// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
+// RPI_SerialSendChar(serial1, 'H');
+// RPI_SerialSendChar(serial1, 'i');
+// RPI_SerialClose(serial1);
+//
+// See also
+// RPI_SerialOpen RPI_SerialClose
+//
+//
+// 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_SerialSendData.sci b/macros/Hardware/RasberryPi/RPI_SerialSendData.sci
new file mode 100644
index 00000000..c05852b1
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_SerialSendData.sci
@@ -0,0 +1,38 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_SerialSendData(fd, data)
+// Function to send data through serial port. Data can be of any datatype and
+// can be scalar or matrix
+//
+// Calling Sequence
+// RPI_SerialSendData(fd, data)
+//
+// Parameters
+// fd : file descriptor for opened port
+// data: data to be sent
+// Description
+// This functions sends input data on specified serial port
+// Examples
+// A = [2 3; 4 5]
+// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
+// RPI_SerialSendData(serial1, A);
+// RPI_SerialClose(serial1);
+//
+// See also
+// RPI_SerialOpen RPI_SerialClose
+//
+//
+// 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_SerialSetup.sci b/macros/Hardware/RasberryPi/RPI_SerialSetup.sci
new file mode 100644
index 00000000..0f266610
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_SerialSetup.sci
@@ -0,0 +1,36 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function fd = RPI_SerialSetup(port, baudrate)
+// Function to setup serial port.
+//
+// Calling Sequence
+// RPI_SerialSetup(port, baudrate)
+//
+// Parameters
+// port : port of RPi to be used (eg. )
+// direction : direction to be set for pin (0 -> INPUT, 1 -> OUTPUT)
+// fd : file descriptor for opened port, -1 for error
+// Description
+// This functions opens the specified serial port and returns file descriptor
+// for the same
+// Examples
+// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
+//
+// See also
+// RPI_SerialClose RPI_SerialSendChar
+//
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for RPi.
+fd = 0;
+endfunction
diff --git a/macros/Hardware/RasberryPi/buildmacros.sce b/macros/Hardware/RasberryPi/buildmacros.sce
new file mode 100644
index 00000000..2954a424
--- /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 00000000..c238317e
Binary files /dev/null and b/macros/Hardware/RasberryPi/lib differ
diff --git a/macros/Hardware/RasberryPi/names b/macros/Hardware/RasberryPi/names
new file mode 100644
index 00000000..fa647761
--- /dev/null
+++ b/macros/Hardware/RasberryPi/names
@@ -0,0 +1,21 @@
+GetRPISupportFunctions
+IsRPISupportFunction
+RPI_DelayMicro
+RPI_DelayMilli
+RPI_DigitalIn
+RPI_DigitalOut
+RPI_DigitalSetup
+RPI_GetMicros
+RPI_GetMillis
+RPI_HardPWMSetClock
+RPI_HardPWMSetMode
+RPI_HardPWMSetRange
+RPI_HardPWMWrite
+RPI_PinISR
+RPI_SerialClose
+RPI_SerialFlush
+RPI_SerialGetChar
+RPI_SerialSendChar
+RPI_SerialSendData
+RPI_SerialSetup
+u16RPISerialDataAvail
diff --git a/macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci b/macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci
new file mode 100644
index 00000000..6eb29a1c
--- /dev/null
+++ b/macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci
@@ -0,0 +1,37 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function bytes = RPI_SerialDataAvail(fd)
+// Function to get number of data bytes available on serial port specified by
+// file descriptor
+// Calling Sequence
+// RPI_SerialDataAvail(fd)
+//
+// Parameters
+// fd : file descriptor for already opened serial port
+// Description
+// This functions returns number of characters available to read,
+// otherwise reads -1 in case of error. This function can be used to check
+// new data is available on serial port
+// Examples
+// serial = RPI_SerialOpen("/dev/ttyAMA0", 9600);
+// charsToRead = RPI_SerialDataAvail(serial);
+// See also
+// RPI_SerialOpen RPI_SerialGetChar
+//
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for RPi.
+
+bytes = 0;
+
+endfunction
\ No newline at end of file
--
cgit
From bd03b38be0918837e147e969c6bb2014900009db Mon Sep 17 00:00:00 2001
From: Brijeshcr
Date: Sat, 8 Jul 2017 20:18:17 +0530
Subject: Revert "SCi2cDeps updated, Windows compatibility resolved"
---
macros/Hardware/AVR/AVRADCSetup.sci | 20 ---------------
macros/Hardware/AVR/AVRDigitalIn.sci | 20 ---------------
macros/Hardware/AVR/AVRDigitalOut.sci | 15 ------------
macros/Hardware/AVR/AVRDigitalPortSetup.sci | 16 ------------
macros/Hardware/AVR/AVRDigitalSetup.sci | 17 -------------
macros/Hardware/AVR/AVRGetTimerValue.sci | 14 -----------
macros/Hardware/AVR/AVRPWM0SetDuty.sci | 17 -------------
macros/Hardware/AVR/AVRPWM0Setup.sci | 35 --------------------------
macros/Hardware/AVR/AVRPWM1SetDuty.sci | 25 -------------------
macros/Hardware/AVR/AVRPWM1Setup.sci | 38 -----------------------------
macros/Hardware/AVR/AVRPWM2SetDuty.sci | 14 -----------
macros/Hardware/AVR/AVRPWM2Setup.sci | 32 ------------------------
macros/Hardware/AVR/AVRReadADC.sci | 19 ---------------
macros/Hardware/AVR/AVRSleep.sci | 4 ---
macros/Hardware/AVR/AVRTimerSetup.sci | 29 ----------------------
macros/Hardware/AVR/AVRUARTReceive.sci | 14 -----------
macros/Hardware/AVR/AVRUARTSetup.sci | 31 -----------------------
macros/Hardware/AVR/AVRUARTTransmit.sci | 19 ---------------
18 files changed, 379 deletions(-)
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/AVRADCSetup.sci b/macros/Hardware/AVR/AVRADCSetup.sci
index 5299058c..603873b3 100644
--- a/macros/Hardware/AVR/AVRADCSetup.sci
+++ b/macros/Hardware/AVR/AVRADCSetup.sci
@@ -17,7 +17,6 @@ function AVRADCSetup(prescaler,adc_ref)
// Parameters
// prescaler: prescaler to be used for generating ADC clock (0-7)
// adc_ref : reference voltage to be used for ADC conversion
-<<<<<<< HEAD
//
// Description
// This function initialises ADc of AVR with given parameters. 'prescaler' is needed for deciding ADC clock. ADC clock should be between 50KHz and 200KHz and it given as (MCU clock/2^prescaler). Select appropriate prescaler depending on MCU clock. 'adc_ref' selects one of the available reference voltage sources available.
@@ -31,34 +30,15 @@ function AVRADCSetup(prescaler,adc_ref)
//
// This is curretly dummy function. It provides no functionality but is required for providing support for generating C code for AVR.
//
-=======
-// 0 -> Voltage on VREF pin
-// 1 -> Voltage on AVCC pin
-// 2 -> Internal 2.56 reference voltage
-//
-// Description
-// This function initialises ADc of AVR with given parameters. 'prescaler' is
-// needed for deciding ADC clock. ADC clock should be between 50KHz and 200KHz
-// and it given as (MCU clock/2^prescaler). Select appropriate prescaler depending
-// on MCU clock. 'adc_ref' selects one of the available reference voltage sources
-// available
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
// Examples
// AVRADCSetup(128,0)
// See also
// AVRReadADC
//
// Authors
-<<<<<<< HEAD
// Siddhesh Wani
// Ashish Kamble
//
-=======
-// Siddhesh Wani Ashish Kamble
-//
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
if(prescaler>=8)
disp("Error : Invalid input argument ''prescaler'' in AVRADCSetup function.");
diff --git a/macros/Hardware/AVR/AVRDigitalIn.sci b/macros/Hardware/AVR/AVRDigitalIn.sci
index 421a4f63..7addd663 100644
--- a/macros/Hardware/AVR/AVRDigitalIn.sci
+++ b/macros/Hardware/AVR/AVRDigitalIn.sci
@@ -18,11 +18,6 @@ function state = AVRDigitalIn(port,pin)
// Parameters
// port : port of microcontroller to be used
// pin : pin of port (mentioned above) to be used
-<<<<<<< HEAD
-=======
-// Returns
-// state : state of an input pin (HIGH\LOW)
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
//
// Description
// Each AVR microcontroller has pins which can be configured as digital
@@ -30,7 +25,6 @@ function state = AVRDigitalIn(port,pin)
// User has to select one of these port and which pin of that port as
// digital input.
//
-<<<<<<< HEAD
// This is curretly dummy function. It provides no functionality but is required
// for providing support for generating C code for AVR.
//
@@ -43,20 +37,6 @@ function state = AVRDigitalIn(port,pin)
// Siddhesh Wani
// Ashish Kamble
//
-=======
-// Examples
-// pinA0 = AVRDigitalIn(1,0) //To read state on pin 0 of port A
-//
-// See also
-// AVRDigitalOut AVRDigitalSetup
-//
-//
-// Authors
-// Siddhesh Wani Ashish Kamble
-//
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
if((port==0)|(port>=5)) then
disp("Error : Inavalid input argument ''port'' in AVRDigitalIn function.");
diff --git a/macros/Hardware/AVR/AVRDigitalOut.sci b/macros/Hardware/AVR/AVRDigitalOut.sci
index a80aff0f..0efc927b 100644
--- a/macros/Hardware/AVR/AVRDigitalOut.sci
+++ b/macros/Hardware/AVR/AVRDigitalOut.sci
@@ -26,7 +26,6 @@ function AVRDigitalOut(port,pin,state)
// digital output. Also, desired output state must be specified as
// 'HIGH' or 'LOW'.
//
-<<<<<<< HEAD
// This is curretly dummy function. It provides no functionality but is required
// for providing support for generating C code for AVR.
//
@@ -39,20 +38,6 @@ function AVRDigitalOut(port,pin,state)
// Siddhesh Wani
// Ashish Kamble
//
-=======
-// Examples
-// AVRDigitalOut('A',0,HIGH)
-//
-// See also
-// AVRDigitalIn
-//
-//
-// Authors
-// Siddhesh Wani Ashish Kamble
-//
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
if((port==0)|(port>=8)) then
disp("Error : Inavalid input argument ''port'' in AVRDigitalOut function.");
diff --git a/macros/Hardware/AVR/AVRDigitalPortSetup.sci b/macros/Hardware/AVR/AVRDigitalPortSetup.sci
index 26bec8db..65e8494a 100644
--- a/macros/Hardware/AVR/AVRDigitalPortSetup.sci
+++ b/macros/Hardware/AVR/AVRDigitalPortSetup.sci
@@ -15,11 +15,7 @@ function AVRDigitalPortSetup(port,direction)
// AVRDigitalPortSetup(port,direction)
//
// Parameters
-<<<<<<< HEAD
// port : port of microcontroller to be used(1 for PORTA, 2 for PORTB,...)
-=======
-// port : port of microcontroller to be used(1 for PORTA, 2 for PORTB,...)
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
// direction : direction to be set for pin (0 for INPUT, 1 for OUTPUT)
//
// Description
@@ -29,31 +25,19 @@ function AVRDigitalPortSetup(port,direction)
// used as digital output/input. Also, desired direction must be specified as
// 'INPUT' or 'OUTPUT'.
//
-<<<<<<< HEAD
// This is curretly dummy function. It provides no functionality but is required
// for providing support for generating C code for AVR.
//
-=======
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
// Examples
// AVRDigitalPortSetup(1,0); //This function will make PortA as input port
//
// See also
// AVRDigitalIn AVRDigitalOut
//
-<<<<<<< HEAD
// Authors
// Siddhesh Wani
// Ashish Kamble
//
-=======
-//
-// Authors
-// Siddhesh Wani Ashish Kamble
-//
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
if((port==0)|(port>=5)) then
disp("Error : Invalid input argument ''port'' in AVRDigitalPortSetup function.");
diff --git a/macros/Hardware/AVR/AVRDigitalSetup.sci b/macros/Hardware/AVR/AVRDigitalSetup.sci
index 8e4efc7e..ed6cf306 100644
--- a/macros/Hardware/AVR/AVRDigitalSetup.sci
+++ b/macros/Hardware/AVR/AVRDigitalSetup.sci
@@ -15,13 +15,8 @@ function AVRDigitalSetup(port,pin,direction)
// AVRDigitalSetup(port,pin,direction)
//
// Parameters
-<<<<<<< HEAD
// port : port of microcontroller to be used
// pin : pin of port (mentioned above) to be used
-=======
-// port : port of microcontroller to be used
-// pin : pin of port (mentioned above) to be used
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
// direction : direction to be set for pin (INPUT\OUTPUT)
//
// Description
@@ -31,31 +26,19 @@ function AVRDigitalSetup(port,pin,direction)
// used as digital output/input. Also, desired direction must be specified as
// 'INPUT' or 'OUTPUT'.
//
-<<<<<<< HEAD
// This is curretly dummy function. It provides no functionality but is required
// for providing support for generating C code for AVR.
//
-=======
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
// Examples
// AVRDigitalSetup('A',0,OUTPUT)
//
// See also
// AVRDigitalIn AVRDigitalOut
//
-<<<<<<< HEAD
// Authors
// Siddhesh Wani
// Ashish Kamble
//
-=======
-//
-// Authors
-// Siddhesh Wani Ashish Kamble
-//
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
if((port==0)|(port>=5)) then
disp("Error : Invalid input argument ''port'' in AVRDigitalSetup function.");
diff --git a/macros/Hardware/AVR/AVRGetTimerValue.sci b/macros/Hardware/AVR/AVRGetTimerValue.sci
index 0b501448..05919b38 100644
--- a/macros/Hardware/AVR/AVRGetTimerValue.sci
+++ b/macros/Hardware/AVR/AVRGetTimerValue.sci
@@ -18,7 +18,6 @@ function count = AVRGetTimerValue(timer)
// 2 for timer2
//
// Description
-<<<<<<< HEAD
// This function returns the count value of a desired timer.By knowing the count value certain interrupt action can be taken.
//
// Timer can take the following values
@@ -33,25 +32,12 @@ function count = AVRGetTimerValue(timer)
//
// Examples
// AVRGetTimerValue(0); //returns present count of the TCNT0 counter
-=======
-// This function returns the count value of a desired timer.By knowing the count value
-// certain interrupt action can be taken.
-//
-// Examples
-// AVRGetTimerValue(0); //returns present count of the TCNT0 counter
-//
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
// See also
// AVRTimerSetup
//
// Authors
// Ashish Kamble
//
-<<<<<<< HEAD
-=======
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
if(timer>=3) then
disp("Error : Invalid input argument ''timer'' in AVRGetTimerValue function.");
diff --git a/macros/Hardware/AVR/AVRPWM0SetDuty.sci b/macros/Hardware/AVR/AVRPWM0SetDuty.sci
index f1faebef..c3815d10 100644
--- a/macros/Hardware/AVR/AVRPWM0SetDuty.sci
+++ b/macros/Hardware/AVR/AVRPWM0SetDuty.sci
@@ -9,7 +9,6 @@
// Email: toolbox@scilab.in
function AVRPWM0SetDuty(duty)
-<<<<<<< HEAD
//Function to Set Duty cycle of PWM Output generated by Timer0 at OC0 pin.
//
//Parameters
@@ -22,17 +21,6 @@ function AVRPWM0SetDuty(duty)
// This is curretly dummy function. It provides no functionality but is required for providing support for generating C code for AVR.
//
//Examples
-=======
-//Function to Set Duty cycle of PWM Output generated by Timer0 at OC0 pin.
-//Parameters
-// duty : It holds an integer value from 0 to 100 which sets the percentage
-// of time for which signal is active.
-//Description
-// Each Micro controller has PWM output pins which can generate varying voltage
-// from 0V-5V.In this function by varying the duty cycle, varying voltage can be
-// produced.
-//Example
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
// AVRPWM0SetDuty(50); //Produces 2.5V at OC0 pin
// AVRPWM0SetDuty(0); //Produces 0V at OC0 pin
//See also
@@ -41,11 +29,6 @@ function AVRPWM0SetDuty(duty)
//Authors
// Ashish Kamble
//
-<<<<<<< HEAD
-=======
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
if(duty>100) then
disp("Error : Invalid input argument ''duty'' in AVRPWM0SetDuty function.");
diff --git a/macros/Hardware/AVR/AVRPWM0Setup.sci b/macros/Hardware/AVR/AVRPWM0Setup.sci
index 19d91a2a..c391f71e 100644
--- a/macros/Hardware/AVR/AVRPWM0Setup.sci
+++ b/macros/Hardware/AVR/AVRPWM0Setup.sci
@@ -10,20 +10,16 @@
function AVRPWM0Setup(waveform_mode,output_mode)
//Function to Setup OC0 pin for required PWM mode
-<<<<<<< HEAD
//
//Parameters
// waveform_mode: integer, from 0 to 2
// output_mode: integer, from 0 to 1 (or 2) depending on the waveform_mode
//
-=======
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
//Description
// Every Micro controller has PWM pins which can generate varying voltages
// from 0V-5V.This function helps to use OC0 pin to produce required
// output waveform by setting the waveform mode and otput mode.
//
-<<<<<<< HEAD
// waveform_mode can take values-
//
// 0 -> for Phase correct PWM Mode
@@ -50,43 +46,12 @@ function AVRPWM0Setup(waveform_mode,output_mode)
//
//Examples
// AVRPWM0Setup(2,0); //This function will select CTC waveform mode and will clear OC0 on compare match
-=======
-//Parameters
-// waveform_mode:
-// 0 for Phase correct PWM Mode
-// 1 for Fast PWM Mode
-// 2 for CTC Mode
-// output_mode:
-// For Phase Correct PWM Mode:
-// 0 for Clear OC0 on compare match when up-counting. Set OC0 on compare
-// match when down-counting.
-// 1 for Set OC0 on compare match when up-counting. Clear OC0 on compare
-// match when down-counting.
-//
-// For Fast PWM Mode:
-// 0 for non-inverted output i.e Clear OC0 on compare match, set OC0 at BOTTOM.
-// 1 for inverted output i.e Set OC0 on compare match, clear OC0 at BOTTOM.
-//
-// For CTC Mode:
-// 0 to Clear OC0 on compare match
-// 1 to Set OC0 on compare match
-// 2 to toggle OC0 on compare match
-//
-//Example
-// AVRPWM0Setup(2,0); //This function will select CTC waveform mode and will clear OC0 on
-// compare match
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
//See also
// AVRPWM0SetDuty
//
//Authors
// Ashish Kamble
//
-<<<<<<< HEAD
-=======
-//This is curretly dummy function. It provides no functionality but is required
-//for providing support for generating C code for AVR.
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
if(waveform_mode>=3) then
disp("Error : Invalid input argument ''waveform_mode'' in AVRPWM0Setup function.");
diff --git a/macros/Hardware/AVR/AVRPWM1SetDuty.sci b/macros/Hardware/AVR/AVRPWM1SetDuty.sci
index 6b3e21f0..fd6e7baf 100644
--- a/macros/Hardware/AVR/AVRPWM1SetDuty.sci
+++ b/macros/Hardware/AVR/AVRPWM1SetDuty.sci
@@ -11,53 +11,28 @@
function AVRPWM1SetDuty(output_pin,duty,Top_Value)
//Function to Set Duty cycle of PWM Output generated by Timer1 at OC1A or OC1B pin.
//Parameters
-<<<<<<< HEAD
// ouput_pin: integer, 0 (for OC1A) or 1 (for OC1B)
//
// duty: It holds an integer value from 0 to 100 which sets the percentage of time for which signal is active.
//
// Top_Value: It holds an integer value from 0 to 65535.This value sets the Top value of the counter TCNT1 i.e ICR.(for more info refer datasheet)
-=======
-// ouput_pin:
-// 0 for selecting OC1A as output pin
-// 1 for selecting OC1B as output pin
-//
-// duty: It holds an integer value from 0 to 100 which sets the percentage
-// of time for which signal is active.
-//
-// Top_Value: It holds an integer value from 0 to 65535.This value sets the Top
-// value of the counter TCNT1 i.e ICR.(for more info refer datasheet)
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
//
//Description
// Each Micro controller has PWM output pins which can generate varying voltage
// from 0V-5V.This function Sets the duty cycle of output PWM signal.Also this function
// decides the Top Vale of TCNT1 and the output pin to output PWM signal.
//
-<<<<<<< HEAD
// This is curretly dummy function. It provides no functionality but is required
// for providing support for generating C code for AVR.
//
//Example
// AVRPWM1SetDuty(0,50,40000); //This function will produce PWM signal of 50% duty cycle on OC1A pin and TCNT1 will reset at 40000 instead at 65535.
-=======
-//Example
-// AVRPWM1SetDuty(0,50,40000); //This function will produce PWM signal of 50% duty
-// cycle on OC1A pin and TCNT1 will reset at 40000 instead
-// at 65535.
-//
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
//See also
// AVRPWM1Setup
//
//Authors
// Ashish Kamble
//
-<<<<<<< HEAD
-=======
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
if(output_pin>=2) then
disp("Error : Invalid input argument ''output_pin'' in AVRPWM1SetDuty function.");
diff --git a/macros/Hardware/AVR/AVRPWM1Setup.sci b/macros/Hardware/AVR/AVRPWM1Setup.sci
index feb40bd6..fbd96ce3 100644
--- a/macros/Hardware/AVR/AVRPWM1Setup.sci
+++ b/macros/Hardware/AVR/AVRPWM1Setup.sci
@@ -10,21 +10,17 @@
function AVRPWM1Setup(waveform_mode,output_mode,output_pin)
//Function to Setup OC1A or OC1B pin for required PWM mode
-<<<<<<< HEAD
//
//Parameters
// waveform_mode: integer, from 0 to 2
// output_mode: integer, from 0 to 1 (or 2) depending on the waveform_mode
// output_pin: 0 (for OC1A) or 1 for (OC1B)
//
-=======
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
//Description
// Every Micro controller has PWM pins which can generate varying voltages
// from 0V-5V.This function helps to use OC1A or OC1B pin to produces required
// output waveform by setting the waveform mode and otput mode.
//
-<<<<<<< HEAD
// waveform_mode can take values-
//
// 0 -> for Phase correct PWM Mode
@@ -48,35 +44,6 @@ function AVRPWM1Setup(waveform_mode,output_mode,output_pin)
//
// This is curretly dummy function. It provides no functionality but is required
// for providing support for generating C code for AVR.
-=======
-//Parameters
-// waveform_mode:
-// 0 for Phase correct PWM Mode
-// 1 for Fast PWM Mode
-// 2 for CTC Mode
-//
-// output_mode:
-// For Phase Correct PWM Mode:
-// 0 for Clear OC1A or OC1B on compare match when up-counting. Set OC1A or OC1B
-// on compare match when down-counting.
-// 1 for Set OC1A or OC1B on compare match when up-counting. Clear OC1A or OC1B
-// on compare match when down-counting.
-//
-// For Fast PWM Mode:
-// 0 for non-inverted output i.e Clear OC1A or OC1B on compare match, set OC1A
-// OC1B at BOTTOM.
-// 1 for inverted output i.e Set OC1A or OC1B on compare match, clear OC1A or OC1B
-// at BOTTOM.
-//
-// For CTC Mode:
-// 0 to Clear OC1A or OC1B on compare match
-// 1 to Set OC1A or OC1B on compare match
-// 2 to toggle OC1A or OC1B on compare match
-//
-// output_pin:
-// 0 for selecting OC1A as output pin
-// 1 for selecting OC1B as output pin
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
//
//Example
// AVRPWM1Setup(2,0,0); //This function will select CTC mode and will clear OC1A or OC1B
@@ -88,11 +55,6 @@ function AVRPWM1Setup(waveform_mode,output_mode,output_pin)
//Authors
// Ashish Kamble
//
-<<<<<<< HEAD
-=======
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
if(waveform_mode>=3) then
disp("Error : Invalid input argument ''waveform_mode'' in AVRPWM1Setup function.");
diff --git a/macros/Hardware/AVR/AVRPWM2SetDuty.sci b/macros/Hardware/AVR/AVRPWM2SetDuty.sci
index 75ae8599..81d1761e 100644
--- a/macros/Hardware/AVR/AVRPWM2SetDuty.sci
+++ b/macros/Hardware/AVR/AVRPWM2SetDuty.sci
@@ -10,26 +10,17 @@
function AVRPWM2SetDuty(duty)
//Function to Set Duty cycle of PWM Output generated by Timer2 at OC2 pin.
-<<<<<<< HEAD
//
//Parameters
// duty : It holds an integer value from 0 to 100 which sets the percentage of time for which signal is active.
//
-=======
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
//Description
// Each Micro controller has PWM output pins which can generate varying voltage
// from 0V-5V.In this function by varying the duty cycle, varying voltage can be
// produced.
//
-<<<<<<< HEAD
// This is curretly dummy function. It provides no functionality but is required
// for providing support for generating C code for AVR.
-=======
-//Parameters
-// duty : It holds an integer value from 0 to 100 which sets the percentage
-// of time for which signal is active.
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
//
//Example
// AVRPWM2SetDuty(50); //Produces 2.5V at OC2 pin
@@ -41,11 +32,6 @@ function AVRPWM2SetDuty(duty)
//Authors
// Ashish Kamble
//
-<<<<<<< HEAD
-=======
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
if(duty>100) then
disp("Error : Invalid input argument ''duty'' in AVRPWM2SetDuty function.");
diff --git a/macros/Hardware/AVR/AVRPWM2Setup.sci b/macros/Hardware/AVR/AVRPWM2Setup.sci
index c76f3f35..11d9b019 100644
--- a/macros/Hardware/AVR/AVRPWM2Setup.sci
+++ b/macros/Hardware/AVR/AVRPWM2Setup.sci
@@ -10,20 +10,16 @@
function AVRPWM2Setup(waveform_mode,output_mode)
//Function to Setup OC2 pin for required PWM mode
-<<<<<<< HEAD
//
//Parameters
// waveform_mode: integer, from 0 to 2
// output_mode: integer, from 0 to 1 (or 2) depending on the waveform_mode
//
-=======
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
//Description
// Every Micro controller has PWM pins which can generate varying voltages
// from 0V-5V.This function helps to use OC2 pin to produces required
// output waveform by setting the waveform mode and otput mode.
//
-<<<<<<< HEAD
// waveform_mode can take values-
//
// 0 -> for Phase correct PWM Mode
@@ -48,29 +44,6 @@ function AVRPWM2Setup(waveform_mode,output_mode)
// This is curretly dummy function. It provides no functionality but is required
// for providing support for generating C code for AVR.
//
-=======
-//Parameters
-// waveform_mode:
-// 0 for Phase correct PWM Mode
-// 1 for Fast PWM Mode
-// 2 for CTC Mode
-//output_mode:
-// For Phase Correct PWM Mode:
-// 0 for Clear OC2 on compare match when up-counting. Set OC2 on compare
-// match when down-counting.
-// 1 for Set OC2 on compare match when up-counting. Clear OC2 on compare
-// match when down-counting.
-//
-// For Fast PWM Mode:
-// 0 for non-inverted output i.e Clear OC2 on compare match, set OC2 at BOTTOM.
-// 1 for inverted output i.e Set OC2 on compare match, clear OC2 at BOTTOM.
-//
-// For CTC Mode:
-// 0 to Clear OC2 on compare match
-// 1 to Set OC2 on compare match
-// 2 to toggle OC2 on compare match
-//
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
//Example
// AVRPWM2Setup(2,0); //This function will select CTC waveform mode and will clear OC2 on
// compare match
@@ -80,11 +53,6 @@ function AVRPWM2Setup(waveform_mode,output_mode)
//Authors
// Ashish Kamble
//
-<<<<<<< HEAD
-=======
-//This is curretly dummy function. It provides no functionality but is required
-//for providing support for generating C code for AVR.
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
if(waveform_mode>=3) then
disp("Error : Invalid input argument ''waveform_mode'' in AVRPWM2Setup function.");
diff --git a/macros/Hardware/AVR/AVRReadADC.sci b/macros/Hardware/AVR/AVRReadADC.sci
index aa94c58d..71cafa7e 100644
--- a/macros/Hardware/AVR/AVRReadADC.sci
+++ b/macros/Hardware/AVR/AVRReadADC.sci
@@ -15,15 +15,7 @@ function adc_result = AVRReadADC(channel)
// u8AVRReadADCs(channel)
//
// Parameters
-<<<<<<< HEAD
// channel : Select which channel is to be read. Values from 0-7 select one of the pins ADC0-ADC7. For other possible channel values refer datasheet
-=======
-// channel : Select which channel is to be read. Values from 0-7 select one
-// of the pins ADC0-ADC7. For other possible channel values refer
-// datasheet
-// Returns->
-// result : Digital value for the voltage present on channel selected
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
//
// Description
// This function returns digital value for present on adc pins. 'channel'
@@ -32,7 +24,6 @@ function adc_result = AVRReadADC(channel)
// voltages between some pins. For channel values for those options, please
// refer datasheet.
//
-<<<<<<< HEAD
// This is curretly dummy function. It provides no functionality but is required
// for providing support for generating C code for AVR.
//
@@ -42,16 +33,6 @@ function adc_result = AVRReadADC(channel)
// Siddhesh Wani
// Ashish Kamble
//
-=======
-// Examples
-// adc_result = u8AVRReadADC(0) //Read ADC0
-//
-// Authors
-// Siddhesh Wani Ashish Kamble
-//
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
if(channel>=8) then
disp("Error : Inavlid input argument ''channel'' in AVRReadADC function.");
diff --git a/macros/Hardware/AVR/AVRSleep.sci b/macros/Hardware/AVR/AVRSleep.sci
index 005fe4ed..eec6e5a2 100644
--- a/macros/Hardware/AVR/AVRSleep.sci
+++ b/macros/Hardware/AVR/AVRSleep.sci
@@ -1,5 +1,4 @@
function AVRSleep(delay)
-<<<<<<< HEAD
// Function to pause the execution for the given time.
//
// Parameter
@@ -18,8 +17,5 @@ function AVRSleep(delay)
// Authors
// Jorawar Singh
//
-=======
-
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
endfunction
diff --git a/macros/Hardware/AVR/AVRTimerSetup.sci b/macros/Hardware/AVR/AVRTimerSetup.sci
index c4c4535e..55fd55fa 100644
--- a/macros/Hardware/AVR/AVRTimerSetup.sci
+++ b/macros/Hardware/AVR/AVRTimerSetup.sci
@@ -10,21 +10,17 @@
function AVRTimerSetup(timer,prescaler,clock_source)
//Function to setup Timers in ATmega16
-<<<<<<< HEAD
//
//Parameters:
// timer : integer, from 0 to 2
// prescaler : integer.
// clock_source : integer, 0 (for internal) or 1 (for external)
//
-=======
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
//Descrpition:
// This function tells the micro controller which clock source you will be using.
// The timer value and prescaler value passed in this function setup the timer as per
// your requirement.
//
-<<<<<<< HEAD
// timer can take values-
//
// 0 -> for timer0
@@ -46,37 +42,12 @@ function AVRTimerSetup(timer,prescaler,clock_source)
//
//Example
// AVRTimerSetup(0,64,0); //This function will select timer0 with timer running as per internal clock source and prescaled by 64.
-=======
-//Parameters:
-// timer : It is an integer value.
-// 0 to setup timer0
-// 1 to setup timer1
-// 2 to setup timer2
-// prescaler : It is an integer value.
-// 1 for no prescaling i.e clock will run at max 16Hz frequency
-// 8 for prescaling clock by 8 i.e new clock frequency will be (clk/8)
-// 64 for prescaling clock by 64 i.e new clock frequency will be (clk/64)
-// 256 for prescaling clock by 256 i.e new clock frequency will be (clk/256)
-// 1024 for prescaling clock by 1024 i.e new clock frequency will be (clk/1024)
-// clock_source : It is an integer value.
-// 0 if you are using internal clock source
-// 1 if you are using external clock source
-//Example
-// AVRTimerSetup(0,64,0); //This function will select timer0 with timer running as per
-// internal clock source and prescaled by 64.
-//
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
//See also
// AVRGetTimerValues
//
//Authors
// Ashish Kamble
//
-<<<<<<< HEAD
-=======
-//This is curretly dummy function. It provides no functionality but is required
-//for providing support for generating C code for AVR.
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
if(timer>=3) then
disp("Error : Invalid input argument ''timer'' in AVRTimerSetup function.");
diff --git a/macros/Hardware/AVR/AVRUARTReceive.sci b/macros/Hardware/AVR/AVRUARTReceive.sci
index f7502e23..7fdf6f05 100644
--- a/macros/Hardware/AVR/AVRUARTReceive.sci
+++ b/macros/Hardware/AVR/AVRUARTReceive.sci
@@ -10,25 +10,16 @@
function received = AVRUARTReceive()
// Function to Receive Char value send to ATmega16 using UART or USART.
-<<<<<<< HEAD
//
-=======
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
// Description
// This function Receives Char as 8 bit value.This value is stored in UDR at receiving
// end.
//
-<<<<<<< HEAD
// This is curretly dummy function. It provides no functionality but is required
// for providing support for generating C code for AVR.
//
//Examples
// state = AVRUARTReceive(); //This function will Receive char and return the entire value
-=======
-//Examples
-// state = AVRUARTReceive(); //This function will Receive char and return the entire value
-//
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
//See also
// AVRUARTSetup
// AVRUARTTransmit
@@ -36,10 +27,5 @@ function received = AVRUARTReceive()
// Authors
// Ashish Kamble
//
-<<<<<<< HEAD
-=======
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
received = 0; // received has been initialised to avoid runtime error.
endfunction
diff --git a/macros/Hardware/AVR/AVRUARTSetup.sci b/macros/Hardware/AVR/AVRUARTSetup.sci
index 896674b3..6ecf2a07 100644
--- a/macros/Hardware/AVR/AVRUARTSetup.sci
+++ b/macros/Hardware/AVR/AVRUARTSetup.sci
@@ -10,7 +10,6 @@
function AVRUARTSetup(mode, baudrate, stopbits, parity)
// Function to Setup Serial Communication i.e UART or USART in ATmega16.
-<<<<<<< HEAD
//
// Parameters
// mode : integer, from 0 to 2
@@ -39,31 +38,6 @@ function AVRUARTSetup(mode, baudrate, stopbits, parity)
// This is curretly dummy function. It provides no functionality but is required
// for providing support for generating C code for AVR.
//
-=======
-// Description
-// This function Setup the UART or USART for Serial Communicaion between ATmega16
-// and different micro controllers or between ATmega16 and Computer.
-//
-// Parameters
-// mode :
-// 0 for Asynchronous Normal mode
-// 1 for Asynchronous Double Speed mode
-// 2 for Synchronous mode
-//
-// baudrate : Enter one of the following available baudrates
-// 2400 , 4800 , 9600 , 14400 , 19200 , 28800 , 38400 , 57600 ,
-// 768000 , 115200 , 230400 , 250000 , 1000000 .
-//
-// stopbits :
-// 0 for one stopbit
-// 1 for two stopbits
-//
-// parity :
-// 0 for parity disabled
-// 1 for even parity
-// 2 for odd parity
-//
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
//Examples
// AVRUARTSetup(0,9600,0,0); //This function will enable UART Communication for ATmega16
// with 9600 as baudrate,one stop bit and parity disabled
@@ -74,12 +48,7 @@ function AVRUARTSetup(mode, baudrate, stopbits, parity)
// Authors
// Ashish Kamble
//
-<<<<<<< HEAD
-=======
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
if(mode>=3) then
disp("Error : Invalid input argument ''mode'' in AVRUARTSetup function.");
end
diff --git a/macros/Hardware/AVR/AVRUARTTransmit.sci b/macros/Hardware/AVR/AVRUARTTransmit.sci
index 150b9fe9..695c708d 100644
--- a/macros/Hardware/AVR/AVRUARTTransmit.sci
+++ b/macros/Hardware/AVR/AVRUARTTransmit.sci
@@ -10,7 +10,6 @@
function AVRUARTTransmit(data)
// Function to Transmit data using UART or USART.
-<<<<<<< HEAD
//
// Parameter
// data : The data to be transmitted can be a Char,String,Unsigned Int,Signed Int.
@@ -24,19 +23,6 @@ function AVRUARTTransmit(data)
//
//Examples
// AVRUARTTransmit("This is example"); //This function will transmit the entered string.
-=======
-// Description
-// This function Tranmits data over UART or USART.The data to be transmitted can
-// be a Char , String , Unsigned Int, Signed Int.
-//
-// Parameter
-// data :
-// The data to be transmitted can be a Char,String,Unsigned Int,Signed Int.
-//
-//Examples
-// AVRUARTTransmit("This is example"); //This function will transmit the entered string.
-//
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
//See also
// AVRUARTSetup
// AVRUARTReceive
@@ -44,9 +30,4 @@ function AVRUARTTransmit(data)
// Authors
// Ashish Kamble
//
-<<<<<<< HEAD
-=======
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for AVR.
->>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
endfunction
--
cgit
From d13b41b79200c533efad1f5dcc8803ca510ae1be Mon Sep 17 00:00:00 2001
From: Abhinav Dronamraju
Date: Mon, 10 Jul 2017 22:11:27 +0530
Subject: Readay to push the final changes
---
macros/Hardware/AVR/lib | Bin 0 -> 920 bytes
macros/Hardware/RasberryPi/lib | Bin 0 -> 924 bytes
2 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 macros/Hardware/AVR/lib
create mode 100644 macros/Hardware/RasberryPi/lib
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib
new file mode 100644
index 00000000..53e56599
Binary files /dev/null and b/macros/Hardware/AVR/lib differ
diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib
new file mode 100644
index 00000000..dc759fe8
Binary files /dev/null and b/macros/Hardware/RasberryPi/lib differ
--
cgit
From d0a1f4e5dcddab2290f68a0395970ec471813119 Mon Sep 17 00:00:00 2001
From: Ankitr19
Date: Tue, 11 Jul 2017 09:01:07 +0530
Subject: New demos for signal processing functions
---
macros/Hardware/AVR/lib | Bin 920 -> 972 bytes
macros/Hardware/RasberryPi/lib | Bin 924 -> 976 bytes
2 files changed, 0 insertions(+), 0 deletions(-)
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib
index 53e56599..069c520e 100644
Binary files a/macros/Hardware/AVR/lib and b/macros/Hardware/AVR/lib differ
diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib
index dc759fe8..4c85475b 100644
Binary files a/macros/Hardware/RasberryPi/lib and b/macros/Hardware/RasberryPi/lib differ
--
cgit
From 09446b579acaf802438810bac018cbf56e1427ca Mon Sep 17 00:00:00 2001
From: Brijeshcr
Date: Wed, 12 Jul 2017 20:00:18 +0530
Subject: Isequal added
---
macros/Hardware/AVR/lib | Bin 972 -> 972 bytes
macros/Hardware/RasberryPi/lib | Bin 976 -> 976 bytes
2 files changed, 0 insertions(+), 0 deletions(-)
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib
index 069c520e..ed4c52b8 100644
Binary files a/macros/Hardware/AVR/lib and b/macros/Hardware/AVR/lib differ
diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib
index 4c85475b..eec912f5 100644
Binary files a/macros/Hardware/RasberryPi/lib and b/macros/Hardware/RasberryPi/lib differ
--
cgit
From 550bca9f6e005872e654bc96b0b477cf502d814f Mon Sep 17 00:00:00 2001
From: Jorawar Singh
Date: Sun, 16 Jul 2017 22:17:43 +0530
Subject: Toolbox merge, RPI demos and structured demos
---
macros/Hardware/AVR/lib | Bin 920 -> 0 bytes
.../RasberryPi/Digital/RPI_digitalRead.sci | 41 +++++++++
.../RasberryPi/Digital/RPI_digitalReadByte.sci | 40 +++++++++
.../RasberryPi/Digital/RPI_digitalWrite.sci | 46 ++++++++++
.../RasberryPi/Digital/RPI_digitalWriteByte.sci | 42 +++++++++
macros/Hardware/RasberryPi/Digital/buildmacros.sce | 14 +++
macros/Hardware/RasberryPi/Digital/names | 4 +
macros/Hardware/RasberryPi/I2C/RPI_I2CRead.sci | 40 +++++++++
.../Hardware/RasberryPi/I2C/RPI_I2CReadReg16.sci | 41 +++++++++
macros/Hardware/RasberryPi/I2C/RPI_I2CReadReg8.sci | 41 +++++++++
macros/Hardware/RasberryPi/I2C/RPI_I2CSetup.sci | 42 +++++++++
.../RasberryPi/I2C/RPI_I2CSetupInterface.sci | 41 +++++++++
macros/Hardware/RasberryPi/I2C/RPI_I2CWrite.sci | 41 +++++++++
.../Hardware/RasberryPi/I2C/RPI_I2CWriteReg16.sci | 42 +++++++++
.../Hardware/RasberryPi/I2C/RPI_I2CWriteReg8.sci | 42 +++++++++
macros/Hardware/RasberryPi/I2C/RPI_i2cdetect.sci | 38 +++++++++
macros/Hardware/RasberryPi/I2C/buildmacros.sce | 14 +++
macros/Hardware/RasberryPi/I2C/names | 9 ++
.../RasberryPi/Interrupt/RPI_waitForInterrupt.sci | 45 ++++++++++
.../Hardware/RasberryPi/Interrupt/buildmacros.sce | 14 +++
macros/Hardware/RasberryPi/Interrupt/names | 1 +
macros/Hardware/RasberryPi/Misc/RPI_boardRev.sci | 34 ++++++++
macros/Hardware/RasberryPi/Misc/RPI_padDrive.sci | 40 +++++++++
.../Hardware/RasberryPi/Misc/RPI_sn3218Setup.sci | 40 +++++++++
macros/Hardware/RasberryPi/Misc/buildmacros.sce | 14 +++
macros/Hardware/RasberryPi/Misc/names | 3 +
macros/Hardware/RasberryPi/RPI_DelayMicro.sci | 38 ---------
macros/Hardware/RasberryPi/RPI_DelayMilli.sci | 39 ---------
macros/Hardware/RasberryPi/RPI_DigitalIn.sci | 43 ----------
macros/Hardware/RasberryPi/RPI_DigitalOut.sci | 44 ----------
macros/Hardware/RasberryPi/RPI_DigitalSetup.sci | 36 --------
macros/Hardware/RasberryPi/RPI_GetMicros.sci | 39 ---------
macros/Hardware/RasberryPi/RPI_GetMillis.sci | 39 ---------
macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci | 35 --------
macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci | 32 -------
macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci | 35 --------
macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci | 39 ---------
macros/Hardware/RasberryPi/RPI_PinISR.sci | 56 ------------
macros/Hardware/RasberryPi/RPI_SerialClose.sci | 33 --------
macros/Hardware/RasberryPi/RPI_SerialFlush.sci | 34 --------
macros/Hardware/RasberryPi/RPI_SerialGetChar.sci | 36 --------
macros/Hardware/RasberryPi/RPI_SerialSendChar.sci | 37 --------
macros/Hardware/RasberryPi/RPI_SerialSendData.sci | 38 ---------
macros/Hardware/RasberryPi/RPI_SerialSetup.sci | 36 --------
macros/Hardware/RasberryPi/RPI_adress.sci | 34 ++++++++
macros/Hardware/RasberryPi/SPI/RPI_SPIDataRW.sci | 42 +++++++++
macros/Hardware/RasberryPi/SPI/RPI_SPIGetFd.sci | 39 +++++++++
macros/Hardware/RasberryPi/SPI/RPI_SPISetup.sci | 43 ++++++++++
.../Hardware/RasberryPi/SPI/RPI_SPISetupMode.sci | 41 +++++++++
macros/Hardware/RasberryPi/SPI/buildmacros.sce | 14 +++
macros/Hardware/RasberryPi/SPI/names | 4 +
.../Hardware/RasberryPi/Serial/RPI_serialClose.sci | 40 +++++++++
.../RasberryPi/Serial/RPI_serialDataAvail.sci | 40 +++++++++
.../Hardware/RasberryPi/Serial/RPI_serialFlush.sci | 40 +++++++++
.../RasberryPi/Serial/RPI_serialGetchar.sci | 40 +++++++++
.../Hardware/RasberryPi/Serial/RPI_serialOpen.sci | 41 +++++++++
.../RasberryPi/Serial/RPI_serialPrintf.sci | 41 +++++++++
.../RasberryPi/Serial/RPI_serialPutchar.sci | 41 +++++++++
.../Hardware/RasberryPi/Serial/RPI_serialPuts.sci | 41 +++++++++
macros/Hardware/RasberryPi/Serial/buildmacros.sce | 14 +++
macros/Hardware/RasberryPi/Serial/names | 8 ++
macros/Hardware/RasberryPi/Setup/RPI_getAlt.sci | 40 +++++++++
macros/Hardware/RasberryPi/Setup/RPI_pinMode.sci | 60 +++++++++++++
.../Hardware/RasberryPi/Setup/RPI_pinModeAlt.sci | 55 ++++++++++++
.../Hardware/RasberryPi/Setup/RPI_pinNumbering.sci | 54 ++++++++++++
.../Hardware/RasberryPi/Setup/RPI_pullControl.sci | 60 +++++++++++++
macros/Hardware/RasberryPi/Setup/buildmacros.sce | 14 +++
macros/Hardware/RasberryPi/Setup/names | 5 ++
macros/Hardware/RasberryPi/Shift/RPI_shiftIn.sci | 42 +++++++++
macros/Hardware/RasberryPi/Shift/RPI_shiftOut.sci | 43 ++++++++++
.../Hardware/RasberryPi/Shift/RPI_sr595Setup.sci | 44 ++++++++++
macros/Hardware/RasberryPi/Shift/buildmacros.sce | 14 +++
macros/Hardware/RasberryPi/Shift/names | 3 +
.../Hardware/RasberryPi/Soft/RPI_softPwmCreate.sci | 44 ++++++++++
.../Hardware/RasberryPi/Soft/RPI_softPwmStop.sci | 40 +++++++++
.../Hardware/RasberryPi/Soft/RPI_softPwmWrite.sci | 41 +++++++++
.../RasberryPi/Soft/RPI_softToneCreate.sci | 43 ++++++++++
.../Hardware/RasberryPi/Soft/RPI_softToneStop.sci | 40 +++++++++
.../Hardware/RasberryPi/Soft/RPI_softToneWrite.sci | 41 +++++++++
macros/Hardware/RasberryPi/Soft/buildmacros.sce | 14 +++
macros/Hardware/RasberryPi/Soft/names | 6 ++
macros/Hardware/RasberryPi/Timing/RPI_delay.sci | 40 +++++++++
.../Hardware/RasberryPi/Timing/RPI_delayMicro.sci | 40 +++++++++
macros/Hardware/RasberryPi/Timing/RPI_micros.sci | 37 ++++++++
macros/Hardware/RasberryPi/Timing/RPI_millis.sci | 37 ++++++++
macros/Hardware/RasberryPi/Timing/buildmacros.sce | 14 +++
macros/Hardware/RasberryPi/Timing/names | 4 +
macros/Hardware/RasberryPi/buildmacros.sce | 49 ++++++++++-
macros/Hardware/RasberryPi/cleanmacros.sce | 20 +++++
.../RasberryPi/gertBoard/RPI_analogRead.sci | 40 +++++++++
.../RasberryPi/gertBoard/RPI_analogWrite.sci | 41 +++++++++
.../gertBoard/RPI_gertboardAnalogRead.sci | 42 +++++++++
.../gertBoard/RPI_gertboardAnalogSetup.sci | 41 +++++++++
.../gertBoard/RPI_gertboardAnalogWrite.sci | 42 +++++++++
.../RasberryPi/gertBoard/RPI_gertboardSPISetup.sci | 39 +++++++++
.../Hardware/RasberryPi/gertBoard/buildmacros.sce | 14 +++
macros/Hardware/RasberryPi/gertBoard/names | 6 ++
macros/Hardware/RasberryPi/lcd/RPI_lcdCharDef.sci | 44 ++++++++++
macros/Hardware/RasberryPi/lcd/RPI_lcdClear.sci | 40 +++++++++
macros/Hardware/RasberryPi/lcd/RPI_lcdCursor.sci | 41 +++++++++
.../Hardware/RasberryPi/lcd/RPI_lcdCursorBlink.sci | 41 +++++++++
macros/Hardware/RasberryPi/lcd/RPI_lcdDisplay.sci | 41 +++++++++
macros/Hardware/RasberryPi/lcd/RPI_lcdHome.sci | 40 +++++++++
macros/Hardware/RasberryPi/lcd/RPI_lcdInit.sci | 54 ++++++++++++
macros/Hardware/RasberryPi/lcd/RPI_lcdPosition.sci | 42 +++++++++
macros/Hardware/RasberryPi/lcd/RPI_lcdPrintf.sci | 41 +++++++++
macros/Hardware/RasberryPi/lcd/RPI_lcdPutchar.sci | 41 +++++++++
macros/Hardware/RasberryPi/lcd/RPI_lcdPuts.sci | 42 +++++++++
.../Hardware/RasberryPi/lcd/RPI_lcdSendCommand.sci | 41 +++++++++
macros/Hardware/RasberryPi/lcd/buildmacros.sce | 14 +++
macros/Hardware/RasberryPi/lcd/names | 12 +++
.../lcd128x64/RPI_lcd128x64Orientation.sci | 48 +++++++++++
.../RasberryPi/lcd128x64/RPI_lcd128x64circle.sci | 44 ++++++++++
.../RasberryPi/lcd128x64/RPI_lcd128x64clear.sci | 40 +++++++++
.../RasberryPi/lcd128x64/RPI_lcd128x64ellipse.sci | 45 ++++++++++
.../RasberryPi/lcd128x64/RPI_lcd128x64line.sci | 44 ++++++++++
.../RasberryPi/lcd128x64/RPI_lcd128x64lineTo.sci | 42 +++++++++
.../RasberryPi/lcd128x64/RPI_lcd128x64point.sci | 42 +++++++++
.../RasberryPi/lcd128x64/RPI_lcd128x64putchar.sci | 44 ++++++++++
.../RasberryPi/lcd128x64/RPI_lcd128x64puts.sci | 44 ++++++++++
.../lcd128x64/RPI_lcd128x64rectangle.sci | 45 ++++++++++
.../lcd128x64/RPI_lcd128x64setOrigin.sci | 41 +++++++++
.../RasberryPi/lcd128x64/RPI_lcd128x64setup.sci | 37 ++++++++
.../Hardware/RasberryPi/lcd128x64/buildmacros.sce | 14 +++
macros/Hardware/RasberryPi/lcd128x64/names | 12 +++
macros/Hardware/RasberryPi/lib | Bin 924 -> 0 bytes
.../Hardware/RasberryPi/mcp/RPI_mcp23008Setup.sci | 41 +++++++++
.../Hardware/RasberryPi/mcp/RPI_mcp23016Setup.sci | 41 +++++++++
.../Hardware/RasberryPi/mcp/RPI_mcp23017Setup.sci | 41 +++++++++
.../Hardware/RasberryPi/mcp/RPI_mcp23s08Setup.sci | 42 +++++++++
.../Hardware/RasberryPi/mcp/RPI_mcp23s17Setup.sci | 42 +++++++++
macros/Hardware/RasberryPi/mcp/buildmacros.sce | 14 +++
macros/Hardware/RasberryPi/mcp/names | 5 ++
macros/Hardware/RasberryPi/names | 22 +----
.../RasberryPi/old/GetRPISupportFunctions.sci | 48 +++++++++++
.../RasberryPi/old/IsRPISupportFunction.sci | 32 +++++++
macros/Hardware/RasberryPi/old/RPI_DelayMicro.sci | 38 +++++++++
macros/Hardware/RasberryPi/old/RPI_DelayMilli.sci | 39 +++++++++
macros/Hardware/RasberryPi/old/RPI_DigitalIn.sci | 43 ++++++++++
macros/Hardware/RasberryPi/old/RPI_DigitalOut.sci | 44 ++++++++++
.../Hardware/RasberryPi/old/RPI_DigitalSetup.sci | 36 ++++++++
macros/Hardware/RasberryPi/old/RPI_GetMicros.sci | 39 +++++++++
macros/Hardware/RasberryPi/old/RPI_GetMillis.sci | 39 +++++++++
.../RasberryPi/old/RPI_HardPWMSetClock.sci | 35 ++++++++
.../Hardware/RasberryPi/old/RPI_HardPWMSetMode.sci | 32 +++++++
.../RasberryPi/old/RPI_HardPWMSetRange.sci | 35 ++++++++
.../Hardware/RasberryPi/old/RPI_HardPWMWrite.sci | 39 +++++++++
macros/Hardware/RasberryPi/old/RPI_PinISR.sci | 56 ++++++++++++
macros/Hardware/RasberryPi/old/RPI_SerialClose.sci | 33 ++++++++
macros/Hardware/RasberryPi/old/RPI_SerialFlush.sci | 34 ++++++++
.../Hardware/RasberryPi/old/RPI_SerialGetChar.sci | 36 ++++++++
.../Hardware/RasberryPi/old/RPI_SerialSendChar.sci | 37 ++++++++
.../Hardware/RasberryPi/old/RPI_SerialSendData.sci | 38 +++++++++
macros/Hardware/RasberryPi/old/RPI_SerialSetup.sci | 36 ++++++++
macros/Hardware/RasberryPi/old/buildmacros.sce | 4 +
macros/Hardware/RasberryPi/old/names | 21 +++++
.../RasberryPi/old/u16RPISerialDataAvail.sci | 37 ++++++++
.../Hardware/RasberryPi/pcf/RPI_pcf8574Setup.sci | 43 ++++++++++
.../Hardware/RasberryPi/pcf/RPI_pcf8591Setup.sci | 43 ++++++++++
macros/Hardware/RasberryPi/pcf/buildmacros.sce | 14 +++
macros/Hardware/RasberryPi/pcf/names | 2 +
macros/Hardware/RasberryPi/piGlow/RPI_piGlow1.sci | 42 +++++++++
.../Hardware/RasberryPi/piGlow/RPI_piGlowLeg.sci | 41 +++++++++
.../Hardware/RasberryPi/piGlow/RPI_piGlowRing.sci | 41 +++++++++
.../Hardware/RasberryPi/piGlow/RPI_piGlowSetup.sci | 42 +++++++++
macros/Hardware/RasberryPi/piGlow/buildmacros.sce | 14 +++
macros/Hardware/RasberryPi/piGlow/names | 4 +
.../Hardware/RasberryPi/pinMap/RPI_physToGpio.sci | 40 +++++++++
.../Hardware/RasberryPi/pinMap/RPI_wpiToGpio.sci | 40 +++++++++
macros/Hardware/RasberryPi/pinMap/buildmacros.sce | 14 +++
macros/Hardware/RasberryPi/pinMap/names | 2 +
macros/Hardware/RasberryPi/pwm/RPI_pwmClock.sci | 40 +++++++++
macros/Hardware/RasberryPi/pwm/RPI_pwmMode.sci | 46 ++++++++++
macros/Hardware/RasberryPi/pwm/RPI_pwmRange.sci | 40 +++++++++
.../Hardware/RasberryPi/pwm/RPI_pwmToneWrite.sci | 41 +++++++++
macros/Hardware/RasberryPi/pwm/RPI_pwmWrite.sci | 45 ++++++++++
macros/Hardware/RasberryPi/pwm/buildmacros.sce | 14 +++
macros/Hardware/RasberryPi/pwm/names | 5 ++
macros/Hardware/RasberryPi/raspi.sci | 94 +++++++++++++++++++++
macros/Hardware/RasberryPi/raspi_close.sci | 34 ++++++++
.../Hardware/RasberryPi/u16RPISerialDataAvail.sci | 37 --------
181 files changed, 5416 insertions(+), 747 deletions(-)
delete mode 100644 macros/Hardware/AVR/lib
create mode 100755 macros/Hardware/RasberryPi/Digital/RPI_digitalRead.sci
create mode 100755 macros/Hardware/RasberryPi/Digital/RPI_digitalReadByte.sci
create mode 100755 macros/Hardware/RasberryPi/Digital/RPI_digitalWrite.sci
create mode 100755 macros/Hardware/RasberryPi/Digital/RPI_digitalWriteByte.sci
create mode 100755 macros/Hardware/RasberryPi/Digital/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/Digital/names
create mode 100755 macros/Hardware/RasberryPi/I2C/RPI_I2CRead.sci
create mode 100755 macros/Hardware/RasberryPi/I2C/RPI_I2CReadReg16.sci
create mode 100755 macros/Hardware/RasberryPi/I2C/RPI_I2CReadReg8.sci
create mode 100755 macros/Hardware/RasberryPi/I2C/RPI_I2CSetup.sci
create mode 100755 macros/Hardware/RasberryPi/I2C/RPI_I2CSetupInterface.sci
create mode 100755 macros/Hardware/RasberryPi/I2C/RPI_I2CWrite.sci
create mode 100755 macros/Hardware/RasberryPi/I2C/RPI_I2CWriteReg16.sci
create mode 100755 macros/Hardware/RasberryPi/I2C/RPI_I2CWriteReg8.sci
create mode 100755 macros/Hardware/RasberryPi/I2C/RPI_i2cdetect.sci
create mode 100755 macros/Hardware/RasberryPi/I2C/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/I2C/names
create mode 100755 macros/Hardware/RasberryPi/Interrupt/RPI_waitForInterrupt.sci
create mode 100755 macros/Hardware/RasberryPi/Interrupt/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/Interrupt/names
create mode 100755 macros/Hardware/RasberryPi/Misc/RPI_boardRev.sci
create mode 100755 macros/Hardware/RasberryPi/Misc/RPI_padDrive.sci
create mode 100755 macros/Hardware/RasberryPi/Misc/RPI_sn3218Setup.sci
create mode 100755 macros/Hardware/RasberryPi/Misc/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/Misc/names
delete mode 100644 macros/Hardware/RasberryPi/RPI_DelayMicro.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_DelayMilli.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_DigitalIn.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_DigitalOut.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_GetMicros.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_GetMillis.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_PinISR.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_SerialClose.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_SerialFlush.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_SerialGetChar.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_SerialSendChar.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_SerialSendData.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_SerialSetup.sci
create mode 100755 macros/Hardware/RasberryPi/RPI_adress.sci
create mode 100755 macros/Hardware/RasberryPi/SPI/RPI_SPIDataRW.sci
create mode 100755 macros/Hardware/RasberryPi/SPI/RPI_SPIGetFd.sci
create mode 100755 macros/Hardware/RasberryPi/SPI/RPI_SPISetup.sci
create mode 100755 macros/Hardware/RasberryPi/SPI/RPI_SPISetupMode.sci
create mode 100755 macros/Hardware/RasberryPi/SPI/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/SPI/names
create mode 100755 macros/Hardware/RasberryPi/Serial/RPI_serialClose.sci
create mode 100755 macros/Hardware/RasberryPi/Serial/RPI_serialDataAvail.sci
create mode 100755 macros/Hardware/RasberryPi/Serial/RPI_serialFlush.sci
create mode 100755 macros/Hardware/RasberryPi/Serial/RPI_serialGetchar.sci
create mode 100755 macros/Hardware/RasberryPi/Serial/RPI_serialOpen.sci
create mode 100755 macros/Hardware/RasberryPi/Serial/RPI_serialPrintf.sci
create mode 100755 macros/Hardware/RasberryPi/Serial/RPI_serialPutchar.sci
create mode 100755 macros/Hardware/RasberryPi/Serial/RPI_serialPuts.sci
create mode 100755 macros/Hardware/RasberryPi/Serial/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/Serial/names
create mode 100755 macros/Hardware/RasberryPi/Setup/RPI_getAlt.sci
create mode 100755 macros/Hardware/RasberryPi/Setup/RPI_pinMode.sci
create mode 100755 macros/Hardware/RasberryPi/Setup/RPI_pinModeAlt.sci
create mode 100755 macros/Hardware/RasberryPi/Setup/RPI_pinNumbering.sci
create mode 100755 macros/Hardware/RasberryPi/Setup/RPI_pullControl.sci
create mode 100755 macros/Hardware/RasberryPi/Setup/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/Setup/names
create mode 100755 macros/Hardware/RasberryPi/Shift/RPI_shiftIn.sci
create mode 100755 macros/Hardware/RasberryPi/Shift/RPI_shiftOut.sci
create mode 100755 macros/Hardware/RasberryPi/Shift/RPI_sr595Setup.sci
create mode 100755 macros/Hardware/RasberryPi/Shift/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/Shift/names
create mode 100755 macros/Hardware/RasberryPi/Soft/RPI_softPwmCreate.sci
create mode 100755 macros/Hardware/RasberryPi/Soft/RPI_softPwmStop.sci
create mode 100755 macros/Hardware/RasberryPi/Soft/RPI_softPwmWrite.sci
create mode 100755 macros/Hardware/RasberryPi/Soft/RPI_softToneCreate.sci
create mode 100755 macros/Hardware/RasberryPi/Soft/RPI_softToneStop.sci
create mode 100755 macros/Hardware/RasberryPi/Soft/RPI_softToneWrite.sci
create mode 100755 macros/Hardware/RasberryPi/Soft/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/Soft/names
create mode 100755 macros/Hardware/RasberryPi/Timing/RPI_delay.sci
create mode 100755 macros/Hardware/RasberryPi/Timing/RPI_delayMicro.sci
create mode 100755 macros/Hardware/RasberryPi/Timing/RPI_micros.sci
create mode 100755 macros/Hardware/RasberryPi/Timing/RPI_millis.sci
create mode 100755 macros/Hardware/RasberryPi/Timing/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/Timing/names
mode change 100644 => 100755 macros/Hardware/RasberryPi/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/cleanmacros.sce
create mode 100755 macros/Hardware/RasberryPi/gertBoard/RPI_analogRead.sci
create mode 100755 macros/Hardware/RasberryPi/gertBoard/RPI_analogWrite.sci
create mode 100755 macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogRead.sci
create mode 100755 macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogSetup.sci
create mode 100755 macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogWrite.sci
create mode 100755 macros/Hardware/RasberryPi/gertBoard/RPI_gertboardSPISetup.sci
create mode 100755 macros/Hardware/RasberryPi/gertBoard/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/gertBoard/names
create mode 100755 macros/Hardware/RasberryPi/lcd/RPI_lcdCharDef.sci
create mode 100755 macros/Hardware/RasberryPi/lcd/RPI_lcdClear.sci
create mode 100755 macros/Hardware/RasberryPi/lcd/RPI_lcdCursor.sci
create mode 100755 macros/Hardware/RasberryPi/lcd/RPI_lcdCursorBlink.sci
create mode 100755 macros/Hardware/RasberryPi/lcd/RPI_lcdDisplay.sci
create mode 100755 macros/Hardware/RasberryPi/lcd/RPI_lcdHome.sci
create mode 100755 macros/Hardware/RasberryPi/lcd/RPI_lcdInit.sci
create mode 100755 macros/Hardware/RasberryPi/lcd/RPI_lcdPosition.sci
create mode 100755 macros/Hardware/RasberryPi/lcd/RPI_lcdPrintf.sci
create mode 100755 macros/Hardware/RasberryPi/lcd/RPI_lcdPutchar.sci
create mode 100755 macros/Hardware/RasberryPi/lcd/RPI_lcdPuts.sci
create mode 100755 macros/Hardware/RasberryPi/lcd/RPI_lcdSendCommand.sci
create mode 100755 macros/Hardware/RasberryPi/lcd/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/lcd/names
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64Orientation.sci
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64circle.sci
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64clear.sci
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64ellipse.sci
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64line.sci
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64lineTo.sci
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64point.sci
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64putchar.sci
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64puts.sci
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64rectangle.sci
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64setOrigin.sci
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64setup.sci
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/names
delete mode 100644 macros/Hardware/RasberryPi/lib
create mode 100755 macros/Hardware/RasberryPi/mcp/RPI_mcp23008Setup.sci
create mode 100755 macros/Hardware/RasberryPi/mcp/RPI_mcp23016Setup.sci
create mode 100755 macros/Hardware/RasberryPi/mcp/RPI_mcp23017Setup.sci
create mode 100755 macros/Hardware/RasberryPi/mcp/RPI_mcp23s08Setup.sci
create mode 100755 macros/Hardware/RasberryPi/mcp/RPI_mcp23s17Setup.sci
create mode 100755 macros/Hardware/RasberryPi/mcp/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/mcp/names
mode change 100644 => 100755 macros/Hardware/RasberryPi/names
create mode 100644 macros/Hardware/RasberryPi/old/GetRPISupportFunctions.sci
create mode 100644 macros/Hardware/RasberryPi/old/IsRPISupportFunction.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_DelayMicro.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_DelayMilli.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_DigitalIn.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_DigitalOut.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_DigitalSetup.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_GetMicros.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_GetMillis.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_HardPWMSetClock.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_HardPWMSetMode.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_HardPWMSetRange.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_HardPWMWrite.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_PinISR.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_SerialClose.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_SerialFlush.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_SerialGetChar.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_SerialSendChar.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_SerialSendData.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_SerialSetup.sci
create mode 100644 macros/Hardware/RasberryPi/old/buildmacros.sce
create mode 100644 macros/Hardware/RasberryPi/old/names
create mode 100644 macros/Hardware/RasberryPi/old/u16RPISerialDataAvail.sci
create mode 100755 macros/Hardware/RasberryPi/pcf/RPI_pcf8574Setup.sci
create mode 100755 macros/Hardware/RasberryPi/pcf/RPI_pcf8591Setup.sci
create mode 100755 macros/Hardware/RasberryPi/pcf/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/pcf/names
create mode 100755 macros/Hardware/RasberryPi/piGlow/RPI_piGlow1.sci
create mode 100755 macros/Hardware/RasberryPi/piGlow/RPI_piGlowLeg.sci
create mode 100755 macros/Hardware/RasberryPi/piGlow/RPI_piGlowRing.sci
create mode 100755 macros/Hardware/RasberryPi/piGlow/RPI_piGlowSetup.sci
create mode 100755 macros/Hardware/RasberryPi/piGlow/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/piGlow/names
create mode 100755 macros/Hardware/RasberryPi/pinMap/RPI_physToGpio.sci
create mode 100755 macros/Hardware/RasberryPi/pinMap/RPI_wpiToGpio.sci
create mode 100755 macros/Hardware/RasberryPi/pinMap/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/pinMap/names
create mode 100755 macros/Hardware/RasberryPi/pwm/RPI_pwmClock.sci
create mode 100755 macros/Hardware/RasberryPi/pwm/RPI_pwmMode.sci
create mode 100755 macros/Hardware/RasberryPi/pwm/RPI_pwmRange.sci
create mode 100755 macros/Hardware/RasberryPi/pwm/RPI_pwmToneWrite.sci
create mode 100755 macros/Hardware/RasberryPi/pwm/RPI_pwmWrite.sci
create mode 100755 macros/Hardware/RasberryPi/pwm/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/pwm/names
create mode 100755 macros/Hardware/RasberryPi/raspi.sci
create mode 100755 macros/Hardware/RasberryPi/raspi_close.sci
delete mode 100644 macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib
deleted file mode 100644
index 53e56599..00000000
Binary files a/macros/Hardware/AVR/lib and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/Digital/RPI_digitalRead.sci b/macros/Hardware/RasberryPi/Digital/RPI_digitalRead.sci
new file mode 100755
index 00000000..f3f229f9
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Digital/RPI_digitalRead.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_digitalRead(pin)
+// Function to read the digital voltage at the given pin
+//
+// Calling Sequence
+// v=RPI_digitalRead(pin)
+//
+// Parameters
+// pin: The pin number to read the voltage from. Numbering sequence to be followed as initiated using RPI_pinNumbering function.
+//
+// Description
+// This funtion reads the digital voltage at the given pin. Returns a 0 (for low) and 1 (for high).
+// Note: pin should be set for input mode using RPI_pinMode. The function will also return 0/1 corresponding to what the voltage is set for an output pin.
+//
+// Examples
+// v=RPI_digitalRead(0)
+// See also
+// RPI_analogWrite, RPI_analogRead, RPI_digitalWrite, RPI_pinNumbering, RPI_pinMode
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="diR#1#"+string(pin)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Digital/RPI_digitalReadByte.sci b/macros/Hardware/RasberryPi/Digital/RPI_digitalReadByte.sci
new file mode 100755
index 00000000..5cbccc21
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Digital/RPI_digitalReadByte.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_digitalReadByte()
+// Function to read first 8 GPIO pins
+//
+// Calling Sequence
+// b=RPI_digitalReadByte()
+//
+// Description
+// This function read the state of the first eight GPIO pins at once. The state is read from pin0 to pin7.
+//
+// Note: The MSB-LSB sequence here is opposite of that of the RPI_digitalWriteByte.
+//
+// Examples
+// b=RPI_digitalReadByte()
+// See also
+// RPI_digitalWriteByte, RPI_digitalRead
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="BtR#0#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Digital/RPI_digitalWrite.sci b/macros/Hardware/RasberryPi/Digital/RPI_digitalWrite.sci
new file mode 100755
index 00000000..d4ac660b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Digital/RPI_digitalWrite.sci
@@ -0,0 +1,46 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_digitalWrite(pin,Volt)
+// Function to set digital voltage at the given pin
+//
+// Calling Sequence
+// RPI_digitalWrite(pin,Volt)
+//
+// Parameters
+// pin : The pin number to set the voltage at. Numbering sequence to be followed as initiated using RPI_pinNumbering function.
+// Volt: Digital voltage to set. 0 (for logic-LOW) or 1 (for logic-HIGH)
+//
+// Description
+// This funtion sets the voltage at the given pin. 0v for logic 0 and 3.3v for logic 1.
+// Note: pin should be set for output mode using RPI_pinMode.
+//
+// Examples
+// RPI_digitalWrite(0,1)
+// See also
+// RPI_analogWrite, RPI_digitalRead, RPI_digitalRead, RPI_pinNumbering, RPI_pinMode
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ if (Volt==0 | Volt==1) then
+ commande="diW#2#"+string(pin)+"#"+string(Volt)+"#";
+ else
+ error("Voltage logic should be 0 or 1.");
+ end
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Digital/RPI_digitalWriteByte.sci b/macros/Hardware/RasberryPi/Digital/RPI_digitalWriteByte.sci
new file mode 100755
index 00000000..f7f9191c
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Digital/RPI_digitalWriteByte.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_digitalWriteByte(Byte)
+// Function to set first eight GPIO pins to a particular value
+//
+// Calling Sequence
+// RPI_digitalWriteByte(Byte)
+//
+// Parameters
+// Byte: An 8-bit byte to write on the first 8 GPIO pins. Inter from 0 to 255.
+//
+// Description
+// This writes the 8-bit byte supplied to the first 8 GPIO pins. It’s the fastest way to set all 8 bits at once to a particular value, although it still takes two write operations to the Pi’s GPIO hardware. The state is written from pin7 to pin0.
+//
+// Note: The MSB-LSB sequence here is opposite to that from RPI_digitalReadByte.
+//
+// Examples
+// RPI_digitalWriteByte(128)
+// See also
+// RPI_digitalReadByte, RPI_digitalWrite
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="BtW#1#"+string(Byte)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Digital/buildmacros.sce b/macros/Hardware/RasberryPi/Digital/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Digital/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/Digital/names b/macros/Hardware/RasberryPi/Digital/names
new file mode 100755
index 00000000..27fe63bc
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Digital/names
@@ -0,0 +1,4 @@
+RPI_digitalRead
+RPI_digitalReadByte
+RPI_digitalWrite
+RPI_digitalWriteByte
diff --git a/macros/Hardware/RasberryPi/I2C/RPI_I2CRead.sci b/macros/Hardware/RasberryPi/I2C/RPI_I2CRead.sci
new file mode 100755
index 00000000..afd98500
--- /dev/null
+++ b/macros/Hardware/RasberryPi/I2C/RPI_I2CRead.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_I2CRead(fd)
+// Function to read device
+//
+// Calling Sequence
+// RPI_I2CRead(fd)
+//
+// Parameters
+// fd: file descriptor obtained from RPI_I2CSetup
+//
+// Description
+// Function for a simple device read. Some devices present data when you read them without having to do any register transactions.
+//
+// Examples
+// RPI_I2CRead(13)
+// See also
+// RPI_i2cdetect, RPI_I2CReadReg8, RPI_I2CReadReg16, RPI_I2CWrite, RPI_I2CWriteReg8, RPI_I2CWriteReg16, RPI_I2CSetupInterface, RPI_I2CSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="CR1#1#"+string(fd)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/I2C/RPI_I2CReadReg16.sci b/macros/Hardware/RasberryPi/I2C/RPI_I2CReadReg16.sci
new file mode 100755
index 00000000..f0ad9898
--- /dev/null
+++ b/macros/Hardware/RasberryPi/I2C/RPI_I2CReadReg16.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_I2CReadReg16(fd,reg)
+// Function to read 16-bit valu from the register
+//
+// Calling Sequence
+// RPI_I2CReadReg16(fd,reg)
+//
+// Parameters
+// fd : file descriptor obtained from RPI_I2CSetup
+// reg: integer register to read data from
+//
+// Description
+// This function reads a 16-bit value from the device register indicated.
+//
+// Examples
+// RPI_I2CReadReg16(13,0x40)
+// See also
+// RPI_i2cdetect, RPI_I2CRead, RPI_I2CReadReg8, RPI_I2CWrite, RPI_I2CWriteReg8, RPI_I2CWriteReg16, RPI_I2CSetupInterface, RPI_I2CSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="CR3#2#"+string(fd)+"#"+string(reg)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/I2C/RPI_I2CReadReg8.sci b/macros/Hardware/RasberryPi/I2C/RPI_I2CReadReg8.sci
new file mode 100755
index 00000000..d2ab59fd
--- /dev/null
+++ b/macros/Hardware/RasberryPi/I2C/RPI_I2CReadReg8.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_I2CReadReg8(fd,reg)
+// Function to read 8-bit valu from the register
+//
+// Calling Sequence
+// RPI_I2CReadReg8(fd,reg)
+//
+// Parameters
+// fd : file descriptor obtained from RPI_I2CSetup
+// reg: integer register to read data from
+//
+// Description
+// This function reads an 8-bit value from the device register indicated.
+//
+// Examples
+// RPI_I2CReadReg8(13,0x40)
+// See also
+// RPI_i2cdetect, RPI_I2CRead, RPI_I2CReadReg16, RPI_I2CWrite, RPI_I2CWriteReg8, RPI_I2CWriteReg16, RPI_I2CSetupInterface, RPI_I2CSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="CR2#2#"+string(fd)+"#"+string(reg)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/I2C/RPI_I2CSetup.sci b/macros/Hardware/RasberryPi/I2C/RPI_I2CSetup.sci
new file mode 100755
index 00000000..801c2e6d
--- /dev/null
+++ b/macros/Hardware/RasberryPi/I2C/RPI_I2CSetup.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_I2CSetup(addr)
+// Function to initialize the I2C system
+//
+// Calling Sequence
+// fd=RPI_I2CSetup(addr)
+//
+// Parameters
+// addr: integer, the I2C number of the device obtained using RPI_i2cdetect
+//
+// Description
+// This initialises the I2C system with your given device identifier. The addr is the I2C number of the device and obtained using RPI_i2cdetect program. The function works out the Raspberry Pi revision and opens the appropriate device in /dev.
+//
+//The return value is the standard Linux filehandle, or -1 if any error – in which case, errno can be consulted as usual.
+//
+// Examples
+// fd=RPI_I2CSetup(64)
+// See also
+// RPI_i2cdetect, RPI_I2CRead, RPI_I2CReadReg8, RPI_I2CReadReg16, RPI_I2CWrite, RPI_I2CWriteReg8, RPI_I2CWriteReg16, RPI_I2CSetupInterface
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="CSe#1#"+string(addr)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/I2C/RPI_I2CSetupInterface.sci b/macros/Hardware/RasberryPi/I2C/RPI_I2CSetupInterface.sci
new file mode 100755
index 00000000..fed4f059
--- /dev/null
+++ b/macros/Hardware/RasberryPi/I2C/RPI_I2CSetupInterface.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_I2CSetupInterface(device,addr)
+// Function to select different I2C interfaces
+//
+// Calling Sequence
+// I2CSetupInterface(device,addr)
+//
+// Parameters
+// device: device
+// addr : the I2C number of the device obtained using RPI_i2cdetect
+//
+// Description
+// This feature is not implemented currently, and will be used to select different I2C interfaces if the RPi ever receives them.
+//
+// Examples
+// I2CSetupInterface(1,0x48)
+// See also
+// RPI_i2cdetect, RPI_I2CRead, RPI_I2CReadReg8, RPI_I2CReadReg16, RPI_I2CWrite, RPI_I2CWriteReg8, RPI_I2CWriteReg16, RPI_I2CSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="CSI#2#"+string(device)+"#"+string(addr)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/I2C/RPI_I2CWrite.sci b/macros/Hardware/RasberryPi/I2C/RPI_I2CWrite.sci
new file mode 100755
index 00000000..854b3b26
--- /dev/null
+++ b/macros/Hardware/RasberryPi/I2C/RPI_I2CWrite.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_I2CWrite(fd,data)
+// Function to write to device
+//
+// Calling Sequence
+// RPI_I2CWrite(fd,data)
+//
+// Parameters
+// fd : file descriptor obtained from RPI_I2CSetup
+// data: integer data to write to device
+//
+// Description
+// Function for simple device write. Some devices accept data this way without needing to access any internal registers.
+//
+// Examples
+// RPI_I2CWrite(13,100)
+// See also
+// RPI_i2cdetect, RPI_I2CRead, RPI_I2CReadReg8, RPI_I2CReadReg16, RPI_I2CWriteReg8, RPI_I2CWriteReg16, RPI_I2CSetupInterface, RPI_I2CSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="CW1#2#"+string(fd)+"#"+string(data)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/I2C/RPI_I2CWriteReg16.sci b/macros/Hardware/RasberryPi/I2C/RPI_I2CWriteReg16.sci
new file mode 100755
index 00000000..b2e8fb69
--- /dev/null
+++ b/macros/Hardware/RasberryPi/I2C/RPI_I2CWriteReg16.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_I2CWriteReg16(fd,reg,data)
+// Function to write 16-bit data to register
+//
+// Calling Sequence
+// RPI_I2CWriteReg16(fd,reg,data)
+//
+// Parameters
+// fd : file descriptor obtained from RPI_I2CSetup
+// reg : integer register to write data at
+// data: integer data to write to device
+//
+// Description
+// This function writes a 16-bit data value into the device register indicated.
+//
+// Examples
+// RPI_I2CWriteReg16(13,0x40,100)
+// See also
+// RPI_i2cdetect, RPI_I2CRead, RPI_I2CReadReg8, RPI_I2CReadReg16, RPI_I2CWrite, RPI_I2CWriteReg8, RPI_I2CSetupInterface, RPI_I2CSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="CW3#3#"+string(fd)+"#"+string(reg)+"#"+string(data)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/I2C/RPI_I2CWriteReg8.sci b/macros/Hardware/RasberryPi/I2C/RPI_I2CWriteReg8.sci
new file mode 100755
index 00000000..19c81570
--- /dev/null
+++ b/macros/Hardware/RasberryPi/I2C/RPI_I2CWriteReg8.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_I2CWriteReg8(fd,reg,data)
+// Function to write 8-bit data to register
+//
+// Calling Sequence
+// RPI_I2CWriteReg8(fd,reg,data)
+//
+// Parameters
+// fd : file descriptor obtained from RPI_I2CSetup
+// reg : integer register to write data at
+// data: integer data to write to device
+//
+// Description
+// This function writes an 8-bit data value into the device register indicated.
+//
+// Examples
+// RPI_I2CWriteReg8(13,0x40,100)
+// See also
+// RPI_i2cdetect, RPI_I2CRead, RPI_I2CReadReg8, RPI_I2CReadReg16, RPI_I2CWrite, RPI_I2CWriteReg16, RPI_I2CSetupInterface, RPI_I2CSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="CW2#3#"+string(fd)+"#"+string(reg)+"#"+string(data)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/I2C/RPI_i2cdetect.sci b/macros/Hardware/RasberryPi/I2C/RPI_i2cdetect.sci
new file mode 100755
index 00000000..a37bc4cb
--- /dev/null
+++ b/macros/Hardware/RasberryPi/I2C/RPI_i2cdetect.sci
@@ -0,0 +1,38 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_i2cdetect()
+// Function to get the address of attached i2c device
+//
+// Calling Sequence
+// RPI_i2cdetect()
+//
+// Description
+// This function returns the address of the i2c device connected to the Raspberry pi.
+//
+// Examples
+// addr=RPI_i2cdetect()
+// See also
+// RPI_I2CRead, RPI_I2CSetup, RPI_I2CReadReg8, RPI_I2CReadReg16, RPI_I2CSetupInterface, RPI_I2CWrite, RPI_I2CWriteReg8, RPI_I2CWriteReg16
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ rev=RPI_boardRev();
+ commande="i2c#1#i2cdetect -y "+string(strtod(rev)-1)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/I2C/buildmacros.sce b/macros/Hardware/RasberryPi/I2C/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/I2C/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/I2C/names b/macros/Hardware/RasberryPi/I2C/names
new file mode 100755
index 00000000..5a318865
--- /dev/null
+++ b/macros/Hardware/RasberryPi/I2C/names
@@ -0,0 +1,9 @@
+RPI_I2CRead
+RPI_I2CReadReg16
+RPI_I2CReadReg8
+RPI_I2CSetup
+RPI_I2CSetupInterface
+RPI_I2CWrite
+RPI_I2CWriteReg16
+RPI_I2CWriteReg8
+RPI_i2cdetect
diff --git a/macros/Hardware/RasberryPi/Interrupt/RPI_waitForInterrupt.sci b/macros/Hardware/RasberryPi/Interrupt/RPI_waitForInterrupt.sci
new file mode 100755
index 00000000..bb180420
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Interrupt/RPI_waitForInterrupt.sci
@@ -0,0 +1,45 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_waitForInterrupt(pin,timeOut)
+// Function to set a pin to wait for interrupt.
+//
+// Calling Sequence
+// i=RPI_waitForInterrupt(pin,timeOut)
+//
+// Parameters
+// pin : The pin to check for interrupt. Numbering sequence to be followed as initiated using RPI_pinNumbering function.
+// timeOut: The time (in milliseconds) for which to wait for interrupt. -1 to wait forever.
+//
+// Description
+// When called, it will wait for an interrupt event to happen on that pin and the program will be stalled. The return value is -1 if an error occurred (and errno will be set appropriately), 0 if it timed out, or 1 on a successful interrupt event.
+//
+// Before using RPI_waitForInterrupt, first initialise the GPIO pin and at present the only way to do this is to use the gpio program, either in a script, or using the system() call from inside the program.
+// Eg: To wait for a falling-edge interrupt on GPIO pin 0, setup the hardware using (before running the program):
+// gpio edge 0 falling
+//
+// Examples
+// i=RPI_waitForInterrupt(0,5000)
+// See also
+//
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="Int#2#"+string(pin)+"#"+string(timeOut)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Interrupt/buildmacros.sce b/macros/Hardware/RasberryPi/Interrupt/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Interrupt/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/Interrupt/names b/macros/Hardware/RasberryPi/Interrupt/names
new file mode 100755
index 00000000..248c3e24
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Interrupt/names
@@ -0,0 +1 @@
+RPI_waitForInterrupt
diff --git a/macros/Hardware/RasberryPi/Misc/RPI_boardRev.sci b/macros/Hardware/RasberryPi/Misc/RPI_boardRev.sci
new file mode 100755
index 00000000..91ddb333
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Misc/RPI_boardRev.sci
@@ -0,0 +1,34 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_boardRev()
+// Function to print the board revision.
+//
+// Calling Sequence
+// rev=RPI_boardRev()
+//
+// Description
+// This function returns the board revision of the Raspberry Pi. Returns either 1 or 2.
+//
+// Examples
+// rev=RPI_boardRev()
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="bRv#0#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Misc/RPI_padDrive.sci b/macros/Hardware/RasberryPi/Misc/RPI_padDrive.sci
new file mode 100755
index 00000000..f2d0b177
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Misc/RPI_padDrive.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_padDrive(Group,value)
+// Function to set the 'strength' of the pad drivers for a particular group of pins
+//
+// Calling Sequence
+// RPI_padDrive(Group,value)
+//
+// Parameters
+// Group: the group to act on, a number from 0 to 2
+// Value: the strength, from 0 to 7, to set for the group
+//
+// Description
+// This sets the “strength” of the pad drivers for a particular group of pins. There are 3 groups of pins and the drive strength is from 0 to 7. Do not use this unless you know what you are doing
+//
+// Examples
+// RPI_padDrive(0,5)
+// See also
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="pDr#2#"+string(Group)+"#"+string(value)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Misc/RPI_sn3218Setup.sci b/macros/Hardware/RasberryPi/Misc/RPI_sn3218Setup.sci
new file mode 100755
index 00000000..0791c506
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Misc/RPI_sn3218Setup.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_sn3218Setup(pinBase)
+// Function for setting up SN3218 I2C based LED controller.
+//
+// Calling Sequence
+// RPI_sn3218Setup(pinBase)
+//
+// Parameters
+// pinBase: any number above 64. The consecutive 18 pins will be allocated alongwith.
+//
+// Description
+// This function sets up the extension module for the SN3218 I2C based LED controller.There is no I2C device address passed into the setup function – the SN3218 has a fixed I2C address of 0x54, so there’s no need to refer to it other than internally inside the driver. This also means that only one device can be connected to a Raspberry Pi.
+//
+// Examples
+// RPI_sn3218Setup(67)
+// See also
+// RPI_sr595Setup, RPI_pcf8574Setup, RPI_pcf8591Setup, RPI_mcp23008Setup, RPI_mcp23016Setup, RPI_mcp23017Setup, RPI_mcp23s08Setup, RPI_mcp23s17Setup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sn3#1#"+string(pinBase)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Misc/buildmacros.sce b/macros/Hardware/RasberryPi/Misc/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Misc/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/Misc/names b/macros/Hardware/RasberryPi/Misc/names
new file mode 100755
index 00000000..35a4a425
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Misc/names
@@ -0,0 +1,3 @@
+RPI_boardRev
+RPI_padDrive
+RPI_sn3218Setup
diff --git a/macros/Hardware/RasberryPi/RPI_DelayMicro.sci b/macros/Hardware/RasberryPi/RPI_DelayMicro.sci
deleted file mode 100644
index bbb0bb3b..00000000
--- a/macros/Hardware/RasberryPi/RPI_DelayMicro.sci
+++ /dev/null
@@ -1,38 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-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_DelayMilli.sci b/macros/Hardware/RasberryPi/RPI_DelayMilli.sci
deleted file mode 100644
index 13b79625..00000000
--- a/macros/Hardware/RasberryPi/RPI_DelayMilli.sci
+++ /dev/null
@@ -1,39 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_DelayMilli(time)
-// Function to insert some delay in milli seconds 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/RPI_DigitalIn.sci b/macros/Hardware/RasberryPi/RPI_DigitalIn.sci
deleted file mode 100644
index 781c49c8..00000000
--- a/macros/Hardware/RasberryPi/RPI_DigitalIn.sci
+++ /dev/null
@@ -1,43 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-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
-//
-// -----------------------------------------------------------------
-//Pins of header P1 which can be used as GPIO
-supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
- 31,31,33,35,36,37,38,40];
-
-PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
-
-//If given pin does not support GPIO functionality, raise the error
-if(PinIsGPIO == 0)
- error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
-end
-state = 1;
-endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalOut.sci b/macros/Hardware/RasberryPi/RPI_DigitalOut.sci
deleted file mode 100644
index dde3c934..00000000
--- a/macros/Hardware/RasberryPi/RPI_DigitalOut.sci
+++ /dev/null
@@ -1,44 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-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
-//
-// -----------------------------------------------------------------
-//Pins of header P1 which can be used as GPIO
-supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
- 31,31,33,35,36,37,38,40];
-
-PinIsGPIO = members(pin, supported_pins); //Check if output pin supports GPIO
-
-//If given pin does not support GPIO functionality, raise the error
-if(PinIsGPIO == 0)
- error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
-end
-state = 1;
-
-endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci b/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
deleted file mode 100644
index 01d6e07d..00000000
--- a/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
+++ /dev/null
@@ -1,36 +0,0 @@
-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, 2->PWM 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(3,0) //Sets pin 3 of header P1 as input
-//
-// See also
-// RPI_DigitalIn RPI_DigitalOut
-//
-//
-// Authors
-// Siddhesh Wani
-// -----------------------------------------------------------------
-//Pins of header P1 which can be used as GPIO
-supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
- 31,31,33,35,36,37,38,40];
-
-PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
-
-//If given pin does not support GPIO functionality, raise the error
-if(PinIsGPIO == 0)
- error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
-end
-state = 1;
-
-endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_GetMicros.sci b/macros/Hardware/RasberryPi/RPI_GetMicros.sci
deleted file mode 100644
index 6c4db57a..00000000
--- a/macros/Hardware/RasberryPi/RPI_GetMicros.sci
+++ /dev/null
@@ -1,39 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function Micros = RPI_GetMicros()
-// Function to get time in Microsecond since first setup function called.
-//
-// Calling Sequence
-// Micros = RPI_GetMicros()
-//
-// Parameters
-// Micros: time in Microseconds since first setup function called
-//
-// Description
-// This function can be used to get time since first setup function called.
-// Note: To use this function atleast one setup function must be called.
-//
-// Examples
-// start = RPI_GetMicros()
-// RPI_DelayMicro(1000) //This will delay the execution of next code by 100 ms.
-// end = RPI_GetMicros()
-// delay = end- start //This should be approximately 1000 us.
-//
-// See also
-// RPI_GetMillis RPI_DelayMilli 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.
-Micros = 0;
-endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_GetMillis.sci b/macros/Hardware/RasberryPi/RPI_GetMillis.sci
deleted file mode 100644
index c034a705..00000000
--- a/macros/Hardware/RasberryPi/RPI_GetMillis.sci
+++ /dev/null
@@ -1,39 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function Millis = RPI_GetMillis()
-// Function to get time in millisecond since first setup function called.
-//
-// Calling Sequence
-// Millis = RPI_GetMillis()
-//
-// Parameters
-// Millis: time in milliseconds since first setup function called
-//
-// Description
-// This function can be used to get time since first setup function called.
-// Note: To use this function atleast one setup function must be called.
-//
-// Examples
-// start = RPI_GetMillis()
-// RPI_DelayMilli(100) //This will delay the execution of next code by 100 ms.
-// end = RPI_GetMillis()
-// delay = end- start //This should be approximately 100ms.
-//
-// See also
-// RPI_GetMicros RPI_DelayMilli 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.
-Millis = 0;
-endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci b/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci
deleted file mode 100644
index 8448d364..00000000
--- a/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci
+++ /dev/null
@@ -1,35 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_HardPWMSetClock(clock_divisor)
-// Function to set PWM clock. PWM clock frequency is 19.2MHz, which can be reduced
-// using suitable clock_divisor (1 to 2048, powers of 2)
-//
-// Calling Sequence
-// RPI_HardPWMSetClock(clock_divisor)
-//
-// Parameters
-// clock_divisor: Value can be from 1 to 2048, powers of 2.
-// Description
-// This function decides pwm clock.
-// PWM frequency = (PWM Clock frequency/Clock divisor/range)
-// PWM clock frequency = 19.2 MHz
-// clock divisor is setup using RPI_HardPWMSetClock
-// range is setup using RPI_HardPWMSetRange
-// Examples
-//
-// See also
-// RPI_HardPWMSetWrite RPI_HardPWMSetRange
-//
-// 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_HardPWMSetMode.sci b/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci
deleted file mode 100644
index 57b82601..00000000
--- a/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci
+++ /dev/null
@@ -1,32 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_HardPWMSetMode(pwm_mode)
-// Function to set PWM mode. Two modes are available - balanced and mark/space
-//
-// Calling Sequence
-// RPI_HardPWMSetMode(pwm_mode)
-//
-// Parameters
-// pwm_mode: decides pwm mode
-// 0 -> balanced
-// 1 -> mark/space
-// Description
-// This function decides pwm mode
-// Examples
-//
-// See also
-// RPI_HardPWMSetWrite RPI_HardPWMSetRange
-//
-// 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_HardPWMSetRange.sci b/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci
deleted file mode 100644
index c2075e2d..00000000
--- a/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci
+++ /dev/null
@@ -1,35 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_HardPWMSetRange(range_val)
-// Function to set range value for PWM. Range value along with clock divisor
-// decides pwm frequency. Range value must be less than 1024
-//
-// Calling Sequence
-// RPI_HardPWMSetRange(range_val)
-//
-// Parameters
-// range_val: range for pwm
-// Description
-// This function decides range for pwm.
-// PWM frequency = (PWM Clock frequency/Clock divisor/range)
-// PWM clock frequency = 19.2 MHz
-// clock divisor is setup using RPI_HardPWMSetClock
-// range is setup using RPI_HardPWMSetRange
-// Examples
-//
-// See also
-// RPI_HardPWMSetClock RPI_HardPWMWrite
-//
-// 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_HardPWMWrite.sci b/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci
deleted file mode 100644
index dba5e674..00000000
--- a/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci
+++ /dev/null
@@ -1,39 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_HardPWMWrite(pin,value)
-// Function to change pwm duty on specified pin. Hardware PWM is available
-// only on pin 12. So, only '12' should be provided as pin
-//
-// Calling Sequence
-// RPI_HardPWMWrite(12,512) //Value must be smaller than the range set
-// using RPI_HARDPWMSetRange
-//
-// Parameters
-// pin: pin no on which pwm value is to be changed. Currently only 12 is allowed
-// value: pwm value for given pin. This must be less than range value set
-// Description
-// This function changes pwm duty on specified pin. As for RPi, only one pin
-// (pin 12) is available for hardware PWM.
-// PWM frequency = (PWM Clock frequency/Clock divisor/range)
-// PWM clock frequency = 19.2 MHz
-// clock divisor is setup using RPI_HardPWMSetClock
-// range is setup using RPI_HardPWMSetRange
-// Actual PWM duty = value/range
-// Examples
-//
-// See also
-// RPI_HardPWMSetClock RPI_HardPWMSetRange
-//
-// 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_PinISR.sci b/macros/Hardware/RasberryPi/RPI_PinISR.sci
deleted file mode 100644
index c2354c1f..00000000
--- a/macros/Hardware/RasberryPi/RPI_PinISR.sci
+++ /dev/null
@@ -1,56 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_PinISR(pin, edgetype, fn)
-// Function to assign a function to be run when an interrupt occurs on
-// specified pin.
-//
-// Calling Sequence
-// RPI_PinISR(pin, edgetype, fn)
-//
-// Parameters
-// pin : pin whose interrupt is to be configured
-// edgetype: edge on which interrupt is to be monitored
-// 1 -> Falling egde
-// 2 -> Rising egde
-// 3 -> Both egde
-// fn: name of the function to be executed on interrupt occurance
-// Description
-// This functions monitors interrupt on specified pin for specified edge,
-// When that interrupt occurs, function specified by 'fn' is executed.
-// Examples
-// RPI_PinISR(12, 0, Pin12ISR) //executes 'Pin12ISR' on falling edge on
-// pin 12
-// See also
-// RPI_ThreadCreate RPI_DigitalSetup
-//
-//
-// Authors
-// Siddhesh Wani
-// -----------------------------------------------------------------
-
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for RPi.
-
-//Pins of header P1 which can be used as GPIO
-supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
- 31,31,33,35,36,37,38,40];
-
-PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
-
-//If given pin does not support GPIO functionality, raise the error
-if(PinIsGPIO == 0)
- error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
-end
-EdgeTypeSupported = members(edgetype,[1 2 3]);
-
-if(EdgeTypeSupported == 0)
- error(9999, 'SCI2CERROR: Given edgetype is incorrect. Please specify correct edgetype from [1,2,3]')
-end
-
-endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_SerialClose.sci b/macros/Hardware/RasberryPi/RPI_SerialClose.sci
deleted file mode 100644
index f27dd432..00000000
--- a/macros/Hardware/RasberryPi/RPI_SerialClose.sci
+++ /dev/null
@@ -1,33 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_SerialClose(fd)
-// Function to close serial port specified by file descriptor.
-//
-// Calling Sequence
-// RPI_SerialClose(fd)
-//
-// Parameters
-// fd : file descriptor for opened port
-// Description
-// This functions closes the specified serial port
-// Examples
-// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
-// RPI_SerialClose(serial1)
-// See also
-// RPI_SerialOpen RPI_SerialSendChar
-//
-//
-// 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_SerialFlush.sci b/macros/Hardware/RasberryPi/RPI_SerialFlush.sci
deleted file mode 100644
index 9bab386f..00000000
--- a/macros/Hardware/RasberryPi/RPI_SerialFlush.sci
+++ /dev/null
@@ -1,34 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function data = RPI_SerialGetChar(fd)
-// Function to read data from specified serial port
-//
-// Calling Sequence
-// RPI_SerialGetCharfd)
-//
-// Parameters
-// fd: file descriptor returned when serial port was opened
-// Description
-// This functions reads character form specified port. In case no
-// character is available, -1 is returned after 10 sec.
-// Examples
-// serial = RPI_SetupSerial("/dev/ttyAMA0", 9600);
-// RPI_SerialFlush(serial);
-// bytes = RPI_SerialDataAvail(serial);
-//
-// See also
-// RPI_SetupSerial RPI_SendData
-//
-// 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_SerialGetChar.sci b/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci
deleted file mode 100644
index a26e5b97..00000000
--- a/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci
+++ /dev/null
@@ -1,36 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function data = RPI_SerialGetChar(fd)
-// Function to read data from specified serial port
-//
-// Calling Sequence
-// RPI_SerialGetChar(fd)
-//
-// Parameters
-// fd: file descriptor returned when serial port was opened
-// Description
-// This functions reads character form specified port. In case no
-// character is available, -1 is returned after 10 sec.
-// Examples
-// serial = RPI_SetupSerial("/dev/ttyAMA0", 9600);
-// bytes = RPI_SerialDataAvail(serial);
-// if(bytes>0)
-// data = RPI_SerialGetChar(serial) //Reads single character
-// end
-// See also
-// RPI_SetupSerial RPI_SendData
-//
-// Authors
-// Siddhesh Wani
-// -----------------------------------------------------------------
-
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for RPi.
-data = 0;
-endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSendChar.sci b/macros/Hardware/RasberryPi/RPI_SerialSendChar.sci
deleted file mode 100644
index 769b21d2..00000000
--- a/macros/Hardware/RasberryPi/RPI_SerialSendChar.sci
+++ /dev/null
@@ -1,37 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_SerialSendChar(fd, data)
-// Function to send 8-bit char through serial port.
-//
-// Calling Sequence
-// RPI_SerialSendChar(fd, data)
-//
-// Parameters
-// fd : file descriptor for opened port
-// data: 8-bit character data to be sent
-// Description
-// This functions sends input 8-bit character data on specified serial port
-// Examples
-// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
-// RPI_SerialSendChar(serial1, 'H');
-// RPI_SerialSendChar(serial1, 'i');
-// RPI_SerialClose(serial1);
-//
-// See also
-// RPI_SerialOpen RPI_SerialClose
-//
-//
-// 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_SerialSendData.sci b/macros/Hardware/RasberryPi/RPI_SerialSendData.sci
deleted file mode 100644
index c05852b1..00000000
--- a/macros/Hardware/RasberryPi/RPI_SerialSendData.sci
+++ /dev/null
@@ -1,38 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_SerialSendData(fd, data)
-// Function to send data through serial port. Data can be of any datatype and
-// can be scalar or matrix
-//
-// Calling Sequence
-// RPI_SerialSendData(fd, data)
-//
-// Parameters
-// fd : file descriptor for opened port
-// data: data to be sent
-// Description
-// This functions sends input data on specified serial port
-// Examples
-// A = [2 3; 4 5]
-// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
-// RPI_SerialSendData(serial1, A);
-// RPI_SerialClose(serial1);
-//
-// See also
-// RPI_SerialOpen RPI_SerialClose
-//
-//
-// 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_SerialSetup.sci b/macros/Hardware/RasberryPi/RPI_SerialSetup.sci
deleted file mode 100644
index 0f266610..00000000
--- a/macros/Hardware/RasberryPi/RPI_SerialSetup.sci
+++ /dev/null
@@ -1,36 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function fd = RPI_SerialSetup(port, baudrate)
-// Function to setup serial port.
-//
-// Calling Sequence
-// RPI_SerialSetup(port, baudrate)
-//
-// Parameters
-// port : port of RPi to be used (eg. )
-// direction : direction to be set for pin (0 -> INPUT, 1 -> OUTPUT)
-// fd : file descriptor for opened port, -1 for error
-// Description
-// This functions opens the specified serial port and returns file descriptor
-// for the same
-// Examples
-// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
-//
-// See also
-// RPI_SerialClose RPI_SerialSendChar
-//
-//
-// Authors
-// Siddhesh Wani
-// -----------------------------------------------------------------
-
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for RPi.
-fd = 0;
-endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_adress.sci b/macros/Hardware/RasberryPi/RPI_adress.sci
new file mode 100755
index 00000000..4c9aa7f0
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_adress.sci
@@ -0,0 +1,34 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+global RPI_piAdress;
+function RPI_adress(adress)
+ // Function for non-ssh connection to raspberry pi
+ //
+ // Calling Sequence
+ // RPI_adress(adress)
+ //
+ // Parameters
+ // address : Network address of the raspberry pi. Eg:192.168.137.214
+ //
+ // Description
+ // This program is required for the functioning of the remaining toolbox if the server is manually run by the user.
+ //
+ // Examples
+ // RPI_adress('10.42.0.82')
+ // See also
+ // raspi,raspi_close
+ //
+ // Authors
+ // Jorawar Singh
+
+ global RPI_piAdress;
+ RPI_piAdress=adress;
+endfunction
diff --git a/macros/Hardware/RasberryPi/SPI/RPI_SPIDataRW.sci b/macros/Hardware/RasberryPi/SPI/RPI_SPIDataRW.sci
new file mode 100755
index 00000000..186e68ff
--- /dev/null
+++ b/macros/Hardware/RasberryPi/SPI/RPI_SPIDataRW.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_SPIDataRW(channel,data,len)
+// Function to perform simultaneous read-write on SPI
+//
+// Calling Sequence
+// RPI_SPIDataRW(channel,data,len)
+//
+// Parameters
+// channel: channel number, 0 or 1
+// data : data to write as list of integers
+// len : length of the data
+//
+// Description
+// This performs a simultaneous write/read transaction over the selected SPI bus. Data that was in your buffer is overwritten by data returned from the SPI bus.
+//
+// Examples
+// RPI_SPIDataRW(0,[13,58],2)
+// See also
+// RPI_SPISetup, RPI_SPISetupMode, RPI_SPIGetFd
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="SPD#3#"+string(channel)+"#"+string(data)+"#"+string(len)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/SPI/RPI_SPIGetFd.sci b/macros/Hardware/RasberryPi/SPI/RPI_SPIGetFd.sci
new file mode 100755
index 00000000..43cfc098
--- /dev/null
+++ b/macros/Hardware/RasberryPi/SPI/RPI_SPIGetFd.sci
@@ -0,0 +1,39 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_SPIGetFd(channel)
+//
+// Calling Sequence
+// RPI_SPIGetFd(channel)
+//
+// Parameters
+// channel: channel number, 0 or 1
+//
+// Description
+//
+//
+// Examples
+// RPI_SPIGetFd(1)
+// See also
+// RPI_SPIDataRW, RPI_SPISetup, RPI_SPISetupMode
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="SPG#1#"+string(channel)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/SPI/RPI_SPISetup.sci b/macros/Hardware/RasberryPi/SPI/RPI_SPISetup.sci
new file mode 100755
index 00000000..5654cf9b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/SPI/RPI_SPISetup.sci
@@ -0,0 +1,43 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_SPISetup(channel,speed)
+// Function to initialize SPI
+//
+// Calling Sequence
+// RPI_SPISetup(channel,spped)
+//
+// Parameters
+// channel: channel number, 0 or 1
+// speed : SPI clock speed in Hz
+//
+// Description
+// This function initialises a channel (The Pi has 2 channels; 0 and 1). The speed parameter is an integer in the range 500,000 through 32,000,000 and represents the SPI clock speed in Hz.
+//
+//The returned value is the Linux file-descriptor for the device, or -1 on error.
+//
+// Examples
+// RPI_SPISetup(1,500000)
+// See also
+// RPI_SPIDataRW, RPI_SPISetupMode, RPI_SPIGetFd
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="SPS#2#"+string(channel)+"#"+string(speed)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/SPI/RPI_SPISetupMode.sci b/macros/Hardware/RasberryPi/SPI/RPI_SPISetupMode.sci
new file mode 100755
index 00000000..fec785ab
--- /dev/null
+++ b/macros/Hardware/RasberryPi/SPI/RPI_SPISetupMode.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_SPISetupMode(channel,speed,Mode)
+// Function to initialize SPI
+//
+// Calling Sequence
+// RPI_SPISetupMode(channel,spped,Mode)
+//
+// Parameters
+// channel: channel number, 0 or 1
+// speed : SPI clock speed in Hz
+// Mode : integer, mode to set
+//
+// Description
+//
+// Examples
+// RPI_SPISetupMode(1,500000,2)
+// See also
+// RPI_SPIDataRW, RPI_SPISetup, RPI_SPIGetFd
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="SPM#23#"+string(channel)+"#"+string(speed)+"#"+string(Mode)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/SPI/buildmacros.sce b/macros/Hardware/RasberryPi/SPI/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/SPI/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/SPI/names b/macros/Hardware/RasberryPi/SPI/names
new file mode 100755
index 00000000..6f458a7e
--- /dev/null
+++ b/macros/Hardware/RasberryPi/SPI/names
@@ -0,0 +1,4 @@
+RPI_SPIDataRW
+RPI_SPIGetFd
+RPI_SPISetup
+RPI_SPISetupMode
diff --git a/macros/Hardware/RasberryPi/Serial/RPI_serialClose.sci b/macros/Hardware/RasberryPi/Serial/RPI_serialClose.sci
new file mode 100755
index 00000000..6f54b655
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Serial/RPI_serialClose.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_serialClose(fd)
+// Function to close and open serial device
+//
+// Calling Sequence
+// RPI_serialClose(fd)
+//
+// Parameters
+// fd: file-descriptor obtained from RPI_serialOpen function
+//
+// Description
+// This function closes the device identified by the file descriptor given.
+//
+// Examples
+// RPI_serialClose(13)
+// See also
+// RPI_serialOpen, RPI_serialFlush, RPI_serialPutchar, RPI_serialPuts, RPI_serialPrintf, RPI_serialDataAvail, RPI_serialGetchar
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sCl#1#"+string(fd)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Serial/RPI_serialDataAvail.sci b/macros/Hardware/RasberryPi/Serial/RPI_serialDataAvail.sci
new file mode 100755
index 00000000..9421e5b4
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Serial/RPI_serialDataAvail.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_serialDataAvail(fd)
+// Function to get number of readable character from the serial device
+//
+// Calling Sequence
+// RPI_serialDataAvail(fd)
+//
+// Parameters
+// fd: file-descriptor obtained from RPI_serialOpen function
+//
+// Description
+// Returns the number of characters available for reading, or -1 for any error condition, in which case error number will be set appropriately.
+//
+// Examples
+// RPI_serialDataAvail(13)
+// See also
+// RPI_serialOpen, RPI_serialClose, RPI_serialFlush, RPI_serialPutchar, RPI_serialPuts, RPI_serialPrintf, RPI_serialGetchar
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sDA#1#"+string(fd)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Serial/RPI_serialFlush.sci b/macros/Hardware/RasberryPi/Serial/RPI_serialFlush.sci
new file mode 100755
index 00000000..845f70b3
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Serial/RPI_serialFlush.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_serialFlush(fd)
+// Function to discard all data to/from the serial device
+//
+// Calling Sequence
+// RPI_serialFlush(fd)
+//
+// Parameters
+// fd: file-descriptor obtained from RPI_serialOpen function
+//
+// Description
+// This function discards all data received, or waiting to be send down the given device.
+//
+// Examples
+// RPI_serialFlush(13)
+// See also
+// RPI_serialOpen, RPI_serialClose, RPI_serialPutchar, RPI_serialPuts, RPI_serialPrintf, RPI_serialDataAvail, RPI_serialGetchar
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sFl#1#"+string(fd)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Serial/RPI_serialGetchar.sci b/macros/Hardware/RasberryPi/Serial/RPI_serialGetchar.sci
new file mode 100755
index 00000000..327fe356
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Serial/RPI_serialGetchar.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_serialGetchar(fd)
+// Function to get next character from serial device
+//
+// Calling Sequence
+// RPI_serialGetchar(fd)
+//
+// Parameters
+// fd: file-descriptor obtained from RPI_serialOpen function
+//
+// Description
+// This function returns the next character available on the serial device. This call will block for up to 10 seconds if no data is available (when it will return -1).
+//
+// Examples
+// RPI_serialGetchar(13)
+// See also
+// RPI_serialOpen, RPI_serialClose, RPI_serialFlush, RPI_serialPutchar, RPI_serialPuts, RPI_serialPrintf, RPI_serialDataAvail
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sGc#1#"+string(fd)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Serial/RPI_serialOpen.sci b/macros/Hardware/RasberryPi/Serial/RPI_serialOpen.sci
new file mode 100755
index 00000000..684a6f20
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Serial/RPI_serialOpen.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_serialOpen(device,baud)
+// Function to initialize a serial device
+//
+// Calling Sequence
+// RPI_serialOpen(device,baud)
+//
+// Parameters
+// device: device to connect to
+// baud : the baud rate for communication
+//
+// Description
+// This function opens and initialises the serial device and sets the baud rate. It sets the port into “raw” mode (character at a time and no translations), and sets the read timeout to 10 seconds. The return value is the file descriptor or -1 for any error, in which case errno will be set as appropriate.
+//
+// Examples
+// RPI_serialOpen("/dev/ttyAMA0", 9600)
+// See also
+// RPI_serialClose, RPI_serialFlush, RPI_serialPutchar, RPI_serialPuts, RPI_serialPrintf, RPI_serialDataAvail, RPI_serialGetchar
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sOp#2#"+string(device)+"#"+string(baud)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Serial/RPI_serialPrintf.sci b/macros/Hardware/RasberryPi/Serial/RPI_serialPrintf.sci
new file mode 100755
index 00000000..668a9fff
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Serial/RPI_serialPrintf.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_serialPrintf(fd,msg)
+// Function to print to serial device
+//
+// Calling Sequence
+// RPI_serialPrintf(fd,msg)
+//
+// Parameters
+// fd : file-descriptor obtained from RPI_serialOpen function
+// msg: message to print
+//
+// Description
+// This function emulates the system printf function to the serial device.
+//
+// Examples
+// RPI_serialPrintf(13,'White Collar rocks')
+// See also
+// RPI_serialOpen, RPI_serialClose, RPI_serialFlush, RPI_serialPutchar, RPI_serialPuts, RPI_serialDataAvail, RPI_serialGetchar
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sPf#2#"+string(fd)+"#"+string(msg)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Serial/RPI_serialPutchar.sci b/macros/Hardware/RasberryPi/Serial/RPI_serialPutchar.sci
new file mode 100755
index 00000000..ceea556c
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Serial/RPI_serialPutchar.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_serialPutchar(fd,character)
+// Function to send a single byte to the serial device
+//
+// Calling Sequence
+// RPI_serialPutchar(fd,character)
+//
+// Parameters
+// fd : file-descriptor obtained from RPI_serialOpen function
+// character: character to send to the serial device
+//
+// Description
+// This function sends the single byte to the serial device identified by the given file descriptor.
+//
+// Examples
+// RPI_serialPutchar(113,'s')
+// See also
+// RPI_serialOpen, RPI_serialClose, RPI_serialFlush, RPI_serialPuts, RPI_serialPrintf, RPI_serialDataAvail, RPI_serialGetchar
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sPc#2#"+string(fd)+"#"+string(character)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Serial/RPI_serialPuts.sci b/macros/Hardware/RasberryPi/Serial/RPI_serialPuts.sci
new file mode 100755
index 00000000..ecbbe057
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Serial/RPI_serialPuts.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_serialPuts(fd,s)
+// Function to send a null-terminalted string
+//
+// Calling Sequence
+// RPI_serialPuts(fd,s)
+//
+// Parameters
+// fd: file-descriptor obtained from RPI_serialOpen function
+// s : string to send
+//
+// Description
+// Sends the nul-terminated string to the serial device identified by the given file descriptor.
+//
+// Examples
+// RPI_serialPuts(13,'Believe it, Dattebayo!\0')
+// See also
+// RPI_serialOpen, RPI_serialClose, RPI_serialFlush, RPI_serialPutchar, RPI_serialPrintf, RPI_serialDataAvail, RPI_serialGetchar
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sPs#2#"+string(fd)+"#"+string(s)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Serial/buildmacros.sce b/macros/Hardware/RasberryPi/Serial/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Serial/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/Serial/names b/macros/Hardware/RasberryPi/Serial/names
new file mode 100755
index 00000000..a652727e
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Serial/names
@@ -0,0 +1,8 @@
+RPI_serialClose
+RPI_serialDataAvail
+RPI_serialFlush
+RPI_serialGetchar
+RPI_serialOpen
+RPI_serialPrintf
+RPI_serialPutchar
+RPI_serialPuts
diff --git a/macros/Hardware/RasberryPi/Setup/RPI_getAlt.sci b/macros/Hardware/RasberryPi/Setup/RPI_getAlt.sci
new file mode 100755
index 00000000..ba3d204f
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Setup/RPI_getAlt.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_getAlt(pin)
+// Function to get the current mode of pin
+//
+// Calling Sequence
+// s=RPI_getAlt(pin)
+//
+// Parameters
+// pin: The pin number to read the voltage from. Numbering sequence to be followed as initiated using RPI_pinNumbering function.
+//
+// Description
+// This function returns the current mode of the pin. Output will be 0 for INPUT, 1 for OUTPUT, 2 for PWM_OUT and 3 for CLOCK.
+//
+// Examples
+// s=RPI_getAlt(0)
+// See also
+// RPI_pinNumbering, RPI_pinModeAlt
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="gAt#1#"+string(pin)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Setup/RPI_pinMode.sci b/macros/Hardware/RasberryPi/Setup/RPI_pinMode.sci
new file mode 100755
index 00000000..b6f52e61
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Setup/RPI_pinMode.sci
@@ -0,0 +1,60 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+
+function RPI_pinMode(pin,Mode)
+// Function to set the mode of the given pin.
+//
+// Calling Sequence
+// RPI_pinMode(pin,Mode)
+//
+// Parameters
+// pin : The pin number to act on. Numbering sequence to be followed as initiated using RPI_pinNumbering function.
+// Mode: The mode in which to set the pin.
+//
+// Description
+// This function configures the Raspberry Pi's given pin to work as the given mode (input/output/pwm/clock). Not all functions are available to all the pins.
+//
+// Mode can take the following values-
+//
+// 'in' -> sets the pin as input
+// 'out' -> sets the pin as output
+// 'pwm' -> sets the pin to PWM output. Only wiringPi pin 1 (BCM_GPIO pin 18) supports this function.
+// 'clock' -> sets the pin to CLOCK output. Only wiringPi pin 7 (BCM_GPIO pin 4) supports this function.
+//
+//
+// Examples
+// RPI_pinMode(0,'out')
+// See also
+// RPI_pinNumbering
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ if Mode=='in' then
+ commande="pnM#2#"+string(pin)+"#0#";
+ elseif Mode=='out' then
+ commande="pnM#2#"+string(pin)+"#1#";
+ elseif Mode=='pwm' then
+ commande="pnM#2#"+string(pin)+"#2#";
+ elseif Mode=='clock' then
+ commande="pnM#2#"+string(pin)+"#3#";
+ else
+ error("Mode should be one of ""in/out/pwm/clock/soft_pwm/soft_tone/pwm_tone"".");
+ end
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Setup/RPI_pinModeAlt.sci b/macros/Hardware/RasberryPi/Setup/RPI_pinModeAlt.sci
new file mode 100755
index 00000000..dd0fa101
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Setup/RPI_pinModeAlt.sci
@@ -0,0 +1,55 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_pinModeAlt(pin,ALTMode)
+// Function to set the current mode of pin
+//
+// Calling Sequence
+// RPI_pinModeAlt(pin,ALTMode)
+//
+// Parameters
+// pin : The pin number to read the voltage from. Numbering sequence to be followed as initiated using RPI_pinNumbering function.
+// ALTMode: integer, from 0 to 7
+//
+// Description
+// This function sets the mode of the pin to either of the general GPIO (also set through RPI_pinMode function) or the alternatives available (not accessible through RPI_pinMode function).
+//
+// ALTMode can take the following values:
+//
+// 0 : Input
+// 1 : Output
+// 2 : ALT5
+// 3 : ALT4
+// 4 : ALT0
+// 5 : ALT1
+// 6 : ALT2
+// 7 : ALT3
+//
+//
+//The list of Alternate functions of all the pins can be found on page 102 of the official documentation: https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2835/BCM2835-ARM-Peripherals.pdf
+//
+// Examples
+// RPI_pinModeAlt(1,2)
+// See also
+// RPI_pinMode, RPI_pinNumbering, RPI_getAlt
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="pMA#2#"+string(pin)+"#"+string(ALTMode)+"#";
+ if getos()=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Setup/RPI_pinNumbering.sci b/macros/Hardware/RasberryPi/Setup/RPI_pinNumbering.sci
new file mode 100755
index 00000000..4716de80
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Setup/RPI_pinNumbering.sci
@@ -0,0 +1,54 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_pinNumbering(pinSetup)
+// Function to initialize wiringpi with the number sequence to be followed.
+//
+// Calling Sequence
+// RPI_pinNumbering(pinSetup)
+//
+// Parameters
+// pinSetup: The pin number sequence to follow
+//
+// Description
+// This function must be called at the start of the program or the program will fail to work correctly. It tells the wiringpi which number sequence will be used to work on Raspberry Pi. Returns 0 if no errors encountered. Pin maps for the different pinSetups can be found at the link in bibliography.
+//
+// pinSetup can take the following values:
+//
+// 'wiringpi' -> This initialises wiringPi and assumes that the calling program is going to be using the wiringPi pin numbering scheme. This is a simplified numbering scheme which provides a mapping from virtual pin numbers to the real underlying Broadcom GPIO pin numbers.
+// 'GPIO' -> Same as above, however it allows the calling programs to use the Broadcom GPIO pin numbers directly with no re-mapping.
+// 'phys' -> Identical to above, however it allows the calling programs to use the physical pin numbers on the P1 connector only.
+//
+//
+// Examples
+// RPI_pinNumbering('wiringpi')
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ if (pinSetup=='wiringpi') then
+ commande="pN0#0#";
+ elseif (pinSetup=='GPIO') then
+ commande="pN1#0#";
+ elseif (pinSetup=='sys') then
+ commande="pN2#0#";
+ elseif (pinSetup=='phys') then
+ commande="pN3#0#";
+ else
+ error("pinSetup should be one of wiringpi/GPIO/sys/phys");
+ end
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Setup/RPI_pullControl.sci b/macros/Hardware/RasberryPi/Setup/RPI_pullControl.sci
new file mode 100755
index 00000000..6354bf55
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Setup/RPI_pullControl.sci
@@ -0,0 +1,60 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_pullControl(pin,RMode)
+// Function to change the internal pull up/down resistor setting for a given pin.
+//
+// Calling Sequence
+// RPI_pullControl(pin,RMode)
+//
+// Parameters
+// pin : The pin number to act on. Numbering sequence to be followed as initiated using RPI_pinNumbering function.
+// RMode: The mode for the internal resistance of the given pin.
+//
+// Description
+// This sets the pull-up or pull-down resistor mode on the given pin, which should be set as an input using the PRI_pinMode function. The internal pull up/down
+// resistors have a value of approximately 50KΩ on the Raspberry Pi.
+//
+// RMode can take values:
+//
+// 'up' -> pull to 3.3v
+// 'down'-> pull to ground
+// 'none'-> no pull up/down
+//
+//
+// This function has no effect on the Raspberry Pi’s GPIO pins when in sys mode, set using RPI_pinNumbering function. To activate a pull-up/pull-down, use the gpio
+// program in a script before starting the program.
+//
+// Examples
+// RPI_pullControl(0,'down')
+// See also
+// RPI_pinNumbering, RPI_pinMode
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ if RMode=='up' then
+ commande="plC#2#"+string(pin)+"#2#";
+ elseif RMode=='down' then
+ commande="plC#2#"+string(pin)+"#1#";
+ elseif RMode=='none' then
+ commande="plC#2#"+string(pin)+"#0#";
+ else
+ error("mode should be one of up/down/none");
+ end
+ if getos()=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Setup/buildmacros.sce b/macros/Hardware/RasberryPi/Setup/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Setup/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/Setup/names b/macros/Hardware/RasberryPi/Setup/names
new file mode 100755
index 00000000..38954982
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Setup/names
@@ -0,0 +1,5 @@
+RPI_getAlt
+RPI_pinMode
+RPI_pinModeAlt
+RPI_pinNumbering
+RPI_pullControl
diff --git a/macros/Hardware/RasberryPi/Shift/RPI_shiftIn.sci b/macros/Hardware/RasberryPi/Shift/RPI_shiftIn.sci
new file mode 100755
index 00000000..2bdb89b8
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Shift/RPI_shiftIn.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_shiftIn(dpin,cpin,order)
+// Function to shift 8-bit value appearing on dpin
+//
+// Calling Sequence
+// RPI_shiftIn(dpin,cpin,order)
+//
+// Parameters
+// dpin : datapin
+// cpin : clockpin
+// order: integer, 0 (LSB first) or 1 (MSB first)
+//
+// Description
+// This shifts an 8-bit data value in with the data appearing on the dPin and the clock being sent out on the cPin. Order is either LSBFIRST or MSBFIRST. The data is sampled after the cPin goes high. (So cPin high, sample data, cPin low, repeat for 8 bits) The 8-bit value is returned by the function.
+//
+// Examples
+// RPI_shiftIn(0,2,0)
+// See also
+// RPI_shiftOut
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="shI#3#"+string(dpin)+"#"+string(cpin)+"#"+string(order)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Shift/RPI_shiftOut.sci b/macros/Hardware/RasberryPi/Shift/RPI_shiftOut.sci
new file mode 100755
index 00000000..c3485609
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Shift/RPI_shiftOut.sci
@@ -0,0 +1,43 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_shiftOut(dpin,cpin,order,val)
+// Function to shift out 8-bit data with value=val
+//
+// Calling Sequence
+// RPI_shiftOut(dpin,cpin,order,val)
+//
+// Parameters
+// dpin : datapin
+// cpin : clockpin
+// order: integer, 0 (LSB first) or 1 (MSB first)
+// val : integer, data to send
+//
+// Description
+// The shifts an 8-bit data value val out with the data being sent out on dPin and the clock being sent out on the cPin. order is as above. Data is clocked out on the rising or falling edge – ie. dPin is set, then cPin is taken high then low – repeated for the 8 bits.
+//
+// Examples
+// RPI_shiftOut(1,2,0,123)
+// See also
+// RPI_shiftIn
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="shO#4#"+string(dpin)+"#"+string(cpin)+"#"+string(order)+"#"+string(val)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Shift/RPI_sr595Setup.sci b/macros/Hardware/RasberryPi/Shift/RPI_sr595Setup.sci
new file mode 100755
index 00000000..fb77f988
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Shift/RPI_sr595Setup.sci
@@ -0,0 +1,44 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_sr595Setup(pinBase,numPins,dataPin,clockPin,latchPin)
+// Function to setup sr5595 shift register chips
+//
+// Calling Sequence
+// RPI_sr595Setup(pinBase,numPins,dataPin,clockPin,latchPin)
+//
+// Parameters
+// pinBase : any number above 64. Consecutive number of numPins will be allocated alongwith.
+// numPins : number of pins, can be 0-32, 8 pins per 74x595
+// dataPin : The Raspberry pin corresponding to the 74x595's data pin. Numbering sequence to be followed as initiated by RPI_pinNumbering function.
+// clockPin: The Raspberry pin corresponding to the 74x595's clock pin. Numbering sequence to be followed as initiated by RPI_pinNumbering function.
+// latchPin: The Raspberry pin corresponding to the 74x595's latch pin. Numbering sequence to be followed as initiated by RPI_pinNumbering function.
+//
+// Description
+// This function sets up the extension module for the 74×595 shift register chips which can be used as general purpose output ports. Each instance can support up to 4 74×595’s daisy-chained together, giving a 32-bit output port using just 3 GPIO wires from the Raspberry Pi (or from any other GPIO expansion port connected to the Pi) One can have as many instances of these enabled in the system, provided there are 3 spare GPIO pins per instance.
+//
+// Examples
+// RPI_sr595Setup(100,10,0,1,2)
+// See also
+// RPI_sn3218Setup, RPI_pcf8574Setup, RPI_pcf8591Setup, RPI_mcp23008Setup, RPI_mcp23016Setup, RPI_mcp23017Setup, RPI_mcp23s08Setup, RPI_mcp23s17Setup, RPI_pinNumbering
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sr5#5#"+string(pinBase)+"#"+string(numPins)+"#"+string(dataPin)+"#"+string(clockPin)+"#"+string(latchPin)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Shift/buildmacros.sce b/macros/Hardware/RasberryPi/Shift/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Shift/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/Shift/names b/macros/Hardware/RasberryPi/Shift/names
new file mode 100755
index 00000000..3fc17b6b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Shift/names
@@ -0,0 +1,3 @@
+RPI_shiftIn
+RPI_shiftOut
+RPI_sr595Setup
diff --git a/macros/Hardware/RasberryPi/Soft/RPI_softPwmCreate.sci b/macros/Hardware/RasberryPi/Soft/RPI_softPwmCreate.sci
new file mode 100755
index 00000000..b0161c25
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Soft/RPI_softPwmCreate.sci
@@ -0,0 +1,44 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_softPwmCreate(pin,ival,pwmrange)
+// Function to set up software pwm on a given pin
+//
+// Calling Sequence
+// RPI_softPwmCreate(pin,ival,pwmrange)
+//
+// Parameters
+// pin : pin to start software pwm on. Numbering sequence to follow as initiated using RPI_pinNumbering function
+// ival : inital value
+// pwmrange: range for the pwm
+//
+// Description
+// This function creates a software controlled PWM pin. Any GPIO pin can be used. Using 100 for the range, the value can be anything from 0 (off) to 100 (fully on) for the given pin.
+//
+//The return value is 0 for success. Otherwise the global error number variable should be checked to see what went wrong.
+//
+// Examples
+// RPI_softPwmCreate(1,25,250)
+// See also
+// RPI_softPwmStop, RPI_softPwmWrite, RPI_softToneCreate, RPI_softToneStop, RPI_softToneWrite, RPI_pinNumbering, RPI_softServoWrite, RIP_softServoSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sPC#3#"+string(pin)+"#"+string(ival)+"#"+string(pwmrange)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Soft/RPI_softPwmStop.sci b/macros/Hardware/RasberryPi/Soft/RPI_softPwmStop.sci
new file mode 100755
index 00000000..5a911c8b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Soft/RPI_softPwmStop.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_softPwmStop(pin)
+// Function to stop the software pwm on the pin
+//
+// Calling Sequence
+// RPI_softPwmStop(pin)
+//
+// Parameters
+// pin: pin to stop. Numbering sequence to follow as initiated using RPI_pinNumbering
+//
+// Description
+// This function stops the software pwm on the specified pin.
+//
+// Examples
+// RPI_softPwmStop(1)
+// See also
+// RPI_softPwmWrite, RPI_softToneCreate, RPI_softToneStop, RPI_softToneWrite, RPI_softPwmCreate, RPI_pinNumbering, RPI_softServoWrite, RIP_softServoSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sPS#1#"+string(pin)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Soft/RPI_softPwmWrite.sci b/macros/Hardware/RasberryPi/Soft/RPI_softPwmWrite.sci
new file mode 100755
index 00000000..349923fa
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Soft/RPI_softPwmWrite.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_softPwmWrite(pin,value)
+// Function to update the softpwm value on the pin
+//
+// Calling Sequence
+// RPI_softPwmWrite(pin,value)
+//
+// Parameters
+// pin : pin to act on, should be initialised using RPI_softPwmCreate. Numbering sequence follows from_RPI pinNumbering
+// value: value to write
+//
+// Description
+// This updates the PWM value on the given pin. The value is checked to be in-range and pins that haven’t previously been initialised via softPwmCreate will be silently ignored.
+//
+// Examples
+// RPI_softPwmWrite(1,250)
+// See also
+// RPI_softPwmStop, RPI_softToneCreate, RPI_softToneStop, RPI_softToneWrite, RPI_softPwmCreate, RPI_pinNumbering, RPI_softServoWrite, RIP_softServoSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sPW#2#"+string(pin)+"#"+string(value)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Soft/RPI_softToneCreate.sci b/macros/Hardware/RasberryPi/Soft/RPI_softToneCreate.sci
new file mode 100755
index 00000000..06adf83e
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Soft/RPI_softToneCreate.sci
@@ -0,0 +1,43 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_softToneCreate(pin)
+// Function to create a software controlled tone pin
+//
+// Calling Sequence
+// RPI_softToneCreate(pin)
+//
+// Parameters
+// pin: pin to create software tone on. Numbering sequence to be followed as initiated using RPI_pinNumbering
+//
+// Description
+// This function creates a software controlled tone pin. Any GPIO pin can be used. Using 100 for the range, the value can be anything from 0 (off) to 100 (fully on) for the given pin.
+//
+//The return value is 0 for success. Otherwise the global error number variable should be checked to see what went wrong.
+//
+//
+// Examples
+// RPI_softToneCreate(1)
+// See also
+// RPI_softPwmStop, RPI_softPwmWrite, RPI_softToneStop, RPI_softToneWrite, RPI_softPwmCreate, RPI_pinNumbering, RPI_softServoWrite, RIP_softServoSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sTC#1#"+string(pin)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Soft/RPI_softToneStop.sci b/macros/Hardware/RasberryPi/Soft/RPI_softToneStop.sci
new file mode 100755
index 00000000..4ecc4208
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Soft/RPI_softToneStop.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_softToneStop(pin)
+// Function to stop the software tone on the pin
+//
+// Calling Sequence
+// RPI_softToneStop(pin)
+//
+// Parameters
+// pin: soft tone pin to stop. Numbering sequence to follow as initiated using RPI_pinNumbering
+//
+// Description
+// This function stops the software tone on the specified pin.
+//
+// Examples
+// RPI_softToneStop(1)
+// See also
+// RPI_softPwmStop, RPI_softPwmWrite, RPI_softToneCreate, RPI_softToneWrite, RPI_softPwmCreate, RPI_pinNumbering, RPI_softServoWrite, RIP_softServoSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sTS#1#"+string(pin)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Soft/RPI_softToneWrite.sci b/macros/Hardware/RasberryPi/Soft/RPI_softToneWrite.sci
new file mode 100755
index 00000000..ba070a82
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Soft/RPI_softToneWrite.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_softToneWrite(pin,freq)
+// Function to update tone frquency on the soft tone pin
+//
+// Calling Sequence
+// RPI_softToneWrite(pin,freq)
+//
+// Parameters
+// pin : soft tone pin
+// freq: frequency value to write
+//
+// Description
+// This function updates the tone frequency value on the given pin. The tone will be played until you set the frequency to 0.
+//
+// Examples
+// RPI_softToneWrite(1,200)
+// See also
+// RPI_softPwmStop, RPI_softPwmWrite, RPI_softToneCreate, RPI_softToneStop, RPI_softPwmCreate, RPI_softServoWrite, RIP_softServoSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sTW#2#"+string(pin)+"#"+string(freq)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Soft/buildmacros.sce b/macros/Hardware/RasberryPi/Soft/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Soft/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/Soft/names b/macros/Hardware/RasberryPi/Soft/names
new file mode 100755
index 00000000..da06cbb5
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Soft/names
@@ -0,0 +1,6 @@
+RPI_softPwmCreate
+RPI_softPwmStop
+RPI_softPwmWrite
+RPI_softToneCreate
+RPI_softToneStop
+RPI_softToneWrite
diff --git a/macros/Hardware/RasberryPi/Timing/RPI_delay.sci b/macros/Hardware/RasberryPi/Timing/RPI_delay.sci
new file mode 100755
index 00000000..bd868e80
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Timing/RPI_delay.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_delay(time)
+// Function to introduce delay in milliseconds
+//
+// Calling Sequence
+// RPI_delay(time)
+//
+// Parameters
+// time: Time in milliseconds for which to pause the program execution.
+//
+// Description
+// This causes program execution to pause for at least 'time' milliseconds. Due to the multi-tasking nature of Linux it could be longer. The maximum delay is an unsigned 32-bit integer or approximately 49 days.
+//
+// Examples
+// RPI_delay(1000)
+// See also
+// RPI_delayMicro, RPI_micros, RPI_millis
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="deS#1#"+string(time)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Timing/RPI_delayMicro.sci b/macros/Hardware/RasberryPi/Timing/RPI_delayMicro.sci
new file mode 100755
index 00000000..a1b5d595
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Timing/RPI_delayMicro.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_delayMicro(time)
+// Function to introduce delay in microseconds
+//
+// Calling Sequence
+// RPI_delayMicros(time)
+//
+// Parameters
+// time: Time in microseconds for which to pause the program execution.
+//
+// Description
+// This causes program execution to pause for at least 'time' microseconds. Due to the multi-tasking nature of Linux it could be longer. The maximum delay is an unsigned 32-bit integer or approximately 71 minutes.
+//
+// Examples
+// RPI_delayMicro(1000)
+// See also
+// RPI_delay, RPI_micros, RPI_millis
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="deU#1#"+string(time)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Timing/RPI_micros.sci b/macros/Hardware/RasberryPi/Timing/RPI_micros.sci
new file mode 100755
index 00000000..058a8278
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Timing/RPI_micros.sci
@@ -0,0 +1,37 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_micros()
+// Function to display the number of microseconds since the call to RPI_pinNumbering function.
+//
+// Calling Sequence
+// t=RPI_micros()
+//
+// Description
+// This returns the time in milliseconds since the call to RPI_pinNumbering function. It returns an unsigned 32-bit integer which wraps after approximately 71 minutes.
+//
+// Examples
+// t=RPI_micros()
+// See also
+// RPI_millis, RPI_delay, RPI_delayMicro
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="mic#0#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Timing/RPI_millis.sci b/macros/Hardware/RasberryPi/Timing/RPI_millis.sci
new file mode 100755
index 00000000..baecddc2
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Timing/RPI_millis.sci
@@ -0,0 +1,37 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_millis()
+// Function to display the number of milliseconds since the call to RPI_pinNumbering function.
+//
+// Calling Sequence
+// t=RPI_millis()
+//
+// Description
+// This returns the time in microseconds since the call to RPI_pinNumbering function. It returns an unsigned 32-bit integer which wraps after 49 days.
+//
+// Examples
+// t=RPI_millis()
+// See also
+// RPI_micros, RPI_delay, RPI_delayMicro
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="mil#0#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Timing/buildmacros.sce b/macros/Hardware/RasberryPi/Timing/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Timing/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/Timing/names b/macros/Hardware/RasberryPi/Timing/names
new file mode 100755
index 00000000..0b47b345
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Timing/names
@@ -0,0 +1,4 @@
+RPI_delay
+RPI_delayMicro
+RPI_micros
+RPI_millis
diff --git a/macros/Hardware/RasberryPi/buildmacros.sce b/macros/Hardware/RasberryPi/buildmacros.sce
old mode 100644
new mode 100755
index 2954a424..07b564e3
--- a/macros/Hardware/RasberryPi/buildmacros.sce
+++ b/macros/Hardware/RasberryPi/buildmacros.sce
@@ -1,4 +1,49 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
-tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+RPI_Directories = [ "Digital", ...
+ "gertBoard", ...
+ "I2C", ...
+ "Interrupt", ...
+ "lcd", ...
+ "lcd128x64", ...
+ "mcp", ...
+ "Misc", ...
+ "pcf", ...
+ "piGlow", ...
+ "pinMap", ...
+ "pwm", ...
+ "Serial", ...
+ "Setup", ...
+ "Shift", ...
+ "Soft", ...
+ "SPI", ...
+ "Timing"];
+
+RPI_path_buildmacros = get_absolute_file_path("buildmacros.sce");
-clear tbx_build_macros;
+for H=1:size(RPI_Directories,"*")
+ myfile = RPI_path_buildmacros + filesep() + RPI_Directories(H) + filesep() + "buildmacros.sce";
+ if isfile(myfile) then
+ exec(myfile);
+ end
+end
+
+clear RPI_path_buildmacros;
+
+function buildmacros()
+ macros_path = get_absolute_file_path("buildmacros.sce");
+ tbx_build_macros(TOOLBOX_NAME, macros_path);
+ clear tbx_build_macros;
+endfunction
+
+buildmacros();
+clear buildmacros;
diff --git a/macros/Hardware/RasberryPi/cleanmacros.sce b/macros/Hardware/RasberryPi/cleanmacros.sce
new file mode 100755
index 00000000..a6428b2a
--- /dev/null
+++ b/macros/Hardware/RasberryPi/cleanmacros.sce
@@ -0,0 +1,20 @@
+// ====================================================================
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+// ====================================================================
+function cleanmacros()
+
+ libpath = get_absolute_file_path("cleanmacros.sce");
+
+ binfiles = ls(libpath+"/*.bin");
+ for i = 1:size(binfiles,"*")
+ mdelete(binfiles(i));
+ end
+
+ mdelete(libpath+"/names");
+ mdelete(libpath+"/lib");
+endfunction
+
+cleanmacros();
+clear cleanmacros; // remove cleanmacros on stack
+
+// ====================================================================
diff --git a/macros/Hardware/RasberryPi/gertBoard/RPI_analogRead.sci b/macros/Hardware/RasberryPi/gertBoard/RPI_analogRead.sci
new file mode 100755
index 00000000..41bf877a
--- /dev/null
+++ b/macros/Hardware/RasberryPi/gertBoard/RPI_analogRead.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_analogRead(pin)
+// Function to read the analog voltage at the given pin
+//
+// Calling Sequence
+// v=RPI_analogRead(pin)
+//
+// Parameters
+// pin: The pin number to read the voltage from. Numbering sequence to be followed as initiated using RPI_pinNumbering function.
+//
+// Description
+// This function returns the value read on the supplied analog input pin. Additional analog modules need to be registered to enable this function for devices such as the Gertboard, quick2Wire analog board, etc.
+//
+// Examples
+// v=RPI_analogRead(0)
+// See also
+// RPI_analogWrite, RPI_digitalRead, RPI_digitalWrite, RPI_pinNumbering, RPI_pinMode
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="anR#1#"+string(pin)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/gertBoard/RPI_analogWrite.sci b/macros/Hardware/RasberryPi/gertBoard/RPI_analogWrite.sci
new file mode 100755
index 00000000..f7089f53
--- /dev/null
+++ b/macros/Hardware/RasberryPi/gertBoard/RPI_analogWrite.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_analogWrite(pin,Volt)
+// Function to set analog voltage at given analog pin.
+//
+// Calling Sequence
+// RPI_analogWrite(pin,Volt)
+//
+// Parameters
+// pin : The pin number to set the voltage at. Numbering sequence to be followed as initiated using RPI_pinNumbering function.
+// Volt: The analog voltage value to set at the pin.
+//
+// Description
+// This writes the given value to the supplied analog pin. Additional analog modules need to be registered to enable this function for devices such as the Gertboard.
+//
+// Examples
+// RPI_analogWrite(0,100)
+// See also
+// RPI_analogRead, RPI_digitalRead, RPI_digitalWrite, RPI_pinNumbering, RPI_pinMode
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="anW#2#"+string(pin)+"#"+string(Volt)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogRead.sci b/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogRead.sci
new file mode 100755
index 00000000..ce7e870e
--- /dev/null
+++ b/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogRead.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_gertboardAnalogRead(pin)
+// Function to read voltage from gertboard
+//
+// Calling Sequence
+// RPI_gertboardAnalogRead(pin)
+//
+// Parameters
+// pin:the pin to read the voltage from. Numbering follows the pinBase from RPI_gertboardSetup function.
+//
+// Description
+// After initialinzing the pinBase using the RPI_gertboeardSetup function, reading channel pinBase + 0 reads the first analog input channel (pin DA0 on the Gertboard). Returns a value from 0 to 1023 representing the value on the supplied pin.
+//
+// Examples
+// RPI_gertboardAnalogRead(101)
+// See also
+// RPI_gertboardAnalogSetup, RPI_gertboardAnalogWrite, RPI_gertboardSPISetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+// http://pi4j.com/apidocs/com/pi4j/wiringpi/Gertboard.html
+
+ commande="gAR#1#"+string(pin)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
+
diff --git a/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogSetup.sci b/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogSetup.sci
new file mode 100755
index 00000000..a8348110
--- /dev/null
+++ b/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogSetup.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_gertboardAnalogSetup(pinBase)
+// Function to setup the gertboard
+//
+// Calling Sequence
+// RPI_getboardAnalogSetup(pinBase)
+//
+// Parameters
+// pinBase:the base pin that the analog ports will appear as
+//
+// Description
+// This function calls a setup routine that allocates 2 pins and overlays the analog to digital input pins with the digital to analog output pins. pinBase is the base pin that you want the analog ports to appear as. So reading channel pinBase + 0 reads the first analog input channel (pin DA0 on the Gertboard), and writing pinBase + 0 outputs to the first analog output channel. (Pin AD0)
+//
+// Examples
+// RPI_getboardAnalogSetup(100)
+// See also
+// RPI_gertboardAnalogRead, RPI_gertboardAnalogWrite, RPI_gertboardSPISetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+// http://pi4j.com/apidocs/com/pi4j/wiringpi/Gertboard.html
+
+ commande="gAS#1#"+string(pinBase)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogWrite.sci b/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogWrite.sci
new file mode 100755
index 00000000..3f8f9dd6
--- /dev/null
+++ b/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogWrite.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_gertboardAnalogWrite(pin,value)
+// Function to write voltage value to pins on gertboard
+//
+// Calling Sequence
+// RPI_gertboardAnalogWrite(pin,value)
+//
+// Parameters
+// pin : the pin to read the voltage from. Numbering follows the pinBase from RPI_gertboardSetup function.
+// value: voltage value to write
+//
+// Description
+// After initialinzing the pinBase using the RPI_gertboeardSetup function, writing pinBase + 0 outputs to the first analog output channel. (Pin AD0).
+//
+// Examples
+// RPI_gertboardAnalogWrite(100,100)
+// See also
+// RPI_gertboardAnalogSetup, RPI_gertboardAnalogRead, RPI_gertboardSPISetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+// http://pi4j.com/apidocs/com/pi4j/wiringpi/Gertboard.html
+
+ commande="gAW#2#"+string(pin)+"#"+string(value)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardSPISetup.sci b/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardSPISetup.sci
new file mode 100755
index 00000000..d4117b00
--- /dev/null
+++ b/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardSPISetup.sci
@@ -0,0 +1,39 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_gertboardSPISetup()
+// Function to initialize SPI bus communication with gertboard
+//
+// Calling Sequence
+// RPI_gertboardSPIsetup()
+//
+// Description
+// This function must be called to initialize the SPI bus to communicate with the Gertboards ADC and DAC chips.
+//
+// Examples
+// RPI_gertboardSPISetup()
+// See also
+// RPI_gertboardAnalogSetup, RPI_gertboardAnalogRead, RPI_gertboardAnalogWrite
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+// http://pi4j.com/apidocs/com/pi4j/wiringpi/Gertboard.html
+
+ commande="gSS#0#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
+
diff --git a/macros/Hardware/RasberryPi/gertBoard/buildmacros.sce b/macros/Hardware/RasberryPi/gertBoard/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/gertBoard/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/gertBoard/names b/macros/Hardware/RasberryPi/gertBoard/names
new file mode 100755
index 00000000..27a469a1
--- /dev/null
+++ b/macros/Hardware/RasberryPi/gertBoard/names
@@ -0,0 +1,6 @@
+RPI_analogRead
+RPI_analogWrite
+RPI_gertboardAnalogRead
+RPI_gertboardAnalogSetup
+RPI_gertboardAnalogWrite
+RPI_gertboardSPISetup
diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdCharDef.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdCharDef.sci
new file mode 100755
index 00000000..905cca84
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdCharDef.sci
@@ -0,0 +1,44 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcdCharDef(fd,index,d0,d1,d2,d3,d4,d5,d6,d7)
+// Function to redefine a user-definable character
+//
+// Calling Sequence
+// RPI_lcdCharDef(fd,index,data)
+//
+// Parameters
+// fd : file-descriptor obtained using RPI_lcdInit function
+// index: which character to redefine (0 to 7)
+// d0-d7: integers from 0 to 255 erpresenting the elements of the array to form the character
+//
+// Description
+// This function re-define one of the 8 user-definable characters in the display.
+//
+// The data array is 8 bytes which represent the character from the top-line to the bottom line. Note that the characters are actually 5×8, so only the lower 5 bits are used.
+//
+// Examples
+// RPI_lcdCharDef(13,0,0,0,0,31,31,31,31,0)
+// See also
+// RPI_lcdCursorBlink, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="lCD#10#"+string(fd)+"#"+string(index)+"#"+string(d0)+"#"+string(d1)+"#"+string(d2)+"#"+string(d3)+"#"+string(d4)+"#"+string(d5)+"#"+string(d6)+"#"+string(d7)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdClear.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdClear.sci
new file mode 100755
index 00000000..6da7212d
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdClear.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcdClear(fd)
+// Function to clear the lcd screen
+//
+// Calling Sequence
+// RPI_lcdClear(fd)
+//
+// Parameters
+// fd: file-descriptor obtained using RPI_lcdInit function
+//
+// Description
+// This function clears the lcd screen.
+//
+// Examples
+// RPI_lcdClear(13)
+// See also
+// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="lCl#1#"+string(fd)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdCursor.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdCursor.sci
new file mode 100755
index 00000000..98c54712
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdCursor.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcdCursor(fd,state)
+// Function to turn cursor on/off
+//
+// Calling Sequence
+// RPI_lcdCursor(fd,state)
+//
+// Parameters
+// fd : file-descriptor obtained using RPI_lcdInit function
+// state: 0 (for off) or 1 (for on)
+//
+// Description
+// This function sets the visibility of cursor.
+//
+// Examples
+// RPI_lcdCursor(13,1)
+// See also
+// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="lCu#2#"+string(fd)+"#"+string(state)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdCursorBlink.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdCursorBlink.sci
new file mode 100755
index 00000000..b16ebc50
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdCursorBlink.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcdCursorBlink(fd,state)
+// Function to turn cursor blinking on/off
+//
+// Calling Sequence
+// RPI_lcdCursorBlink(fd,state)
+//
+// Parameters
+// fd : file-descriptor obtained using RPI_lcdInit function
+// state: 0 (for off) or 1 (for on)
+//
+// Description
+// This function sets the blinking of cursor.
+//
+// Examples
+// RPI_lcdCursorBlink(13,1)
+// See also
+// RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="lCB#2#"+string(fd)+"#"+string(state)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdDisplay.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdDisplay.sci
new file mode 100755
index 00000000..de50af64
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdDisplay.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcdDisplay(fd,state)
+// Function to turn display on/off
+//
+// Calling Sequence
+// RPI_lcdDisplay(fd,state)
+//
+// Parameters
+// fd : file-descriptor obtained using RPI_lcdInit function
+// state: 0 (for off) or 1 (for on)
+//
+// Description
+// This function turns the display 'on' or 'off'.
+//
+// Examples
+// RPI_lcdDisplay(13,1)
+// See also
+// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="lDs#2#"+string(fd)+"#"+string(state)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdHome.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdHome.sci
new file mode 100755
index 00000000..0c4507f1
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdHome.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcdHome(fd)
+// Function to send cursor back to the starting point (home)
+//
+// Calling Sequence
+// RPI_lcdHome(fd)
+//
+// Parameters
+// fd: file-descriptor obtained using RPI_lcdInit function
+//
+// Description
+// This function sends the cursor to the top left (row=0,col=0) position on the lcd screen.
+//
+// Examples
+// RPI_lcdHome(13)
+// See also
+// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="lHo#1#"+string(fd)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdInit.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdInit.sci
new file mode 100755
index 00000000..c5ddb1e5
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdInit.sci
@@ -0,0 +1,54 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_lcdInit(rows,cols,bits,rs,strb,d0,d1,d2,d3,d4,d5,d6,d7)
+// Function to initialize lcd
+//
+// Calling Sequence
+// RPI_lcdInit(rows,cols,bits,rs,strb,d0,d1,d2,d3,d4,d5,d6,d7)
+//
+// Parameters
+// rows: numer of rows in lcd
+// cols: numer of colums in lcd
+// bits: number of bits wide on the interface (4 or 8)
+// rs : pin number of display RS
+// strb: pin number of strobe (E)
+// d0 : pin number of data pin 1
+// d1 : pin number of data pin 2
+// d2 : pin number of data pin 3
+// d3 : pin number of data pin 4
+// d4 : pin number of data pin 5
+// d5 : pin number of data pin 6
+// d6 : pin number of data pin 7
+// d7 : pin number of data pin 8
+//
+// Description
+// This function initalizes an lcd display attaced to the Raspberry pi. The return value is the file-descriptor to be used for all subsequent calls to the lcd library when dealing with that LCD, or -1 to indicate a fault. (Usually incorrect parameters)
+//
+// The numberin sequence to be followed as initiated using RPI_pinNumbering
+//
+// Examples
+// fd=RPI_lcdInit (2,16,8,11,10,0,1,2,3,4,5,6,7) ;
+// See also
+// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand, RPI_pinNumbering
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="lIn#13#"+string(rows)+"#"+string(cols)+"#"+string(bits)+"#"+string(rs)+"#"+string(strb)+"#"+string(d0)+"#"+string(d1)+"#"+string(d2)+"#"+string(d3)+"#"+string(d4)+"#"+string(d5)+"#"+string(d6)+"#"+string(d7)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdPosition.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdPosition.sci
new file mode 100755
index 00000000..0f978324
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdPosition.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcdPosition(fd,col,row)
+// Function to move the cursor
+//
+// Calling Sequence
+// RPI_lcdPosition(fd,col,row)
+//
+// Parameters
+// fd : file-descriptor obtained using RPI_lcdInit function
+// col: column number to go to
+// row: row number to go to
+//
+// Description
+// This function set the position of the cursor for subsequent text entry. col=0 is the left-most edge any row=0 is the top line.
+//
+// Examples
+// RPI_lcdPosition(13,0,1)
+// See also
+// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="lPo#3#"+string(fd)+"#"+string(col)+"#"+string(row)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdPrintf.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdPrintf.sci
new file mode 100755
index 00000000..833bf44a
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdPrintf.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcdPrintf(fd,String)
+// Function to print on the lcd screen
+//
+// Calling Sequence
+// RPI_lcdPrintf(fd,String)
+//
+// Parameters
+// fd : file-descriptor obtained using RPI_lcdInit function
+// String: string to print on the screen
+//
+// Description
+// This function outputs a single ASCII character, a string or a formatted string using the usual printf formatting commands.
+//
+// Examples
+// RPI_lcdPrintf(13,'We live in the shadows to serve the light.')
+// See also
+// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="lPf#2#"+string(fd)+"#"+String+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdPutchar.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdPutchar.sci
new file mode 100755
index 00000000..337691d8
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdPutchar.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcdPutchar(fd,character)
+// Function to print on the lcd screen
+//
+// Calling Sequence
+// RPI_lcdPutchar(fd,charcter)
+//
+// Parameters
+// fd : file-descriptor obtained using RPI_lcdInit function
+// charcter: integer, 0 to 255, character to print
+//
+// Description
+// This function outputs a single ASCII character, a string or a formatted string using the usual printf formatting commands.
+//
+// Examples
+// RPI_lcdPutchar(13,200)
+// See also
+// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="lPc#2#"+string(fd)+"#"+string(character)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdPuts.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdPuts.sci
new file mode 100755
index 00000000..8584309d
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdPuts.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcdPuts(fd,character)
+// Function to print on the lcd screen
+//
+// Calling Sequence
+// RPI_lcdPuts(fd,character)
+//
+// Parameters
+// fd : file-descriptor obtained using RPI_lcdInit function
+// character: character to print
+//
+// Description
+// This function outputs a single ASCII character, a string or a formatted string using the usual printf formatting commands.
+//
+// Examples
+// RPI_lcdPuts(13,'K')
+// See also
+// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="lPu#2#"+string(fd)+"#"+string(character)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
+
diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdSendCommand.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdSendCommand.sci
new file mode 100755
index 00000000..db677bef
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdSendCommand.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcdSendCommand(fd,command)
+// Function to send command to lcd
+//
+// Calling Sequence
+// RPI_lcdSendCommand(fd,command)
+//
+// Parameters
+// fd : file-descriptor obtained using RPI_lcdInit function
+// command: A command, binary, to submit to the LCD.
+//
+// Description
+// This function sends any arbitrary command to the LCD.
+//
+// Examples
+// RPI_lcdSendCommand(13,00)
+// See also
+// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="lSC#2#"+string(fd)+"#"+string(command)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd/buildmacros.sce b/macros/Hardware/RasberryPi/lcd/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/lcd/names b/macros/Hardware/RasberryPi/lcd/names
new file mode 100755
index 00000000..8f87ff8b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/names
@@ -0,0 +1,12 @@
+RPI_lcdCharDef
+RPI_lcdClear
+RPI_lcdCursor
+RPI_lcdCursorBlink
+RPI_lcdDisplay
+RPI_lcdHome
+RPI_lcdInit
+RPI_lcdPosition
+RPI_lcdPrintf
+RPI_lcdPutchar
+RPI_lcdPuts
+RPI_lcdSendCommand
diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64Orientation.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64Orientation.sci
new file mode 100755
index 00000000..5bfe4dcd
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64Orientation.sci
@@ -0,0 +1,48 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcd128x64Orientation(mode)
+// Function to set lcd orientation.
+//
+// Calling Sequence
+// RPI_lcd128x64Orientation(mode)
+//
+// Parameters
+// mode: Orientation Mode, integer from 0 to 3
+//
+// Description
+// This function sets the orientation of the lcd display.
+//
+// mode can take values:
+//
+// 0 :Portrait
+// 1 :Landscape
+// 2 :Portrait, flipped
+// 3 :Landscape, flipped
+//
+//
+// Examples
+// RPI_lcd128x64Orientation(1)
+// See also
+// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="LOn#1#"+string(mode)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64circle.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64circle.sci
new file mode 100755
index 00000000..96358a32
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64circle.sci
@@ -0,0 +1,44 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcd128x64circle(x,y,r,color,fill)
+// Function to draw a circle
+//
+// Calling Sequence
+// RPI_lcd128x64circle(x,y,r,color,fill)
+//
+// Parameters
+// x : integer, x coordinate of centre
+// y : integer, y coordinate of centre
+// r : integer, radius of the circle
+// color: integer, color of the rectangle
+// fill : 0 (for empty) or 1 (for filled)
+//
+// Description
+// This function draws a circle of radius r with x,y as centre, specified color and fill.
+//
+// Examples
+// RPI_lcd128x64circle(3,3,2,0,0)
+// See also
+// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="Lci#5#"+string(x)+"#"+string(y)+"#"+string(r)+"#"+string(color)+"#"+string(fill)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64clear.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64clear.sci
new file mode 100755
index 00000000..5b800491
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64clear.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcd128x64clear(color)
+// Function to clear the lcd screen
+//
+// Calling Sequence
+// RPI_lcd128x64clear(color)
+//
+// Parameters
+// color: integer, color of the lcd
+//
+// Description
+// This function clears the lcd display to the given colour.
+//
+// Examples
+// RPI_lcd128x64clear(0)
+// See also
+// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="LCl#1#"+string(color)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64ellipse.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64ellipse.sci
new file mode 100755
index 00000000..b4281e61
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64ellipse.sci
@@ -0,0 +1,45 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcd128x64ellipse(cx,cy,xr,yr,color,fill)
+// Function to draw a ellipse
+//
+// Calling Sequence
+// RPI_lcd128x64ellipse(cx,cy,xr,yr,color,fill)
+//
+// Parameters
+// cx : integer, x coordinate of centre
+// cy : integer, y coordinate of centre
+// xr : integer, x radius
+// yr : integer, y radius
+// color: integer, color pf the ellipse
+// fill : 0 (for empty) or 1 (for filled)
+//
+// Description
+// This function draws an ellipse with centre at (cx,cy) x and y radii as xr and yr, specified color and fill
+//
+// Examples
+// RPI_lcd128x64ellipse()
+// See also
+// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="Lel#6#"+string(cx)+"#"+string(cy)+"#"+string(xr)+"#"+string(yr)+"#"+string(color)+"#"+string(fill)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64line.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64line.sci
new file mode 100755
index 00000000..951a6639
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64line.sci
@@ -0,0 +1,44 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcd128x64line(x0,y0,x1,y1,color)
+// Function to plota line.
+//
+// Calling Sequence
+// RPI_lcd128x64line(x0,y0,x1,y1,color)
+//
+// Parameters
+// x0 : integer, initial x coordinate
+// y0 : integer, initial y coordinate
+// x1 : integer, final x coordinate
+// y1 : integer, final y coordinate
+// color: integer, color of the line
+//
+// Description
+// This function plots a line from (x0,y0) to (x1,y1).
+//
+// Examples
+// RPI_lcd128x64line(0,0,1,1,0)
+// See also
+// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="Lli#5#"+string(x0)+"#"+string(y0)+"#"+string(x1)+"#"+string(y1)+"#"+string(color)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64lineTo.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64lineTo.sci
new file mode 100755
index 00000000..466713eb
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64lineTo.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcd128x64lineTo(x,y,color)
+// Function to plot a line
+//
+// Calling Sequence
+// RPI_lcd128x64lineTo(x,y,color)
+//
+// Parameters
+// x : integer, final x coordinate
+// y : integer, final y coordinate
+// color: integer, color of the line
+//
+// Description
+// This function draws a line from the current position to the point (x,y) specified.
+//
+// Examples
+// RPI_lcd128x64lineTo(2,2,0)
+// See also
+// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="LlT#3#"+string(x)+"#"+string(y)+"#"+string(color)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64point.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64point.sci
new file mode 100755
index 00000000..287b022a
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64point.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcd128x64point(x,y,color)
+// Function to plot a point
+//
+// Calling Sequence
+// RPI_lcd128x64point(x,y,color)
+//
+// Parameters
+// x : integer, x coordinate
+// y : integer, y coordinate
+// color: integer, color of the point
+//
+// Description
+// This function plots a point at x,y.
+//
+// Examples
+// RPI_lcd128x64point(2,2,0)
+// See also
+// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="Lpo#3#"+string(x)+"#"+string(y)+"#"+string(color)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64putchar.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64putchar.sci
new file mode 100755
index 00000000..a6b27240
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64putchar.sci
@@ -0,0 +1,44 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcd128x64putchar(x,y,c,bg,fg)
+// Function to print a single character.
+//
+// Calling Sequence
+// RPI_lcd128x64putchar(x,y,c,bg,fg)
+//
+// Parameters
+// x : integer, x coordinate of starting point
+// y : integer, y coordinate of starting point
+// c : integer, from 0 to 255, character to print
+// bg: integer, background color
+// fg: integer, foreground color
+//
+// Description
+// This function prints a single character to the screen.
+//
+// Examples
+// RPI_lcd128x64putchar(0,1,128,1,0)
+// See also
+// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="Lpc#5#"+string(x)+"#"+string(y)+"#"+string(c)+"#"+string(bg)+"#"+string(fg)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64puts.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64puts.sci
new file mode 100755
index 00000000..6785f067
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64puts.sci
@@ -0,0 +1,44 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcd128x64puts(x,y,s,bf,fg)
+// Function to send a string to the lcd display
+//
+// Calling Sequence
+// RPI_lcd128x64puts(x,y,s,bg,fg)
+//
+// Parameters
+// x : integer, x coordinate of starting point
+// y : integer, y coordinate of starting point
+// s : string to send
+// bg: integer, background color
+// fg: integer, foreground color
+//
+// Description
+// This function sends a string to the display. Obeys \n and \r formatting.
+//
+// Examples
+// RPI_lcd128x64puts(0,0,'Talos guide you',0,1)
+// See also
+// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="LPu#5#"+string(x)+"#"+string(y)+"#"+string(s)+"#"+string(bg)+"#"+string(fg)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64rectangle.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64rectangle.sci
new file mode 100755
index 00000000..ccda4c62
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64rectangle.sci
@@ -0,0 +1,45 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcd128x64rectangle(x1,y1,x2,y2,color,fill)
+// Function to draw a rectangle
+//
+// Calling Sequence
+// RPI_lcd128x64rectangle(x1,y1,x2,y2,color,fill)
+//
+// Parameters
+// x1 : integer, x coordinate of upper left corner
+// y1 : integer, y coordinate of upper left corner
+// x2 : integer, x coordinate of lower right corner
+// y2 : integer, y coordinate of lower right corner
+// color: integer, color of the rectangle
+// fill : 0 (for empty) or 1 (for filled)
+//
+// Description
+// This function draws a rectangle with (x1,y1) as the upper left point and (x2,y2) as the lower right point with specified color and fill.
+//
+// Examples
+// RPI_lcd128x64rectangle(0,0,1,1,0,1)
+// See also
+// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="Lre#6#"+string(x1)+"#"+string(y1)+"#"+string(x2)+"#"+string(y2)+"#"+string(color)+"#"+string(fill)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64setOrigin.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64setOrigin.sci
new file mode 100755
index 00000000..996b0623
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64setOrigin.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcd128x64setOrigin(x,y)
+// Function to set origin
+//
+// Calling Sequence
+// RPI_lcd128x64setOrigin(x,y)
+//
+// Parameters
+// x: x coordinate
+// y: y coordinate
+//
+// Description
+// This function sets the origin of the lcd display
+//
+// Examples
+// RPI_lcd128x64setOrigin(1,0)
+// See also
+// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="LOr#2#"+string(x)+"#"+string(y)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64setup.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64setup.sci
new file mode 100755
index 00000000..60ded7d8
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64setup.sci
@@ -0,0 +1,37 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_lcd128x64setup()
+// Function to initialize the lcd display
+//
+// Calling Sequence
+// RPI_lcd128x64setup()
+//
+// Description
+// This function initialises the lcd display.
+//
+// Examples
+// RPI_lcd128x64setup()
+// See also
+// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="Lse#0#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd128x64/buildmacros.sce b/macros/Hardware/RasberryPi/lcd128x64/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/lcd128x64/names b/macros/Hardware/RasberryPi/lcd128x64/names
new file mode 100755
index 00000000..82439718
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/names
@@ -0,0 +1,12 @@
+RPI_lcd128x64Orientation
+RPI_lcd128x64circle
+RPI_lcd128x64clear
+RPI_lcd128x64ellipse
+RPI_lcd128x64line
+RPI_lcd128x64lineTo
+RPI_lcd128x64point
+RPI_lcd128x64putchar
+RPI_lcd128x64puts
+RPI_lcd128x64rectangle
+RPI_lcd128x64setOrigin
+RPI_lcd128x64setup
diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib
deleted file mode 100644
index dc759fe8..00000000
Binary files a/macros/Hardware/RasberryPi/lib and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/mcp/RPI_mcp23008Setup.sci b/macros/Hardware/RasberryPi/mcp/RPI_mcp23008Setup.sci
new file mode 100755
index 00000000..03963bd1
--- /dev/null
+++ b/macros/Hardware/RasberryPi/mcp/RPI_mcp23008Setup.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_mcp23008Setup(pinBase,i2cAddress)
+// Function for setting up 8-bit MCP23008 I2C GPIO expansion chip.
+//
+// Calling Sequence
+// RPI_mcp23008Setup(pinBase,i2cAddress)
+//
+// Parameters
+// pinBase : any number above 64. The consecutive 8 pins will be allocated alongwith.
+// i2cAdress: integer, the I2C address obtained using RPI_i2cdetect function
+//
+// Description
+// This function sets up the extension module for the 8-bit MCP23008 I2C GPIO expansion chip.
+//
+// Examples
+// RPI_mcp23008Setup(73,64)
+// See also
+// RPI_sr595Setup, RPI_pcf8574Setup, RPI_pcf8591Setup, RPI_mcp23016Setup, RPI_mcp23017Setup, RPI_mcp23s08Setup, RPI_mcp23s17Setup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="mp8#2#"+string(pinBase)+"#"+string(i2cAddress)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/mcp/RPI_mcp23016Setup.sci b/macros/Hardware/RasberryPi/mcp/RPI_mcp23016Setup.sci
new file mode 100755
index 00000000..0424616e
--- /dev/null
+++ b/macros/Hardware/RasberryPi/mcp/RPI_mcp23016Setup.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_mcp23016Setup(pinBase,i2cAddress)
+// Function for setting up 16-bit MCP23016 I2C GPIO expansion chip.
+//
+// Calling Sequence
+// RPI_mcp23016Setup(pinBase,i2cAddress)
+//
+// Parameters
+// pinBase : any number above 64. The consecutive 16 pins will be allocated alongwith.
+// i2cAdress: integer, the I2C address obtained using RPI_i2cdetect function
+//
+// Description
+// This function sets up the extension module for the MCP23017 (16-bit) I2C GPIO expansion chips. The MCP23016 is the fore-runner of the MCP23017 GPIO expansion chip and may be present on some older interface boards.
+//
+// Examples
+// RPI_mcp23016Setup(73,100)
+// See also
+// RPI_sr595Setup, RPI_pcf8574Setup, RPI_pcf8591Setup, RPI_mcp23008Setup, RPI_mcp23017Setup, RPI_mcp23s08Setup, RPI_mcp23s17Setup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="mp6#2#"+string(pinBase)+"#"+string(i2cAddress)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/mcp/RPI_mcp23017Setup.sci b/macros/Hardware/RasberryPi/mcp/RPI_mcp23017Setup.sci
new file mode 100755
index 00000000..c453ebb3
--- /dev/null
+++ b/macros/Hardware/RasberryPi/mcp/RPI_mcp23017Setup.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_mcp23017Setup(pinBase,i2cAddress)
+// Function for setting up 16-bit MCP23017 I2C GPIO expansion chip.
+//
+// Calling Sequence
+// RPI_mcp23017Setup(pinBase,i2cAddress)
+//
+// Parameters
+// pinBase : any number above 64. The consecutive 16 pins will be allocated alongwith.
+// i2cAdress: integer, the I2C address obtained using RPI_i2cdetect function
+//
+// Description
+// This function setups the extension module for the 16-bit MCP23017 I2C GPIO expansion chip.
+//
+// Examples
+// RPI_mcp23017Setup(73,100)
+// See also
+// RPI_sr595Setup, RPI_pcf8574Setup, RPI_pcf8591Setup, RPI_mcp23008Setup, RPI_mcp23016Setup, RPI_mcp23s08Setup, RPI_mcp23s17Setup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="mp7#2#"+string(pinBase)+"#"+string(i2cAddress)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/mcp/RPI_mcp23s08Setup.sci b/macros/Hardware/RasberryPi/mcp/RPI_mcp23s08Setup.sci
new file mode 100755
index 00000000..b5b215b6
--- /dev/null
+++ b/macros/Hardware/RasberryPi/mcp/RPI_mcp23s08Setup.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_mcp23s08Setup(pinBase,spiPort,devId)
+// Function for setting up 8-bit MCP23s08 SPI GPIO expansion chip.
+//
+// Calling Sequence
+// RPI_mcp23s08Setup(pinBase,spiPort,devId)
+//
+// Parameters
+// pinBase: any number above 64. The consecutive 8 pins will be allocated alongwith.
+// spiPort: 0 or 1 for one of the two SPI ports on the Raspberry Pi.
+// devId : the ID of the MCP23s08 on the SPI port.
+//
+// Description
+// This function setups the extension module for the 8-bit MCP23s08 SPI GPIO expansion chip.
+//
+// Examples
+// RPI_mcp23s08Setup(67,1,0)
+// See also
+// RPI_sr595Setup, RPI_pcf8574Setup, RPI_pcf8591Setup, RPI_mcp23008Setup, RPI_mcp23016Setup, RPI_mcp23017Setup, RPI_mcp23s17Setup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="ms8#3#"+string(pinBase)+"#"+string(spiPort)+"#"+string(devId)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/mcp/RPI_mcp23s17Setup.sci b/macros/Hardware/RasberryPi/mcp/RPI_mcp23s17Setup.sci
new file mode 100755
index 00000000..4ba9fd65
--- /dev/null
+++ b/macros/Hardware/RasberryPi/mcp/RPI_mcp23s17Setup.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_mcp23s17Setup(pinBase,spiPort,devId)
+// Function for setting up 16-bit MCP23s17 SPI GPIO expansion chip.
+//
+// Calling Sequence
+// RPI_mcp23s17Setup(pinBase,spiPort,devId)
+//
+// Parameters
+// pinBase: any number above 64. The consecutive 16 pins will be allocated alongwith.
+// spiPort: 0 or 1 for one of the two SPI ports on the Raspberry Pi.
+// devId : the ID of the MCP23s17 on the SPI port.
+//
+// Description
+// This function setups the extension module for the 16-bit MCP23s17 SPI GPIO expansion chip.
+//
+// Examples
+// RPI_mcp23s17Setup(67,0,0)
+// See also
+// RPI_sr595Setup, RPI_pcf8574Setup, RPI_pcf8591Setup, RPI_mcp23008Setup, RPI_mcp23016Setup, RPI_mcp23017Setup, RPI_mcp23s08Setup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="ms7#3#"+string(pinBase)+"#"+string(spiPort)+"#"+string(devId)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/mcp/buildmacros.sce b/macros/Hardware/RasberryPi/mcp/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/mcp/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/mcp/names b/macros/Hardware/RasberryPi/mcp/names
new file mode 100755
index 00000000..23e7af04
--- /dev/null
+++ b/macros/Hardware/RasberryPi/mcp/names
@@ -0,0 +1,5 @@
+RPI_mcp23008Setup
+RPI_mcp23016Setup
+RPI_mcp23017Setup
+RPI_mcp23s08Setup
+RPI_mcp23s17Setup
diff --git a/macros/Hardware/RasberryPi/names b/macros/Hardware/RasberryPi/names
old mode 100644
new mode 100755
index fa647761..9f20c937
--- a/macros/Hardware/RasberryPi/names
+++ b/macros/Hardware/RasberryPi/names
@@ -1,21 +1,5 @@
GetRPISupportFunctions
IsRPISupportFunction
-RPI_DelayMicro
-RPI_DelayMilli
-RPI_DigitalIn
-RPI_DigitalOut
-RPI_DigitalSetup
-RPI_GetMicros
-RPI_GetMillis
-RPI_HardPWMSetClock
-RPI_HardPWMSetMode
-RPI_HardPWMSetRange
-RPI_HardPWMWrite
-RPI_PinISR
-RPI_SerialClose
-RPI_SerialFlush
-RPI_SerialGetChar
-RPI_SerialSendChar
-RPI_SerialSendData
-RPI_SerialSetup
-u16RPISerialDataAvail
+RPI_adress
+raspi
+raspi_close
diff --git a/macros/Hardware/RasberryPi/old/GetRPISupportFunctions.sci b/macros/Hardware/RasberryPi/old/GetRPISupportFunctions.sci
new file mode 100644
index 00000000..3e6397b2
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/GetRPISupportFunctions.sci
@@ -0,0 +1,48 @@
+function RPiSupportFunctions = GetRPISupportFunctions()
+// -----------------------------------------------------------------
+// Get list of RPI peripherals supported
+//
+// Input data:
+// None
+//
+// Output data:
+// None
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+//
+// -----------------------------------------------------------------
+
+RPiSupportFunctions = [
+ "RPI_DigitalIn"
+ "RPI_DigitalOut"
+ "RPI_DigitalSetup"
+ "RPI_DelayMilli"
+ "RPI_DelayMicro"
+ "RPI_GetMillis"
+ "RPI_GetMicros"
+ "RPI_SerialSetup"
+ "RPI_SerialClose"
+ "RPI_SerialSendChar"
+ "RPI_SerialFlush"
+ "RPI_SerialGetChar"
+ "RPI_ThreadCreate"
+ "RPI_PinISR"
+ "RPI_HardPWMWrite"
+ "RPI_HardPWMSetRange"
+ "RPI_HardPWMSetClock"
+ "RPI_HardPWMSetMode"
+ ];
+
+//Note: "RPI_SerialSendData" is removed since distinction between input data
+//types is required
+
+
+endfunction
diff --git a/macros/Hardware/RasberryPi/old/IsRPISupportFunction.sci b/macros/Hardware/RasberryPi/old/IsRPISupportFunction.sci
new file mode 100644
index 00000000..c6a2c365
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/IsRPISupportFunction.sci
@@ -0,0 +1,32 @@
+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
+//
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+//
+// -----------------------------------------------------------------
+
+//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/old/RPI_DelayMicro.sci b/macros/Hardware/RasberryPi/old/RPI_DelayMicro.sci
new file mode 100644
index 00000000..bbb0bb3b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_DelayMicro.sci
@@ -0,0 +1,38 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+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/old/RPI_DelayMilli.sci b/macros/Hardware/RasberryPi/old/RPI_DelayMilli.sci
new file mode 100644
index 00000000..13b79625
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_DelayMilli.sci
@@ -0,0 +1,39 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_DelayMilli(time)
+// Function to insert some delay in milli seconds 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/old/RPI_DigitalIn.sci b/macros/Hardware/RasberryPi/old/RPI_DigitalIn.sci
new file mode 100644
index 00000000..781c49c8
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_DigitalIn.sci
@@ -0,0 +1,43 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+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
+//
+// -----------------------------------------------------------------
+//Pins of header P1 which can be used as GPIO
+supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
+ 31,31,33,35,36,37,38,40];
+
+PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
+
+//If given pin does not support GPIO functionality, raise the error
+if(PinIsGPIO == 0)
+ error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
+end
+state = 1;
+endfunction
diff --git a/macros/Hardware/RasberryPi/old/RPI_DigitalOut.sci b/macros/Hardware/RasberryPi/old/RPI_DigitalOut.sci
new file mode 100644
index 00000000..dde3c934
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_DigitalOut.sci
@@ -0,0 +1,44 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+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
+//
+// -----------------------------------------------------------------
+//Pins of header P1 which can be used as GPIO
+supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
+ 31,31,33,35,36,37,38,40];
+
+PinIsGPIO = members(pin, supported_pins); //Check if output pin supports GPIO
+
+//If given pin does not support GPIO functionality, raise the error
+if(PinIsGPIO == 0)
+ error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
+end
+state = 1;
+
+endfunction
diff --git a/macros/Hardware/RasberryPi/old/RPI_DigitalSetup.sci b/macros/Hardware/RasberryPi/old/RPI_DigitalSetup.sci
new file mode 100644
index 00000000..01d6e07d
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_DigitalSetup.sci
@@ -0,0 +1,36 @@
+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, 2->PWM 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(3,0) //Sets pin 3 of header P1 as input
+//
+// See also
+// RPI_DigitalIn RPI_DigitalOut
+//
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+//Pins of header P1 which can be used as GPIO
+supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
+ 31,31,33,35,36,37,38,40];
+
+PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
+
+//If given pin does not support GPIO functionality, raise the error
+if(PinIsGPIO == 0)
+ error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
+end
+state = 1;
+
+endfunction
diff --git a/macros/Hardware/RasberryPi/old/RPI_GetMicros.sci b/macros/Hardware/RasberryPi/old/RPI_GetMicros.sci
new file mode 100644
index 00000000..6c4db57a
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_GetMicros.sci
@@ -0,0 +1,39 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function Micros = RPI_GetMicros()
+// Function to get time in Microsecond since first setup function called.
+//
+// Calling Sequence
+// Micros = RPI_GetMicros()
+//
+// Parameters
+// Micros: time in Microseconds since first setup function called
+//
+// Description
+// This function can be used to get time since first setup function called.
+// Note: To use this function atleast one setup function must be called.
+//
+// Examples
+// start = RPI_GetMicros()
+// RPI_DelayMicro(1000) //This will delay the execution of next code by 100 ms.
+// end = RPI_GetMicros()
+// delay = end- start //This should be approximately 1000 us.
+//
+// See also
+// RPI_GetMillis RPI_DelayMilli 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.
+Micros = 0;
+endfunction
diff --git a/macros/Hardware/RasberryPi/old/RPI_GetMillis.sci b/macros/Hardware/RasberryPi/old/RPI_GetMillis.sci
new file mode 100644
index 00000000..c034a705
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_GetMillis.sci
@@ -0,0 +1,39 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function Millis = RPI_GetMillis()
+// Function to get time in millisecond since first setup function called.
+//
+// Calling Sequence
+// Millis = RPI_GetMillis()
+//
+// Parameters
+// Millis: time in milliseconds since first setup function called
+//
+// Description
+// This function can be used to get time since first setup function called.
+// Note: To use this function atleast one setup function must be called.
+//
+// Examples
+// start = RPI_GetMillis()
+// RPI_DelayMilli(100) //This will delay the execution of next code by 100 ms.
+// end = RPI_GetMillis()
+// delay = end- start //This should be approximately 100ms.
+//
+// See also
+// RPI_GetMicros RPI_DelayMilli 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.
+Millis = 0;
+endfunction
diff --git a/macros/Hardware/RasberryPi/old/RPI_HardPWMSetClock.sci b/macros/Hardware/RasberryPi/old/RPI_HardPWMSetClock.sci
new file mode 100644
index 00000000..8448d364
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_HardPWMSetClock.sci
@@ -0,0 +1,35 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_HardPWMSetClock(clock_divisor)
+// Function to set PWM clock. PWM clock frequency is 19.2MHz, which can be reduced
+// using suitable clock_divisor (1 to 2048, powers of 2)
+//
+// Calling Sequence
+// RPI_HardPWMSetClock(clock_divisor)
+//
+// Parameters
+// clock_divisor: Value can be from 1 to 2048, powers of 2.
+// Description
+// This function decides pwm clock.
+// PWM frequency = (PWM Clock frequency/Clock divisor/range)
+// PWM clock frequency = 19.2 MHz
+// clock divisor is setup using RPI_HardPWMSetClock
+// range is setup using RPI_HardPWMSetRange
+// Examples
+//
+// See also
+// RPI_HardPWMSetWrite RPI_HardPWMSetRange
+//
+// 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/old/RPI_HardPWMSetMode.sci b/macros/Hardware/RasberryPi/old/RPI_HardPWMSetMode.sci
new file mode 100644
index 00000000..57b82601
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_HardPWMSetMode.sci
@@ -0,0 +1,32 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_HardPWMSetMode(pwm_mode)
+// Function to set PWM mode. Two modes are available - balanced and mark/space
+//
+// Calling Sequence
+// RPI_HardPWMSetMode(pwm_mode)
+//
+// Parameters
+// pwm_mode: decides pwm mode
+// 0 -> balanced
+// 1 -> mark/space
+// Description
+// This function decides pwm mode
+// Examples
+//
+// See also
+// RPI_HardPWMSetWrite RPI_HardPWMSetRange
+//
+// 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/old/RPI_HardPWMSetRange.sci b/macros/Hardware/RasberryPi/old/RPI_HardPWMSetRange.sci
new file mode 100644
index 00000000..c2075e2d
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_HardPWMSetRange.sci
@@ -0,0 +1,35 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_HardPWMSetRange(range_val)
+// Function to set range value for PWM. Range value along with clock divisor
+// decides pwm frequency. Range value must be less than 1024
+//
+// Calling Sequence
+// RPI_HardPWMSetRange(range_val)
+//
+// Parameters
+// range_val: range for pwm
+// Description
+// This function decides range for pwm.
+// PWM frequency = (PWM Clock frequency/Clock divisor/range)
+// PWM clock frequency = 19.2 MHz
+// clock divisor is setup using RPI_HardPWMSetClock
+// range is setup using RPI_HardPWMSetRange
+// Examples
+//
+// See also
+// RPI_HardPWMSetClock RPI_HardPWMWrite
+//
+// 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/old/RPI_HardPWMWrite.sci b/macros/Hardware/RasberryPi/old/RPI_HardPWMWrite.sci
new file mode 100644
index 00000000..dba5e674
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_HardPWMWrite.sci
@@ -0,0 +1,39 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_HardPWMWrite(pin,value)
+// Function to change pwm duty on specified pin. Hardware PWM is available
+// only on pin 12. So, only '12' should be provided as pin
+//
+// Calling Sequence
+// RPI_HardPWMWrite(12,512) //Value must be smaller than the range set
+// using RPI_HARDPWMSetRange
+//
+// Parameters
+// pin: pin no on which pwm value is to be changed. Currently only 12 is allowed
+// value: pwm value for given pin. This must be less than range value set
+// Description
+// This function changes pwm duty on specified pin. As for RPi, only one pin
+// (pin 12) is available for hardware PWM.
+// PWM frequency = (PWM Clock frequency/Clock divisor/range)
+// PWM clock frequency = 19.2 MHz
+// clock divisor is setup using RPI_HardPWMSetClock
+// range is setup using RPI_HardPWMSetRange
+// Actual PWM duty = value/range
+// Examples
+//
+// See also
+// RPI_HardPWMSetClock RPI_HardPWMSetRange
+//
+// 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/old/RPI_PinISR.sci b/macros/Hardware/RasberryPi/old/RPI_PinISR.sci
new file mode 100644
index 00000000..c2354c1f
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_PinISR.sci
@@ -0,0 +1,56 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_PinISR(pin, edgetype, fn)
+// Function to assign a function to be run when an interrupt occurs on
+// specified pin.
+//
+// Calling Sequence
+// RPI_PinISR(pin, edgetype, fn)
+//
+// Parameters
+// pin : pin whose interrupt is to be configured
+// edgetype: edge on which interrupt is to be monitored
+// 1 -> Falling egde
+// 2 -> Rising egde
+// 3 -> Both egde
+// fn: name of the function to be executed on interrupt occurance
+// Description
+// This functions monitors interrupt on specified pin for specified edge,
+// When that interrupt occurs, function specified by 'fn' is executed.
+// Examples
+// RPI_PinISR(12, 0, Pin12ISR) //executes 'Pin12ISR' on falling edge on
+// pin 12
+// See also
+// RPI_ThreadCreate RPI_DigitalSetup
+//
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for RPi.
+
+//Pins of header P1 which can be used as GPIO
+supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
+ 31,31,33,35,36,37,38,40];
+
+PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
+
+//If given pin does not support GPIO functionality, raise the error
+if(PinIsGPIO == 0)
+ error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
+end
+EdgeTypeSupported = members(edgetype,[1 2 3]);
+
+if(EdgeTypeSupported == 0)
+ error(9999, 'SCI2CERROR: Given edgetype is incorrect. Please specify correct edgetype from [1,2,3]')
+end
+
+endfunction
diff --git a/macros/Hardware/RasberryPi/old/RPI_SerialClose.sci b/macros/Hardware/RasberryPi/old/RPI_SerialClose.sci
new file mode 100644
index 00000000..f27dd432
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_SerialClose.sci
@@ -0,0 +1,33 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_SerialClose(fd)
+// Function to close serial port specified by file descriptor.
+//
+// Calling Sequence
+// RPI_SerialClose(fd)
+//
+// Parameters
+// fd : file descriptor for opened port
+// Description
+// This functions closes the specified serial port
+// Examples
+// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
+// RPI_SerialClose(serial1)
+// See also
+// RPI_SerialOpen RPI_SerialSendChar
+//
+//
+// 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/old/RPI_SerialFlush.sci b/macros/Hardware/RasberryPi/old/RPI_SerialFlush.sci
new file mode 100644
index 00000000..9bab386f
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_SerialFlush.sci
@@ -0,0 +1,34 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function data = RPI_SerialGetChar(fd)
+// Function to read data from specified serial port
+//
+// Calling Sequence
+// RPI_SerialGetCharfd)
+//
+// Parameters
+// fd: file descriptor returned when serial port was opened
+// Description
+// This functions reads character form specified port. In case no
+// character is available, -1 is returned after 10 sec.
+// Examples
+// serial = RPI_SetupSerial("/dev/ttyAMA0", 9600);
+// RPI_SerialFlush(serial);
+// bytes = RPI_SerialDataAvail(serial);
+//
+// See also
+// RPI_SetupSerial RPI_SendData
+//
+// 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/old/RPI_SerialGetChar.sci b/macros/Hardware/RasberryPi/old/RPI_SerialGetChar.sci
new file mode 100644
index 00000000..a26e5b97
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_SerialGetChar.sci
@@ -0,0 +1,36 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function data = RPI_SerialGetChar(fd)
+// Function to read data from specified serial port
+//
+// Calling Sequence
+// RPI_SerialGetChar(fd)
+//
+// Parameters
+// fd: file descriptor returned when serial port was opened
+// Description
+// This functions reads character form specified port. In case no
+// character is available, -1 is returned after 10 sec.
+// Examples
+// serial = RPI_SetupSerial("/dev/ttyAMA0", 9600);
+// bytes = RPI_SerialDataAvail(serial);
+// if(bytes>0)
+// data = RPI_SerialGetChar(serial) //Reads single character
+// end
+// See also
+// RPI_SetupSerial RPI_SendData
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for RPi.
+data = 0;
+endfunction
diff --git a/macros/Hardware/RasberryPi/old/RPI_SerialSendChar.sci b/macros/Hardware/RasberryPi/old/RPI_SerialSendChar.sci
new file mode 100644
index 00000000..769b21d2
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_SerialSendChar.sci
@@ -0,0 +1,37 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_SerialSendChar(fd, data)
+// Function to send 8-bit char through serial port.
+//
+// Calling Sequence
+// RPI_SerialSendChar(fd, data)
+//
+// Parameters
+// fd : file descriptor for opened port
+// data: 8-bit character data to be sent
+// Description
+// This functions sends input 8-bit character data on specified serial port
+// Examples
+// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
+// RPI_SerialSendChar(serial1, 'H');
+// RPI_SerialSendChar(serial1, 'i');
+// RPI_SerialClose(serial1);
+//
+// See also
+// RPI_SerialOpen RPI_SerialClose
+//
+//
+// 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/old/RPI_SerialSendData.sci b/macros/Hardware/RasberryPi/old/RPI_SerialSendData.sci
new file mode 100644
index 00000000..c05852b1
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_SerialSendData.sci
@@ -0,0 +1,38 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_SerialSendData(fd, data)
+// Function to send data through serial port. Data can be of any datatype and
+// can be scalar or matrix
+//
+// Calling Sequence
+// RPI_SerialSendData(fd, data)
+//
+// Parameters
+// fd : file descriptor for opened port
+// data: data to be sent
+// Description
+// This functions sends input data on specified serial port
+// Examples
+// A = [2 3; 4 5]
+// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
+// RPI_SerialSendData(serial1, A);
+// RPI_SerialClose(serial1);
+//
+// See also
+// RPI_SerialOpen RPI_SerialClose
+//
+//
+// 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/old/RPI_SerialSetup.sci b/macros/Hardware/RasberryPi/old/RPI_SerialSetup.sci
new file mode 100644
index 00000000..0f266610
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_SerialSetup.sci
@@ -0,0 +1,36 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function fd = RPI_SerialSetup(port, baudrate)
+// Function to setup serial port.
+//
+// Calling Sequence
+// RPI_SerialSetup(port, baudrate)
+//
+// Parameters
+// port : port of RPi to be used (eg. )
+// direction : direction to be set for pin (0 -> INPUT, 1 -> OUTPUT)
+// fd : file descriptor for opened port, -1 for error
+// Description
+// This functions opens the specified serial port and returns file descriptor
+// for the same
+// Examples
+// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
+//
+// See also
+// RPI_SerialClose RPI_SerialSendChar
+//
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for RPi.
+fd = 0;
+endfunction
diff --git a/macros/Hardware/RasberryPi/old/buildmacros.sce b/macros/Hardware/RasberryPi/old/buildmacros.sce
new file mode 100644
index 00000000..2954a424
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/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/old/names b/macros/Hardware/RasberryPi/old/names
new file mode 100644
index 00000000..fa647761
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/names
@@ -0,0 +1,21 @@
+GetRPISupportFunctions
+IsRPISupportFunction
+RPI_DelayMicro
+RPI_DelayMilli
+RPI_DigitalIn
+RPI_DigitalOut
+RPI_DigitalSetup
+RPI_GetMicros
+RPI_GetMillis
+RPI_HardPWMSetClock
+RPI_HardPWMSetMode
+RPI_HardPWMSetRange
+RPI_HardPWMWrite
+RPI_PinISR
+RPI_SerialClose
+RPI_SerialFlush
+RPI_SerialGetChar
+RPI_SerialSendChar
+RPI_SerialSendData
+RPI_SerialSetup
+u16RPISerialDataAvail
diff --git a/macros/Hardware/RasberryPi/old/u16RPISerialDataAvail.sci b/macros/Hardware/RasberryPi/old/u16RPISerialDataAvail.sci
new file mode 100644
index 00000000..6eb29a1c
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/u16RPISerialDataAvail.sci
@@ -0,0 +1,37 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function bytes = RPI_SerialDataAvail(fd)
+// Function to get number of data bytes available on serial port specified by
+// file descriptor
+// Calling Sequence
+// RPI_SerialDataAvail(fd)
+//
+// Parameters
+// fd : file descriptor for already opened serial port
+// Description
+// This functions returns number of characters available to read,
+// otherwise reads -1 in case of error. This function can be used to check
+// new data is available on serial port
+// Examples
+// serial = RPI_SerialOpen("/dev/ttyAMA0", 9600);
+// charsToRead = RPI_SerialDataAvail(serial);
+// See also
+// RPI_SerialOpen RPI_SerialGetChar
+//
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for RPi.
+
+bytes = 0;
+
+endfunction
\ No newline at end of file
diff --git a/macros/Hardware/RasberryPi/pcf/RPI_pcf8574Setup.sci b/macros/Hardware/RasberryPi/pcf/RPI_pcf8574Setup.sci
new file mode 100755
index 00000000..f3e79429
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pcf/RPI_pcf8574Setup.sci
@@ -0,0 +1,43 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_pcf8574Setup(pinBase,i2cAddress)
+// Function for setting up PCF8574 8-bit GPIO expander IC
+//
+// Calling Sequence
+// RPI_pcf8574Setup(pinBase,i2cAddress)
+//
+// Parameters
+// pinBase : any number above 64. The consecutive 8 pins will be allocated alongwith.
+// i2cAddress: I2C address obtained using RPI_i2cdetect function
+//
+// Description
+// This function sets up the extension module for the PCF8574 8-bit GPIO expander IC. Can be called multiple times for multiple PCF8574 using different pinBase for each.
+//
+//You don’t need to specify the number of pins here – the PCF8754 has 8 pins.
+//
+// Examples
+// RPI_pcf8574Setup(67,100)
+// See also
+// RPI_pcf8591Setup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="pf7#2#"+string(pinBase)+"#"+string(i2cAddress)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/pcf/RPI_pcf8591Setup.sci b/macros/Hardware/RasberryPi/pcf/RPI_pcf8591Setup.sci
new file mode 100755
index 00000000..87054907
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pcf/RPI_pcf8591Setup.sci
@@ -0,0 +1,43 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_pcf8591Setup(pinBase,i2cAddress)
+// Function for setting up 8-bit PCF8591 Analog IO expander IC
+//
+// Calling Sequence
+// RPI_pcf8591Setup(pinBase,i2cAddress)
+//
+// Parameters
+// pinBase : any number above 64.The consecutive 4 pins will be allocated alongwith.
+// i2cAddress: I2C address obtained using RPI_i2cdetect function
+//
+// Description
+// This function sets up the extension module for the PCF8591 8-bit GPIO expander IC. Can be called multiple times for multiple PCF8591 using different pinBase for each.
+//
+//Specifying the number of pins is not necessary – the PCF8791 has 4 pins – the analog output uses base pin number 0 – the same as analog input 0.
+//
+// Examples
+// RPI_pcf8591Setup(67,64)
+// See also
+// RPI_pcf8574Setup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="pf9#2#"+string(pinBase)+"#"+string(i2cAddress)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/pcf/buildmacros.sce b/macros/Hardware/RasberryPi/pcf/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pcf/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/pcf/names b/macros/Hardware/RasberryPi/pcf/names
new file mode 100755
index 00000000..3e326a01
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pcf/names
@@ -0,0 +1,2 @@
+RPI_pcf8574Setup
+RPI_pcf8591Setup
diff --git a/macros/Hardware/RasberryPi/piGlow/RPI_piGlow1.sci b/macros/Hardware/RasberryPi/piGlow/RPI_piGlow1.sci
new file mode 100755
index 00000000..e093238c
--- /dev/null
+++ b/macros/Hardware/RasberryPi/piGlow/RPI_piGlow1.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_piGlow1(leg,ring,intensity)
+// Function to modify a single LED on the piGlow
+//
+// Calling Sequence
+// RPI_piGlow1(leg,ring,intensity)
+//
+// Parameters
+// leg : leg number
+// ring : ring number
+// intensity: brightness from 0 (off) to 255 (full)
+//
+// Description
+// The function modifies the brightness of the single specified LED.
+//
+// Examples
+// RPI_piGlow1(0,0,125)
+// See also
+// RPI_piGlowLeg, RPI_piGlowRing, RPI_piGlowSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="pG1#3#"+string(leg)+"#"+string(ring)+"#"+string(intensity)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/piGlow/RPI_piGlowLeg.sci b/macros/Hardware/RasberryPi/piGlow/RPI_piGlowLeg.sci
new file mode 100755
index 00000000..d0425797
--- /dev/null
+++ b/macros/Hardware/RasberryPi/piGlow/RPI_piGlowLeg.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_piGlowLeg(leg,intensity)
+// Function to modify a full leg of LEDs on the piGlow
+//
+// Calling Sequence
+// RPI_piGlowLeg(leg,intensity)
+//
+// Parameters
+// leg : leg number
+// intensity: brightness from 0 (off) to 255 (full)
+//
+// Description
+// This function modifies the brightness of all the LEDs in the single specified leg of piGlow.
+//
+// Examples
+// RPI_piGlowLeg(0,100)
+// See also
+// RPI_piGlow1, RPI_piGlowRing, RPI_piGlowSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="pGL#2#"+string(leg)+"#"+string(intensity)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/piGlow/RPI_piGlowRing.sci b/macros/Hardware/RasberryPi/piGlow/RPI_piGlowRing.sci
new file mode 100755
index 00000000..ef816205
--- /dev/null
+++ b/macros/Hardware/RasberryPi/piGlow/RPI_piGlowRing.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_piGlowRing(ring,intensity)
+// Function to modify a full ring of LEDs on the piGlow
+//
+// Calling Sequence
+// RPI_piGlowRing(ring,intensity)
+//
+// Parameters
+// ring : ring number
+// intensity: brightness from 0 (off) to 255 (full)
+//
+// Description
+// This function modifies the brightness of all the LEDs in the single specified ring of piGlow.
+//
+// Examples
+// RPI_piGlowRing(1,200)
+// See also
+// RPI_piGlowLeg, RPI_piGlow1, RPI_piGlowSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="pGR#2#"+string(ring)+"#"+string(intensity)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/piGlow/RPI_piGlowSetup.sci b/macros/Hardware/RasberryPi/piGlow/RPI_piGlowSetup.sci
new file mode 100755
index 00000000..718fa3b6
--- /dev/null
+++ b/macros/Hardware/RasberryPi/piGlow/RPI_piGlowSetup.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_piGlowSetup(Empty)
+// Function to initialize the piGlow board
+//
+// Calling Sequence
+// RPI_piGlowSetup(Empty)
+//
+// Parameters
+// Empty: integer, 0 or 1. If 1, then all the LEDs will be turned off to start with.
+//
+// Description
+// This initialises the PiGlow devLib software. The I2C kernel module needs to be pre-loaded. ThePiGlow board has an SN3218 I2C LED controller and 18 LEDs arranged in 3 “legs” of 6 LEDs. (or 6 “rings” of 3 LEDs).
+//
+// The LED colours in each leg match and are in the order Red (at the outside), Yellow, Orange, Green, Blue and White (in the center)
+//
+// Examples
+// RPI_piGlowSetup(TRUE)
+// See also
+// RPI_piGlowLeg, RPI_piGlow1, RPI_piGlowRing
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="pGS#1#"+string(Empty)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/piGlow/buildmacros.sce b/macros/Hardware/RasberryPi/piGlow/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/piGlow/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/piGlow/names b/macros/Hardware/RasberryPi/piGlow/names
new file mode 100755
index 00000000..b63ec8f7
--- /dev/null
+++ b/macros/Hardware/RasberryPi/piGlow/names
@@ -0,0 +1,4 @@
+RPI_piGlow1
+RPI_piGlowLeg
+RPI_piGlowRing
+RPI_piGlowSetup
diff --git a/macros/Hardware/RasberryPi/pinMap/RPI_physToGpio.sci b/macros/Hardware/RasberryPi/pinMap/RPI_physToGpio.sci
new file mode 100755
index 00000000..9a59caa2
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pinMap/RPI_physToGpio.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_physToGpio(pin)
+// Function to check the GPIO pin number corresponding to given physical pin number.
+//
+// Calling Sequence
+// p=RPI_physToGpio(pin)
+//
+// Parameters
+// pin: The pin number to check in physical numbering sequence.
+//
+// Description
+// This funtion return the GPIO pin number corresponding to the supplied physical pin number.
+//
+// Examples
+// p=RPI_physToGpio(11)
+// See also
+// RPI_wpiToGpio
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="ptG#1#"+string(pin)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/pinMap/RPI_wpiToGpio.sci b/macros/Hardware/RasberryPi/pinMap/RPI_wpiToGpio.sci
new file mode 100755
index 00000000..deed4264
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pinMap/RPI_wpiToGpio.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_wpiToGpio(pin)
+// Function to check the GPIO pin number corresponding to given wiringpi pin number.
+//
+// Calling Sequence
+// p=RPI_wpiToGpio(pin)
+//
+// Parameters
+// pin: The pin number to check in wiringpi numbering sequence.
+//
+// Description
+// This funtion return the GPIO pin number corresponding to the supplied wiringpi pin number.
+//
+// Examples
+// p=RPI_wpiToGpio(0)
+// See also
+// RPI_physToGpio
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="wtG#1#"+string(pin)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/pinMap/buildmacros.sce b/macros/Hardware/RasberryPi/pinMap/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pinMap/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/pinMap/names b/macros/Hardware/RasberryPi/pinMap/names
new file mode 100755
index 00000000..71efa237
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pinMap/names
@@ -0,0 +1,2 @@
+RPI_physToGpio
+RPI_wpiToGpio
diff --git a/macros/Hardware/RasberryPi/pwm/RPI_pwmClock.sci b/macros/Hardware/RasberryPi/pwm/RPI_pwmClock.sci
new file mode 100755
index 00000000..d0653537
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pwm/RPI_pwmClock.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_pwmClock(value)
+// Function to set the divisor for the PWM clock.
+//
+// Calling Sequence
+// RPI_pwmClock(value)
+//
+// Parameters
+// value: The divisor for the PWM clock.
+//
+// Description
+// This function sets the divisor for the PWM clock.
+//
+// Examples
+// RPI_pwmClock(100)
+// See also
+// RPI_pwmMode, RPI_pwmRange, RPI_pwmToneWrite, RPI_pwmWrite
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="pwC#1#"+string(value)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/pwm/RPI_pwmMode.sci b/macros/Hardware/RasberryPi/pwm/RPI_pwmMode.sci
new file mode 100755
index 00000000..13d0c367
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pwm/RPI_pwmMode.sci
@@ -0,0 +1,46 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_pwmMode(Mode)
+// Function to set the mode for the PWM generator
+//
+// Calling Sequence
+// RPI_pwmMode(mode)
+//
+// Parameters
+// mode: The mode to set for the PWM generator. 'ms' (for mark:space) or 'bal' (for balanced)
+//
+// Description
+// This function sets the mode for the PWM generator. The PWM generator can run in 2 modes – “balanced” and “mark:space”. The mark:space mode is traditional, however the default mode in the Pi is “balanced”. Switch modes by supplying the parameter: bal or ms
+//
+// Examples
+// RPI_pwmMode('bal')
+// See also
+// RPI_pwmRange, RPI_pwmClock, RPI_pwmToneWrite, RPI_pwmWrite
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ if Mode=='ms' then
+ commande="pwM#1#0#";
+ elseif Mode=='bal' then
+ commande="pwM#1#1#";
+ else:
+ error("mode should be ""ms"" or ""bal""");
+ end
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/pwm/RPI_pwmRange.sci b/macros/Hardware/RasberryPi/pwm/RPI_pwmRange.sci
new file mode 100755
index 00000000..6a1503a0
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pwm/RPI_pwmRange.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_pwmRange(value)
+// Function to set the divisor for the PWM clock.
+//
+// Calling Sequence
+// RPI_pwmRange(value)
+//
+// Parameters
+// value: maximum of the range for the PWM generator.
+//
+// Description
+// This function sets the range register in the PWM generator. The default is 1024.
+//
+// Examples
+// RPI_pwmRange(512)
+// See also
+// RPI_pwmMode, RPI_pwmClock, RPI_pwmToneWrite, RPI_pwmWrite
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="pwR#1#"+string(value)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/pwm/RPI_pwmToneWrite.sci b/macros/Hardware/RasberryPi/pwm/RPI_pwmToneWrite.sci
new file mode 100755
index 00000000..d7ff6eda
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pwm/RPI_pwmToneWrite.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_pwmToneWrite(pin,freq)
+// Function to write a tone of a given frequency to the pin
+//
+// Calling Sequence
+// RPI_pwmToneWrite(pin,freq)
+//
+// Parameters
+// pin : The pin to set the frequency on. Numbering to be followed as initiated using RPI_pinNumbering.
+// freq: frequency to write
+//
+// Description
+// This function write the given frequency tone to the given pin.
+//
+// Examples
+// RPI_pwmToneWrite(0,100)
+// See also
+// RPI_pwmMode, RPI_pwmRange, RPI_pwmClock, RPI_pwmWrite, PRI_pinNumbering
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="pwT#2#"+string(pin)+"#"+string(freq)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/pwm/RPI_pwmWrite.sci b/macros/Hardware/RasberryPi/pwm/RPI_pwmWrite.sci
new file mode 100755
index 00000000..113547af
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pwm/RPI_pwmWrite.sci
@@ -0,0 +1,45 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_pwmWrite(pin,value)
+// Function to write voltage value to the PWM register for the given pin.
+//
+// Calling Sequence
+// RPI_pwmWrite(pin,value)
+//
+// Parameters
+// pin : The pin number set the voltage at. Numbering sequence to be followed as initiated using RPI_pinNumbering function.
+// value: The voltage to set at the given pin. Range is 0-1024.
+//
+// Description
+// Writes the value to the PWM register for the given pin. The Raspberry Pi has one on-board PWM pin, pin 1 (BMC_GPIO 18, Phys 12). Other PWM devices may have other PWM ranges.
+//
+// Examples
+// RPI_pwmWrite(1,500)
+// See also
+// RPI_pwmMode, RPI_pwmRange, RPI_pwmClock, RPI_pwmToneWrite
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ if [0logs.txt 2>&1");
+ disp("Step 3/6")
+ TCL_EvalStr("exec ssh-copy-id -i /home/"+local+"/.ssh/id_rsa.pub "+username+"@"+adress+" > logs.txt 2>&1");
+ disp("Step 4/6")
+ TCL_EvalStr("exec rsync -avz "+RPI_MacrosPath+"serverWP.py "+username+"@"+adress+":.scilab/ >logs.txt");
+ disp("Step 5/6")
+ TCL_EvalStr("exec ssh "+username+"@"+adress+" sudo python /home/"+username+"/.scilab/serverWP.py &");
+ disp("Step 6/6")
+ TCL_EvalStr(["file delete logs.txt";"file delete &1"]);
+ endfunction
+elseif getos()=='Windows' then
+ tempPath=get_absolute_file_path("raspi.sci");
+ RPI_MacrosPath=strsubst(tempPath,'\','/');
+ RPI_MacrosPath=part(RPI_MacrosPath,1:(length(RPI_MacrosPath)-7));
+ RPI_MacrosPath=RPI_MacrosPath+'src/python/';
+ function raspi(adress,username)
+ // Function to initiate the connection to the raspberry pi
+ //
+ // Calling Sequence
+ // raspi(adress,username)
+ //
+ // Parameters
+ // address : Network address of the raspberry pi. Eg:10.42.0.82
+ // username: username on the raspberry pi.
+ //
+ // Description
+ // This program initiates the connection to the raspberry pi at the given address by running the python server script on port 9077 on the pi.
+ //
+ // Examples
+ // raspi('169.254.191.116','pi')
+ // See also
+ // raspi_close
+ //
+ // Authors
+ // Jorawar Singh
+
+ global RPI_piAdress;
+ RPI_piAdress=adress;
+
+ disp("Step 1/3")
+ TCL_EvalStr("exec mintty ssh "+username+"@"+adress+" mkdir .scilab");
+ disp("Step 2/3")
+ TCL_EvalStr("exec mintty scp "+RPI_MacrosPath+"serverWP.py "+username+"@"+adress+":/home/"+username+"/.scilab/");
+ disp("Step 3/3 (Wait ~15 seconds)")
+ TCL_EvalStr("exec mintty ssh "+username+"@"+adress+" sudo python /home/"+username+"/.scilab/serverWP.py &");
+ sleep(15000)
+ TCL_EvalStr("exec taskkill /IM mintty.exe");
+ endfunction
+end
diff --git a/macros/Hardware/RasberryPi/raspi_close.sci b/macros/Hardware/RasberryPi/raspi_close.sci
new file mode 100755
index 00000000..b5bb0ee7
--- /dev/null
+++ b/macros/Hardware/RasberryPi/raspi_close.sci
@@ -0,0 +1,34 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function raspi_close()
+// Function to close an open Raspberry-Pi connection.
+//
+// Calling Sequence
+// raspi_close()
+//
+// Description
+// This function causes the pyhton server script running on Raspberry pi to close, irrespective of it being started natively on pi or by using raspi function.
+//
+// Examples
+// raspi_close()
+// See also
+// raspi
+//
+// Authors
+// Jorawar Singh
+
+ commande="cls#0#";
+ if getos()=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci b/macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci
deleted file mode 100644
index 6eb29a1c..00000000
--- a/macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci
+++ /dev/null
@@ -1,37 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function bytes = RPI_SerialDataAvail(fd)
-// Function to get number of data bytes available on serial port specified by
-// file descriptor
-// Calling Sequence
-// RPI_SerialDataAvail(fd)
-//
-// Parameters
-// fd : file descriptor for already opened serial port
-// Description
-// This functions returns number of characters available to read,
-// otherwise reads -1 in case of error. This function can be used to check
-// new data is available on serial port
-// Examples
-// serial = RPI_SerialOpen("/dev/ttyAMA0", 9600);
-// charsToRead = RPI_SerialDataAvail(serial);
-// See also
-// RPI_SerialOpen RPI_SerialGetChar
-//
-//
-// Authors
-// Siddhesh Wani
-// -----------------------------------------------------------------
-
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for RPi.
-
-bytes = 0;
-
-endfunction
\ No newline at end of file
--
cgit
From d9d92203ea349d5eb44c0edc5565d827322caabe Mon Sep 17 00:00:00 2001
From: Jorawar Singh
Date: Sun, 16 Jul 2017 22:17:43 +0530
Subject: Toolbox merge, RPI demos and structured demos
---
.../RasberryPi/Digital/RPI_digitalRead.sci | 41 ++++++++++
.../RasberryPi/Digital/RPI_digitalReadByte.sci | 40 +++++++++
.../RasberryPi/Digital/RPI_digitalWrite.sci | 46 +++++++++++
.../RasberryPi/Digital/RPI_digitalWriteByte.sci | 42 ++++++++++
macros/Hardware/RasberryPi/Digital/buildmacros.sce | 14 ++++
macros/Hardware/RasberryPi/Digital/names | 4 +
macros/Hardware/RasberryPi/I2C/RPI_I2CRead.sci | 40 +++++++++
.../Hardware/RasberryPi/I2C/RPI_I2CReadReg16.sci | 41 ++++++++++
macros/Hardware/RasberryPi/I2C/RPI_I2CReadReg8.sci | 41 ++++++++++
macros/Hardware/RasberryPi/I2C/RPI_I2CSetup.sci | 42 ++++++++++
.../RasberryPi/I2C/RPI_I2CSetupInterface.sci | 41 ++++++++++
macros/Hardware/RasberryPi/I2C/RPI_I2CWrite.sci | 41 ++++++++++
.../Hardware/RasberryPi/I2C/RPI_I2CWriteReg16.sci | 42 ++++++++++
.../Hardware/RasberryPi/I2C/RPI_I2CWriteReg8.sci | 42 ++++++++++
macros/Hardware/RasberryPi/I2C/RPI_i2cdetect.sci | 38 +++++++++
macros/Hardware/RasberryPi/I2C/buildmacros.sce | 14 ++++
macros/Hardware/RasberryPi/I2C/names | 9 +++
.../RasberryPi/Interrupt/RPI_waitForInterrupt.sci | 45 +++++++++++
.../Hardware/RasberryPi/Interrupt/buildmacros.sce | 14 ++++
macros/Hardware/RasberryPi/Interrupt/names | 1 +
macros/Hardware/RasberryPi/Misc/RPI_boardRev.sci | 34 ++++++++
macros/Hardware/RasberryPi/Misc/RPI_padDrive.sci | 40 +++++++++
.../Hardware/RasberryPi/Misc/RPI_sn3218Setup.sci | 40 +++++++++
macros/Hardware/RasberryPi/Misc/buildmacros.sce | 14 ++++
macros/Hardware/RasberryPi/Misc/names | 3 +
macros/Hardware/RasberryPi/RPI_DelayMicro.sci | 38 ---------
macros/Hardware/RasberryPi/RPI_DelayMilli.sci | 39 ---------
macros/Hardware/RasberryPi/RPI_DigitalIn.sci | 43 ----------
macros/Hardware/RasberryPi/RPI_DigitalOut.sci | 44 ----------
macros/Hardware/RasberryPi/RPI_DigitalSetup.sci | 36 ---------
macros/Hardware/RasberryPi/RPI_GetMicros.sci | 39 ---------
macros/Hardware/RasberryPi/RPI_GetMillis.sci | 39 ---------
macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci | 35 --------
macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci | 32 --------
macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci | 35 --------
macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci | 39 ---------
macros/Hardware/RasberryPi/RPI_PinISR.sci | 56 -------------
macros/Hardware/RasberryPi/RPI_SerialClose.sci | 33 --------
macros/Hardware/RasberryPi/RPI_SerialFlush.sci | 34 --------
macros/Hardware/RasberryPi/RPI_SerialGetChar.sci | 36 ---------
macros/Hardware/RasberryPi/RPI_SerialSendChar.sci | 37 ---------
macros/Hardware/RasberryPi/RPI_SerialSendData.sci | 38 ---------
macros/Hardware/RasberryPi/RPI_SerialSetup.sci | 36 ---------
macros/Hardware/RasberryPi/RPI_adress.sci | 34 ++++++++
macros/Hardware/RasberryPi/SPI/RPI_SPIDataRW.sci | 42 ++++++++++
macros/Hardware/RasberryPi/SPI/RPI_SPIGetFd.sci | 39 +++++++++
macros/Hardware/RasberryPi/SPI/RPI_SPISetup.sci | 43 ++++++++++
.../Hardware/RasberryPi/SPI/RPI_SPISetupMode.sci | 41 ++++++++++
macros/Hardware/RasberryPi/SPI/buildmacros.sce | 14 ++++
macros/Hardware/RasberryPi/SPI/names | 4 +
.../Hardware/RasberryPi/Serial/RPI_serialClose.sci | 40 +++++++++
.../RasberryPi/Serial/RPI_serialDataAvail.sci | 40 +++++++++
.../Hardware/RasberryPi/Serial/RPI_serialFlush.sci | 40 +++++++++
.../RasberryPi/Serial/RPI_serialGetchar.sci | 40 +++++++++
.../Hardware/RasberryPi/Serial/RPI_serialOpen.sci | 41 ++++++++++
.../RasberryPi/Serial/RPI_serialPrintf.sci | 41 ++++++++++
.../RasberryPi/Serial/RPI_serialPutchar.sci | 41 ++++++++++
.../Hardware/RasberryPi/Serial/RPI_serialPuts.sci | 41 ++++++++++
macros/Hardware/RasberryPi/Serial/buildmacros.sce | 14 ++++
macros/Hardware/RasberryPi/Serial/names | 8 ++
macros/Hardware/RasberryPi/Setup/RPI_getAlt.sci | 40 +++++++++
macros/Hardware/RasberryPi/Setup/RPI_pinMode.sci | 60 ++++++++++++++
.../Hardware/RasberryPi/Setup/RPI_pinModeAlt.sci | 55 +++++++++++++
.../Hardware/RasberryPi/Setup/RPI_pinNumbering.sci | 54 +++++++++++++
.../Hardware/RasberryPi/Setup/RPI_pullControl.sci | 60 ++++++++++++++
macros/Hardware/RasberryPi/Setup/buildmacros.sce | 14 ++++
macros/Hardware/RasberryPi/Setup/names | 5 ++
macros/Hardware/RasberryPi/Shift/RPI_shiftIn.sci | 42 ++++++++++
macros/Hardware/RasberryPi/Shift/RPI_shiftOut.sci | 43 ++++++++++
.../Hardware/RasberryPi/Shift/RPI_sr595Setup.sci | 44 ++++++++++
macros/Hardware/RasberryPi/Shift/buildmacros.sce | 14 ++++
macros/Hardware/RasberryPi/Shift/names | 3 +
.../Hardware/RasberryPi/Soft/RPI_softPwmCreate.sci | 44 ++++++++++
.../Hardware/RasberryPi/Soft/RPI_softPwmStop.sci | 40 +++++++++
.../Hardware/RasberryPi/Soft/RPI_softPwmWrite.sci | 41 ++++++++++
.../RasberryPi/Soft/RPI_softToneCreate.sci | 43 ++++++++++
.../Hardware/RasberryPi/Soft/RPI_softToneStop.sci | 40 +++++++++
.../Hardware/RasberryPi/Soft/RPI_softToneWrite.sci | 41 ++++++++++
macros/Hardware/RasberryPi/Soft/buildmacros.sce | 14 ++++
macros/Hardware/RasberryPi/Soft/names | 6 ++
macros/Hardware/RasberryPi/Timing/RPI_delay.sci | 40 +++++++++
.../Hardware/RasberryPi/Timing/RPI_delayMicro.sci | 40 +++++++++
macros/Hardware/RasberryPi/Timing/RPI_micros.sci | 37 +++++++++
macros/Hardware/RasberryPi/Timing/RPI_millis.sci | 37 +++++++++
macros/Hardware/RasberryPi/Timing/buildmacros.sce | 14 ++++
macros/Hardware/RasberryPi/Timing/names | 4 +
macros/Hardware/RasberryPi/buildmacros.sce | 49 ++++++++++-
macros/Hardware/RasberryPi/cleanmacros.sce | 20 +++++
.../RasberryPi/gertBoard/RPI_analogRead.sci | 40 +++++++++
.../RasberryPi/gertBoard/RPI_analogWrite.sci | 41 ++++++++++
.../gertBoard/RPI_gertboardAnalogRead.sci | 42 ++++++++++
.../gertBoard/RPI_gertboardAnalogSetup.sci | 41 ++++++++++
.../gertBoard/RPI_gertboardAnalogWrite.sci | 42 ++++++++++
.../RasberryPi/gertBoard/RPI_gertboardSPISetup.sci | 39 +++++++++
.../Hardware/RasberryPi/gertBoard/buildmacros.sce | 14 ++++
macros/Hardware/RasberryPi/gertBoard/names | 6 ++
macros/Hardware/RasberryPi/lcd/RPI_lcdCharDef.sci | 44 ++++++++++
macros/Hardware/RasberryPi/lcd/RPI_lcdClear.sci | 40 +++++++++
macros/Hardware/RasberryPi/lcd/RPI_lcdCursor.sci | 41 ++++++++++
.../Hardware/RasberryPi/lcd/RPI_lcdCursorBlink.sci | 41 ++++++++++
macros/Hardware/RasberryPi/lcd/RPI_lcdDisplay.sci | 41 ++++++++++
macros/Hardware/RasberryPi/lcd/RPI_lcdHome.sci | 40 +++++++++
macros/Hardware/RasberryPi/lcd/RPI_lcdInit.sci | 54 +++++++++++++
macros/Hardware/RasberryPi/lcd/RPI_lcdPosition.sci | 42 ++++++++++
macros/Hardware/RasberryPi/lcd/RPI_lcdPrintf.sci | 41 ++++++++++
macros/Hardware/RasberryPi/lcd/RPI_lcdPutchar.sci | 41 ++++++++++
macros/Hardware/RasberryPi/lcd/RPI_lcdPuts.sci | 42 ++++++++++
.../Hardware/RasberryPi/lcd/RPI_lcdSendCommand.sci | 41 ++++++++++
macros/Hardware/RasberryPi/lcd/buildmacros.sce | 14 ++++
macros/Hardware/RasberryPi/lcd/names | 12 +++
.../lcd128x64/RPI_lcd128x64Orientation.sci | 48 +++++++++++
.../RasberryPi/lcd128x64/RPI_lcd128x64circle.sci | 44 ++++++++++
.../RasberryPi/lcd128x64/RPI_lcd128x64clear.sci | 40 +++++++++
.../RasberryPi/lcd128x64/RPI_lcd128x64ellipse.sci | 45 +++++++++++
.../RasberryPi/lcd128x64/RPI_lcd128x64line.sci | 44 ++++++++++
.../RasberryPi/lcd128x64/RPI_lcd128x64lineTo.sci | 42 ++++++++++
.../RasberryPi/lcd128x64/RPI_lcd128x64point.sci | 42 ++++++++++
.../RasberryPi/lcd128x64/RPI_lcd128x64putchar.sci | 44 ++++++++++
.../RasberryPi/lcd128x64/RPI_lcd128x64puts.sci | 44 ++++++++++
.../lcd128x64/RPI_lcd128x64rectangle.sci | 45 +++++++++++
.../lcd128x64/RPI_lcd128x64setOrigin.sci | 41 ++++++++++
.../RasberryPi/lcd128x64/RPI_lcd128x64setup.sci | 37 +++++++++
.../Hardware/RasberryPi/lcd128x64/buildmacros.sce | 14 ++++
macros/Hardware/RasberryPi/lcd128x64/names | 12 +++
.../Hardware/RasberryPi/mcp/RPI_mcp23008Setup.sci | 41 ++++++++++
.../Hardware/RasberryPi/mcp/RPI_mcp23016Setup.sci | 41 ++++++++++
.../Hardware/RasberryPi/mcp/RPI_mcp23017Setup.sci | 41 ++++++++++
.../Hardware/RasberryPi/mcp/RPI_mcp23s08Setup.sci | 42 ++++++++++
.../Hardware/RasberryPi/mcp/RPI_mcp23s17Setup.sci | 42 ++++++++++
macros/Hardware/RasberryPi/mcp/buildmacros.sce | 14 ++++
macros/Hardware/RasberryPi/mcp/names | 5 ++
macros/Hardware/RasberryPi/names | 22 +----
.../RasberryPi/old/GetRPISupportFunctions.sci | 48 +++++++++++
.../RasberryPi/old/IsRPISupportFunction.sci | 32 ++++++++
macros/Hardware/RasberryPi/old/RPI_DelayMicro.sci | 38 +++++++++
macros/Hardware/RasberryPi/old/RPI_DelayMilli.sci | 39 +++++++++
macros/Hardware/RasberryPi/old/RPI_DigitalIn.sci | 43 ++++++++++
macros/Hardware/RasberryPi/old/RPI_DigitalOut.sci | 44 ++++++++++
.../Hardware/RasberryPi/old/RPI_DigitalSetup.sci | 36 +++++++++
macros/Hardware/RasberryPi/old/RPI_GetMicros.sci | 39 +++++++++
macros/Hardware/RasberryPi/old/RPI_GetMillis.sci | 39 +++++++++
.../RasberryPi/old/RPI_HardPWMSetClock.sci | 35 ++++++++
.../Hardware/RasberryPi/old/RPI_HardPWMSetMode.sci | 32 ++++++++
.../RasberryPi/old/RPI_HardPWMSetRange.sci | 35 ++++++++
.../Hardware/RasberryPi/old/RPI_HardPWMWrite.sci | 39 +++++++++
macros/Hardware/RasberryPi/old/RPI_PinISR.sci | 56 +++++++++++++
macros/Hardware/RasberryPi/old/RPI_SerialClose.sci | 33 ++++++++
macros/Hardware/RasberryPi/old/RPI_SerialFlush.sci | 34 ++++++++
.../Hardware/RasberryPi/old/RPI_SerialGetChar.sci | 36 +++++++++
.../Hardware/RasberryPi/old/RPI_SerialSendChar.sci | 37 +++++++++
.../Hardware/RasberryPi/old/RPI_SerialSendData.sci | 38 +++++++++
macros/Hardware/RasberryPi/old/RPI_SerialSetup.sci | 36 +++++++++
macros/Hardware/RasberryPi/old/buildmacros.sce | 4 +
macros/Hardware/RasberryPi/old/names | 21 +++++
.../RasberryPi/old/u16RPISerialDataAvail.sci | 37 +++++++++
.../Hardware/RasberryPi/pcf/RPI_pcf8574Setup.sci | 43 ++++++++++
.../Hardware/RasberryPi/pcf/RPI_pcf8591Setup.sci | 43 ++++++++++
macros/Hardware/RasberryPi/pcf/buildmacros.sce | 14 ++++
macros/Hardware/RasberryPi/pcf/names | 2 +
macros/Hardware/RasberryPi/piGlow/RPI_piGlow1.sci | 42 ++++++++++
.../Hardware/RasberryPi/piGlow/RPI_piGlowLeg.sci | 41 ++++++++++
.../Hardware/RasberryPi/piGlow/RPI_piGlowRing.sci | 41 ++++++++++
.../Hardware/RasberryPi/piGlow/RPI_piGlowSetup.sci | 42 ++++++++++
macros/Hardware/RasberryPi/piGlow/buildmacros.sce | 14 ++++
macros/Hardware/RasberryPi/piGlow/names | 4 +
.../Hardware/RasberryPi/pinMap/RPI_physToGpio.sci | 40 +++++++++
.../Hardware/RasberryPi/pinMap/RPI_wpiToGpio.sci | 40 +++++++++
macros/Hardware/RasberryPi/pinMap/buildmacros.sce | 14 ++++
macros/Hardware/RasberryPi/pinMap/names | 2 +
macros/Hardware/RasberryPi/pwm/RPI_pwmClock.sci | 40 +++++++++
macros/Hardware/RasberryPi/pwm/RPI_pwmMode.sci | 46 +++++++++++
macros/Hardware/RasberryPi/pwm/RPI_pwmRange.sci | 40 +++++++++
.../Hardware/RasberryPi/pwm/RPI_pwmToneWrite.sci | 41 ++++++++++
macros/Hardware/RasberryPi/pwm/RPI_pwmWrite.sci | 45 +++++++++++
macros/Hardware/RasberryPi/pwm/buildmacros.sce | 14 ++++
macros/Hardware/RasberryPi/pwm/names | 5 ++
macros/Hardware/RasberryPi/raspi.sci | 94 ++++++++++++++++++++++
macros/Hardware/RasberryPi/raspi_close.sci | 34 ++++++++
.../Hardware/RasberryPi/u16RPISerialDataAvail.sci | 37 ---------
179 files changed, 5416 insertions(+), 747 deletions(-)
create mode 100755 macros/Hardware/RasberryPi/Digital/RPI_digitalRead.sci
create mode 100755 macros/Hardware/RasberryPi/Digital/RPI_digitalReadByte.sci
create mode 100755 macros/Hardware/RasberryPi/Digital/RPI_digitalWrite.sci
create mode 100755 macros/Hardware/RasberryPi/Digital/RPI_digitalWriteByte.sci
create mode 100755 macros/Hardware/RasberryPi/Digital/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/Digital/names
create mode 100755 macros/Hardware/RasberryPi/I2C/RPI_I2CRead.sci
create mode 100755 macros/Hardware/RasberryPi/I2C/RPI_I2CReadReg16.sci
create mode 100755 macros/Hardware/RasberryPi/I2C/RPI_I2CReadReg8.sci
create mode 100755 macros/Hardware/RasberryPi/I2C/RPI_I2CSetup.sci
create mode 100755 macros/Hardware/RasberryPi/I2C/RPI_I2CSetupInterface.sci
create mode 100755 macros/Hardware/RasberryPi/I2C/RPI_I2CWrite.sci
create mode 100755 macros/Hardware/RasberryPi/I2C/RPI_I2CWriteReg16.sci
create mode 100755 macros/Hardware/RasberryPi/I2C/RPI_I2CWriteReg8.sci
create mode 100755 macros/Hardware/RasberryPi/I2C/RPI_i2cdetect.sci
create mode 100755 macros/Hardware/RasberryPi/I2C/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/I2C/names
create mode 100755 macros/Hardware/RasberryPi/Interrupt/RPI_waitForInterrupt.sci
create mode 100755 macros/Hardware/RasberryPi/Interrupt/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/Interrupt/names
create mode 100755 macros/Hardware/RasberryPi/Misc/RPI_boardRev.sci
create mode 100755 macros/Hardware/RasberryPi/Misc/RPI_padDrive.sci
create mode 100755 macros/Hardware/RasberryPi/Misc/RPI_sn3218Setup.sci
create mode 100755 macros/Hardware/RasberryPi/Misc/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/Misc/names
delete mode 100644 macros/Hardware/RasberryPi/RPI_DelayMicro.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_DelayMilli.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_DigitalIn.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_DigitalOut.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_GetMicros.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_GetMillis.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_PinISR.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_SerialClose.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_SerialFlush.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_SerialGetChar.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_SerialSendChar.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_SerialSendData.sci
delete mode 100644 macros/Hardware/RasberryPi/RPI_SerialSetup.sci
create mode 100755 macros/Hardware/RasberryPi/RPI_adress.sci
create mode 100755 macros/Hardware/RasberryPi/SPI/RPI_SPIDataRW.sci
create mode 100755 macros/Hardware/RasberryPi/SPI/RPI_SPIGetFd.sci
create mode 100755 macros/Hardware/RasberryPi/SPI/RPI_SPISetup.sci
create mode 100755 macros/Hardware/RasberryPi/SPI/RPI_SPISetupMode.sci
create mode 100755 macros/Hardware/RasberryPi/SPI/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/SPI/names
create mode 100755 macros/Hardware/RasberryPi/Serial/RPI_serialClose.sci
create mode 100755 macros/Hardware/RasberryPi/Serial/RPI_serialDataAvail.sci
create mode 100755 macros/Hardware/RasberryPi/Serial/RPI_serialFlush.sci
create mode 100755 macros/Hardware/RasberryPi/Serial/RPI_serialGetchar.sci
create mode 100755 macros/Hardware/RasberryPi/Serial/RPI_serialOpen.sci
create mode 100755 macros/Hardware/RasberryPi/Serial/RPI_serialPrintf.sci
create mode 100755 macros/Hardware/RasberryPi/Serial/RPI_serialPutchar.sci
create mode 100755 macros/Hardware/RasberryPi/Serial/RPI_serialPuts.sci
create mode 100755 macros/Hardware/RasberryPi/Serial/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/Serial/names
create mode 100755 macros/Hardware/RasberryPi/Setup/RPI_getAlt.sci
create mode 100755 macros/Hardware/RasberryPi/Setup/RPI_pinMode.sci
create mode 100755 macros/Hardware/RasberryPi/Setup/RPI_pinModeAlt.sci
create mode 100755 macros/Hardware/RasberryPi/Setup/RPI_pinNumbering.sci
create mode 100755 macros/Hardware/RasberryPi/Setup/RPI_pullControl.sci
create mode 100755 macros/Hardware/RasberryPi/Setup/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/Setup/names
create mode 100755 macros/Hardware/RasberryPi/Shift/RPI_shiftIn.sci
create mode 100755 macros/Hardware/RasberryPi/Shift/RPI_shiftOut.sci
create mode 100755 macros/Hardware/RasberryPi/Shift/RPI_sr595Setup.sci
create mode 100755 macros/Hardware/RasberryPi/Shift/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/Shift/names
create mode 100755 macros/Hardware/RasberryPi/Soft/RPI_softPwmCreate.sci
create mode 100755 macros/Hardware/RasberryPi/Soft/RPI_softPwmStop.sci
create mode 100755 macros/Hardware/RasberryPi/Soft/RPI_softPwmWrite.sci
create mode 100755 macros/Hardware/RasberryPi/Soft/RPI_softToneCreate.sci
create mode 100755 macros/Hardware/RasberryPi/Soft/RPI_softToneStop.sci
create mode 100755 macros/Hardware/RasberryPi/Soft/RPI_softToneWrite.sci
create mode 100755 macros/Hardware/RasberryPi/Soft/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/Soft/names
create mode 100755 macros/Hardware/RasberryPi/Timing/RPI_delay.sci
create mode 100755 macros/Hardware/RasberryPi/Timing/RPI_delayMicro.sci
create mode 100755 macros/Hardware/RasberryPi/Timing/RPI_micros.sci
create mode 100755 macros/Hardware/RasberryPi/Timing/RPI_millis.sci
create mode 100755 macros/Hardware/RasberryPi/Timing/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/Timing/names
mode change 100644 => 100755 macros/Hardware/RasberryPi/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/cleanmacros.sce
create mode 100755 macros/Hardware/RasberryPi/gertBoard/RPI_analogRead.sci
create mode 100755 macros/Hardware/RasberryPi/gertBoard/RPI_analogWrite.sci
create mode 100755 macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogRead.sci
create mode 100755 macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogSetup.sci
create mode 100755 macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogWrite.sci
create mode 100755 macros/Hardware/RasberryPi/gertBoard/RPI_gertboardSPISetup.sci
create mode 100755 macros/Hardware/RasberryPi/gertBoard/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/gertBoard/names
create mode 100755 macros/Hardware/RasberryPi/lcd/RPI_lcdCharDef.sci
create mode 100755 macros/Hardware/RasberryPi/lcd/RPI_lcdClear.sci
create mode 100755 macros/Hardware/RasberryPi/lcd/RPI_lcdCursor.sci
create mode 100755 macros/Hardware/RasberryPi/lcd/RPI_lcdCursorBlink.sci
create mode 100755 macros/Hardware/RasberryPi/lcd/RPI_lcdDisplay.sci
create mode 100755 macros/Hardware/RasberryPi/lcd/RPI_lcdHome.sci
create mode 100755 macros/Hardware/RasberryPi/lcd/RPI_lcdInit.sci
create mode 100755 macros/Hardware/RasberryPi/lcd/RPI_lcdPosition.sci
create mode 100755 macros/Hardware/RasberryPi/lcd/RPI_lcdPrintf.sci
create mode 100755 macros/Hardware/RasberryPi/lcd/RPI_lcdPutchar.sci
create mode 100755 macros/Hardware/RasberryPi/lcd/RPI_lcdPuts.sci
create mode 100755 macros/Hardware/RasberryPi/lcd/RPI_lcdSendCommand.sci
create mode 100755 macros/Hardware/RasberryPi/lcd/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/lcd/names
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64Orientation.sci
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64circle.sci
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64clear.sci
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64ellipse.sci
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64line.sci
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64lineTo.sci
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64point.sci
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64putchar.sci
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64puts.sci
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64rectangle.sci
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64setOrigin.sci
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64setup.sci
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/lcd128x64/names
create mode 100755 macros/Hardware/RasberryPi/mcp/RPI_mcp23008Setup.sci
create mode 100755 macros/Hardware/RasberryPi/mcp/RPI_mcp23016Setup.sci
create mode 100755 macros/Hardware/RasberryPi/mcp/RPI_mcp23017Setup.sci
create mode 100755 macros/Hardware/RasberryPi/mcp/RPI_mcp23s08Setup.sci
create mode 100755 macros/Hardware/RasberryPi/mcp/RPI_mcp23s17Setup.sci
create mode 100755 macros/Hardware/RasberryPi/mcp/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/mcp/names
mode change 100644 => 100755 macros/Hardware/RasberryPi/names
create mode 100644 macros/Hardware/RasberryPi/old/GetRPISupportFunctions.sci
create mode 100644 macros/Hardware/RasberryPi/old/IsRPISupportFunction.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_DelayMicro.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_DelayMilli.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_DigitalIn.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_DigitalOut.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_DigitalSetup.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_GetMicros.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_GetMillis.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_HardPWMSetClock.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_HardPWMSetMode.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_HardPWMSetRange.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_HardPWMWrite.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_PinISR.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_SerialClose.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_SerialFlush.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_SerialGetChar.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_SerialSendChar.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_SerialSendData.sci
create mode 100644 macros/Hardware/RasberryPi/old/RPI_SerialSetup.sci
create mode 100644 macros/Hardware/RasberryPi/old/buildmacros.sce
create mode 100644 macros/Hardware/RasberryPi/old/names
create mode 100644 macros/Hardware/RasberryPi/old/u16RPISerialDataAvail.sci
create mode 100755 macros/Hardware/RasberryPi/pcf/RPI_pcf8574Setup.sci
create mode 100755 macros/Hardware/RasberryPi/pcf/RPI_pcf8591Setup.sci
create mode 100755 macros/Hardware/RasberryPi/pcf/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/pcf/names
create mode 100755 macros/Hardware/RasberryPi/piGlow/RPI_piGlow1.sci
create mode 100755 macros/Hardware/RasberryPi/piGlow/RPI_piGlowLeg.sci
create mode 100755 macros/Hardware/RasberryPi/piGlow/RPI_piGlowRing.sci
create mode 100755 macros/Hardware/RasberryPi/piGlow/RPI_piGlowSetup.sci
create mode 100755 macros/Hardware/RasberryPi/piGlow/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/piGlow/names
create mode 100755 macros/Hardware/RasberryPi/pinMap/RPI_physToGpio.sci
create mode 100755 macros/Hardware/RasberryPi/pinMap/RPI_wpiToGpio.sci
create mode 100755 macros/Hardware/RasberryPi/pinMap/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/pinMap/names
create mode 100755 macros/Hardware/RasberryPi/pwm/RPI_pwmClock.sci
create mode 100755 macros/Hardware/RasberryPi/pwm/RPI_pwmMode.sci
create mode 100755 macros/Hardware/RasberryPi/pwm/RPI_pwmRange.sci
create mode 100755 macros/Hardware/RasberryPi/pwm/RPI_pwmToneWrite.sci
create mode 100755 macros/Hardware/RasberryPi/pwm/RPI_pwmWrite.sci
create mode 100755 macros/Hardware/RasberryPi/pwm/buildmacros.sce
create mode 100755 macros/Hardware/RasberryPi/pwm/names
create mode 100755 macros/Hardware/RasberryPi/raspi.sci
create mode 100755 macros/Hardware/RasberryPi/raspi_close.sci
delete mode 100644 macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/RasberryPi/Digital/RPI_digitalRead.sci b/macros/Hardware/RasberryPi/Digital/RPI_digitalRead.sci
new file mode 100755
index 00000000..f3f229f9
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Digital/RPI_digitalRead.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_digitalRead(pin)
+// Function to read the digital voltage at the given pin
+//
+// Calling Sequence
+// v=RPI_digitalRead(pin)
+//
+// Parameters
+// pin: The pin number to read the voltage from. Numbering sequence to be followed as initiated using RPI_pinNumbering function.
+//
+// Description
+// This funtion reads the digital voltage at the given pin. Returns a 0 (for low) and 1 (for high).
+// Note: pin should be set for input mode using RPI_pinMode. The function will also return 0/1 corresponding to what the voltage is set for an output pin.
+//
+// Examples
+// v=RPI_digitalRead(0)
+// See also
+// RPI_analogWrite, RPI_analogRead, RPI_digitalWrite, RPI_pinNumbering, RPI_pinMode
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="diR#1#"+string(pin)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Digital/RPI_digitalReadByte.sci b/macros/Hardware/RasberryPi/Digital/RPI_digitalReadByte.sci
new file mode 100755
index 00000000..5cbccc21
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Digital/RPI_digitalReadByte.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_digitalReadByte()
+// Function to read first 8 GPIO pins
+//
+// Calling Sequence
+// b=RPI_digitalReadByte()
+//
+// Description
+// This function read the state of the first eight GPIO pins at once. The state is read from pin0 to pin7.
+//
+// Note: The MSB-LSB sequence here is opposite of that of the RPI_digitalWriteByte.
+//
+// Examples
+// b=RPI_digitalReadByte()
+// See also
+// RPI_digitalWriteByte, RPI_digitalRead
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="BtR#0#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Digital/RPI_digitalWrite.sci b/macros/Hardware/RasberryPi/Digital/RPI_digitalWrite.sci
new file mode 100755
index 00000000..d4ac660b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Digital/RPI_digitalWrite.sci
@@ -0,0 +1,46 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_digitalWrite(pin,Volt)
+// Function to set digital voltage at the given pin
+//
+// Calling Sequence
+// RPI_digitalWrite(pin,Volt)
+//
+// Parameters
+// pin : The pin number to set the voltage at. Numbering sequence to be followed as initiated using RPI_pinNumbering function.
+// Volt: Digital voltage to set. 0 (for logic-LOW) or 1 (for logic-HIGH)
+//
+// Description
+// This funtion sets the voltage at the given pin. 0v for logic 0 and 3.3v for logic 1.
+// Note: pin should be set for output mode using RPI_pinMode.
+//
+// Examples
+// RPI_digitalWrite(0,1)
+// See also
+// RPI_analogWrite, RPI_digitalRead, RPI_digitalRead, RPI_pinNumbering, RPI_pinMode
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ if (Volt==0 | Volt==1) then
+ commande="diW#2#"+string(pin)+"#"+string(Volt)+"#";
+ else
+ error("Voltage logic should be 0 or 1.");
+ end
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Digital/RPI_digitalWriteByte.sci b/macros/Hardware/RasberryPi/Digital/RPI_digitalWriteByte.sci
new file mode 100755
index 00000000..f7f9191c
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Digital/RPI_digitalWriteByte.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_digitalWriteByte(Byte)
+// Function to set first eight GPIO pins to a particular value
+//
+// Calling Sequence
+// RPI_digitalWriteByte(Byte)
+//
+// Parameters
+// Byte: An 8-bit byte to write on the first 8 GPIO pins. Inter from 0 to 255.
+//
+// Description
+// This writes the 8-bit byte supplied to the first 8 GPIO pins. It’s the fastest way to set all 8 bits at once to a particular value, although it still takes two write operations to the Pi’s GPIO hardware. The state is written from pin7 to pin0.
+//
+// Note: The MSB-LSB sequence here is opposite to that from RPI_digitalReadByte.
+//
+// Examples
+// RPI_digitalWriteByte(128)
+// See also
+// RPI_digitalReadByte, RPI_digitalWrite
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="BtW#1#"+string(Byte)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Digital/buildmacros.sce b/macros/Hardware/RasberryPi/Digital/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Digital/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/Digital/names b/macros/Hardware/RasberryPi/Digital/names
new file mode 100755
index 00000000..27fe63bc
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Digital/names
@@ -0,0 +1,4 @@
+RPI_digitalRead
+RPI_digitalReadByte
+RPI_digitalWrite
+RPI_digitalWriteByte
diff --git a/macros/Hardware/RasberryPi/I2C/RPI_I2CRead.sci b/macros/Hardware/RasberryPi/I2C/RPI_I2CRead.sci
new file mode 100755
index 00000000..afd98500
--- /dev/null
+++ b/macros/Hardware/RasberryPi/I2C/RPI_I2CRead.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_I2CRead(fd)
+// Function to read device
+//
+// Calling Sequence
+// RPI_I2CRead(fd)
+//
+// Parameters
+// fd: file descriptor obtained from RPI_I2CSetup
+//
+// Description
+// Function for a simple device read. Some devices present data when you read them without having to do any register transactions.
+//
+// Examples
+// RPI_I2CRead(13)
+// See also
+// RPI_i2cdetect, RPI_I2CReadReg8, RPI_I2CReadReg16, RPI_I2CWrite, RPI_I2CWriteReg8, RPI_I2CWriteReg16, RPI_I2CSetupInterface, RPI_I2CSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="CR1#1#"+string(fd)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/I2C/RPI_I2CReadReg16.sci b/macros/Hardware/RasberryPi/I2C/RPI_I2CReadReg16.sci
new file mode 100755
index 00000000..f0ad9898
--- /dev/null
+++ b/macros/Hardware/RasberryPi/I2C/RPI_I2CReadReg16.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_I2CReadReg16(fd,reg)
+// Function to read 16-bit valu from the register
+//
+// Calling Sequence
+// RPI_I2CReadReg16(fd,reg)
+//
+// Parameters
+// fd : file descriptor obtained from RPI_I2CSetup
+// reg: integer register to read data from
+//
+// Description
+// This function reads a 16-bit value from the device register indicated.
+//
+// Examples
+// RPI_I2CReadReg16(13,0x40)
+// See also
+// RPI_i2cdetect, RPI_I2CRead, RPI_I2CReadReg8, RPI_I2CWrite, RPI_I2CWriteReg8, RPI_I2CWriteReg16, RPI_I2CSetupInterface, RPI_I2CSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="CR3#2#"+string(fd)+"#"+string(reg)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/I2C/RPI_I2CReadReg8.sci b/macros/Hardware/RasberryPi/I2C/RPI_I2CReadReg8.sci
new file mode 100755
index 00000000..d2ab59fd
--- /dev/null
+++ b/macros/Hardware/RasberryPi/I2C/RPI_I2CReadReg8.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_I2CReadReg8(fd,reg)
+// Function to read 8-bit valu from the register
+//
+// Calling Sequence
+// RPI_I2CReadReg8(fd,reg)
+//
+// Parameters
+// fd : file descriptor obtained from RPI_I2CSetup
+// reg: integer register to read data from
+//
+// Description
+// This function reads an 8-bit value from the device register indicated.
+//
+// Examples
+// RPI_I2CReadReg8(13,0x40)
+// See also
+// RPI_i2cdetect, RPI_I2CRead, RPI_I2CReadReg16, RPI_I2CWrite, RPI_I2CWriteReg8, RPI_I2CWriteReg16, RPI_I2CSetupInterface, RPI_I2CSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="CR2#2#"+string(fd)+"#"+string(reg)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/I2C/RPI_I2CSetup.sci b/macros/Hardware/RasberryPi/I2C/RPI_I2CSetup.sci
new file mode 100755
index 00000000..801c2e6d
--- /dev/null
+++ b/macros/Hardware/RasberryPi/I2C/RPI_I2CSetup.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_I2CSetup(addr)
+// Function to initialize the I2C system
+//
+// Calling Sequence
+// fd=RPI_I2CSetup(addr)
+//
+// Parameters
+// addr: integer, the I2C number of the device obtained using RPI_i2cdetect
+//
+// Description
+// This initialises the I2C system with your given device identifier. The addr is the I2C number of the device and obtained using RPI_i2cdetect program. The function works out the Raspberry Pi revision and opens the appropriate device in /dev.
+//
+//The return value is the standard Linux filehandle, or -1 if any error – in which case, errno can be consulted as usual.
+//
+// Examples
+// fd=RPI_I2CSetup(64)
+// See also
+// RPI_i2cdetect, RPI_I2CRead, RPI_I2CReadReg8, RPI_I2CReadReg16, RPI_I2CWrite, RPI_I2CWriteReg8, RPI_I2CWriteReg16, RPI_I2CSetupInterface
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="CSe#1#"+string(addr)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/I2C/RPI_I2CSetupInterface.sci b/macros/Hardware/RasberryPi/I2C/RPI_I2CSetupInterface.sci
new file mode 100755
index 00000000..fed4f059
--- /dev/null
+++ b/macros/Hardware/RasberryPi/I2C/RPI_I2CSetupInterface.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_I2CSetupInterface(device,addr)
+// Function to select different I2C interfaces
+//
+// Calling Sequence
+// I2CSetupInterface(device,addr)
+//
+// Parameters
+// device: device
+// addr : the I2C number of the device obtained using RPI_i2cdetect
+//
+// Description
+// This feature is not implemented currently, and will be used to select different I2C interfaces if the RPi ever receives them.
+//
+// Examples
+// I2CSetupInterface(1,0x48)
+// See also
+// RPI_i2cdetect, RPI_I2CRead, RPI_I2CReadReg8, RPI_I2CReadReg16, RPI_I2CWrite, RPI_I2CWriteReg8, RPI_I2CWriteReg16, RPI_I2CSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="CSI#2#"+string(device)+"#"+string(addr)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/I2C/RPI_I2CWrite.sci b/macros/Hardware/RasberryPi/I2C/RPI_I2CWrite.sci
new file mode 100755
index 00000000..854b3b26
--- /dev/null
+++ b/macros/Hardware/RasberryPi/I2C/RPI_I2CWrite.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_I2CWrite(fd,data)
+// Function to write to device
+//
+// Calling Sequence
+// RPI_I2CWrite(fd,data)
+//
+// Parameters
+// fd : file descriptor obtained from RPI_I2CSetup
+// data: integer data to write to device
+//
+// Description
+// Function for simple device write. Some devices accept data this way without needing to access any internal registers.
+//
+// Examples
+// RPI_I2CWrite(13,100)
+// See also
+// RPI_i2cdetect, RPI_I2CRead, RPI_I2CReadReg8, RPI_I2CReadReg16, RPI_I2CWriteReg8, RPI_I2CWriteReg16, RPI_I2CSetupInterface, RPI_I2CSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="CW1#2#"+string(fd)+"#"+string(data)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/I2C/RPI_I2CWriteReg16.sci b/macros/Hardware/RasberryPi/I2C/RPI_I2CWriteReg16.sci
new file mode 100755
index 00000000..b2e8fb69
--- /dev/null
+++ b/macros/Hardware/RasberryPi/I2C/RPI_I2CWriteReg16.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_I2CWriteReg16(fd,reg,data)
+// Function to write 16-bit data to register
+//
+// Calling Sequence
+// RPI_I2CWriteReg16(fd,reg,data)
+//
+// Parameters
+// fd : file descriptor obtained from RPI_I2CSetup
+// reg : integer register to write data at
+// data: integer data to write to device
+//
+// Description
+// This function writes a 16-bit data value into the device register indicated.
+//
+// Examples
+// RPI_I2CWriteReg16(13,0x40,100)
+// See also
+// RPI_i2cdetect, RPI_I2CRead, RPI_I2CReadReg8, RPI_I2CReadReg16, RPI_I2CWrite, RPI_I2CWriteReg8, RPI_I2CSetupInterface, RPI_I2CSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="CW3#3#"+string(fd)+"#"+string(reg)+"#"+string(data)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/I2C/RPI_I2CWriteReg8.sci b/macros/Hardware/RasberryPi/I2C/RPI_I2CWriteReg8.sci
new file mode 100755
index 00000000..19c81570
--- /dev/null
+++ b/macros/Hardware/RasberryPi/I2C/RPI_I2CWriteReg8.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_I2CWriteReg8(fd,reg,data)
+// Function to write 8-bit data to register
+//
+// Calling Sequence
+// RPI_I2CWriteReg8(fd,reg,data)
+//
+// Parameters
+// fd : file descriptor obtained from RPI_I2CSetup
+// reg : integer register to write data at
+// data: integer data to write to device
+//
+// Description
+// This function writes an 8-bit data value into the device register indicated.
+//
+// Examples
+// RPI_I2CWriteReg8(13,0x40,100)
+// See also
+// RPI_i2cdetect, RPI_I2CRead, RPI_I2CReadReg8, RPI_I2CReadReg16, RPI_I2CWrite, RPI_I2CWriteReg16, RPI_I2CSetupInterface, RPI_I2CSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="CW2#3#"+string(fd)+"#"+string(reg)+"#"+string(data)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/I2C/RPI_i2cdetect.sci b/macros/Hardware/RasberryPi/I2C/RPI_i2cdetect.sci
new file mode 100755
index 00000000..a37bc4cb
--- /dev/null
+++ b/macros/Hardware/RasberryPi/I2C/RPI_i2cdetect.sci
@@ -0,0 +1,38 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_i2cdetect()
+// Function to get the address of attached i2c device
+//
+// Calling Sequence
+// RPI_i2cdetect()
+//
+// Description
+// This function returns the address of the i2c device connected to the Raspberry pi.
+//
+// Examples
+// addr=RPI_i2cdetect()
+// See also
+// RPI_I2CRead, RPI_I2CSetup, RPI_I2CReadReg8, RPI_I2CReadReg16, RPI_I2CSetupInterface, RPI_I2CWrite, RPI_I2CWriteReg8, RPI_I2CWriteReg16
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ rev=RPI_boardRev();
+ commande="i2c#1#i2cdetect -y "+string(strtod(rev)-1)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/I2C/buildmacros.sce b/macros/Hardware/RasberryPi/I2C/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/I2C/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/I2C/names b/macros/Hardware/RasberryPi/I2C/names
new file mode 100755
index 00000000..5a318865
--- /dev/null
+++ b/macros/Hardware/RasberryPi/I2C/names
@@ -0,0 +1,9 @@
+RPI_I2CRead
+RPI_I2CReadReg16
+RPI_I2CReadReg8
+RPI_I2CSetup
+RPI_I2CSetupInterface
+RPI_I2CWrite
+RPI_I2CWriteReg16
+RPI_I2CWriteReg8
+RPI_i2cdetect
diff --git a/macros/Hardware/RasberryPi/Interrupt/RPI_waitForInterrupt.sci b/macros/Hardware/RasberryPi/Interrupt/RPI_waitForInterrupt.sci
new file mode 100755
index 00000000..bb180420
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Interrupt/RPI_waitForInterrupt.sci
@@ -0,0 +1,45 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_waitForInterrupt(pin,timeOut)
+// Function to set a pin to wait for interrupt.
+//
+// Calling Sequence
+// i=RPI_waitForInterrupt(pin,timeOut)
+//
+// Parameters
+// pin : The pin to check for interrupt. Numbering sequence to be followed as initiated using RPI_pinNumbering function.
+// timeOut: The time (in milliseconds) for which to wait for interrupt. -1 to wait forever.
+//
+// Description
+// When called, it will wait for an interrupt event to happen on that pin and the program will be stalled. The return value is -1 if an error occurred (and errno will be set appropriately), 0 if it timed out, or 1 on a successful interrupt event.
+//
+// Before using RPI_waitForInterrupt, first initialise the GPIO pin and at present the only way to do this is to use the gpio program, either in a script, or using the system() call from inside the program.
+// Eg: To wait for a falling-edge interrupt on GPIO pin 0, setup the hardware using (before running the program):
+// gpio edge 0 falling
+//
+// Examples
+// i=RPI_waitForInterrupt(0,5000)
+// See also
+//
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="Int#2#"+string(pin)+"#"+string(timeOut)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Interrupt/buildmacros.sce b/macros/Hardware/RasberryPi/Interrupt/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Interrupt/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/Interrupt/names b/macros/Hardware/RasberryPi/Interrupt/names
new file mode 100755
index 00000000..248c3e24
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Interrupt/names
@@ -0,0 +1 @@
+RPI_waitForInterrupt
diff --git a/macros/Hardware/RasberryPi/Misc/RPI_boardRev.sci b/macros/Hardware/RasberryPi/Misc/RPI_boardRev.sci
new file mode 100755
index 00000000..91ddb333
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Misc/RPI_boardRev.sci
@@ -0,0 +1,34 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_boardRev()
+// Function to print the board revision.
+//
+// Calling Sequence
+// rev=RPI_boardRev()
+//
+// Description
+// This function returns the board revision of the Raspberry Pi. Returns either 1 or 2.
+//
+// Examples
+// rev=RPI_boardRev()
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="bRv#0#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Misc/RPI_padDrive.sci b/macros/Hardware/RasberryPi/Misc/RPI_padDrive.sci
new file mode 100755
index 00000000..f2d0b177
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Misc/RPI_padDrive.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_padDrive(Group,value)
+// Function to set the 'strength' of the pad drivers for a particular group of pins
+//
+// Calling Sequence
+// RPI_padDrive(Group,value)
+//
+// Parameters
+// Group: the group to act on, a number from 0 to 2
+// Value: the strength, from 0 to 7, to set for the group
+//
+// Description
+// This sets the “strength” of the pad drivers for a particular group of pins. There are 3 groups of pins and the drive strength is from 0 to 7. Do not use this unless you know what you are doing
+//
+// Examples
+// RPI_padDrive(0,5)
+// See also
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="pDr#2#"+string(Group)+"#"+string(value)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Misc/RPI_sn3218Setup.sci b/macros/Hardware/RasberryPi/Misc/RPI_sn3218Setup.sci
new file mode 100755
index 00000000..0791c506
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Misc/RPI_sn3218Setup.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_sn3218Setup(pinBase)
+// Function for setting up SN3218 I2C based LED controller.
+//
+// Calling Sequence
+// RPI_sn3218Setup(pinBase)
+//
+// Parameters
+// pinBase: any number above 64. The consecutive 18 pins will be allocated alongwith.
+//
+// Description
+// This function sets up the extension module for the SN3218 I2C based LED controller.There is no I2C device address passed into the setup function – the SN3218 has a fixed I2C address of 0x54, so there’s no need to refer to it other than internally inside the driver. This also means that only one device can be connected to a Raspberry Pi.
+//
+// Examples
+// RPI_sn3218Setup(67)
+// See also
+// RPI_sr595Setup, RPI_pcf8574Setup, RPI_pcf8591Setup, RPI_mcp23008Setup, RPI_mcp23016Setup, RPI_mcp23017Setup, RPI_mcp23s08Setup, RPI_mcp23s17Setup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sn3#1#"+string(pinBase)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Misc/buildmacros.sce b/macros/Hardware/RasberryPi/Misc/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Misc/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/Misc/names b/macros/Hardware/RasberryPi/Misc/names
new file mode 100755
index 00000000..35a4a425
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Misc/names
@@ -0,0 +1,3 @@
+RPI_boardRev
+RPI_padDrive
+RPI_sn3218Setup
diff --git a/macros/Hardware/RasberryPi/RPI_DelayMicro.sci b/macros/Hardware/RasberryPi/RPI_DelayMicro.sci
deleted file mode 100644
index bbb0bb3b..00000000
--- a/macros/Hardware/RasberryPi/RPI_DelayMicro.sci
+++ /dev/null
@@ -1,38 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-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_DelayMilli.sci b/macros/Hardware/RasberryPi/RPI_DelayMilli.sci
deleted file mode 100644
index 13b79625..00000000
--- a/macros/Hardware/RasberryPi/RPI_DelayMilli.sci
+++ /dev/null
@@ -1,39 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_DelayMilli(time)
-// Function to insert some delay in milli seconds 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/RPI_DigitalIn.sci b/macros/Hardware/RasberryPi/RPI_DigitalIn.sci
deleted file mode 100644
index 781c49c8..00000000
--- a/macros/Hardware/RasberryPi/RPI_DigitalIn.sci
+++ /dev/null
@@ -1,43 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-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
-//
-// -----------------------------------------------------------------
-//Pins of header P1 which can be used as GPIO
-supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
- 31,31,33,35,36,37,38,40];
-
-PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
-
-//If given pin does not support GPIO functionality, raise the error
-if(PinIsGPIO == 0)
- error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
-end
-state = 1;
-endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalOut.sci b/macros/Hardware/RasberryPi/RPI_DigitalOut.sci
deleted file mode 100644
index dde3c934..00000000
--- a/macros/Hardware/RasberryPi/RPI_DigitalOut.sci
+++ /dev/null
@@ -1,44 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-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
-//
-// -----------------------------------------------------------------
-//Pins of header P1 which can be used as GPIO
-supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
- 31,31,33,35,36,37,38,40];
-
-PinIsGPIO = members(pin, supported_pins); //Check if output pin supports GPIO
-
-//If given pin does not support GPIO functionality, raise the error
-if(PinIsGPIO == 0)
- error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
-end
-state = 1;
-
-endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci b/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
deleted file mode 100644
index 01d6e07d..00000000
--- a/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
+++ /dev/null
@@ -1,36 +0,0 @@
-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, 2->PWM 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(3,0) //Sets pin 3 of header P1 as input
-//
-// See also
-// RPI_DigitalIn RPI_DigitalOut
-//
-//
-// Authors
-// Siddhesh Wani
-// -----------------------------------------------------------------
-//Pins of header P1 which can be used as GPIO
-supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
- 31,31,33,35,36,37,38,40];
-
-PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
-
-//If given pin does not support GPIO functionality, raise the error
-if(PinIsGPIO == 0)
- error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
-end
-state = 1;
-
-endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_GetMicros.sci b/macros/Hardware/RasberryPi/RPI_GetMicros.sci
deleted file mode 100644
index 6c4db57a..00000000
--- a/macros/Hardware/RasberryPi/RPI_GetMicros.sci
+++ /dev/null
@@ -1,39 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function Micros = RPI_GetMicros()
-// Function to get time in Microsecond since first setup function called.
-//
-// Calling Sequence
-// Micros = RPI_GetMicros()
-//
-// Parameters
-// Micros: time in Microseconds since first setup function called
-//
-// Description
-// This function can be used to get time since first setup function called.
-// Note: To use this function atleast one setup function must be called.
-//
-// Examples
-// start = RPI_GetMicros()
-// RPI_DelayMicro(1000) //This will delay the execution of next code by 100 ms.
-// end = RPI_GetMicros()
-// delay = end- start //This should be approximately 1000 us.
-//
-// See also
-// RPI_GetMillis RPI_DelayMilli 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.
-Micros = 0;
-endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_GetMillis.sci b/macros/Hardware/RasberryPi/RPI_GetMillis.sci
deleted file mode 100644
index c034a705..00000000
--- a/macros/Hardware/RasberryPi/RPI_GetMillis.sci
+++ /dev/null
@@ -1,39 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function Millis = RPI_GetMillis()
-// Function to get time in millisecond since first setup function called.
-//
-// Calling Sequence
-// Millis = RPI_GetMillis()
-//
-// Parameters
-// Millis: time in milliseconds since first setup function called
-//
-// Description
-// This function can be used to get time since first setup function called.
-// Note: To use this function atleast one setup function must be called.
-//
-// Examples
-// start = RPI_GetMillis()
-// RPI_DelayMilli(100) //This will delay the execution of next code by 100 ms.
-// end = RPI_GetMillis()
-// delay = end- start //This should be approximately 100ms.
-//
-// See also
-// RPI_GetMicros RPI_DelayMilli 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.
-Millis = 0;
-endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci b/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci
deleted file mode 100644
index 8448d364..00000000
--- a/macros/Hardware/RasberryPi/RPI_HardPWMSetClock.sci
+++ /dev/null
@@ -1,35 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_HardPWMSetClock(clock_divisor)
-// Function to set PWM clock. PWM clock frequency is 19.2MHz, which can be reduced
-// using suitable clock_divisor (1 to 2048, powers of 2)
-//
-// Calling Sequence
-// RPI_HardPWMSetClock(clock_divisor)
-//
-// Parameters
-// clock_divisor: Value can be from 1 to 2048, powers of 2.
-// Description
-// This function decides pwm clock.
-// PWM frequency = (PWM Clock frequency/Clock divisor/range)
-// PWM clock frequency = 19.2 MHz
-// clock divisor is setup using RPI_HardPWMSetClock
-// range is setup using RPI_HardPWMSetRange
-// Examples
-//
-// See also
-// RPI_HardPWMSetWrite RPI_HardPWMSetRange
-//
-// 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_HardPWMSetMode.sci b/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci
deleted file mode 100644
index 57b82601..00000000
--- a/macros/Hardware/RasberryPi/RPI_HardPWMSetMode.sci
+++ /dev/null
@@ -1,32 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_HardPWMSetMode(pwm_mode)
-// Function to set PWM mode. Two modes are available - balanced and mark/space
-//
-// Calling Sequence
-// RPI_HardPWMSetMode(pwm_mode)
-//
-// Parameters
-// pwm_mode: decides pwm mode
-// 0 -> balanced
-// 1 -> mark/space
-// Description
-// This function decides pwm mode
-// Examples
-//
-// See also
-// RPI_HardPWMSetWrite RPI_HardPWMSetRange
-//
-// 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_HardPWMSetRange.sci b/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci
deleted file mode 100644
index c2075e2d..00000000
--- a/macros/Hardware/RasberryPi/RPI_HardPWMSetRange.sci
+++ /dev/null
@@ -1,35 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_HardPWMSetRange(range_val)
-// Function to set range value for PWM. Range value along with clock divisor
-// decides pwm frequency. Range value must be less than 1024
-//
-// Calling Sequence
-// RPI_HardPWMSetRange(range_val)
-//
-// Parameters
-// range_val: range for pwm
-// Description
-// This function decides range for pwm.
-// PWM frequency = (PWM Clock frequency/Clock divisor/range)
-// PWM clock frequency = 19.2 MHz
-// clock divisor is setup using RPI_HardPWMSetClock
-// range is setup using RPI_HardPWMSetRange
-// Examples
-//
-// See also
-// RPI_HardPWMSetClock RPI_HardPWMWrite
-//
-// 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_HardPWMWrite.sci b/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci
deleted file mode 100644
index dba5e674..00000000
--- a/macros/Hardware/RasberryPi/RPI_HardPWMWrite.sci
+++ /dev/null
@@ -1,39 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_HardPWMWrite(pin,value)
-// Function to change pwm duty on specified pin. Hardware PWM is available
-// only on pin 12. So, only '12' should be provided as pin
-//
-// Calling Sequence
-// RPI_HardPWMWrite(12,512) //Value must be smaller than the range set
-// using RPI_HARDPWMSetRange
-//
-// Parameters
-// pin: pin no on which pwm value is to be changed. Currently only 12 is allowed
-// value: pwm value for given pin. This must be less than range value set
-// Description
-// This function changes pwm duty on specified pin. As for RPi, only one pin
-// (pin 12) is available for hardware PWM.
-// PWM frequency = (PWM Clock frequency/Clock divisor/range)
-// PWM clock frequency = 19.2 MHz
-// clock divisor is setup using RPI_HardPWMSetClock
-// range is setup using RPI_HardPWMSetRange
-// Actual PWM duty = value/range
-// Examples
-//
-// See also
-// RPI_HardPWMSetClock RPI_HardPWMSetRange
-//
-// 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_PinISR.sci b/macros/Hardware/RasberryPi/RPI_PinISR.sci
deleted file mode 100644
index c2354c1f..00000000
--- a/macros/Hardware/RasberryPi/RPI_PinISR.sci
+++ /dev/null
@@ -1,56 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_PinISR(pin, edgetype, fn)
-// Function to assign a function to be run when an interrupt occurs on
-// specified pin.
-//
-// Calling Sequence
-// RPI_PinISR(pin, edgetype, fn)
-//
-// Parameters
-// pin : pin whose interrupt is to be configured
-// edgetype: edge on which interrupt is to be monitored
-// 1 -> Falling egde
-// 2 -> Rising egde
-// 3 -> Both egde
-// fn: name of the function to be executed on interrupt occurance
-// Description
-// This functions monitors interrupt on specified pin for specified edge,
-// When that interrupt occurs, function specified by 'fn' is executed.
-// Examples
-// RPI_PinISR(12, 0, Pin12ISR) //executes 'Pin12ISR' on falling edge on
-// pin 12
-// See also
-// RPI_ThreadCreate RPI_DigitalSetup
-//
-//
-// Authors
-// Siddhesh Wani
-// -----------------------------------------------------------------
-
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for RPi.
-
-//Pins of header P1 which can be used as GPIO
-supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
- 31,31,33,35,36,37,38,40];
-
-PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
-
-//If given pin does not support GPIO functionality, raise the error
-if(PinIsGPIO == 0)
- error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
-end
-EdgeTypeSupported = members(edgetype,[1 2 3]);
-
-if(EdgeTypeSupported == 0)
- error(9999, 'SCI2CERROR: Given edgetype is incorrect. Please specify correct edgetype from [1,2,3]')
-end
-
-endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_SerialClose.sci b/macros/Hardware/RasberryPi/RPI_SerialClose.sci
deleted file mode 100644
index f27dd432..00000000
--- a/macros/Hardware/RasberryPi/RPI_SerialClose.sci
+++ /dev/null
@@ -1,33 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_SerialClose(fd)
-// Function to close serial port specified by file descriptor.
-//
-// Calling Sequence
-// RPI_SerialClose(fd)
-//
-// Parameters
-// fd : file descriptor for opened port
-// Description
-// This functions closes the specified serial port
-// Examples
-// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
-// RPI_SerialClose(serial1)
-// See also
-// RPI_SerialOpen RPI_SerialSendChar
-//
-//
-// 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_SerialFlush.sci b/macros/Hardware/RasberryPi/RPI_SerialFlush.sci
deleted file mode 100644
index 9bab386f..00000000
--- a/macros/Hardware/RasberryPi/RPI_SerialFlush.sci
+++ /dev/null
@@ -1,34 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function data = RPI_SerialGetChar(fd)
-// Function to read data from specified serial port
-//
-// Calling Sequence
-// RPI_SerialGetCharfd)
-//
-// Parameters
-// fd: file descriptor returned when serial port was opened
-// Description
-// This functions reads character form specified port. In case no
-// character is available, -1 is returned after 10 sec.
-// Examples
-// serial = RPI_SetupSerial("/dev/ttyAMA0", 9600);
-// RPI_SerialFlush(serial);
-// bytes = RPI_SerialDataAvail(serial);
-//
-// See also
-// RPI_SetupSerial RPI_SendData
-//
-// 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_SerialGetChar.sci b/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci
deleted file mode 100644
index a26e5b97..00000000
--- a/macros/Hardware/RasberryPi/RPI_SerialGetChar.sci
+++ /dev/null
@@ -1,36 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function data = RPI_SerialGetChar(fd)
-// Function to read data from specified serial port
-//
-// Calling Sequence
-// RPI_SerialGetChar(fd)
-//
-// Parameters
-// fd: file descriptor returned when serial port was opened
-// Description
-// This functions reads character form specified port. In case no
-// character is available, -1 is returned after 10 sec.
-// Examples
-// serial = RPI_SetupSerial("/dev/ttyAMA0", 9600);
-// bytes = RPI_SerialDataAvail(serial);
-// if(bytes>0)
-// data = RPI_SerialGetChar(serial) //Reads single character
-// end
-// See also
-// RPI_SetupSerial RPI_SendData
-//
-// Authors
-// Siddhesh Wani
-// -----------------------------------------------------------------
-
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for RPi.
-data = 0;
-endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_SerialSendChar.sci b/macros/Hardware/RasberryPi/RPI_SerialSendChar.sci
deleted file mode 100644
index 769b21d2..00000000
--- a/macros/Hardware/RasberryPi/RPI_SerialSendChar.sci
+++ /dev/null
@@ -1,37 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_SerialSendChar(fd, data)
-// Function to send 8-bit char through serial port.
-//
-// Calling Sequence
-// RPI_SerialSendChar(fd, data)
-//
-// Parameters
-// fd : file descriptor for opened port
-// data: 8-bit character data to be sent
-// Description
-// This functions sends input 8-bit character data on specified serial port
-// Examples
-// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
-// RPI_SerialSendChar(serial1, 'H');
-// RPI_SerialSendChar(serial1, 'i');
-// RPI_SerialClose(serial1);
-//
-// See also
-// RPI_SerialOpen RPI_SerialClose
-//
-//
-// 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_SerialSendData.sci b/macros/Hardware/RasberryPi/RPI_SerialSendData.sci
deleted file mode 100644
index c05852b1..00000000
--- a/macros/Hardware/RasberryPi/RPI_SerialSendData.sci
+++ /dev/null
@@ -1,38 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_SerialSendData(fd, data)
-// Function to send data through serial port. Data can be of any datatype and
-// can be scalar or matrix
-//
-// Calling Sequence
-// RPI_SerialSendData(fd, data)
-//
-// Parameters
-// fd : file descriptor for opened port
-// data: data to be sent
-// Description
-// This functions sends input data on specified serial port
-// Examples
-// A = [2 3; 4 5]
-// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
-// RPI_SerialSendData(serial1, A);
-// RPI_SerialClose(serial1);
-//
-// See also
-// RPI_SerialOpen RPI_SerialClose
-//
-//
-// 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_SerialSetup.sci b/macros/Hardware/RasberryPi/RPI_SerialSetup.sci
deleted file mode 100644
index 0f266610..00000000
--- a/macros/Hardware/RasberryPi/RPI_SerialSetup.sci
+++ /dev/null
@@ -1,36 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function fd = RPI_SerialSetup(port, baudrate)
-// Function to setup serial port.
-//
-// Calling Sequence
-// RPI_SerialSetup(port, baudrate)
-//
-// Parameters
-// port : port of RPi to be used (eg. )
-// direction : direction to be set for pin (0 -> INPUT, 1 -> OUTPUT)
-// fd : file descriptor for opened port, -1 for error
-// Description
-// This functions opens the specified serial port and returns file descriptor
-// for the same
-// Examples
-// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
-//
-// See also
-// RPI_SerialClose RPI_SerialSendChar
-//
-//
-// Authors
-// Siddhesh Wani
-// -----------------------------------------------------------------
-
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for RPi.
-fd = 0;
-endfunction
diff --git a/macros/Hardware/RasberryPi/RPI_adress.sci b/macros/Hardware/RasberryPi/RPI_adress.sci
new file mode 100755
index 00000000..4c9aa7f0
--- /dev/null
+++ b/macros/Hardware/RasberryPi/RPI_adress.sci
@@ -0,0 +1,34 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+global RPI_piAdress;
+function RPI_adress(adress)
+ // Function for non-ssh connection to raspberry pi
+ //
+ // Calling Sequence
+ // RPI_adress(adress)
+ //
+ // Parameters
+ // address : Network address of the raspberry pi. Eg:192.168.137.214
+ //
+ // Description
+ // This program is required for the functioning of the remaining toolbox if the server is manually run by the user.
+ //
+ // Examples
+ // RPI_adress('10.42.0.82')
+ // See also
+ // raspi,raspi_close
+ //
+ // Authors
+ // Jorawar Singh
+
+ global RPI_piAdress;
+ RPI_piAdress=adress;
+endfunction
diff --git a/macros/Hardware/RasberryPi/SPI/RPI_SPIDataRW.sci b/macros/Hardware/RasberryPi/SPI/RPI_SPIDataRW.sci
new file mode 100755
index 00000000..186e68ff
--- /dev/null
+++ b/macros/Hardware/RasberryPi/SPI/RPI_SPIDataRW.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_SPIDataRW(channel,data,len)
+// Function to perform simultaneous read-write on SPI
+//
+// Calling Sequence
+// RPI_SPIDataRW(channel,data,len)
+//
+// Parameters
+// channel: channel number, 0 or 1
+// data : data to write as list of integers
+// len : length of the data
+//
+// Description
+// This performs a simultaneous write/read transaction over the selected SPI bus. Data that was in your buffer is overwritten by data returned from the SPI bus.
+//
+// Examples
+// RPI_SPIDataRW(0,[13,58],2)
+// See also
+// RPI_SPISetup, RPI_SPISetupMode, RPI_SPIGetFd
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="SPD#3#"+string(channel)+"#"+string(data)+"#"+string(len)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/SPI/RPI_SPIGetFd.sci b/macros/Hardware/RasberryPi/SPI/RPI_SPIGetFd.sci
new file mode 100755
index 00000000..43cfc098
--- /dev/null
+++ b/macros/Hardware/RasberryPi/SPI/RPI_SPIGetFd.sci
@@ -0,0 +1,39 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_SPIGetFd(channel)
+//
+// Calling Sequence
+// RPI_SPIGetFd(channel)
+//
+// Parameters
+// channel: channel number, 0 or 1
+//
+// Description
+//
+//
+// Examples
+// RPI_SPIGetFd(1)
+// See also
+// RPI_SPIDataRW, RPI_SPISetup, RPI_SPISetupMode
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="SPG#1#"+string(channel)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/SPI/RPI_SPISetup.sci b/macros/Hardware/RasberryPi/SPI/RPI_SPISetup.sci
new file mode 100755
index 00000000..5654cf9b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/SPI/RPI_SPISetup.sci
@@ -0,0 +1,43 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_SPISetup(channel,speed)
+// Function to initialize SPI
+//
+// Calling Sequence
+// RPI_SPISetup(channel,spped)
+//
+// Parameters
+// channel: channel number, 0 or 1
+// speed : SPI clock speed in Hz
+//
+// Description
+// This function initialises a channel (The Pi has 2 channels; 0 and 1). The speed parameter is an integer in the range 500,000 through 32,000,000 and represents the SPI clock speed in Hz.
+//
+//The returned value is the Linux file-descriptor for the device, or -1 on error.
+//
+// Examples
+// RPI_SPISetup(1,500000)
+// See also
+// RPI_SPIDataRW, RPI_SPISetupMode, RPI_SPIGetFd
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="SPS#2#"+string(channel)+"#"+string(speed)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/SPI/RPI_SPISetupMode.sci b/macros/Hardware/RasberryPi/SPI/RPI_SPISetupMode.sci
new file mode 100755
index 00000000..fec785ab
--- /dev/null
+++ b/macros/Hardware/RasberryPi/SPI/RPI_SPISetupMode.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_SPISetupMode(channel,speed,Mode)
+// Function to initialize SPI
+//
+// Calling Sequence
+// RPI_SPISetupMode(channel,spped,Mode)
+//
+// Parameters
+// channel: channel number, 0 or 1
+// speed : SPI clock speed in Hz
+// Mode : integer, mode to set
+//
+// Description
+//
+// Examples
+// RPI_SPISetupMode(1,500000,2)
+// See also
+// RPI_SPIDataRW, RPI_SPISetup, RPI_SPIGetFd
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="SPM#23#"+string(channel)+"#"+string(speed)+"#"+string(Mode)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/SPI/buildmacros.sce b/macros/Hardware/RasberryPi/SPI/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/SPI/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/SPI/names b/macros/Hardware/RasberryPi/SPI/names
new file mode 100755
index 00000000..6f458a7e
--- /dev/null
+++ b/macros/Hardware/RasberryPi/SPI/names
@@ -0,0 +1,4 @@
+RPI_SPIDataRW
+RPI_SPIGetFd
+RPI_SPISetup
+RPI_SPISetupMode
diff --git a/macros/Hardware/RasberryPi/Serial/RPI_serialClose.sci b/macros/Hardware/RasberryPi/Serial/RPI_serialClose.sci
new file mode 100755
index 00000000..6f54b655
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Serial/RPI_serialClose.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_serialClose(fd)
+// Function to close and open serial device
+//
+// Calling Sequence
+// RPI_serialClose(fd)
+//
+// Parameters
+// fd: file-descriptor obtained from RPI_serialOpen function
+//
+// Description
+// This function closes the device identified by the file descriptor given.
+//
+// Examples
+// RPI_serialClose(13)
+// See also
+// RPI_serialOpen, RPI_serialFlush, RPI_serialPutchar, RPI_serialPuts, RPI_serialPrintf, RPI_serialDataAvail, RPI_serialGetchar
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sCl#1#"+string(fd)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Serial/RPI_serialDataAvail.sci b/macros/Hardware/RasberryPi/Serial/RPI_serialDataAvail.sci
new file mode 100755
index 00000000..9421e5b4
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Serial/RPI_serialDataAvail.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_serialDataAvail(fd)
+// Function to get number of readable character from the serial device
+//
+// Calling Sequence
+// RPI_serialDataAvail(fd)
+//
+// Parameters
+// fd: file-descriptor obtained from RPI_serialOpen function
+//
+// Description
+// Returns the number of characters available for reading, or -1 for any error condition, in which case error number will be set appropriately.
+//
+// Examples
+// RPI_serialDataAvail(13)
+// See also
+// RPI_serialOpen, RPI_serialClose, RPI_serialFlush, RPI_serialPutchar, RPI_serialPuts, RPI_serialPrintf, RPI_serialGetchar
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sDA#1#"+string(fd)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Serial/RPI_serialFlush.sci b/macros/Hardware/RasberryPi/Serial/RPI_serialFlush.sci
new file mode 100755
index 00000000..845f70b3
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Serial/RPI_serialFlush.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_serialFlush(fd)
+// Function to discard all data to/from the serial device
+//
+// Calling Sequence
+// RPI_serialFlush(fd)
+//
+// Parameters
+// fd: file-descriptor obtained from RPI_serialOpen function
+//
+// Description
+// This function discards all data received, or waiting to be send down the given device.
+//
+// Examples
+// RPI_serialFlush(13)
+// See also
+// RPI_serialOpen, RPI_serialClose, RPI_serialPutchar, RPI_serialPuts, RPI_serialPrintf, RPI_serialDataAvail, RPI_serialGetchar
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sFl#1#"+string(fd)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Serial/RPI_serialGetchar.sci b/macros/Hardware/RasberryPi/Serial/RPI_serialGetchar.sci
new file mode 100755
index 00000000..327fe356
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Serial/RPI_serialGetchar.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_serialGetchar(fd)
+// Function to get next character from serial device
+//
+// Calling Sequence
+// RPI_serialGetchar(fd)
+//
+// Parameters
+// fd: file-descriptor obtained from RPI_serialOpen function
+//
+// Description
+// This function returns the next character available on the serial device. This call will block for up to 10 seconds if no data is available (when it will return -1).
+//
+// Examples
+// RPI_serialGetchar(13)
+// See also
+// RPI_serialOpen, RPI_serialClose, RPI_serialFlush, RPI_serialPutchar, RPI_serialPuts, RPI_serialPrintf, RPI_serialDataAvail
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sGc#1#"+string(fd)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Serial/RPI_serialOpen.sci b/macros/Hardware/RasberryPi/Serial/RPI_serialOpen.sci
new file mode 100755
index 00000000..684a6f20
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Serial/RPI_serialOpen.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_serialOpen(device,baud)
+// Function to initialize a serial device
+//
+// Calling Sequence
+// RPI_serialOpen(device,baud)
+//
+// Parameters
+// device: device to connect to
+// baud : the baud rate for communication
+//
+// Description
+// This function opens and initialises the serial device and sets the baud rate. It sets the port into “raw” mode (character at a time and no translations), and sets the read timeout to 10 seconds. The return value is the file descriptor or -1 for any error, in which case errno will be set as appropriate.
+//
+// Examples
+// RPI_serialOpen("/dev/ttyAMA0", 9600)
+// See also
+// RPI_serialClose, RPI_serialFlush, RPI_serialPutchar, RPI_serialPuts, RPI_serialPrintf, RPI_serialDataAvail, RPI_serialGetchar
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sOp#2#"+string(device)+"#"+string(baud)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Serial/RPI_serialPrintf.sci b/macros/Hardware/RasberryPi/Serial/RPI_serialPrintf.sci
new file mode 100755
index 00000000..668a9fff
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Serial/RPI_serialPrintf.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_serialPrintf(fd,msg)
+// Function to print to serial device
+//
+// Calling Sequence
+// RPI_serialPrintf(fd,msg)
+//
+// Parameters
+// fd : file-descriptor obtained from RPI_serialOpen function
+// msg: message to print
+//
+// Description
+// This function emulates the system printf function to the serial device.
+//
+// Examples
+// RPI_serialPrintf(13,'White Collar rocks')
+// See also
+// RPI_serialOpen, RPI_serialClose, RPI_serialFlush, RPI_serialPutchar, RPI_serialPuts, RPI_serialDataAvail, RPI_serialGetchar
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sPf#2#"+string(fd)+"#"+string(msg)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Serial/RPI_serialPutchar.sci b/macros/Hardware/RasberryPi/Serial/RPI_serialPutchar.sci
new file mode 100755
index 00000000..ceea556c
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Serial/RPI_serialPutchar.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_serialPutchar(fd,character)
+// Function to send a single byte to the serial device
+//
+// Calling Sequence
+// RPI_serialPutchar(fd,character)
+//
+// Parameters
+// fd : file-descriptor obtained from RPI_serialOpen function
+// character: character to send to the serial device
+//
+// Description
+// This function sends the single byte to the serial device identified by the given file descriptor.
+//
+// Examples
+// RPI_serialPutchar(113,'s')
+// See also
+// RPI_serialOpen, RPI_serialClose, RPI_serialFlush, RPI_serialPuts, RPI_serialPrintf, RPI_serialDataAvail, RPI_serialGetchar
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sPc#2#"+string(fd)+"#"+string(character)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Serial/RPI_serialPuts.sci b/macros/Hardware/RasberryPi/Serial/RPI_serialPuts.sci
new file mode 100755
index 00000000..ecbbe057
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Serial/RPI_serialPuts.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_serialPuts(fd,s)
+// Function to send a null-terminalted string
+//
+// Calling Sequence
+// RPI_serialPuts(fd,s)
+//
+// Parameters
+// fd: file-descriptor obtained from RPI_serialOpen function
+// s : string to send
+//
+// Description
+// Sends the nul-terminated string to the serial device identified by the given file descriptor.
+//
+// Examples
+// RPI_serialPuts(13,'Believe it, Dattebayo!\0')
+// See also
+// RPI_serialOpen, RPI_serialClose, RPI_serialFlush, RPI_serialPutchar, RPI_serialPrintf, RPI_serialDataAvail, RPI_serialGetchar
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sPs#2#"+string(fd)+"#"+string(s)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Serial/buildmacros.sce b/macros/Hardware/RasberryPi/Serial/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Serial/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/Serial/names b/macros/Hardware/RasberryPi/Serial/names
new file mode 100755
index 00000000..a652727e
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Serial/names
@@ -0,0 +1,8 @@
+RPI_serialClose
+RPI_serialDataAvail
+RPI_serialFlush
+RPI_serialGetchar
+RPI_serialOpen
+RPI_serialPrintf
+RPI_serialPutchar
+RPI_serialPuts
diff --git a/macros/Hardware/RasberryPi/Setup/RPI_getAlt.sci b/macros/Hardware/RasberryPi/Setup/RPI_getAlt.sci
new file mode 100755
index 00000000..ba3d204f
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Setup/RPI_getAlt.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_getAlt(pin)
+// Function to get the current mode of pin
+//
+// Calling Sequence
+// s=RPI_getAlt(pin)
+//
+// Parameters
+// pin: The pin number to read the voltage from. Numbering sequence to be followed as initiated using RPI_pinNumbering function.
+//
+// Description
+// This function returns the current mode of the pin. Output will be 0 for INPUT, 1 for OUTPUT, 2 for PWM_OUT and 3 for CLOCK.
+//
+// Examples
+// s=RPI_getAlt(0)
+// See also
+// RPI_pinNumbering, RPI_pinModeAlt
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="gAt#1#"+string(pin)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Setup/RPI_pinMode.sci b/macros/Hardware/RasberryPi/Setup/RPI_pinMode.sci
new file mode 100755
index 00000000..b6f52e61
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Setup/RPI_pinMode.sci
@@ -0,0 +1,60 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+
+function RPI_pinMode(pin,Mode)
+// Function to set the mode of the given pin.
+//
+// Calling Sequence
+// RPI_pinMode(pin,Mode)
+//
+// Parameters
+// pin : The pin number to act on. Numbering sequence to be followed as initiated using RPI_pinNumbering function.
+// Mode: The mode in which to set the pin.
+//
+// Description
+// This function configures the Raspberry Pi's given pin to work as the given mode (input/output/pwm/clock). Not all functions are available to all the pins.
+//
+// Mode can take the following values-
+//
+// 'in' -> sets the pin as input
+// 'out' -> sets the pin as output
+// 'pwm' -> sets the pin to PWM output. Only wiringPi pin 1 (BCM_GPIO pin 18) supports this function.
+// 'clock' -> sets the pin to CLOCK output. Only wiringPi pin 7 (BCM_GPIO pin 4) supports this function.
+//
+//
+// Examples
+// RPI_pinMode(0,'out')
+// See also
+// RPI_pinNumbering
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ if Mode=='in' then
+ commande="pnM#2#"+string(pin)+"#0#";
+ elseif Mode=='out' then
+ commande="pnM#2#"+string(pin)+"#1#";
+ elseif Mode=='pwm' then
+ commande="pnM#2#"+string(pin)+"#2#";
+ elseif Mode=='clock' then
+ commande="pnM#2#"+string(pin)+"#3#";
+ else
+ error("Mode should be one of ""in/out/pwm/clock/soft_pwm/soft_tone/pwm_tone"".");
+ end
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Setup/RPI_pinModeAlt.sci b/macros/Hardware/RasberryPi/Setup/RPI_pinModeAlt.sci
new file mode 100755
index 00000000..dd0fa101
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Setup/RPI_pinModeAlt.sci
@@ -0,0 +1,55 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_pinModeAlt(pin,ALTMode)
+// Function to set the current mode of pin
+//
+// Calling Sequence
+// RPI_pinModeAlt(pin,ALTMode)
+//
+// Parameters
+// pin : The pin number to read the voltage from. Numbering sequence to be followed as initiated using RPI_pinNumbering function.
+// ALTMode: integer, from 0 to 7
+//
+// Description
+// This function sets the mode of the pin to either of the general GPIO (also set through RPI_pinMode function) or the alternatives available (not accessible through RPI_pinMode function).
+//
+// ALTMode can take the following values:
+//
+// 0 : Input
+// 1 : Output
+// 2 : ALT5
+// 3 : ALT4
+// 4 : ALT0
+// 5 : ALT1
+// 6 : ALT2
+// 7 : ALT3
+//
+//
+//The list of Alternate functions of all the pins can be found on page 102 of the official documentation: https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2835/BCM2835-ARM-Peripherals.pdf
+//
+// Examples
+// RPI_pinModeAlt(1,2)
+// See also
+// RPI_pinMode, RPI_pinNumbering, RPI_getAlt
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="pMA#2#"+string(pin)+"#"+string(ALTMode)+"#";
+ if getos()=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Setup/RPI_pinNumbering.sci b/macros/Hardware/RasberryPi/Setup/RPI_pinNumbering.sci
new file mode 100755
index 00000000..4716de80
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Setup/RPI_pinNumbering.sci
@@ -0,0 +1,54 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_pinNumbering(pinSetup)
+// Function to initialize wiringpi with the number sequence to be followed.
+//
+// Calling Sequence
+// RPI_pinNumbering(pinSetup)
+//
+// Parameters
+// pinSetup: The pin number sequence to follow
+//
+// Description
+// This function must be called at the start of the program or the program will fail to work correctly. It tells the wiringpi which number sequence will be used to work on Raspberry Pi. Returns 0 if no errors encountered. Pin maps for the different pinSetups can be found at the link in bibliography.
+//
+// pinSetup can take the following values:
+//
+// 'wiringpi' -> This initialises wiringPi and assumes that the calling program is going to be using the wiringPi pin numbering scheme. This is a simplified numbering scheme which provides a mapping from virtual pin numbers to the real underlying Broadcom GPIO pin numbers.
+// 'GPIO' -> Same as above, however it allows the calling programs to use the Broadcom GPIO pin numbers directly with no re-mapping.
+// 'phys' -> Identical to above, however it allows the calling programs to use the physical pin numbers on the P1 connector only.
+//
+//
+// Examples
+// RPI_pinNumbering('wiringpi')
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ if (pinSetup=='wiringpi') then
+ commande="pN0#0#";
+ elseif (pinSetup=='GPIO') then
+ commande="pN1#0#";
+ elseif (pinSetup=='sys') then
+ commande="pN2#0#";
+ elseif (pinSetup=='phys') then
+ commande="pN3#0#";
+ else
+ error("pinSetup should be one of wiringpi/GPIO/sys/phys");
+ end
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Setup/RPI_pullControl.sci b/macros/Hardware/RasberryPi/Setup/RPI_pullControl.sci
new file mode 100755
index 00000000..6354bf55
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Setup/RPI_pullControl.sci
@@ -0,0 +1,60 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_pullControl(pin,RMode)
+// Function to change the internal pull up/down resistor setting for a given pin.
+//
+// Calling Sequence
+// RPI_pullControl(pin,RMode)
+//
+// Parameters
+// pin : The pin number to act on. Numbering sequence to be followed as initiated using RPI_pinNumbering function.
+// RMode: The mode for the internal resistance of the given pin.
+//
+// Description
+// This sets the pull-up or pull-down resistor mode on the given pin, which should be set as an input using the PRI_pinMode function. The internal pull up/down
+// resistors have a value of approximately 50KΩ on the Raspberry Pi.
+//
+// RMode can take values:
+//
+// 'up' -> pull to 3.3v
+// 'down'-> pull to ground
+// 'none'-> no pull up/down
+//
+//
+// This function has no effect on the Raspberry Pi’s GPIO pins when in sys mode, set using RPI_pinNumbering function. To activate a pull-up/pull-down, use the gpio
+// program in a script before starting the program.
+//
+// Examples
+// RPI_pullControl(0,'down')
+// See also
+// RPI_pinNumbering, RPI_pinMode
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ if RMode=='up' then
+ commande="plC#2#"+string(pin)+"#2#";
+ elseif RMode=='down' then
+ commande="plC#2#"+string(pin)+"#1#";
+ elseif RMode=='none' then
+ commande="plC#2#"+string(pin)+"#0#";
+ else
+ error("mode should be one of up/down/none");
+ end
+ if getos()=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Setup/buildmacros.sce b/macros/Hardware/RasberryPi/Setup/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Setup/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/Setup/names b/macros/Hardware/RasberryPi/Setup/names
new file mode 100755
index 00000000..38954982
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Setup/names
@@ -0,0 +1,5 @@
+RPI_getAlt
+RPI_pinMode
+RPI_pinModeAlt
+RPI_pinNumbering
+RPI_pullControl
diff --git a/macros/Hardware/RasberryPi/Shift/RPI_shiftIn.sci b/macros/Hardware/RasberryPi/Shift/RPI_shiftIn.sci
new file mode 100755
index 00000000..2bdb89b8
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Shift/RPI_shiftIn.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_shiftIn(dpin,cpin,order)
+// Function to shift 8-bit value appearing on dpin
+//
+// Calling Sequence
+// RPI_shiftIn(dpin,cpin,order)
+//
+// Parameters
+// dpin : datapin
+// cpin : clockpin
+// order: integer, 0 (LSB first) or 1 (MSB first)
+//
+// Description
+// This shifts an 8-bit data value in with the data appearing on the dPin and the clock being sent out on the cPin. Order is either LSBFIRST or MSBFIRST. The data is sampled after the cPin goes high. (So cPin high, sample data, cPin low, repeat for 8 bits) The 8-bit value is returned by the function.
+//
+// Examples
+// RPI_shiftIn(0,2,0)
+// See also
+// RPI_shiftOut
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="shI#3#"+string(dpin)+"#"+string(cpin)+"#"+string(order)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Shift/RPI_shiftOut.sci b/macros/Hardware/RasberryPi/Shift/RPI_shiftOut.sci
new file mode 100755
index 00000000..c3485609
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Shift/RPI_shiftOut.sci
@@ -0,0 +1,43 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_shiftOut(dpin,cpin,order,val)
+// Function to shift out 8-bit data with value=val
+//
+// Calling Sequence
+// RPI_shiftOut(dpin,cpin,order,val)
+//
+// Parameters
+// dpin : datapin
+// cpin : clockpin
+// order: integer, 0 (LSB first) or 1 (MSB first)
+// val : integer, data to send
+//
+// Description
+// The shifts an 8-bit data value val out with the data being sent out on dPin and the clock being sent out on the cPin. order is as above. Data is clocked out on the rising or falling edge – ie. dPin is set, then cPin is taken high then low – repeated for the 8 bits.
+//
+// Examples
+// RPI_shiftOut(1,2,0,123)
+// See also
+// RPI_shiftIn
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="shO#4#"+string(dpin)+"#"+string(cpin)+"#"+string(order)+"#"+string(val)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Shift/RPI_sr595Setup.sci b/macros/Hardware/RasberryPi/Shift/RPI_sr595Setup.sci
new file mode 100755
index 00000000..fb77f988
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Shift/RPI_sr595Setup.sci
@@ -0,0 +1,44 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_sr595Setup(pinBase,numPins,dataPin,clockPin,latchPin)
+// Function to setup sr5595 shift register chips
+//
+// Calling Sequence
+// RPI_sr595Setup(pinBase,numPins,dataPin,clockPin,latchPin)
+//
+// Parameters
+// pinBase : any number above 64. Consecutive number of numPins will be allocated alongwith.
+// numPins : number of pins, can be 0-32, 8 pins per 74x595
+// dataPin : The Raspberry pin corresponding to the 74x595's data pin. Numbering sequence to be followed as initiated by RPI_pinNumbering function.
+// clockPin: The Raspberry pin corresponding to the 74x595's clock pin. Numbering sequence to be followed as initiated by RPI_pinNumbering function.
+// latchPin: The Raspberry pin corresponding to the 74x595's latch pin. Numbering sequence to be followed as initiated by RPI_pinNumbering function.
+//
+// Description
+// This function sets up the extension module for the 74×595 shift register chips which can be used as general purpose output ports. Each instance can support up to 4 74×595’s daisy-chained together, giving a 32-bit output port using just 3 GPIO wires from the Raspberry Pi (or from any other GPIO expansion port connected to the Pi) One can have as many instances of these enabled in the system, provided there are 3 spare GPIO pins per instance.
+//
+// Examples
+// RPI_sr595Setup(100,10,0,1,2)
+// See also
+// RPI_sn3218Setup, RPI_pcf8574Setup, RPI_pcf8591Setup, RPI_mcp23008Setup, RPI_mcp23016Setup, RPI_mcp23017Setup, RPI_mcp23s08Setup, RPI_mcp23s17Setup, RPI_pinNumbering
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sr5#5#"+string(pinBase)+"#"+string(numPins)+"#"+string(dataPin)+"#"+string(clockPin)+"#"+string(latchPin)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Shift/buildmacros.sce b/macros/Hardware/RasberryPi/Shift/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Shift/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/Shift/names b/macros/Hardware/RasberryPi/Shift/names
new file mode 100755
index 00000000..3fc17b6b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Shift/names
@@ -0,0 +1,3 @@
+RPI_shiftIn
+RPI_shiftOut
+RPI_sr595Setup
diff --git a/macros/Hardware/RasberryPi/Soft/RPI_softPwmCreate.sci b/macros/Hardware/RasberryPi/Soft/RPI_softPwmCreate.sci
new file mode 100755
index 00000000..b0161c25
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Soft/RPI_softPwmCreate.sci
@@ -0,0 +1,44 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_softPwmCreate(pin,ival,pwmrange)
+// Function to set up software pwm on a given pin
+//
+// Calling Sequence
+// RPI_softPwmCreate(pin,ival,pwmrange)
+//
+// Parameters
+// pin : pin to start software pwm on. Numbering sequence to follow as initiated using RPI_pinNumbering function
+// ival : inital value
+// pwmrange: range for the pwm
+//
+// Description
+// This function creates a software controlled PWM pin. Any GPIO pin can be used. Using 100 for the range, the value can be anything from 0 (off) to 100 (fully on) for the given pin.
+//
+//The return value is 0 for success. Otherwise the global error number variable should be checked to see what went wrong.
+//
+// Examples
+// RPI_softPwmCreate(1,25,250)
+// See also
+// RPI_softPwmStop, RPI_softPwmWrite, RPI_softToneCreate, RPI_softToneStop, RPI_softToneWrite, RPI_pinNumbering, RPI_softServoWrite, RIP_softServoSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sPC#3#"+string(pin)+"#"+string(ival)+"#"+string(pwmrange)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Soft/RPI_softPwmStop.sci b/macros/Hardware/RasberryPi/Soft/RPI_softPwmStop.sci
new file mode 100755
index 00000000..5a911c8b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Soft/RPI_softPwmStop.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_softPwmStop(pin)
+// Function to stop the software pwm on the pin
+//
+// Calling Sequence
+// RPI_softPwmStop(pin)
+//
+// Parameters
+// pin: pin to stop. Numbering sequence to follow as initiated using RPI_pinNumbering
+//
+// Description
+// This function stops the software pwm on the specified pin.
+//
+// Examples
+// RPI_softPwmStop(1)
+// See also
+// RPI_softPwmWrite, RPI_softToneCreate, RPI_softToneStop, RPI_softToneWrite, RPI_softPwmCreate, RPI_pinNumbering, RPI_softServoWrite, RIP_softServoSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sPS#1#"+string(pin)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Soft/RPI_softPwmWrite.sci b/macros/Hardware/RasberryPi/Soft/RPI_softPwmWrite.sci
new file mode 100755
index 00000000..349923fa
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Soft/RPI_softPwmWrite.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_softPwmWrite(pin,value)
+// Function to update the softpwm value on the pin
+//
+// Calling Sequence
+// RPI_softPwmWrite(pin,value)
+//
+// Parameters
+// pin : pin to act on, should be initialised using RPI_softPwmCreate. Numbering sequence follows from_RPI pinNumbering
+// value: value to write
+//
+// Description
+// This updates the PWM value on the given pin. The value is checked to be in-range and pins that haven’t previously been initialised via softPwmCreate will be silently ignored.
+//
+// Examples
+// RPI_softPwmWrite(1,250)
+// See also
+// RPI_softPwmStop, RPI_softToneCreate, RPI_softToneStop, RPI_softToneWrite, RPI_softPwmCreate, RPI_pinNumbering, RPI_softServoWrite, RIP_softServoSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sPW#2#"+string(pin)+"#"+string(value)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Soft/RPI_softToneCreate.sci b/macros/Hardware/RasberryPi/Soft/RPI_softToneCreate.sci
new file mode 100755
index 00000000..06adf83e
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Soft/RPI_softToneCreate.sci
@@ -0,0 +1,43 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_softToneCreate(pin)
+// Function to create a software controlled tone pin
+//
+// Calling Sequence
+// RPI_softToneCreate(pin)
+//
+// Parameters
+// pin: pin to create software tone on. Numbering sequence to be followed as initiated using RPI_pinNumbering
+//
+// Description
+// This function creates a software controlled tone pin. Any GPIO pin can be used. Using 100 for the range, the value can be anything from 0 (off) to 100 (fully on) for the given pin.
+//
+//The return value is 0 for success. Otherwise the global error number variable should be checked to see what went wrong.
+//
+//
+// Examples
+// RPI_softToneCreate(1)
+// See also
+// RPI_softPwmStop, RPI_softPwmWrite, RPI_softToneStop, RPI_softToneWrite, RPI_softPwmCreate, RPI_pinNumbering, RPI_softServoWrite, RIP_softServoSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sTC#1#"+string(pin)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Soft/RPI_softToneStop.sci b/macros/Hardware/RasberryPi/Soft/RPI_softToneStop.sci
new file mode 100755
index 00000000..4ecc4208
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Soft/RPI_softToneStop.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_softToneStop(pin)
+// Function to stop the software tone on the pin
+//
+// Calling Sequence
+// RPI_softToneStop(pin)
+//
+// Parameters
+// pin: soft tone pin to stop. Numbering sequence to follow as initiated using RPI_pinNumbering
+//
+// Description
+// This function stops the software tone on the specified pin.
+//
+// Examples
+// RPI_softToneStop(1)
+// See also
+// RPI_softPwmStop, RPI_softPwmWrite, RPI_softToneCreate, RPI_softToneWrite, RPI_softPwmCreate, RPI_pinNumbering, RPI_softServoWrite, RIP_softServoSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sTS#1#"+string(pin)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Soft/RPI_softToneWrite.sci b/macros/Hardware/RasberryPi/Soft/RPI_softToneWrite.sci
new file mode 100755
index 00000000..ba070a82
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Soft/RPI_softToneWrite.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_softToneWrite(pin,freq)
+// Function to update tone frquency on the soft tone pin
+//
+// Calling Sequence
+// RPI_softToneWrite(pin,freq)
+//
+// Parameters
+// pin : soft tone pin
+// freq: frequency value to write
+//
+// Description
+// This function updates the tone frequency value on the given pin. The tone will be played until you set the frequency to 0.
+//
+// Examples
+// RPI_softToneWrite(1,200)
+// See also
+// RPI_softPwmStop, RPI_softPwmWrite, RPI_softToneCreate, RPI_softToneStop, RPI_softPwmCreate, RPI_softServoWrite, RIP_softServoSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="sTW#2#"+string(pin)+"#"+string(freq)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Soft/buildmacros.sce b/macros/Hardware/RasberryPi/Soft/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Soft/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/Soft/names b/macros/Hardware/RasberryPi/Soft/names
new file mode 100755
index 00000000..da06cbb5
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Soft/names
@@ -0,0 +1,6 @@
+RPI_softPwmCreate
+RPI_softPwmStop
+RPI_softPwmWrite
+RPI_softToneCreate
+RPI_softToneStop
+RPI_softToneWrite
diff --git a/macros/Hardware/RasberryPi/Timing/RPI_delay.sci b/macros/Hardware/RasberryPi/Timing/RPI_delay.sci
new file mode 100755
index 00000000..bd868e80
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Timing/RPI_delay.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_delay(time)
+// Function to introduce delay in milliseconds
+//
+// Calling Sequence
+// RPI_delay(time)
+//
+// Parameters
+// time: Time in milliseconds for which to pause the program execution.
+//
+// Description
+// This causes program execution to pause for at least 'time' milliseconds. Due to the multi-tasking nature of Linux it could be longer. The maximum delay is an unsigned 32-bit integer or approximately 49 days.
+//
+// Examples
+// RPI_delay(1000)
+// See also
+// RPI_delayMicro, RPI_micros, RPI_millis
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="deS#1#"+string(time)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Timing/RPI_delayMicro.sci b/macros/Hardware/RasberryPi/Timing/RPI_delayMicro.sci
new file mode 100755
index 00000000..a1b5d595
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Timing/RPI_delayMicro.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_delayMicro(time)
+// Function to introduce delay in microseconds
+//
+// Calling Sequence
+// RPI_delayMicros(time)
+//
+// Parameters
+// time: Time in microseconds for which to pause the program execution.
+//
+// Description
+// This causes program execution to pause for at least 'time' microseconds. Due to the multi-tasking nature of Linux it could be longer. The maximum delay is an unsigned 32-bit integer or approximately 71 minutes.
+//
+// Examples
+// RPI_delayMicro(1000)
+// See also
+// RPI_delay, RPI_micros, RPI_millis
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="deU#1#"+string(time)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Timing/RPI_micros.sci b/macros/Hardware/RasberryPi/Timing/RPI_micros.sci
new file mode 100755
index 00000000..058a8278
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Timing/RPI_micros.sci
@@ -0,0 +1,37 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_micros()
+// Function to display the number of microseconds since the call to RPI_pinNumbering function.
+//
+// Calling Sequence
+// t=RPI_micros()
+//
+// Description
+// This returns the time in milliseconds since the call to RPI_pinNumbering function. It returns an unsigned 32-bit integer which wraps after approximately 71 minutes.
+//
+// Examples
+// t=RPI_micros()
+// See also
+// RPI_millis, RPI_delay, RPI_delayMicro
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="mic#0#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Timing/RPI_millis.sci b/macros/Hardware/RasberryPi/Timing/RPI_millis.sci
new file mode 100755
index 00000000..baecddc2
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Timing/RPI_millis.sci
@@ -0,0 +1,37 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_millis()
+// Function to display the number of milliseconds since the call to RPI_pinNumbering function.
+//
+// Calling Sequence
+// t=RPI_millis()
+//
+// Description
+// This returns the time in microseconds since the call to RPI_pinNumbering function. It returns an unsigned 32-bit integer which wraps after 49 days.
+//
+// Examples
+// t=RPI_millis()
+// See also
+// RPI_micros, RPI_delay, RPI_delayMicro
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="mil#0#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/Timing/buildmacros.sce b/macros/Hardware/RasberryPi/Timing/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Timing/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/Timing/names b/macros/Hardware/RasberryPi/Timing/names
new file mode 100755
index 00000000..0b47b345
--- /dev/null
+++ b/macros/Hardware/RasberryPi/Timing/names
@@ -0,0 +1,4 @@
+RPI_delay
+RPI_delayMicro
+RPI_micros
+RPI_millis
diff --git a/macros/Hardware/RasberryPi/buildmacros.sce b/macros/Hardware/RasberryPi/buildmacros.sce
old mode 100644
new mode 100755
index 2954a424..07b564e3
--- a/macros/Hardware/RasberryPi/buildmacros.sce
+++ b/macros/Hardware/RasberryPi/buildmacros.sce
@@ -1,4 +1,49 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
-tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+RPI_Directories = [ "Digital", ...
+ "gertBoard", ...
+ "I2C", ...
+ "Interrupt", ...
+ "lcd", ...
+ "lcd128x64", ...
+ "mcp", ...
+ "Misc", ...
+ "pcf", ...
+ "piGlow", ...
+ "pinMap", ...
+ "pwm", ...
+ "Serial", ...
+ "Setup", ...
+ "Shift", ...
+ "Soft", ...
+ "SPI", ...
+ "Timing"];
+
+RPI_path_buildmacros = get_absolute_file_path("buildmacros.sce");
-clear tbx_build_macros;
+for H=1:size(RPI_Directories,"*")
+ myfile = RPI_path_buildmacros + filesep() + RPI_Directories(H) + filesep() + "buildmacros.sce";
+ if isfile(myfile) then
+ exec(myfile);
+ end
+end
+
+clear RPI_path_buildmacros;
+
+function buildmacros()
+ macros_path = get_absolute_file_path("buildmacros.sce");
+ tbx_build_macros(TOOLBOX_NAME, macros_path);
+ clear tbx_build_macros;
+endfunction
+
+buildmacros();
+clear buildmacros;
diff --git a/macros/Hardware/RasberryPi/cleanmacros.sce b/macros/Hardware/RasberryPi/cleanmacros.sce
new file mode 100755
index 00000000..a6428b2a
--- /dev/null
+++ b/macros/Hardware/RasberryPi/cleanmacros.sce
@@ -0,0 +1,20 @@
+// ====================================================================
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+// ====================================================================
+function cleanmacros()
+
+ libpath = get_absolute_file_path("cleanmacros.sce");
+
+ binfiles = ls(libpath+"/*.bin");
+ for i = 1:size(binfiles,"*")
+ mdelete(binfiles(i));
+ end
+
+ mdelete(libpath+"/names");
+ mdelete(libpath+"/lib");
+endfunction
+
+cleanmacros();
+clear cleanmacros; // remove cleanmacros on stack
+
+// ====================================================================
diff --git a/macros/Hardware/RasberryPi/gertBoard/RPI_analogRead.sci b/macros/Hardware/RasberryPi/gertBoard/RPI_analogRead.sci
new file mode 100755
index 00000000..41bf877a
--- /dev/null
+++ b/macros/Hardware/RasberryPi/gertBoard/RPI_analogRead.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_analogRead(pin)
+// Function to read the analog voltage at the given pin
+//
+// Calling Sequence
+// v=RPI_analogRead(pin)
+//
+// Parameters
+// pin: The pin number to read the voltage from. Numbering sequence to be followed as initiated using RPI_pinNumbering function.
+//
+// Description
+// This function returns the value read on the supplied analog input pin. Additional analog modules need to be registered to enable this function for devices such as the Gertboard, quick2Wire analog board, etc.
+//
+// Examples
+// v=RPI_analogRead(0)
+// See also
+// RPI_analogWrite, RPI_digitalRead, RPI_digitalWrite, RPI_pinNumbering, RPI_pinMode
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="anR#1#"+string(pin)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/gertBoard/RPI_analogWrite.sci b/macros/Hardware/RasberryPi/gertBoard/RPI_analogWrite.sci
new file mode 100755
index 00000000..f7089f53
--- /dev/null
+++ b/macros/Hardware/RasberryPi/gertBoard/RPI_analogWrite.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_analogWrite(pin,Volt)
+// Function to set analog voltage at given analog pin.
+//
+// Calling Sequence
+// RPI_analogWrite(pin,Volt)
+//
+// Parameters
+// pin : The pin number to set the voltage at. Numbering sequence to be followed as initiated using RPI_pinNumbering function.
+// Volt: The analog voltage value to set at the pin.
+//
+// Description
+// This writes the given value to the supplied analog pin. Additional analog modules need to be registered to enable this function for devices such as the Gertboard.
+//
+// Examples
+// RPI_analogWrite(0,100)
+// See also
+// RPI_analogRead, RPI_digitalRead, RPI_digitalWrite, RPI_pinNumbering, RPI_pinMode
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="anW#2#"+string(pin)+"#"+string(Volt)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogRead.sci b/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogRead.sci
new file mode 100755
index 00000000..ce7e870e
--- /dev/null
+++ b/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogRead.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_gertboardAnalogRead(pin)
+// Function to read voltage from gertboard
+//
+// Calling Sequence
+// RPI_gertboardAnalogRead(pin)
+//
+// Parameters
+// pin:the pin to read the voltage from. Numbering follows the pinBase from RPI_gertboardSetup function.
+//
+// Description
+// After initialinzing the pinBase using the RPI_gertboeardSetup function, reading channel pinBase + 0 reads the first analog input channel (pin DA0 on the Gertboard). Returns a value from 0 to 1023 representing the value on the supplied pin.
+//
+// Examples
+// RPI_gertboardAnalogRead(101)
+// See also
+// RPI_gertboardAnalogSetup, RPI_gertboardAnalogWrite, RPI_gertboardSPISetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+// http://pi4j.com/apidocs/com/pi4j/wiringpi/Gertboard.html
+
+ commande="gAR#1#"+string(pin)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
+
diff --git a/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogSetup.sci b/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogSetup.sci
new file mode 100755
index 00000000..a8348110
--- /dev/null
+++ b/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogSetup.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_gertboardAnalogSetup(pinBase)
+// Function to setup the gertboard
+//
+// Calling Sequence
+// RPI_getboardAnalogSetup(pinBase)
+//
+// Parameters
+// pinBase:the base pin that the analog ports will appear as
+//
+// Description
+// This function calls a setup routine that allocates 2 pins and overlays the analog to digital input pins with the digital to analog output pins. pinBase is the base pin that you want the analog ports to appear as. So reading channel pinBase + 0 reads the first analog input channel (pin DA0 on the Gertboard), and writing pinBase + 0 outputs to the first analog output channel. (Pin AD0)
+//
+// Examples
+// RPI_getboardAnalogSetup(100)
+// See also
+// RPI_gertboardAnalogRead, RPI_gertboardAnalogWrite, RPI_gertboardSPISetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+// http://pi4j.com/apidocs/com/pi4j/wiringpi/Gertboard.html
+
+ commande="gAS#1#"+string(pinBase)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogWrite.sci b/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogWrite.sci
new file mode 100755
index 00000000..3f8f9dd6
--- /dev/null
+++ b/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardAnalogWrite.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_gertboardAnalogWrite(pin,value)
+// Function to write voltage value to pins on gertboard
+//
+// Calling Sequence
+// RPI_gertboardAnalogWrite(pin,value)
+//
+// Parameters
+// pin : the pin to read the voltage from. Numbering follows the pinBase from RPI_gertboardSetup function.
+// value: voltage value to write
+//
+// Description
+// After initialinzing the pinBase using the RPI_gertboeardSetup function, writing pinBase + 0 outputs to the first analog output channel. (Pin AD0).
+//
+// Examples
+// RPI_gertboardAnalogWrite(100,100)
+// See also
+// RPI_gertboardAnalogSetup, RPI_gertboardAnalogRead, RPI_gertboardSPISetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+// http://pi4j.com/apidocs/com/pi4j/wiringpi/Gertboard.html
+
+ commande="gAW#2#"+string(pin)+"#"+string(value)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardSPISetup.sci b/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardSPISetup.sci
new file mode 100755
index 00000000..d4117b00
--- /dev/null
+++ b/macros/Hardware/RasberryPi/gertBoard/RPI_gertboardSPISetup.sci
@@ -0,0 +1,39 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_gertboardSPISetup()
+// Function to initialize SPI bus communication with gertboard
+//
+// Calling Sequence
+// RPI_gertboardSPIsetup()
+//
+// Description
+// This function must be called to initialize the SPI bus to communicate with the Gertboards ADC and DAC chips.
+//
+// Examples
+// RPI_gertboardSPISetup()
+// See also
+// RPI_gertboardAnalogSetup, RPI_gertboardAnalogRead, RPI_gertboardAnalogWrite
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+// http://pi4j.com/apidocs/com/pi4j/wiringpi/Gertboard.html
+
+ commande="gSS#0#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
+
diff --git a/macros/Hardware/RasberryPi/gertBoard/buildmacros.sce b/macros/Hardware/RasberryPi/gertBoard/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/gertBoard/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/gertBoard/names b/macros/Hardware/RasberryPi/gertBoard/names
new file mode 100755
index 00000000..27a469a1
--- /dev/null
+++ b/macros/Hardware/RasberryPi/gertBoard/names
@@ -0,0 +1,6 @@
+RPI_analogRead
+RPI_analogWrite
+RPI_gertboardAnalogRead
+RPI_gertboardAnalogSetup
+RPI_gertboardAnalogWrite
+RPI_gertboardSPISetup
diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdCharDef.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdCharDef.sci
new file mode 100755
index 00000000..905cca84
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdCharDef.sci
@@ -0,0 +1,44 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcdCharDef(fd,index,d0,d1,d2,d3,d4,d5,d6,d7)
+// Function to redefine a user-definable character
+//
+// Calling Sequence
+// RPI_lcdCharDef(fd,index,data)
+//
+// Parameters
+// fd : file-descriptor obtained using RPI_lcdInit function
+// index: which character to redefine (0 to 7)
+// d0-d7: integers from 0 to 255 erpresenting the elements of the array to form the character
+//
+// Description
+// This function re-define one of the 8 user-definable characters in the display.
+//
+// The data array is 8 bytes which represent the character from the top-line to the bottom line. Note that the characters are actually 5×8, so only the lower 5 bits are used.
+//
+// Examples
+// RPI_lcdCharDef(13,0,0,0,0,31,31,31,31,0)
+// See also
+// RPI_lcdCursorBlink, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="lCD#10#"+string(fd)+"#"+string(index)+"#"+string(d0)+"#"+string(d1)+"#"+string(d2)+"#"+string(d3)+"#"+string(d4)+"#"+string(d5)+"#"+string(d6)+"#"+string(d7)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdClear.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdClear.sci
new file mode 100755
index 00000000..6da7212d
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdClear.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcdClear(fd)
+// Function to clear the lcd screen
+//
+// Calling Sequence
+// RPI_lcdClear(fd)
+//
+// Parameters
+// fd: file-descriptor obtained using RPI_lcdInit function
+//
+// Description
+// This function clears the lcd screen.
+//
+// Examples
+// RPI_lcdClear(13)
+// See also
+// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="lCl#1#"+string(fd)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdCursor.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdCursor.sci
new file mode 100755
index 00000000..98c54712
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdCursor.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcdCursor(fd,state)
+// Function to turn cursor on/off
+//
+// Calling Sequence
+// RPI_lcdCursor(fd,state)
+//
+// Parameters
+// fd : file-descriptor obtained using RPI_lcdInit function
+// state: 0 (for off) or 1 (for on)
+//
+// Description
+// This function sets the visibility of cursor.
+//
+// Examples
+// RPI_lcdCursor(13,1)
+// See also
+// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="lCu#2#"+string(fd)+"#"+string(state)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdCursorBlink.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdCursorBlink.sci
new file mode 100755
index 00000000..b16ebc50
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdCursorBlink.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcdCursorBlink(fd,state)
+// Function to turn cursor blinking on/off
+//
+// Calling Sequence
+// RPI_lcdCursorBlink(fd,state)
+//
+// Parameters
+// fd : file-descriptor obtained using RPI_lcdInit function
+// state: 0 (for off) or 1 (for on)
+//
+// Description
+// This function sets the blinking of cursor.
+//
+// Examples
+// RPI_lcdCursorBlink(13,1)
+// See also
+// RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="lCB#2#"+string(fd)+"#"+string(state)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdDisplay.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdDisplay.sci
new file mode 100755
index 00000000..de50af64
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdDisplay.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcdDisplay(fd,state)
+// Function to turn display on/off
+//
+// Calling Sequence
+// RPI_lcdDisplay(fd,state)
+//
+// Parameters
+// fd : file-descriptor obtained using RPI_lcdInit function
+// state: 0 (for off) or 1 (for on)
+//
+// Description
+// This function turns the display 'on' or 'off'.
+//
+// Examples
+// RPI_lcdDisplay(13,1)
+// See also
+// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="lDs#2#"+string(fd)+"#"+string(state)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdHome.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdHome.sci
new file mode 100755
index 00000000..0c4507f1
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdHome.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcdHome(fd)
+// Function to send cursor back to the starting point (home)
+//
+// Calling Sequence
+// RPI_lcdHome(fd)
+//
+// Parameters
+// fd: file-descriptor obtained using RPI_lcdInit function
+//
+// Description
+// This function sends the cursor to the top left (row=0,col=0) position on the lcd screen.
+//
+// Examples
+// RPI_lcdHome(13)
+// See also
+// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="lHo#1#"+string(fd)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdInit.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdInit.sci
new file mode 100755
index 00000000..c5ddb1e5
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdInit.sci
@@ -0,0 +1,54 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_lcdInit(rows,cols,bits,rs,strb,d0,d1,d2,d3,d4,d5,d6,d7)
+// Function to initialize lcd
+//
+// Calling Sequence
+// RPI_lcdInit(rows,cols,bits,rs,strb,d0,d1,d2,d3,d4,d5,d6,d7)
+//
+// Parameters
+// rows: numer of rows in lcd
+// cols: numer of colums in lcd
+// bits: number of bits wide on the interface (4 or 8)
+// rs : pin number of display RS
+// strb: pin number of strobe (E)
+// d0 : pin number of data pin 1
+// d1 : pin number of data pin 2
+// d2 : pin number of data pin 3
+// d3 : pin number of data pin 4
+// d4 : pin number of data pin 5
+// d5 : pin number of data pin 6
+// d6 : pin number of data pin 7
+// d7 : pin number of data pin 8
+//
+// Description
+// This function initalizes an lcd display attaced to the Raspberry pi. The return value is the file-descriptor to be used for all subsequent calls to the lcd library when dealing with that LCD, or -1 to indicate a fault. (Usually incorrect parameters)
+//
+// The numberin sequence to be followed as initiated using RPI_pinNumbering
+//
+// Examples
+// fd=RPI_lcdInit (2,16,8,11,10,0,1,2,3,4,5,6,7) ;
+// See also
+// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand, RPI_pinNumbering
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="lIn#13#"+string(rows)+"#"+string(cols)+"#"+string(bits)+"#"+string(rs)+"#"+string(strb)+"#"+string(d0)+"#"+string(d1)+"#"+string(d2)+"#"+string(d3)+"#"+string(d4)+"#"+string(d5)+"#"+string(d6)+"#"+string(d7)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdPosition.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdPosition.sci
new file mode 100755
index 00000000..0f978324
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdPosition.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcdPosition(fd,col,row)
+// Function to move the cursor
+//
+// Calling Sequence
+// RPI_lcdPosition(fd,col,row)
+//
+// Parameters
+// fd : file-descriptor obtained using RPI_lcdInit function
+// col: column number to go to
+// row: row number to go to
+//
+// Description
+// This function set the position of the cursor for subsequent text entry. col=0 is the left-most edge any row=0 is the top line.
+//
+// Examples
+// RPI_lcdPosition(13,0,1)
+// See also
+// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="lPo#3#"+string(fd)+"#"+string(col)+"#"+string(row)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdPrintf.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdPrintf.sci
new file mode 100755
index 00000000..833bf44a
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdPrintf.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcdPrintf(fd,String)
+// Function to print on the lcd screen
+//
+// Calling Sequence
+// RPI_lcdPrintf(fd,String)
+//
+// Parameters
+// fd : file-descriptor obtained using RPI_lcdInit function
+// String: string to print on the screen
+//
+// Description
+// This function outputs a single ASCII character, a string or a formatted string using the usual printf formatting commands.
+//
+// Examples
+// RPI_lcdPrintf(13,'We live in the shadows to serve the light.')
+// See also
+// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="lPf#2#"+string(fd)+"#"+String+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdPutchar.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdPutchar.sci
new file mode 100755
index 00000000..337691d8
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdPutchar.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcdPutchar(fd,character)
+// Function to print on the lcd screen
+//
+// Calling Sequence
+// RPI_lcdPutchar(fd,charcter)
+//
+// Parameters
+// fd : file-descriptor obtained using RPI_lcdInit function
+// charcter: integer, 0 to 255, character to print
+//
+// Description
+// This function outputs a single ASCII character, a string or a formatted string using the usual printf formatting commands.
+//
+// Examples
+// RPI_lcdPutchar(13,200)
+// See also
+// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="lPc#2#"+string(fd)+"#"+string(character)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdPuts.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdPuts.sci
new file mode 100755
index 00000000..8584309d
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdPuts.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcdPuts(fd,character)
+// Function to print on the lcd screen
+//
+// Calling Sequence
+// RPI_lcdPuts(fd,character)
+//
+// Parameters
+// fd : file-descriptor obtained using RPI_lcdInit function
+// character: character to print
+//
+// Description
+// This function outputs a single ASCII character, a string or a formatted string using the usual printf formatting commands.
+//
+// Examples
+// RPI_lcdPuts(13,'K')
+// See also
+// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="lPu#2#"+string(fd)+"#"+string(character)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
+
diff --git a/macros/Hardware/RasberryPi/lcd/RPI_lcdSendCommand.sci b/macros/Hardware/RasberryPi/lcd/RPI_lcdSendCommand.sci
new file mode 100755
index 00000000..db677bef
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/RPI_lcdSendCommand.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcdSendCommand(fd,command)
+// Function to send command to lcd
+//
+// Calling Sequence
+// RPI_lcdSendCommand(fd,command)
+//
+// Parameters
+// fd : file-descriptor obtained using RPI_lcdInit function
+// command: A command, binary, to submit to the LCD.
+//
+// Description
+// This function sends any arbitrary command to the LCD.
+//
+// Examples
+// RPI_lcdSendCommand(13,00)
+// See also
+// RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdHome, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="lSC#2#"+string(fd)+"#"+string(command)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd/buildmacros.sce b/macros/Hardware/RasberryPi/lcd/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/lcd/names b/macros/Hardware/RasberryPi/lcd/names
new file mode 100755
index 00000000..8f87ff8b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd/names
@@ -0,0 +1,12 @@
+RPI_lcdCharDef
+RPI_lcdClear
+RPI_lcdCursor
+RPI_lcdCursorBlink
+RPI_lcdDisplay
+RPI_lcdHome
+RPI_lcdInit
+RPI_lcdPosition
+RPI_lcdPrintf
+RPI_lcdPutchar
+RPI_lcdPuts
+RPI_lcdSendCommand
diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64Orientation.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64Orientation.sci
new file mode 100755
index 00000000..5bfe4dcd
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64Orientation.sci
@@ -0,0 +1,48 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcd128x64Orientation(mode)
+// Function to set lcd orientation.
+//
+// Calling Sequence
+// RPI_lcd128x64Orientation(mode)
+//
+// Parameters
+// mode: Orientation Mode, integer from 0 to 3
+//
+// Description
+// This function sets the orientation of the lcd display.
+//
+// mode can take values:
+//
+// 0 :Portrait
+// 1 :Landscape
+// 2 :Portrait, flipped
+// 3 :Landscape, flipped
+//
+//
+// Examples
+// RPI_lcd128x64Orientation(1)
+// See also
+// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="LOn#1#"+string(mode)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64circle.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64circle.sci
new file mode 100755
index 00000000..96358a32
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64circle.sci
@@ -0,0 +1,44 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcd128x64circle(x,y,r,color,fill)
+// Function to draw a circle
+//
+// Calling Sequence
+// RPI_lcd128x64circle(x,y,r,color,fill)
+//
+// Parameters
+// x : integer, x coordinate of centre
+// y : integer, y coordinate of centre
+// r : integer, radius of the circle
+// color: integer, color of the rectangle
+// fill : 0 (for empty) or 1 (for filled)
+//
+// Description
+// This function draws a circle of radius r with x,y as centre, specified color and fill.
+//
+// Examples
+// RPI_lcd128x64circle(3,3,2,0,0)
+// See also
+// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="Lci#5#"+string(x)+"#"+string(y)+"#"+string(r)+"#"+string(color)+"#"+string(fill)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64clear.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64clear.sci
new file mode 100755
index 00000000..5b800491
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64clear.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcd128x64clear(color)
+// Function to clear the lcd screen
+//
+// Calling Sequence
+// RPI_lcd128x64clear(color)
+//
+// Parameters
+// color: integer, color of the lcd
+//
+// Description
+// This function clears the lcd display to the given colour.
+//
+// Examples
+// RPI_lcd128x64clear(0)
+// See also
+// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="LCl#1#"+string(color)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64ellipse.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64ellipse.sci
new file mode 100755
index 00000000..b4281e61
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64ellipse.sci
@@ -0,0 +1,45 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcd128x64ellipse(cx,cy,xr,yr,color,fill)
+// Function to draw a ellipse
+//
+// Calling Sequence
+// RPI_lcd128x64ellipse(cx,cy,xr,yr,color,fill)
+//
+// Parameters
+// cx : integer, x coordinate of centre
+// cy : integer, y coordinate of centre
+// xr : integer, x radius
+// yr : integer, y radius
+// color: integer, color pf the ellipse
+// fill : 0 (for empty) or 1 (for filled)
+//
+// Description
+// This function draws an ellipse with centre at (cx,cy) x and y radii as xr and yr, specified color and fill
+//
+// Examples
+// RPI_lcd128x64ellipse()
+// See also
+// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="Lel#6#"+string(cx)+"#"+string(cy)+"#"+string(xr)+"#"+string(yr)+"#"+string(color)+"#"+string(fill)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64line.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64line.sci
new file mode 100755
index 00000000..951a6639
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64line.sci
@@ -0,0 +1,44 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcd128x64line(x0,y0,x1,y1,color)
+// Function to plota line.
+//
+// Calling Sequence
+// RPI_lcd128x64line(x0,y0,x1,y1,color)
+//
+// Parameters
+// x0 : integer, initial x coordinate
+// y0 : integer, initial y coordinate
+// x1 : integer, final x coordinate
+// y1 : integer, final y coordinate
+// color: integer, color of the line
+//
+// Description
+// This function plots a line from (x0,y0) to (x1,y1).
+//
+// Examples
+// RPI_lcd128x64line(0,0,1,1,0)
+// See also
+// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="Lli#5#"+string(x0)+"#"+string(y0)+"#"+string(x1)+"#"+string(y1)+"#"+string(color)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64lineTo.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64lineTo.sci
new file mode 100755
index 00000000..466713eb
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64lineTo.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcd128x64lineTo(x,y,color)
+// Function to plot a line
+//
+// Calling Sequence
+// RPI_lcd128x64lineTo(x,y,color)
+//
+// Parameters
+// x : integer, final x coordinate
+// y : integer, final y coordinate
+// color: integer, color of the line
+//
+// Description
+// This function draws a line from the current position to the point (x,y) specified.
+//
+// Examples
+// RPI_lcd128x64lineTo(2,2,0)
+// See also
+// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="LlT#3#"+string(x)+"#"+string(y)+"#"+string(color)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64point.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64point.sci
new file mode 100755
index 00000000..287b022a
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64point.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcd128x64point(x,y,color)
+// Function to plot a point
+//
+// Calling Sequence
+// RPI_lcd128x64point(x,y,color)
+//
+// Parameters
+// x : integer, x coordinate
+// y : integer, y coordinate
+// color: integer, color of the point
+//
+// Description
+// This function plots a point at x,y.
+//
+// Examples
+// RPI_lcd128x64point(2,2,0)
+// See also
+// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="Lpo#3#"+string(x)+"#"+string(y)+"#"+string(color)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64putchar.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64putchar.sci
new file mode 100755
index 00000000..a6b27240
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64putchar.sci
@@ -0,0 +1,44 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcd128x64putchar(x,y,c,bg,fg)
+// Function to print a single character.
+//
+// Calling Sequence
+// RPI_lcd128x64putchar(x,y,c,bg,fg)
+//
+// Parameters
+// x : integer, x coordinate of starting point
+// y : integer, y coordinate of starting point
+// c : integer, from 0 to 255, character to print
+// bg: integer, background color
+// fg: integer, foreground color
+//
+// Description
+// This function prints a single character to the screen.
+//
+// Examples
+// RPI_lcd128x64putchar(0,1,128,1,0)
+// See also
+// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="Lpc#5#"+string(x)+"#"+string(y)+"#"+string(c)+"#"+string(bg)+"#"+string(fg)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64puts.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64puts.sci
new file mode 100755
index 00000000..6785f067
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64puts.sci
@@ -0,0 +1,44 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcd128x64puts(x,y,s,bf,fg)
+// Function to send a string to the lcd display
+//
+// Calling Sequence
+// RPI_lcd128x64puts(x,y,s,bg,fg)
+//
+// Parameters
+// x : integer, x coordinate of starting point
+// y : integer, y coordinate of starting point
+// s : string to send
+// bg: integer, background color
+// fg: integer, foreground color
+//
+// Description
+// This function sends a string to the display. Obeys \n and \r formatting.
+//
+// Examples
+// RPI_lcd128x64puts(0,0,'Talos guide you',0,1)
+// See also
+// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="LPu#5#"+string(x)+"#"+string(y)+"#"+string(s)+"#"+string(bg)+"#"+string(fg)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64rectangle.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64rectangle.sci
new file mode 100755
index 00000000..ccda4c62
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64rectangle.sci
@@ -0,0 +1,45 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcd128x64rectangle(x1,y1,x2,y2,color,fill)
+// Function to draw a rectangle
+//
+// Calling Sequence
+// RPI_lcd128x64rectangle(x1,y1,x2,y2,color,fill)
+//
+// Parameters
+// x1 : integer, x coordinate of upper left corner
+// y1 : integer, y coordinate of upper left corner
+// x2 : integer, x coordinate of lower right corner
+// y2 : integer, y coordinate of lower right corner
+// color: integer, color of the rectangle
+// fill : 0 (for empty) or 1 (for filled)
+//
+// Description
+// This function draws a rectangle with (x1,y1) as the upper left point and (x2,y2) as the lower right point with specified color and fill.
+//
+// Examples
+// RPI_lcd128x64rectangle(0,0,1,1,0,1)
+// See also
+// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="Lre#6#"+string(x1)+"#"+string(y1)+"#"+string(x2)+"#"+string(y2)+"#"+string(color)+"#"+string(fill)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64setOrigin.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64setOrigin.sci
new file mode 100755
index 00000000..996b0623
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64setOrigin.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_lcd128x64setOrigin(x,y)
+// Function to set origin
+//
+// Calling Sequence
+// RPI_lcd128x64setOrigin(x,y)
+//
+// Parameters
+// x: x coordinate
+// y: y coordinate
+//
+// Description
+// This function sets the origin of the lcd display
+//
+// Examples
+// RPI_lcd128x64setOrigin(1,0)
+// See also
+// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="LOr#2#"+string(x)+"#"+string(y)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64setup.sci b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64setup.sci
new file mode 100755
index 00000000..60ded7d8
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/RPI_lcd128x64setup.sci
@@ -0,0 +1,37 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_lcd128x64setup()
+// Function to initialize the lcd display
+//
+// Calling Sequence
+// RPI_lcd128x64setup()
+//
+// Description
+// This function initialises the lcd display.
+//
+// Examples
+// RPI_lcd128x64setup()
+// See also
+// RPI_lcd128x64setup, RPI_lcd128x64update, RPI_lcd128x64setOrigin, RPI_lcd128x64Orientation, RPI_lcd128x64orientCoord, RPI_lcd128x64ScreenSize, RPI_lcd128x64point, RPI_lcd128x64line, RPI_lcd128x64lineTo, RPI_lcd128x64rectangle, RPI_lcd128x64circle, RPI_lcd128x64ellipse, RPI_lcd128x64putchar, RPI_lcd128x64puts, RPI_lcd128x64clear, RPI_lcdCursorBlink, RPI_lcdCharDef, RPI_lcdClear, RPI_lcdCursor, RPI_lcdDisplay, RPI_lcdInit, RPI_lcdPutchar, RPI_lcdPosition, RPI_lcdPrintf, RPI_lcdPuts, RPI_lcdSendCommand
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="Lse#0#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/lcd128x64/buildmacros.sce b/macros/Hardware/RasberryPi/lcd128x64/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/lcd128x64/names b/macros/Hardware/RasberryPi/lcd128x64/names
new file mode 100755
index 00000000..82439718
--- /dev/null
+++ b/macros/Hardware/RasberryPi/lcd128x64/names
@@ -0,0 +1,12 @@
+RPI_lcd128x64Orientation
+RPI_lcd128x64circle
+RPI_lcd128x64clear
+RPI_lcd128x64ellipse
+RPI_lcd128x64line
+RPI_lcd128x64lineTo
+RPI_lcd128x64point
+RPI_lcd128x64putchar
+RPI_lcd128x64puts
+RPI_lcd128x64rectangle
+RPI_lcd128x64setOrigin
+RPI_lcd128x64setup
diff --git a/macros/Hardware/RasberryPi/mcp/RPI_mcp23008Setup.sci b/macros/Hardware/RasberryPi/mcp/RPI_mcp23008Setup.sci
new file mode 100755
index 00000000..03963bd1
--- /dev/null
+++ b/macros/Hardware/RasberryPi/mcp/RPI_mcp23008Setup.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_mcp23008Setup(pinBase,i2cAddress)
+// Function for setting up 8-bit MCP23008 I2C GPIO expansion chip.
+//
+// Calling Sequence
+// RPI_mcp23008Setup(pinBase,i2cAddress)
+//
+// Parameters
+// pinBase : any number above 64. The consecutive 8 pins will be allocated alongwith.
+// i2cAdress: integer, the I2C address obtained using RPI_i2cdetect function
+//
+// Description
+// This function sets up the extension module for the 8-bit MCP23008 I2C GPIO expansion chip.
+//
+// Examples
+// RPI_mcp23008Setup(73,64)
+// See also
+// RPI_sr595Setup, RPI_pcf8574Setup, RPI_pcf8591Setup, RPI_mcp23016Setup, RPI_mcp23017Setup, RPI_mcp23s08Setup, RPI_mcp23s17Setup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="mp8#2#"+string(pinBase)+"#"+string(i2cAddress)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/mcp/RPI_mcp23016Setup.sci b/macros/Hardware/RasberryPi/mcp/RPI_mcp23016Setup.sci
new file mode 100755
index 00000000..0424616e
--- /dev/null
+++ b/macros/Hardware/RasberryPi/mcp/RPI_mcp23016Setup.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_mcp23016Setup(pinBase,i2cAddress)
+// Function for setting up 16-bit MCP23016 I2C GPIO expansion chip.
+//
+// Calling Sequence
+// RPI_mcp23016Setup(pinBase,i2cAddress)
+//
+// Parameters
+// pinBase : any number above 64. The consecutive 16 pins will be allocated alongwith.
+// i2cAdress: integer, the I2C address obtained using RPI_i2cdetect function
+//
+// Description
+// This function sets up the extension module for the MCP23017 (16-bit) I2C GPIO expansion chips. The MCP23016 is the fore-runner of the MCP23017 GPIO expansion chip and may be present on some older interface boards.
+//
+// Examples
+// RPI_mcp23016Setup(73,100)
+// See also
+// RPI_sr595Setup, RPI_pcf8574Setup, RPI_pcf8591Setup, RPI_mcp23008Setup, RPI_mcp23017Setup, RPI_mcp23s08Setup, RPI_mcp23s17Setup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="mp6#2#"+string(pinBase)+"#"+string(i2cAddress)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/mcp/RPI_mcp23017Setup.sci b/macros/Hardware/RasberryPi/mcp/RPI_mcp23017Setup.sci
new file mode 100755
index 00000000..c453ebb3
--- /dev/null
+++ b/macros/Hardware/RasberryPi/mcp/RPI_mcp23017Setup.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_mcp23017Setup(pinBase,i2cAddress)
+// Function for setting up 16-bit MCP23017 I2C GPIO expansion chip.
+//
+// Calling Sequence
+// RPI_mcp23017Setup(pinBase,i2cAddress)
+//
+// Parameters
+// pinBase : any number above 64. The consecutive 16 pins will be allocated alongwith.
+// i2cAdress: integer, the I2C address obtained using RPI_i2cdetect function
+//
+// Description
+// This function setups the extension module for the 16-bit MCP23017 I2C GPIO expansion chip.
+//
+// Examples
+// RPI_mcp23017Setup(73,100)
+// See also
+// RPI_sr595Setup, RPI_pcf8574Setup, RPI_pcf8591Setup, RPI_mcp23008Setup, RPI_mcp23016Setup, RPI_mcp23s08Setup, RPI_mcp23s17Setup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="mp7#2#"+string(pinBase)+"#"+string(i2cAddress)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/mcp/RPI_mcp23s08Setup.sci b/macros/Hardware/RasberryPi/mcp/RPI_mcp23s08Setup.sci
new file mode 100755
index 00000000..b5b215b6
--- /dev/null
+++ b/macros/Hardware/RasberryPi/mcp/RPI_mcp23s08Setup.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_mcp23s08Setup(pinBase,spiPort,devId)
+// Function for setting up 8-bit MCP23s08 SPI GPIO expansion chip.
+//
+// Calling Sequence
+// RPI_mcp23s08Setup(pinBase,spiPort,devId)
+//
+// Parameters
+// pinBase: any number above 64. The consecutive 8 pins will be allocated alongwith.
+// spiPort: 0 or 1 for one of the two SPI ports on the Raspberry Pi.
+// devId : the ID of the MCP23s08 on the SPI port.
+//
+// Description
+// This function setups the extension module for the 8-bit MCP23s08 SPI GPIO expansion chip.
+//
+// Examples
+// RPI_mcp23s08Setup(67,1,0)
+// See also
+// RPI_sr595Setup, RPI_pcf8574Setup, RPI_pcf8591Setup, RPI_mcp23008Setup, RPI_mcp23016Setup, RPI_mcp23017Setup, RPI_mcp23s17Setup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="ms8#3#"+string(pinBase)+"#"+string(spiPort)+"#"+string(devId)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/mcp/RPI_mcp23s17Setup.sci b/macros/Hardware/RasberryPi/mcp/RPI_mcp23s17Setup.sci
new file mode 100755
index 00000000..4ba9fd65
--- /dev/null
+++ b/macros/Hardware/RasberryPi/mcp/RPI_mcp23s17Setup.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_mcp23s17Setup(pinBase,spiPort,devId)
+// Function for setting up 16-bit MCP23s17 SPI GPIO expansion chip.
+//
+// Calling Sequence
+// RPI_mcp23s17Setup(pinBase,spiPort,devId)
+//
+// Parameters
+// pinBase: any number above 64. The consecutive 16 pins will be allocated alongwith.
+// spiPort: 0 or 1 for one of the two SPI ports on the Raspberry Pi.
+// devId : the ID of the MCP23s17 on the SPI port.
+//
+// Description
+// This function setups the extension module for the 16-bit MCP23s17 SPI GPIO expansion chip.
+//
+// Examples
+// RPI_mcp23s17Setup(67,0,0)
+// See also
+// RPI_sr595Setup, RPI_pcf8574Setup, RPI_pcf8591Setup, RPI_mcp23008Setup, RPI_mcp23016Setup, RPI_mcp23017Setup, RPI_mcp23s08Setup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="ms7#3#"+string(pinBase)+"#"+string(spiPort)+"#"+string(devId)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/mcp/buildmacros.sce b/macros/Hardware/RasberryPi/mcp/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/mcp/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/mcp/names b/macros/Hardware/RasberryPi/mcp/names
new file mode 100755
index 00000000..23e7af04
--- /dev/null
+++ b/macros/Hardware/RasberryPi/mcp/names
@@ -0,0 +1,5 @@
+RPI_mcp23008Setup
+RPI_mcp23016Setup
+RPI_mcp23017Setup
+RPI_mcp23s08Setup
+RPI_mcp23s17Setup
diff --git a/macros/Hardware/RasberryPi/names b/macros/Hardware/RasberryPi/names
old mode 100644
new mode 100755
index fa647761..9f20c937
--- a/macros/Hardware/RasberryPi/names
+++ b/macros/Hardware/RasberryPi/names
@@ -1,21 +1,5 @@
GetRPISupportFunctions
IsRPISupportFunction
-RPI_DelayMicro
-RPI_DelayMilli
-RPI_DigitalIn
-RPI_DigitalOut
-RPI_DigitalSetup
-RPI_GetMicros
-RPI_GetMillis
-RPI_HardPWMSetClock
-RPI_HardPWMSetMode
-RPI_HardPWMSetRange
-RPI_HardPWMWrite
-RPI_PinISR
-RPI_SerialClose
-RPI_SerialFlush
-RPI_SerialGetChar
-RPI_SerialSendChar
-RPI_SerialSendData
-RPI_SerialSetup
-u16RPISerialDataAvail
+RPI_adress
+raspi
+raspi_close
diff --git a/macros/Hardware/RasberryPi/old/GetRPISupportFunctions.sci b/macros/Hardware/RasberryPi/old/GetRPISupportFunctions.sci
new file mode 100644
index 00000000..3e6397b2
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/GetRPISupportFunctions.sci
@@ -0,0 +1,48 @@
+function RPiSupportFunctions = GetRPISupportFunctions()
+// -----------------------------------------------------------------
+// Get list of RPI peripherals supported
+//
+// Input data:
+// None
+//
+// Output data:
+// None
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+//
+// -----------------------------------------------------------------
+
+RPiSupportFunctions = [
+ "RPI_DigitalIn"
+ "RPI_DigitalOut"
+ "RPI_DigitalSetup"
+ "RPI_DelayMilli"
+ "RPI_DelayMicro"
+ "RPI_GetMillis"
+ "RPI_GetMicros"
+ "RPI_SerialSetup"
+ "RPI_SerialClose"
+ "RPI_SerialSendChar"
+ "RPI_SerialFlush"
+ "RPI_SerialGetChar"
+ "RPI_ThreadCreate"
+ "RPI_PinISR"
+ "RPI_HardPWMWrite"
+ "RPI_HardPWMSetRange"
+ "RPI_HardPWMSetClock"
+ "RPI_HardPWMSetMode"
+ ];
+
+//Note: "RPI_SerialSendData" is removed since distinction between input data
+//types is required
+
+
+endfunction
diff --git a/macros/Hardware/RasberryPi/old/IsRPISupportFunction.sci b/macros/Hardware/RasberryPi/old/IsRPISupportFunction.sci
new file mode 100644
index 00000000..c6a2c365
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/IsRPISupportFunction.sci
@@ -0,0 +1,32 @@
+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
+//
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+//
+// -----------------------------------------------------------------
+
+//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/old/RPI_DelayMicro.sci b/macros/Hardware/RasberryPi/old/RPI_DelayMicro.sci
new file mode 100644
index 00000000..bbb0bb3b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_DelayMicro.sci
@@ -0,0 +1,38 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+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/old/RPI_DelayMilli.sci b/macros/Hardware/RasberryPi/old/RPI_DelayMilli.sci
new file mode 100644
index 00000000..13b79625
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_DelayMilli.sci
@@ -0,0 +1,39 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_DelayMilli(time)
+// Function to insert some delay in milli seconds 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/old/RPI_DigitalIn.sci b/macros/Hardware/RasberryPi/old/RPI_DigitalIn.sci
new file mode 100644
index 00000000..781c49c8
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_DigitalIn.sci
@@ -0,0 +1,43 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+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
+//
+// -----------------------------------------------------------------
+//Pins of header P1 which can be used as GPIO
+supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
+ 31,31,33,35,36,37,38,40];
+
+PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
+
+//If given pin does not support GPIO functionality, raise the error
+if(PinIsGPIO == 0)
+ error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
+end
+state = 1;
+endfunction
diff --git a/macros/Hardware/RasberryPi/old/RPI_DigitalOut.sci b/macros/Hardware/RasberryPi/old/RPI_DigitalOut.sci
new file mode 100644
index 00000000..dde3c934
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_DigitalOut.sci
@@ -0,0 +1,44 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+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
+//
+// -----------------------------------------------------------------
+//Pins of header P1 which can be used as GPIO
+supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
+ 31,31,33,35,36,37,38,40];
+
+PinIsGPIO = members(pin, supported_pins); //Check if output pin supports GPIO
+
+//If given pin does not support GPIO functionality, raise the error
+if(PinIsGPIO == 0)
+ error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
+end
+state = 1;
+
+endfunction
diff --git a/macros/Hardware/RasberryPi/old/RPI_DigitalSetup.sci b/macros/Hardware/RasberryPi/old/RPI_DigitalSetup.sci
new file mode 100644
index 00000000..01d6e07d
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_DigitalSetup.sci
@@ -0,0 +1,36 @@
+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, 2->PWM 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(3,0) //Sets pin 3 of header P1 as input
+//
+// See also
+// RPI_DigitalIn RPI_DigitalOut
+//
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+//Pins of header P1 which can be used as GPIO
+supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
+ 31,31,33,35,36,37,38,40];
+
+PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
+
+//If given pin does not support GPIO functionality, raise the error
+if(PinIsGPIO == 0)
+ error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
+end
+state = 1;
+
+endfunction
diff --git a/macros/Hardware/RasberryPi/old/RPI_GetMicros.sci b/macros/Hardware/RasberryPi/old/RPI_GetMicros.sci
new file mode 100644
index 00000000..6c4db57a
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_GetMicros.sci
@@ -0,0 +1,39 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function Micros = RPI_GetMicros()
+// Function to get time in Microsecond since first setup function called.
+//
+// Calling Sequence
+// Micros = RPI_GetMicros()
+//
+// Parameters
+// Micros: time in Microseconds since first setup function called
+//
+// Description
+// This function can be used to get time since first setup function called.
+// Note: To use this function atleast one setup function must be called.
+//
+// Examples
+// start = RPI_GetMicros()
+// RPI_DelayMicro(1000) //This will delay the execution of next code by 100 ms.
+// end = RPI_GetMicros()
+// delay = end- start //This should be approximately 1000 us.
+//
+// See also
+// RPI_GetMillis RPI_DelayMilli 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.
+Micros = 0;
+endfunction
diff --git a/macros/Hardware/RasberryPi/old/RPI_GetMillis.sci b/macros/Hardware/RasberryPi/old/RPI_GetMillis.sci
new file mode 100644
index 00000000..c034a705
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_GetMillis.sci
@@ -0,0 +1,39 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function Millis = RPI_GetMillis()
+// Function to get time in millisecond since first setup function called.
+//
+// Calling Sequence
+// Millis = RPI_GetMillis()
+//
+// Parameters
+// Millis: time in milliseconds since first setup function called
+//
+// Description
+// This function can be used to get time since first setup function called.
+// Note: To use this function atleast one setup function must be called.
+//
+// Examples
+// start = RPI_GetMillis()
+// RPI_DelayMilli(100) //This will delay the execution of next code by 100 ms.
+// end = RPI_GetMillis()
+// delay = end- start //This should be approximately 100ms.
+//
+// See also
+// RPI_GetMicros RPI_DelayMilli 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.
+Millis = 0;
+endfunction
diff --git a/macros/Hardware/RasberryPi/old/RPI_HardPWMSetClock.sci b/macros/Hardware/RasberryPi/old/RPI_HardPWMSetClock.sci
new file mode 100644
index 00000000..8448d364
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_HardPWMSetClock.sci
@@ -0,0 +1,35 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_HardPWMSetClock(clock_divisor)
+// Function to set PWM clock. PWM clock frequency is 19.2MHz, which can be reduced
+// using suitable clock_divisor (1 to 2048, powers of 2)
+//
+// Calling Sequence
+// RPI_HardPWMSetClock(clock_divisor)
+//
+// Parameters
+// clock_divisor: Value can be from 1 to 2048, powers of 2.
+// Description
+// This function decides pwm clock.
+// PWM frequency = (PWM Clock frequency/Clock divisor/range)
+// PWM clock frequency = 19.2 MHz
+// clock divisor is setup using RPI_HardPWMSetClock
+// range is setup using RPI_HardPWMSetRange
+// Examples
+//
+// See also
+// RPI_HardPWMSetWrite RPI_HardPWMSetRange
+//
+// 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/old/RPI_HardPWMSetMode.sci b/macros/Hardware/RasberryPi/old/RPI_HardPWMSetMode.sci
new file mode 100644
index 00000000..57b82601
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_HardPWMSetMode.sci
@@ -0,0 +1,32 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_HardPWMSetMode(pwm_mode)
+// Function to set PWM mode. Two modes are available - balanced and mark/space
+//
+// Calling Sequence
+// RPI_HardPWMSetMode(pwm_mode)
+//
+// Parameters
+// pwm_mode: decides pwm mode
+// 0 -> balanced
+// 1 -> mark/space
+// Description
+// This function decides pwm mode
+// Examples
+//
+// See also
+// RPI_HardPWMSetWrite RPI_HardPWMSetRange
+//
+// 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/old/RPI_HardPWMSetRange.sci b/macros/Hardware/RasberryPi/old/RPI_HardPWMSetRange.sci
new file mode 100644
index 00000000..c2075e2d
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_HardPWMSetRange.sci
@@ -0,0 +1,35 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_HardPWMSetRange(range_val)
+// Function to set range value for PWM. Range value along with clock divisor
+// decides pwm frequency. Range value must be less than 1024
+//
+// Calling Sequence
+// RPI_HardPWMSetRange(range_val)
+//
+// Parameters
+// range_val: range for pwm
+// Description
+// This function decides range for pwm.
+// PWM frequency = (PWM Clock frequency/Clock divisor/range)
+// PWM clock frequency = 19.2 MHz
+// clock divisor is setup using RPI_HardPWMSetClock
+// range is setup using RPI_HardPWMSetRange
+// Examples
+//
+// See also
+// RPI_HardPWMSetClock RPI_HardPWMWrite
+//
+// 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/old/RPI_HardPWMWrite.sci b/macros/Hardware/RasberryPi/old/RPI_HardPWMWrite.sci
new file mode 100644
index 00000000..dba5e674
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_HardPWMWrite.sci
@@ -0,0 +1,39 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_HardPWMWrite(pin,value)
+// Function to change pwm duty on specified pin. Hardware PWM is available
+// only on pin 12. So, only '12' should be provided as pin
+//
+// Calling Sequence
+// RPI_HardPWMWrite(12,512) //Value must be smaller than the range set
+// using RPI_HARDPWMSetRange
+//
+// Parameters
+// pin: pin no on which pwm value is to be changed. Currently only 12 is allowed
+// value: pwm value for given pin. This must be less than range value set
+// Description
+// This function changes pwm duty on specified pin. As for RPi, only one pin
+// (pin 12) is available for hardware PWM.
+// PWM frequency = (PWM Clock frequency/Clock divisor/range)
+// PWM clock frequency = 19.2 MHz
+// clock divisor is setup using RPI_HardPWMSetClock
+// range is setup using RPI_HardPWMSetRange
+// Actual PWM duty = value/range
+// Examples
+//
+// See also
+// RPI_HardPWMSetClock RPI_HardPWMSetRange
+//
+// 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/old/RPI_PinISR.sci b/macros/Hardware/RasberryPi/old/RPI_PinISR.sci
new file mode 100644
index 00000000..c2354c1f
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_PinISR.sci
@@ -0,0 +1,56 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_PinISR(pin, edgetype, fn)
+// Function to assign a function to be run when an interrupt occurs on
+// specified pin.
+//
+// Calling Sequence
+// RPI_PinISR(pin, edgetype, fn)
+//
+// Parameters
+// pin : pin whose interrupt is to be configured
+// edgetype: edge on which interrupt is to be monitored
+// 1 -> Falling egde
+// 2 -> Rising egde
+// 3 -> Both egde
+// fn: name of the function to be executed on interrupt occurance
+// Description
+// This functions monitors interrupt on specified pin for specified edge,
+// When that interrupt occurs, function specified by 'fn' is executed.
+// Examples
+// RPI_PinISR(12, 0, Pin12ISR) //executes 'Pin12ISR' on falling edge on
+// pin 12
+// See also
+// RPI_ThreadCreate RPI_DigitalSetup
+//
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for RPi.
+
+//Pins of header P1 which can be used as GPIO
+supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
+ 31,31,33,35,36,37,38,40];
+
+PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
+
+//If given pin does not support GPIO functionality, raise the error
+if(PinIsGPIO == 0)
+ error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
+end
+EdgeTypeSupported = members(edgetype,[1 2 3]);
+
+if(EdgeTypeSupported == 0)
+ error(9999, 'SCI2CERROR: Given edgetype is incorrect. Please specify correct edgetype from [1,2,3]')
+end
+
+endfunction
diff --git a/macros/Hardware/RasberryPi/old/RPI_SerialClose.sci b/macros/Hardware/RasberryPi/old/RPI_SerialClose.sci
new file mode 100644
index 00000000..f27dd432
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_SerialClose.sci
@@ -0,0 +1,33 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_SerialClose(fd)
+// Function to close serial port specified by file descriptor.
+//
+// Calling Sequence
+// RPI_SerialClose(fd)
+//
+// Parameters
+// fd : file descriptor for opened port
+// Description
+// This functions closes the specified serial port
+// Examples
+// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
+// RPI_SerialClose(serial1)
+// See also
+// RPI_SerialOpen RPI_SerialSendChar
+//
+//
+// 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/old/RPI_SerialFlush.sci b/macros/Hardware/RasberryPi/old/RPI_SerialFlush.sci
new file mode 100644
index 00000000..9bab386f
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_SerialFlush.sci
@@ -0,0 +1,34 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function data = RPI_SerialGetChar(fd)
+// Function to read data from specified serial port
+//
+// Calling Sequence
+// RPI_SerialGetCharfd)
+//
+// Parameters
+// fd: file descriptor returned when serial port was opened
+// Description
+// This functions reads character form specified port. In case no
+// character is available, -1 is returned after 10 sec.
+// Examples
+// serial = RPI_SetupSerial("/dev/ttyAMA0", 9600);
+// RPI_SerialFlush(serial);
+// bytes = RPI_SerialDataAvail(serial);
+//
+// See also
+// RPI_SetupSerial RPI_SendData
+//
+// 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/old/RPI_SerialGetChar.sci b/macros/Hardware/RasberryPi/old/RPI_SerialGetChar.sci
new file mode 100644
index 00000000..a26e5b97
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_SerialGetChar.sci
@@ -0,0 +1,36 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function data = RPI_SerialGetChar(fd)
+// Function to read data from specified serial port
+//
+// Calling Sequence
+// RPI_SerialGetChar(fd)
+//
+// Parameters
+// fd: file descriptor returned when serial port was opened
+// Description
+// This functions reads character form specified port. In case no
+// character is available, -1 is returned after 10 sec.
+// Examples
+// serial = RPI_SetupSerial("/dev/ttyAMA0", 9600);
+// bytes = RPI_SerialDataAvail(serial);
+// if(bytes>0)
+// data = RPI_SerialGetChar(serial) //Reads single character
+// end
+// See also
+// RPI_SetupSerial RPI_SendData
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for RPi.
+data = 0;
+endfunction
diff --git a/macros/Hardware/RasberryPi/old/RPI_SerialSendChar.sci b/macros/Hardware/RasberryPi/old/RPI_SerialSendChar.sci
new file mode 100644
index 00000000..769b21d2
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_SerialSendChar.sci
@@ -0,0 +1,37 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_SerialSendChar(fd, data)
+// Function to send 8-bit char through serial port.
+//
+// Calling Sequence
+// RPI_SerialSendChar(fd, data)
+//
+// Parameters
+// fd : file descriptor for opened port
+// data: 8-bit character data to be sent
+// Description
+// This functions sends input 8-bit character data on specified serial port
+// Examples
+// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
+// RPI_SerialSendChar(serial1, 'H');
+// RPI_SerialSendChar(serial1, 'i');
+// RPI_SerialClose(serial1);
+//
+// See also
+// RPI_SerialOpen RPI_SerialClose
+//
+//
+// 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/old/RPI_SerialSendData.sci b/macros/Hardware/RasberryPi/old/RPI_SerialSendData.sci
new file mode 100644
index 00000000..c05852b1
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_SerialSendData.sci
@@ -0,0 +1,38 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_SerialSendData(fd, data)
+// Function to send data through serial port. Data can be of any datatype and
+// can be scalar or matrix
+//
+// Calling Sequence
+// RPI_SerialSendData(fd, data)
+//
+// Parameters
+// fd : file descriptor for opened port
+// data: data to be sent
+// Description
+// This functions sends input data on specified serial port
+// Examples
+// A = [2 3; 4 5]
+// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
+// RPI_SerialSendData(serial1, A);
+// RPI_SerialClose(serial1);
+//
+// See also
+// RPI_SerialOpen RPI_SerialClose
+//
+//
+// 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/old/RPI_SerialSetup.sci b/macros/Hardware/RasberryPi/old/RPI_SerialSetup.sci
new file mode 100644
index 00000000..0f266610
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/RPI_SerialSetup.sci
@@ -0,0 +1,36 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function fd = RPI_SerialSetup(port, baudrate)
+// Function to setup serial port.
+//
+// Calling Sequence
+// RPI_SerialSetup(port, baudrate)
+//
+// Parameters
+// port : port of RPi to be used (eg. )
+// direction : direction to be set for pin (0 -> INPUT, 1 -> OUTPUT)
+// fd : file descriptor for opened port, -1 for error
+// Description
+// This functions opens the specified serial port and returns file descriptor
+// for the same
+// Examples
+// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
+//
+// See also
+// RPI_SerialClose RPI_SerialSendChar
+//
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for RPi.
+fd = 0;
+endfunction
diff --git a/macros/Hardware/RasberryPi/old/buildmacros.sce b/macros/Hardware/RasberryPi/old/buildmacros.sce
new file mode 100644
index 00000000..2954a424
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/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/old/names b/macros/Hardware/RasberryPi/old/names
new file mode 100644
index 00000000..fa647761
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/names
@@ -0,0 +1,21 @@
+GetRPISupportFunctions
+IsRPISupportFunction
+RPI_DelayMicro
+RPI_DelayMilli
+RPI_DigitalIn
+RPI_DigitalOut
+RPI_DigitalSetup
+RPI_GetMicros
+RPI_GetMillis
+RPI_HardPWMSetClock
+RPI_HardPWMSetMode
+RPI_HardPWMSetRange
+RPI_HardPWMWrite
+RPI_PinISR
+RPI_SerialClose
+RPI_SerialFlush
+RPI_SerialGetChar
+RPI_SerialSendChar
+RPI_SerialSendData
+RPI_SerialSetup
+u16RPISerialDataAvail
diff --git a/macros/Hardware/RasberryPi/old/u16RPISerialDataAvail.sci b/macros/Hardware/RasberryPi/old/u16RPISerialDataAvail.sci
new file mode 100644
index 00000000..6eb29a1c
--- /dev/null
+++ b/macros/Hardware/RasberryPi/old/u16RPISerialDataAvail.sci
@@ -0,0 +1,37 @@
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function bytes = RPI_SerialDataAvail(fd)
+// Function to get number of data bytes available on serial port specified by
+// file descriptor
+// Calling Sequence
+// RPI_SerialDataAvail(fd)
+//
+// Parameters
+// fd : file descriptor for already opened serial port
+// Description
+// This functions returns number of characters available to read,
+// otherwise reads -1 in case of error. This function can be used to check
+// new data is available on serial port
+// Examples
+// serial = RPI_SerialOpen("/dev/ttyAMA0", 9600);
+// charsToRead = RPI_SerialDataAvail(serial);
+// See also
+// RPI_SerialOpen RPI_SerialGetChar
+//
+//
+// Authors
+// Siddhesh Wani
+// -----------------------------------------------------------------
+
+// This is curretly dummy function. It provides no functionality but is required
+// for providing support for generating C code for RPi.
+
+bytes = 0;
+
+endfunction
\ No newline at end of file
diff --git a/macros/Hardware/RasberryPi/pcf/RPI_pcf8574Setup.sci b/macros/Hardware/RasberryPi/pcf/RPI_pcf8574Setup.sci
new file mode 100755
index 00000000..f3e79429
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pcf/RPI_pcf8574Setup.sci
@@ -0,0 +1,43 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_pcf8574Setup(pinBase,i2cAddress)
+// Function for setting up PCF8574 8-bit GPIO expander IC
+//
+// Calling Sequence
+// RPI_pcf8574Setup(pinBase,i2cAddress)
+//
+// Parameters
+// pinBase : any number above 64. The consecutive 8 pins will be allocated alongwith.
+// i2cAddress: I2C address obtained using RPI_i2cdetect function
+//
+// Description
+// This function sets up the extension module for the PCF8574 8-bit GPIO expander IC. Can be called multiple times for multiple PCF8574 using different pinBase for each.
+//
+//You don’t need to specify the number of pins here – the PCF8754 has 8 pins.
+//
+// Examples
+// RPI_pcf8574Setup(67,100)
+// See also
+// RPI_pcf8591Setup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="pf7#2#"+string(pinBase)+"#"+string(i2cAddress)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/pcf/RPI_pcf8591Setup.sci b/macros/Hardware/RasberryPi/pcf/RPI_pcf8591Setup.sci
new file mode 100755
index 00000000..87054907
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pcf/RPI_pcf8591Setup.sci
@@ -0,0 +1,43 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_pcf8591Setup(pinBase,i2cAddress)
+// Function for setting up 8-bit PCF8591 Analog IO expander IC
+//
+// Calling Sequence
+// RPI_pcf8591Setup(pinBase,i2cAddress)
+//
+// Parameters
+// pinBase : any number above 64.The consecutive 4 pins will be allocated alongwith.
+// i2cAddress: I2C address obtained using RPI_i2cdetect function
+//
+// Description
+// This function sets up the extension module for the PCF8591 8-bit GPIO expander IC. Can be called multiple times for multiple PCF8591 using different pinBase for each.
+//
+//Specifying the number of pins is not necessary – the PCF8791 has 4 pins – the analog output uses base pin number 0 – the same as analog input 0.
+//
+// Examples
+// RPI_pcf8591Setup(67,64)
+// See also
+// RPI_pcf8574Setup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="pf9#2#"+string(pinBase)+"#"+string(i2cAddress)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/pcf/buildmacros.sce b/macros/Hardware/RasberryPi/pcf/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pcf/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/pcf/names b/macros/Hardware/RasberryPi/pcf/names
new file mode 100755
index 00000000..3e326a01
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pcf/names
@@ -0,0 +1,2 @@
+RPI_pcf8574Setup
+RPI_pcf8591Setup
diff --git a/macros/Hardware/RasberryPi/piGlow/RPI_piGlow1.sci b/macros/Hardware/RasberryPi/piGlow/RPI_piGlow1.sci
new file mode 100755
index 00000000..e093238c
--- /dev/null
+++ b/macros/Hardware/RasberryPi/piGlow/RPI_piGlow1.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_piGlow1(leg,ring,intensity)
+// Function to modify a single LED on the piGlow
+//
+// Calling Sequence
+// RPI_piGlow1(leg,ring,intensity)
+//
+// Parameters
+// leg : leg number
+// ring : ring number
+// intensity: brightness from 0 (off) to 255 (full)
+//
+// Description
+// The function modifies the brightness of the single specified LED.
+//
+// Examples
+// RPI_piGlow1(0,0,125)
+// See also
+// RPI_piGlowLeg, RPI_piGlowRing, RPI_piGlowSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="pG1#3#"+string(leg)+"#"+string(ring)+"#"+string(intensity)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/piGlow/RPI_piGlowLeg.sci b/macros/Hardware/RasberryPi/piGlow/RPI_piGlowLeg.sci
new file mode 100755
index 00000000..d0425797
--- /dev/null
+++ b/macros/Hardware/RasberryPi/piGlow/RPI_piGlowLeg.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_piGlowLeg(leg,intensity)
+// Function to modify a full leg of LEDs on the piGlow
+//
+// Calling Sequence
+// RPI_piGlowLeg(leg,intensity)
+//
+// Parameters
+// leg : leg number
+// intensity: brightness from 0 (off) to 255 (full)
+//
+// Description
+// This function modifies the brightness of all the LEDs in the single specified leg of piGlow.
+//
+// Examples
+// RPI_piGlowLeg(0,100)
+// See also
+// RPI_piGlow1, RPI_piGlowRing, RPI_piGlowSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="pGL#2#"+string(leg)+"#"+string(intensity)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/piGlow/RPI_piGlowRing.sci b/macros/Hardware/RasberryPi/piGlow/RPI_piGlowRing.sci
new file mode 100755
index 00000000..ef816205
--- /dev/null
+++ b/macros/Hardware/RasberryPi/piGlow/RPI_piGlowRing.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_piGlowRing(ring,intensity)
+// Function to modify a full ring of LEDs on the piGlow
+//
+// Calling Sequence
+// RPI_piGlowRing(ring,intensity)
+//
+// Parameters
+// ring : ring number
+// intensity: brightness from 0 (off) to 255 (full)
+//
+// Description
+// This function modifies the brightness of all the LEDs in the single specified ring of piGlow.
+//
+// Examples
+// RPI_piGlowRing(1,200)
+// See also
+// RPI_piGlowLeg, RPI_piGlow1, RPI_piGlowSetup
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="pGR#2#"+string(ring)+"#"+string(intensity)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/piGlow/RPI_piGlowSetup.sci b/macros/Hardware/RasberryPi/piGlow/RPI_piGlowSetup.sci
new file mode 100755
index 00000000..718fa3b6
--- /dev/null
+++ b/macros/Hardware/RasberryPi/piGlow/RPI_piGlowSetup.sci
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_piGlowSetup(Empty)
+// Function to initialize the piGlow board
+//
+// Calling Sequence
+// RPI_piGlowSetup(Empty)
+//
+// Parameters
+// Empty: integer, 0 or 1. If 1, then all the LEDs will be turned off to start with.
+//
+// Description
+// This initialises the PiGlow devLib software. The I2C kernel module needs to be pre-loaded. ThePiGlow board has an SN3218 I2C LED controller and 18 LEDs arranged in 3 “legs” of 6 LEDs. (or 6 “rings” of 3 LEDs).
+//
+// The LED colours in each leg match and are in the order Red (at the outside), Yellow, Orange, Green, Blue and White (in the center)
+//
+// Examples
+// RPI_piGlowSetup(TRUE)
+// See also
+// RPI_piGlowLeg, RPI_piGlow1, RPI_piGlowRing
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="pGS#1#"+string(Empty)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/piGlow/buildmacros.sce b/macros/Hardware/RasberryPi/piGlow/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/piGlow/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/piGlow/names b/macros/Hardware/RasberryPi/piGlow/names
new file mode 100755
index 00000000..b63ec8f7
--- /dev/null
+++ b/macros/Hardware/RasberryPi/piGlow/names
@@ -0,0 +1,4 @@
+RPI_piGlow1
+RPI_piGlowLeg
+RPI_piGlowRing
+RPI_piGlowSetup
diff --git a/macros/Hardware/RasberryPi/pinMap/RPI_physToGpio.sci b/macros/Hardware/RasberryPi/pinMap/RPI_physToGpio.sci
new file mode 100755
index 00000000..9a59caa2
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pinMap/RPI_physToGpio.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_physToGpio(pin)
+// Function to check the GPIO pin number corresponding to given physical pin number.
+//
+// Calling Sequence
+// p=RPI_physToGpio(pin)
+//
+// Parameters
+// pin: The pin number to check in physical numbering sequence.
+//
+// Description
+// This funtion return the GPIO pin number corresponding to the supplied physical pin number.
+//
+// Examples
+// p=RPI_physToGpio(11)
+// See also
+// RPI_wpiToGpio
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="ptG#1#"+string(pin)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/pinMap/RPI_wpiToGpio.sci b/macros/Hardware/RasberryPi/pinMap/RPI_wpiToGpio.sci
new file mode 100755
index 00000000..deed4264
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pinMap/RPI_wpiToGpio.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function out=RPI_wpiToGpio(pin)
+// Function to check the GPIO pin number corresponding to given wiringpi pin number.
+//
+// Calling Sequence
+// p=RPI_wpiToGpio(pin)
+//
+// Parameters
+// pin: The pin number to check in wiringpi numbering sequence.
+//
+// Description
+// This funtion return the GPIO pin number corresponding to the supplied wiringpi pin number.
+//
+// Examples
+// p=RPI_wpiToGpio(0)
+// See also
+// RPI_physToGpio
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="wtG#1#"+string(pin)+"#";
+ if getos()=="Linux" then
+ out=unix_g("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ [out,RPI_winR]=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/pinMap/buildmacros.sce b/macros/Hardware/RasberryPi/pinMap/buildmacros.sce
new file mode 100755
index 00000000..7d533f7b
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pinMap/buildmacros.sce
@@ -0,0 +1,14 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Author: Jorawar Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
+
+clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/pinMap/names b/macros/Hardware/RasberryPi/pinMap/names
new file mode 100755
index 00000000..71efa237
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pinMap/names
@@ -0,0 +1,2 @@
+RPI_physToGpio
+RPI_wpiToGpio
diff --git a/macros/Hardware/RasberryPi/pwm/RPI_pwmClock.sci b/macros/Hardware/RasberryPi/pwm/RPI_pwmClock.sci
new file mode 100755
index 00000000..d0653537
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pwm/RPI_pwmClock.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_pwmClock(value)
+// Function to set the divisor for the PWM clock.
+//
+// Calling Sequence
+// RPI_pwmClock(value)
+//
+// Parameters
+// value: The divisor for the PWM clock.
+//
+// Description
+// This function sets the divisor for the PWM clock.
+//
+// Examples
+// RPI_pwmClock(100)
+// See also
+// RPI_pwmMode, RPI_pwmRange, RPI_pwmToneWrite, RPI_pwmWrite
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="pwC#1#"+string(value)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/pwm/RPI_pwmMode.sci b/macros/Hardware/RasberryPi/pwm/RPI_pwmMode.sci
new file mode 100755
index 00000000..13d0c367
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pwm/RPI_pwmMode.sci
@@ -0,0 +1,46 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_pwmMode(Mode)
+// Function to set the mode for the PWM generator
+//
+// Calling Sequence
+// RPI_pwmMode(mode)
+//
+// Parameters
+// mode: The mode to set for the PWM generator. 'ms' (for mark:space) or 'bal' (for balanced)
+//
+// Description
+// This function sets the mode for the PWM generator. The PWM generator can run in 2 modes – “balanced” and “mark:space”. The mark:space mode is traditional, however the default mode in the Pi is “balanced”. Switch modes by supplying the parameter: bal or ms
+//
+// Examples
+// RPI_pwmMode('bal')
+// See also
+// RPI_pwmRange, RPI_pwmClock, RPI_pwmToneWrite, RPI_pwmWrite
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ if Mode=='ms' then
+ commande="pwM#1#0#";
+ elseif Mode=='bal' then
+ commande="pwM#1#1#";
+ else:
+ error("mode should be ""ms"" or ""bal""");
+ end
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/pwm/RPI_pwmRange.sci b/macros/Hardware/RasberryPi/pwm/RPI_pwmRange.sci
new file mode 100755
index 00000000..6a1503a0
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pwm/RPI_pwmRange.sci
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_pwmRange(value)
+// Function to set the divisor for the PWM clock.
+//
+// Calling Sequence
+// RPI_pwmRange(value)
+//
+// Parameters
+// value: maximum of the range for the PWM generator.
+//
+// Description
+// This function sets the range register in the PWM generator. The default is 1024.
+//
+// Examples
+// RPI_pwmRange(512)
+// See also
+// RPI_pwmMode, RPI_pwmClock, RPI_pwmToneWrite, RPI_pwmWrite
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="pwR#1#"+string(value)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/pwm/RPI_pwmToneWrite.sci b/macros/Hardware/RasberryPi/pwm/RPI_pwmToneWrite.sci
new file mode 100755
index 00000000..d7ff6eda
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pwm/RPI_pwmToneWrite.sci
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_pwmToneWrite(pin,freq)
+// Function to write a tone of a given frequency to the pin
+//
+// Calling Sequence
+// RPI_pwmToneWrite(pin,freq)
+//
+// Parameters
+// pin : The pin to set the frequency on. Numbering to be followed as initiated using RPI_pinNumbering.
+// freq: frequency to write
+//
+// Description
+// This function write the given frequency tone to the given pin.
+//
+// Examples
+// RPI_pwmToneWrite(0,100)
+// See also
+// RPI_pwmMode, RPI_pwmRange, RPI_pwmClock, RPI_pwmWrite, PRI_pinNumbering
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ commande="pwT#2#"+string(pin)+"#"+string(freq)+"#";
+ if getos=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/pwm/RPI_pwmWrite.sci b/macros/Hardware/RasberryPi/pwm/RPI_pwmWrite.sci
new file mode 100755
index 00000000..113547af
--- /dev/null
+++ b/macros/Hardware/RasberryPi/pwm/RPI_pwmWrite.sci
@@ -0,0 +1,45 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function RPI_pwmWrite(pin,value)
+// Function to write voltage value to the PWM register for the given pin.
+//
+// Calling Sequence
+// RPI_pwmWrite(pin,value)
+//
+// Parameters
+// pin : The pin number set the voltage at. Numbering sequence to be followed as initiated using RPI_pinNumbering function.
+// value: The voltage to set at the given pin. Range is 0-1024.
+//
+// Description
+// Writes the value to the PWM register for the given pin. The Raspberry Pi has one on-board PWM pin, pin 1 (BMC_GPIO 18, Phys 12). Other PWM devices may have other PWM ranges.
+//
+// Examples
+// RPI_pwmWrite(1,500)
+// See also
+// RPI_pwmMode, RPI_pwmRange, RPI_pwmClock, RPI_pwmToneWrite
+//
+// Authors
+// Jorawar Singh
+//
+// Bibliography
+// http://wiringpi.com/reference/
+
+ if [0logs.txt 2>&1");
+ disp("Step 3/6")
+ TCL_EvalStr("exec ssh-copy-id -i /home/"+local+"/.ssh/id_rsa.pub "+username+"@"+adress+" > logs.txt 2>&1");
+ disp("Step 4/6")
+ TCL_EvalStr("exec rsync -avz "+RPI_MacrosPath+"serverWP.py "+username+"@"+adress+":.scilab/ >logs.txt");
+ disp("Step 5/6")
+ TCL_EvalStr("exec ssh "+username+"@"+adress+" sudo python /home/"+username+"/.scilab/serverWP.py &");
+ disp("Step 6/6")
+ TCL_EvalStr(["file delete logs.txt";"file delete &1"]);
+ endfunction
+elseif getos()=='Windows' then
+ tempPath=get_absolute_file_path("raspi.sci");
+ RPI_MacrosPath=strsubst(tempPath,'\','/');
+ RPI_MacrosPath=part(RPI_MacrosPath,1:(length(RPI_MacrosPath)-7));
+ RPI_MacrosPath=RPI_MacrosPath+'src/python/';
+ function raspi(adress,username)
+ // Function to initiate the connection to the raspberry pi
+ //
+ // Calling Sequence
+ // raspi(adress,username)
+ //
+ // Parameters
+ // address : Network address of the raspberry pi. Eg:10.42.0.82
+ // username: username on the raspberry pi.
+ //
+ // Description
+ // This program initiates the connection to the raspberry pi at the given address by running the python server script on port 9077 on the pi.
+ //
+ // Examples
+ // raspi('169.254.191.116','pi')
+ // See also
+ // raspi_close
+ //
+ // Authors
+ // Jorawar Singh
+
+ global RPI_piAdress;
+ RPI_piAdress=adress;
+
+ disp("Step 1/3")
+ TCL_EvalStr("exec mintty ssh "+username+"@"+adress+" mkdir .scilab");
+ disp("Step 2/3")
+ TCL_EvalStr("exec mintty scp "+RPI_MacrosPath+"serverWP.py "+username+"@"+adress+":/home/"+username+"/.scilab/");
+ disp("Step 3/3 (Wait ~15 seconds)")
+ TCL_EvalStr("exec mintty ssh "+username+"@"+adress+" sudo python /home/"+username+"/.scilab/serverWP.py &");
+ sleep(15000)
+ TCL_EvalStr("exec taskkill /IM mintty.exe");
+ endfunction
+end
diff --git a/macros/Hardware/RasberryPi/raspi_close.sci b/macros/Hardware/RasberryPi/raspi_close.sci
new file mode 100755
index 00000000..b5bb0ee7
--- /dev/null
+++ b/macros/Hardware/RasberryPi/raspi_close.sci
@@ -0,0 +1,34 @@
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+//
+// 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
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function raspi_close()
+// Function to close an open Raspberry-Pi connection.
+//
+// Calling Sequence
+// raspi_close()
+//
+// Description
+// This function causes the pyhton server script running on Raspberry pi to close, irrespective of it being started natively on pi or by using raspi function.
+//
+// Examples
+// raspi_close()
+// See also
+// raspi
+//
+// Authors
+// Jorawar Singh
+
+ commande="cls#0#";
+ if getos()=="Linux" then
+ unix_w("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ elseif getos()=="Windows" then
+ RPI_winR=dos("python -c ""import socket;s=socket.socket();s.connect((''"+RPI_piAdress+"'',9077));s.send(''"+commande+"'');print(s.recv(1024));s.close()""");
+ end
+endfunction
diff --git a/macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci b/macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci
deleted file mode 100644
index 6eb29a1c..00000000
--- a/macros/Hardware/RasberryPi/u16RPISerialDataAvail.sci
+++ /dev/null
@@ -1,37 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function bytes = RPI_SerialDataAvail(fd)
-// Function to get number of data bytes available on serial port specified by
-// file descriptor
-// Calling Sequence
-// RPI_SerialDataAvail(fd)
-//
-// Parameters
-// fd : file descriptor for already opened serial port
-// Description
-// This functions returns number of characters available to read,
-// otherwise reads -1 in case of error. This function can be used to check
-// new data is available on serial port
-// Examples
-// serial = RPI_SerialOpen("/dev/ttyAMA0", 9600);
-// charsToRead = RPI_SerialDataAvail(serial);
-// See also
-// RPI_SerialOpen RPI_SerialGetChar
-//
-//
-// Authors
-// Siddhesh Wani
-// -----------------------------------------------------------------
-
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for RPi.
-
-bytes = 0;
-
-endfunction
\ No newline at end of file
--
cgit
From 3d61d19dba96a677e63e6a8d349d8352ebcf9e64 Mon Sep 17 00:00:00 2001
From: Jorawar Singh
Date: Sun, 16 Jul 2017 22:41:14 +0530
Subject: Toolbox merge, RPI demos and structured demos
---
.../RasberryPi/old/GetRPISupportFunctions.sci | 48 -------------------
.../RasberryPi/old/IsRPISupportFunction.sci | 32 -------------
macros/Hardware/RasberryPi/old/RPI_DelayMicro.sci | 38 ---------------
macros/Hardware/RasberryPi/old/RPI_DelayMilli.sci | 39 ---------------
macros/Hardware/RasberryPi/old/RPI_DigitalIn.sci | 43 -----------------
macros/Hardware/RasberryPi/old/RPI_DigitalOut.sci | 44 -----------------
.../Hardware/RasberryPi/old/RPI_DigitalSetup.sci | 36 --------------
macros/Hardware/RasberryPi/old/RPI_GetMicros.sci | 39 ---------------
macros/Hardware/RasberryPi/old/RPI_GetMillis.sci | 39 ---------------
.../RasberryPi/old/RPI_HardPWMSetClock.sci | 35 --------------
.../Hardware/RasberryPi/old/RPI_HardPWMSetMode.sci | 32 -------------
.../RasberryPi/old/RPI_HardPWMSetRange.sci | 35 --------------
.../Hardware/RasberryPi/old/RPI_HardPWMWrite.sci | 39 ---------------
macros/Hardware/RasberryPi/old/RPI_PinISR.sci | 56 ----------------------
macros/Hardware/RasberryPi/old/RPI_SerialClose.sci | 33 -------------
macros/Hardware/RasberryPi/old/RPI_SerialFlush.sci | 34 -------------
.../Hardware/RasberryPi/old/RPI_SerialGetChar.sci | 36 --------------
.../Hardware/RasberryPi/old/RPI_SerialSendChar.sci | 37 --------------
.../Hardware/RasberryPi/old/RPI_SerialSendData.sci | 38 ---------------
macros/Hardware/RasberryPi/old/RPI_SerialSetup.sci | 36 --------------
macros/Hardware/RasberryPi/old/buildmacros.sce | 4 --
macros/Hardware/RasberryPi/old/names | 21 --------
.../RasberryPi/old/u16RPISerialDataAvail.sci | 37 --------------
23 files changed, 831 deletions(-)
delete mode 100644 macros/Hardware/RasberryPi/old/GetRPISupportFunctions.sci
delete mode 100644 macros/Hardware/RasberryPi/old/IsRPISupportFunction.sci
delete mode 100644 macros/Hardware/RasberryPi/old/RPI_DelayMicro.sci
delete mode 100644 macros/Hardware/RasberryPi/old/RPI_DelayMilli.sci
delete mode 100644 macros/Hardware/RasberryPi/old/RPI_DigitalIn.sci
delete mode 100644 macros/Hardware/RasberryPi/old/RPI_DigitalOut.sci
delete mode 100644 macros/Hardware/RasberryPi/old/RPI_DigitalSetup.sci
delete mode 100644 macros/Hardware/RasberryPi/old/RPI_GetMicros.sci
delete mode 100644 macros/Hardware/RasberryPi/old/RPI_GetMillis.sci
delete mode 100644 macros/Hardware/RasberryPi/old/RPI_HardPWMSetClock.sci
delete mode 100644 macros/Hardware/RasberryPi/old/RPI_HardPWMSetMode.sci
delete mode 100644 macros/Hardware/RasberryPi/old/RPI_HardPWMSetRange.sci
delete mode 100644 macros/Hardware/RasberryPi/old/RPI_HardPWMWrite.sci
delete mode 100644 macros/Hardware/RasberryPi/old/RPI_PinISR.sci
delete mode 100644 macros/Hardware/RasberryPi/old/RPI_SerialClose.sci
delete mode 100644 macros/Hardware/RasberryPi/old/RPI_SerialFlush.sci
delete mode 100644 macros/Hardware/RasberryPi/old/RPI_SerialGetChar.sci
delete mode 100644 macros/Hardware/RasberryPi/old/RPI_SerialSendChar.sci
delete mode 100644 macros/Hardware/RasberryPi/old/RPI_SerialSendData.sci
delete mode 100644 macros/Hardware/RasberryPi/old/RPI_SerialSetup.sci
delete mode 100644 macros/Hardware/RasberryPi/old/buildmacros.sce
delete mode 100644 macros/Hardware/RasberryPi/old/names
delete mode 100644 macros/Hardware/RasberryPi/old/u16RPISerialDataAvail.sci
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/RasberryPi/old/GetRPISupportFunctions.sci b/macros/Hardware/RasberryPi/old/GetRPISupportFunctions.sci
deleted file mode 100644
index 3e6397b2..00000000
--- a/macros/Hardware/RasberryPi/old/GetRPISupportFunctions.sci
+++ /dev/null
@@ -1,48 +0,0 @@
-function RPiSupportFunctions = GetRPISupportFunctions()
-// -----------------------------------------------------------------
-// Get list of RPI peripherals supported
-//
-// Input data:
-// None
-//
-// Output data:
-// None
-// Copyright (C) 2017 - IIT Bombay - FOSSEE
-//
-// 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
-// Author: Siddhesh Wani
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-//
-// -----------------------------------------------------------------
-
-RPiSupportFunctions = [
- "RPI_DigitalIn"
- "RPI_DigitalOut"
- "RPI_DigitalSetup"
- "RPI_DelayMilli"
- "RPI_DelayMicro"
- "RPI_GetMillis"
- "RPI_GetMicros"
- "RPI_SerialSetup"
- "RPI_SerialClose"
- "RPI_SerialSendChar"
- "RPI_SerialFlush"
- "RPI_SerialGetChar"
- "RPI_ThreadCreate"
- "RPI_PinISR"
- "RPI_HardPWMWrite"
- "RPI_HardPWMSetRange"
- "RPI_HardPWMSetClock"
- "RPI_HardPWMSetMode"
- ];
-
-//Note: "RPI_SerialSendData" is removed since distinction between input data
-//types is required
-
-
-endfunction
diff --git a/macros/Hardware/RasberryPi/old/IsRPISupportFunction.sci b/macros/Hardware/RasberryPi/old/IsRPISupportFunction.sci
deleted file mode 100644
index c6a2c365..00000000
--- a/macros/Hardware/RasberryPi/old/IsRPISupportFunction.sci
+++ /dev/null
@@ -1,32 +0,0 @@
-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
-//
-// Copyright (C) 2017 - IIT Bombay - FOSSEE
-//
-// 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
-// Author: Siddhesh Wani
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-//
-// -----------------------------------------------------------------
-
-//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/old/RPI_DelayMicro.sci b/macros/Hardware/RasberryPi/old/RPI_DelayMicro.sci
deleted file mode 100644
index bbb0bb3b..00000000
--- a/macros/Hardware/RasberryPi/old/RPI_DelayMicro.sci
+++ /dev/null
@@ -1,38 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-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/old/RPI_DelayMilli.sci b/macros/Hardware/RasberryPi/old/RPI_DelayMilli.sci
deleted file mode 100644
index 13b79625..00000000
--- a/macros/Hardware/RasberryPi/old/RPI_DelayMilli.sci
+++ /dev/null
@@ -1,39 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_DelayMilli(time)
-// Function to insert some delay in milli seconds 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/old/RPI_DigitalIn.sci b/macros/Hardware/RasberryPi/old/RPI_DigitalIn.sci
deleted file mode 100644
index 781c49c8..00000000
--- a/macros/Hardware/RasberryPi/old/RPI_DigitalIn.sci
+++ /dev/null
@@ -1,43 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-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
-//
-// -----------------------------------------------------------------
-//Pins of header P1 which can be used as GPIO
-supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
- 31,31,33,35,36,37,38,40];
-
-PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
-
-//If given pin does not support GPIO functionality, raise the error
-if(PinIsGPIO == 0)
- error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
-end
-state = 1;
-endfunction
diff --git a/macros/Hardware/RasberryPi/old/RPI_DigitalOut.sci b/macros/Hardware/RasberryPi/old/RPI_DigitalOut.sci
deleted file mode 100644
index dde3c934..00000000
--- a/macros/Hardware/RasberryPi/old/RPI_DigitalOut.sci
+++ /dev/null
@@ -1,44 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-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
-//
-// -----------------------------------------------------------------
-//Pins of header P1 which can be used as GPIO
-supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
- 31,31,33,35,36,37,38,40];
-
-PinIsGPIO = members(pin, supported_pins); //Check if output pin supports GPIO
-
-//If given pin does not support GPIO functionality, raise the error
-if(PinIsGPIO == 0)
- error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
-end
-state = 1;
-
-endfunction
diff --git a/macros/Hardware/RasberryPi/old/RPI_DigitalSetup.sci b/macros/Hardware/RasberryPi/old/RPI_DigitalSetup.sci
deleted file mode 100644
index 01d6e07d..00000000
--- a/macros/Hardware/RasberryPi/old/RPI_DigitalSetup.sci
+++ /dev/null
@@ -1,36 +0,0 @@
-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, 2->PWM 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(3,0) //Sets pin 3 of header P1 as input
-//
-// See also
-// RPI_DigitalIn RPI_DigitalOut
-//
-//
-// Authors
-// Siddhesh Wani
-// -----------------------------------------------------------------
-//Pins of header P1 which can be used as GPIO
-supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
- 31,31,33,35,36,37,38,40];
-
-PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
-
-//If given pin does not support GPIO functionality, raise the error
-if(PinIsGPIO == 0)
- error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
-end
-state = 1;
-
-endfunction
diff --git a/macros/Hardware/RasberryPi/old/RPI_GetMicros.sci b/macros/Hardware/RasberryPi/old/RPI_GetMicros.sci
deleted file mode 100644
index 6c4db57a..00000000
--- a/macros/Hardware/RasberryPi/old/RPI_GetMicros.sci
+++ /dev/null
@@ -1,39 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function Micros = RPI_GetMicros()
-// Function to get time in Microsecond since first setup function called.
-//
-// Calling Sequence
-// Micros = RPI_GetMicros()
-//
-// Parameters
-// Micros: time in Microseconds since first setup function called
-//
-// Description
-// This function can be used to get time since first setup function called.
-// Note: To use this function atleast one setup function must be called.
-//
-// Examples
-// start = RPI_GetMicros()
-// RPI_DelayMicro(1000) //This will delay the execution of next code by 100 ms.
-// end = RPI_GetMicros()
-// delay = end- start //This should be approximately 1000 us.
-//
-// See also
-// RPI_GetMillis RPI_DelayMilli 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.
-Micros = 0;
-endfunction
diff --git a/macros/Hardware/RasberryPi/old/RPI_GetMillis.sci b/macros/Hardware/RasberryPi/old/RPI_GetMillis.sci
deleted file mode 100644
index c034a705..00000000
--- a/macros/Hardware/RasberryPi/old/RPI_GetMillis.sci
+++ /dev/null
@@ -1,39 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function Millis = RPI_GetMillis()
-// Function to get time in millisecond since first setup function called.
-//
-// Calling Sequence
-// Millis = RPI_GetMillis()
-//
-// Parameters
-// Millis: time in milliseconds since first setup function called
-//
-// Description
-// This function can be used to get time since first setup function called.
-// Note: To use this function atleast one setup function must be called.
-//
-// Examples
-// start = RPI_GetMillis()
-// RPI_DelayMilli(100) //This will delay the execution of next code by 100 ms.
-// end = RPI_GetMillis()
-// delay = end- start //This should be approximately 100ms.
-//
-// See also
-// RPI_GetMicros RPI_DelayMilli 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.
-Millis = 0;
-endfunction
diff --git a/macros/Hardware/RasberryPi/old/RPI_HardPWMSetClock.sci b/macros/Hardware/RasberryPi/old/RPI_HardPWMSetClock.sci
deleted file mode 100644
index 8448d364..00000000
--- a/macros/Hardware/RasberryPi/old/RPI_HardPWMSetClock.sci
+++ /dev/null
@@ -1,35 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_HardPWMSetClock(clock_divisor)
-// Function to set PWM clock. PWM clock frequency is 19.2MHz, which can be reduced
-// using suitable clock_divisor (1 to 2048, powers of 2)
-//
-// Calling Sequence
-// RPI_HardPWMSetClock(clock_divisor)
-//
-// Parameters
-// clock_divisor: Value can be from 1 to 2048, powers of 2.
-// Description
-// This function decides pwm clock.
-// PWM frequency = (PWM Clock frequency/Clock divisor/range)
-// PWM clock frequency = 19.2 MHz
-// clock divisor is setup using RPI_HardPWMSetClock
-// range is setup using RPI_HardPWMSetRange
-// Examples
-//
-// See also
-// RPI_HardPWMSetWrite RPI_HardPWMSetRange
-//
-// 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/old/RPI_HardPWMSetMode.sci b/macros/Hardware/RasberryPi/old/RPI_HardPWMSetMode.sci
deleted file mode 100644
index 57b82601..00000000
--- a/macros/Hardware/RasberryPi/old/RPI_HardPWMSetMode.sci
+++ /dev/null
@@ -1,32 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_HardPWMSetMode(pwm_mode)
-// Function to set PWM mode. Two modes are available - balanced and mark/space
-//
-// Calling Sequence
-// RPI_HardPWMSetMode(pwm_mode)
-//
-// Parameters
-// pwm_mode: decides pwm mode
-// 0 -> balanced
-// 1 -> mark/space
-// Description
-// This function decides pwm mode
-// Examples
-//
-// See also
-// RPI_HardPWMSetWrite RPI_HardPWMSetRange
-//
-// 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/old/RPI_HardPWMSetRange.sci b/macros/Hardware/RasberryPi/old/RPI_HardPWMSetRange.sci
deleted file mode 100644
index c2075e2d..00000000
--- a/macros/Hardware/RasberryPi/old/RPI_HardPWMSetRange.sci
+++ /dev/null
@@ -1,35 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_HardPWMSetRange(range_val)
-// Function to set range value for PWM. Range value along with clock divisor
-// decides pwm frequency. Range value must be less than 1024
-//
-// Calling Sequence
-// RPI_HardPWMSetRange(range_val)
-//
-// Parameters
-// range_val: range for pwm
-// Description
-// This function decides range for pwm.
-// PWM frequency = (PWM Clock frequency/Clock divisor/range)
-// PWM clock frequency = 19.2 MHz
-// clock divisor is setup using RPI_HardPWMSetClock
-// range is setup using RPI_HardPWMSetRange
-// Examples
-//
-// See also
-// RPI_HardPWMSetClock RPI_HardPWMWrite
-//
-// 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/old/RPI_HardPWMWrite.sci b/macros/Hardware/RasberryPi/old/RPI_HardPWMWrite.sci
deleted file mode 100644
index dba5e674..00000000
--- a/macros/Hardware/RasberryPi/old/RPI_HardPWMWrite.sci
+++ /dev/null
@@ -1,39 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_HardPWMWrite(pin,value)
-// Function to change pwm duty on specified pin. Hardware PWM is available
-// only on pin 12. So, only '12' should be provided as pin
-//
-// Calling Sequence
-// RPI_HardPWMWrite(12,512) //Value must be smaller than the range set
-// using RPI_HARDPWMSetRange
-//
-// Parameters
-// pin: pin no on which pwm value is to be changed. Currently only 12 is allowed
-// value: pwm value for given pin. This must be less than range value set
-// Description
-// This function changes pwm duty on specified pin. As for RPi, only one pin
-// (pin 12) is available for hardware PWM.
-// PWM frequency = (PWM Clock frequency/Clock divisor/range)
-// PWM clock frequency = 19.2 MHz
-// clock divisor is setup using RPI_HardPWMSetClock
-// range is setup using RPI_HardPWMSetRange
-// Actual PWM duty = value/range
-// Examples
-//
-// See also
-// RPI_HardPWMSetClock RPI_HardPWMSetRange
-//
-// 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/old/RPI_PinISR.sci b/macros/Hardware/RasberryPi/old/RPI_PinISR.sci
deleted file mode 100644
index c2354c1f..00000000
--- a/macros/Hardware/RasberryPi/old/RPI_PinISR.sci
+++ /dev/null
@@ -1,56 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_PinISR(pin, edgetype, fn)
-// Function to assign a function to be run when an interrupt occurs on
-// specified pin.
-//
-// Calling Sequence
-// RPI_PinISR(pin, edgetype, fn)
-//
-// Parameters
-// pin : pin whose interrupt is to be configured
-// edgetype: edge on which interrupt is to be monitored
-// 1 -> Falling egde
-// 2 -> Rising egde
-// 3 -> Both egde
-// fn: name of the function to be executed on interrupt occurance
-// Description
-// This functions monitors interrupt on specified pin for specified edge,
-// When that interrupt occurs, function specified by 'fn' is executed.
-// Examples
-// RPI_PinISR(12, 0, Pin12ISR) //executes 'Pin12ISR' on falling edge on
-// pin 12
-// See also
-// RPI_ThreadCreate RPI_DigitalSetup
-//
-//
-// Authors
-// Siddhesh Wani
-// -----------------------------------------------------------------
-
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for RPi.
-
-//Pins of header P1 which can be used as GPIO
-supported_pins = [3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,27,28,29,...
- 31,31,33,35,36,37,38,40];
-
-PinIsGPIO = members(pin, supported_pins); //Check if input pin supports GPIO
-
-//If given pin does not support GPIO functionality, raise the error
-if(PinIsGPIO == 0)
- error(9999, 'SCI2CERROR: Given pin number doesnot support GPIO functionality.');
-end
-EdgeTypeSupported = members(edgetype,[1 2 3]);
-
-if(EdgeTypeSupported == 0)
- error(9999, 'SCI2CERROR: Given edgetype is incorrect. Please specify correct edgetype from [1,2,3]')
-end
-
-endfunction
diff --git a/macros/Hardware/RasberryPi/old/RPI_SerialClose.sci b/macros/Hardware/RasberryPi/old/RPI_SerialClose.sci
deleted file mode 100644
index f27dd432..00000000
--- a/macros/Hardware/RasberryPi/old/RPI_SerialClose.sci
+++ /dev/null
@@ -1,33 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_SerialClose(fd)
-// Function to close serial port specified by file descriptor.
-//
-// Calling Sequence
-// RPI_SerialClose(fd)
-//
-// Parameters
-// fd : file descriptor for opened port
-// Description
-// This functions closes the specified serial port
-// Examples
-// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
-// RPI_SerialClose(serial1)
-// See also
-// RPI_SerialOpen RPI_SerialSendChar
-//
-//
-// 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/old/RPI_SerialFlush.sci b/macros/Hardware/RasberryPi/old/RPI_SerialFlush.sci
deleted file mode 100644
index 9bab386f..00000000
--- a/macros/Hardware/RasberryPi/old/RPI_SerialFlush.sci
+++ /dev/null
@@ -1,34 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function data = RPI_SerialGetChar(fd)
-// Function to read data from specified serial port
-//
-// Calling Sequence
-// RPI_SerialGetCharfd)
-//
-// Parameters
-// fd: file descriptor returned when serial port was opened
-// Description
-// This functions reads character form specified port. In case no
-// character is available, -1 is returned after 10 sec.
-// Examples
-// serial = RPI_SetupSerial("/dev/ttyAMA0", 9600);
-// RPI_SerialFlush(serial);
-// bytes = RPI_SerialDataAvail(serial);
-//
-// See also
-// RPI_SetupSerial RPI_SendData
-//
-// 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/old/RPI_SerialGetChar.sci b/macros/Hardware/RasberryPi/old/RPI_SerialGetChar.sci
deleted file mode 100644
index a26e5b97..00000000
--- a/macros/Hardware/RasberryPi/old/RPI_SerialGetChar.sci
+++ /dev/null
@@ -1,36 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function data = RPI_SerialGetChar(fd)
-// Function to read data from specified serial port
-//
-// Calling Sequence
-// RPI_SerialGetChar(fd)
-//
-// Parameters
-// fd: file descriptor returned when serial port was opened
-// Description
-// This functions reads character form specified port. In case no
-// character is available, -1 is returned after 10 sec.
-// Examples
-// serial = RPI_SetupSerial("/dev/ttyAMA0", 9600);
-// bytes = RPI_SerialDataAvail(serial);
-// if(bytes>0)
-// data = RPI_SerialGetChar(serial) //Reads single character
-// end
-// See also
-// RPI_SetupSerial RPI_SendData
-//
-// Authors
-// Siddhesh Wani
-// -----------------------------------------------------------------
-
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for RPi.
-data = 0;
-endfunction
diff --git a/macros/Hardware/RasberryPi/old/RPI_SerialSendChar.sci b/macros/Hardware/RasberryPi/old/RPI_SerialSendChar.sci
deleted file mode 100644
index 769b21d2..00000000
--- a/macros/Hardware/RasberryPi/old/RPI_SerialSendChar.sci
+++ /dev/null
@@ -1,37 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_SerialSendChar(fd, data)
-// Function to send 8-bit char through serial port.
-//
-// Calling Sequence
-// RPI_SerialSendChar(fd, data)
-//
-// Parameters
-// fd : file descriptor for opened port
-// data: 8-bit character data to be sent
-// Description
-// This functions sends input 8-bit character data on specified serial port
-// Examples
-// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
-// RPI_SerialSendChar(serial1, 'H');
-// RPI_SerialSendChar(serial1, 'i');
-// RPI_SerialClose(serial1);
-//
-// See also
-// RPI_SerialOpen RPI_SerialClose
-//
-//
-// 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/old/RPI_SerialSendData.sci b/macros/Hardware/RasberryPi/old/RPI_SerialSendData.sci
deleted file mode 100644
index c05852b1..00000000
--- a/macros/Hardware/RasberryPi/old/RPI_SerialSendData.sci
+++ /dev/null
@@ -1,38 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function RPI_SerialSendData(fd, data)
-// Function to send data through serial port. Data can be of any datatype and
-// can be scalar or matrix
-//
-// Calling Sequence
-// RPI_SerialSendData(fd, data)
-//
-// Parameters
-// fd : file descriptor for opened port
-// data: data to be sent
-// Description
-// This functions sends input data on specified serial port
-// Examples
-// A = [2 3; 4 5]
-// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
-// RPI_SerialSendData(serial1, A);
-// RPI_SerialClose(serial1);
-//
-// See also
-// RPI_SerialOpen RPI_SerialClose
-//
-//
-// 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/old/RPI_SerialSetup.sci b/macros/Hardware/RasberryPi/old/RPI_SerialSetup.sci
deleted file mode 100644
index 0f266610..00000000
--- a/macros/Hardware/RasberryPi/old/RPI_SerialSetup.sci
+++ /dev/null
@@ -1,36 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function fd = RPI_SerialSetup(port, baudrate)
-// Function to setup serial port.
-//
-// Calling Sequence
-// RPI_SerialSetup(port, baudrate)
-//
-// Parameters
-// port : port of RPi to be used (eg. )
-// direction : direction to be set for pin (0 -> INPUT, 1 -> OUTPUT)
-// fd : file descriptor for opened port, -1 for error
-// Description
-// This functions opens the specified serial port and returns file descriptor
-// for the same
-// Examples
-// serial1 = RPI_SerialSetup('/dev/ttyAMA0',9600) //opens port 'USBtty0'
-//
-// See also
-// RPI_SerialClose RPI_SerialSendChar
-//
-//
-// Authors
-// Siddhesh Wani
-// -----------------------------------------------------------------
-
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for RPi.
-fd = 0;
-endfunction
diff --git a/macros/Hardware/RasberryPi/old/buildmacros.sce b/macros/Hardware/RasberryPi/old/buildmacros.sce
deleted file mode 100644
index 2954a424..00000000
--- a/macros/Hardware/RasberryPi/old/buildmacros.sce
+++ /dev/null
@@ -1,4 +0,0 @@
-
-tbx_build_macros(TOOLBOX_NAME, get_absolute_file_path('buildmacros.sce'));
-
-clear tbx_build_macros;
diff --git a/macros/Hardware/RasberryPi/old/names b/macros/Hardware/RasberryPi/old/names
deleted file mode 100644
index fa647761..00000000
--- a/macros/Hardware/RasberryPi/old/names
+++ /dev/null
@@ -1,21 +0,0 @@
-GetRPISupportFunctions
-IsRPISupportFunction
-RPI_DelayMicro
-RPI_DelayMilli
-RPI_DigitalIn
-RPI_DigitalOut
-RPI_DigitalSetup
-RPI_GetMicros
-RPI_GetMillis
-RPI_HardPWMSetClock
-RPI_HardPWMSetMode
-RPI_HardPWMSetRange
-RPI_HardPWMWrite
-RPI_PinISR
-RPI_SerialClose
-RPI_SerialFlush
-RPI_SerialGetChar
-RPI_SerialSendChar
-RPI_SerialSendData
-RPI_SerialSetup
-u16RPISerialDataAvail
diff --git a/macros/Hardware/RasberryPi/old/u16RPISerialDataAvail.sci b/macros/Hardware/RasberryPi/old/u16RPISerialDataAvail.sci
deleted file mode 100644
index 6eb29a1c..00000000
--- a/macros/Hardware/RasberryPi/old/u16RPISerialDataAvail.sci
+++ /dev/null
@@ -1,37 +0,0 @@
-// 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
-// Organization: FOSSEE, IIT Bombay
-// Email: toolbox@scilab.in
-
-function bytes = RPI_SerialDataAvail(fd)
-// Function to get number of data bytes available on serial port specified by
-// file descriptor
-// Calling Sequence
-// RPI_SerialDataAvail(fd)
-//
-// Parameters
-// fd : file descriptor for already opened serial port
-// Description
-// This functions returns number of characters available to read,
-// otherwise reads -1 in case of error. This function can be used to check
-// new data is available on serial port
-// Examples
-// serial = RPI_SerialOpen("/dev/ttyAMA0", 9600);
-// charsToRead = RPI_SerialDataAvail(serial);
-// See also
-// RPI_SerialOpen RPI_SerialGetChar
-//
-//
-// Authors
-// Siddhesh Wani
-// -----------------------------------------------------------------
-
-// This is curretly dummy function. It provides no functionality but is required
-// for providing support for generating C code for RPi.
-
-bytes = 0;
-
-endfunction
\ No newline at end of file
--
cgit
From 29388094e30cae9f11ba82360c1d9bc03b229d10 Mon Sep 17 00:00:00 2001
From: Brijeshcr
Date: Thu, 20 Jul 2017 21:03:09 +0530
Subject: Added Erfcx
---
macros/Hardware/AVR/lib | Bin 0 -> 972 bytes
macros/Hardware/RasberryPi/Digital/lib | Bin 0 -> 600 bytes
macros/Hardware/RasberryPi/I2C/lib | Bin 0 -> 704 bytes
macros/Hardware/RasberryPi/Interrupt/lib | Bin 0 -> 536 bytes
macros/Hardware/RasberryPi/Misc/lib | Bin 0 -> 564 bytes
macros/Hardware/RasberryPi/SPI/lib | Bin 0 -> 584 bytes
macros/Hardware/RasberryPi/Serial/lib | Bin 0 -> 692 bytes
macros/Hardware/RasberryPi/Setup/lib | Bin 0 -> 616 bytes
macros/Hardware/RasberryPi/Shift/lib | Bin 0 -> 568 bytes
macros/Hardware/RasberryPi/Soft/lib | Bin 0 -> 636 bytes
macros/Hardware/RasberryPi/Timing/lib | Bin 0 -> 596 bytes
macros/Hardware/RasberryPi/gertBoard/lib | Bin 0 -> 656 bytes
macros/Hardware/RasberryPi/lcd/lib | Bin 0 -> 776 bytes
macros/Hardware/RasberryPi/lcd128x64/lib | Bin 0 -> 800 bytes
macros/Hardware/RasberryPi/lib | Bin 0 -> 592 bytes
macros/Hardware/RasberryPi/mcp/lib | Bin 0 -> 608 bytes
macros/Hardware/RasberryPi/pcf/lib | Bin 0 -> 536 bytes
macros/Hardware/RasberryPi/piGlow/lib | Bin 0 -> 596 bytes
macros/Hardware/RasberryPi/pinMap/lib | Bin 0 -> 548 bytes
macros/Hardware/RasberryPi/pwm/lib | Bin 0 -> 608 bytes
20 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 macros/Hardware/AVR/lib
create mode 100644 macros/Hardware/RasberryPi/Digital/lib
create mode 100644 macros/Hardware/RasberryPi/I2C/lib
create mode 100644 macros/Hardware/RasberryPi/Interrupt/lib
create mode 100644 macros/Hardware/RasberryPi/Misc/lib
create mode 100644 macros/Hardware/RasberryPi/SPI/lib
create mode 100644 macros/Hardware/RasberryPi/Serial/lib
create mode 100644 macros/Hardware/RasberryPi/Setup/lib
create mode 100644 macros/Hardware/RasberryPi/Shift/lib
create mode 100644 macros/Hardware/RasberryPi/Soft/lib
create mode 100644 macros/Hardware/RasberryPi/Timing/lib
create mode 100644 macros/Hardware/RasberryPi/gertBoard/lib
create mode 100644 macros/Hardware/RasberryPi/lcd/lib
create mode 100644 macros/Hardware/RasberryPi/lcd128x64/lib
create mode 100644 macros/Hardware/RasberryPi/lib
create mode 100644 macros/Hardware/RasberryPi/mcp/lib
create mode 100644 macros/Hardware/RasberryPi/pcf/lib
create mode 100644 macros/Hardware/RasberryPi/piGlow/lib
create mode 100644 macros/Hardware/RasberryPi/pinMap/lib
create mode 100644 macros/Hardware/RasberryPi/pwm/lib
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib
new file mode 100644
index 00000000..ed4c52b8
Binary files /dev/null and b/macros/Hardware/AVR/lib differ
diff --git a/macros/Hardware/RasberryPi/Digital/lib b/macros/Hardware/RasberryPi/Digital/lib
new file mode 100644
index 00000000..ba42ba7c
Binary files /dev/null and b/macros/Hardware/RasberryPi/Digital/lib differ
diff --git a/macros/Hardware/RasberryPi/I2C/lib b/macros/Hardware/RasberryPi/I2C/lib
new file mode 100644
index 00000000..561476c1
Binary files /dev/null and b/macros/Hardware/RasberryPi/I2C/lib differ
diff --git a/macros/Hardware/RasberryPi/Interrupt/lib b/macros/Hardware/RasberryPi/Interrupt/lib
new file mode 100644
index 00000000..97a61acb
Binary files /dev/null and b/macros/Hardware/RasberryPi/Interrupt/lib differ
diff --git a/macros/Hardware/RasberryPi/Misc/lib b/macros/Hardware/RasberryPi/Misc/lib
new file mode 100644
index 00000000..c718615f
Binary files /dev/null and b/macros/Hardware/RasberryPi/Misc/lib differ
diff --git a/macros/Hardware/RasberryPi/SPI/lib b/macros/Hardware/RasberryPi/SPI/lib
new file mode 100644
index 00000000..a16d474e
Binary files /dev/null and b/macros/Hardware/RasberryPi/SPI/lib differ
diff --git a/macros/Hardware/RasberryPi/Serial/lib b/macros/Hardware/RasberryPi/Serial/lib
new file mode 100644
index 00000000..a007f001
Binary files /dev/null and b/macros/Hardware/RasberryPi/Serial/lib differ
diff --git a/macros/Hardware/RasberryPi/Setup/lib b/macros/Hardware/RasberryPi/Setup/lib
new file mode 100644
index 00000000..83655c94
Binary files /dev/null and b/macros/Hardware/RasberryPi/Setup/lib differ
diff --git a/macros/Hardware/RasberryPi/Shift/lib b/macros/Hardware/RasberryPi/Shift/lib
new file mode 100644
index 00000000..2b12025f
Binary files /dev/null and b/macros/Hardware/RasberryPi/Shift/lib differ
diff --git a/macros/Hardware/RasberryPi/Soft/lib b/macros/Hardware/RasberryPi/Soft/lib
new file mode 100644
index 00000000..09ecede9
Binary files /dev/null and b/macros/Hardware/RasberryPi/Soft/lib differ
diff --git a/macros/Hardware/RasberryPi/Timing/lib b/macros/Hardware/RasberryPi/Timing/lib
new file mode 100644
index 00000000..d271c900
Binary files /dev/null and b/macros/Hardware/RasberryPi/Timing/lib differ
diff --git a/macros/Hardware/RasberryPi/gertBoard/lib b/macros/Hardware/RasberryPi/gertBoard/lib
new file mode 100644
index 00000000..e8db080c
Binary files /dev/null and b/macros/Hardware/RasberryPi/gertBoard/lib differ
diff --git a/macros/Hardware/RasberryPi/lcd/lib b/macros/Hardware/RasberryPi/lcd/lib
new file mode 100644
index 00000000..c2b693fa
Binary files /dev/null and b/macros/Hardware/RasberryPi/lcd/lib differ
diff --git a/macros/Hardware/RasberryPi/lcd128x64/lib b/macros/Hardware/RasberryPi/lcd128x64/lib
new file mode 100644
index 00000000..94dfda86
Binary files /dev/null and b/macros/Hardware/RasberryPi/lcd128x64/lib differ
diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib
new file mode 100644
index 00000000..49ed8116
Binary files /dev/null and b/macros/Hardware/RasberryPi/lib differ
diff --git a/macros/Hardware/RasberryPi/mcp/lib b/macros/Hardware/RasberryPi/mcp/lib
new file mode 100644
index 00000000..d411aad8
Binary files /dev/null and b/macros/Hardware/RasberryPi/mcp/lib differ
diff --git a/macros/Hardware/RasberryPi/pcf/lib b/macros/Hardware/RasberryPi/pcf/lib
new file mode 100644
index 00000000..da6a8dad
Binary files /dev/null and b/macros/Hardware/RasberryPi/pcf/lib differ
diff --git a/macros/Hardware/RasberryPi/piGlow/lib b/macros/Hardware/RasberryPi/piGlow/lib
new file mode 100644
index 00000000..3f30f859
Binary files /dev/null and b/macros/Hardware/RasberryPi/piGlow/lib differ
diff --git a/macros/Hardware/RasberryPi/pinMap/lib b/macros/Hardware/RasberryPi/pinMap/lib
new file mode 100644
index 00000000..133363e6
Binary files /dev/null and b/macros/Hardware/RasberryPi/pinMap/lib differ
diff --git a/macros/Hardware/RasberryPi/pwm/lib b/macros/Hardware/RasberryPi/pwm/lib
new file mode 100644
index 00000000..8711baf0
Binary files /dev/null and b/macros/Hardware/RasberryPi/pwm/lib differ
--
cgit
From b58911a949248b09a0597309feb35fbcc25556fd Mon Sep 17 00:00:00 2001
From: Abhinav Dronamraju
Date: Thu, 20 Jul 2017 22:17:24 +0530
Subject: Solved error of nnz
---
macros/Hardware/AVR/lib | Bin 972 -> 0 bytes
macros/Hardware/RasberryPi/Digital/lib | Bin 600 -> 0 bytes
macros/Hardware/RasberryPi/I2C/lib | Bin 704 -> 0 bytes
macros/Hardware/RasberryPi/Interrupt/lib | Bin 536 -> 0 bytes
macros/Hardware/RasberryPi/Misc/lib | Bin 564 -> 0 bytes
macros/Hardware/RasberryPi/SPI/lib | Bin 584 -> 0 bytes
macros/Hardware/RasberryPi/Serial/lib | Bin 692 -> 0 bytes
macros/Hardware/RasberryPi/Setup/lib | Bin 616 -> 0 bytes
macros/Hardware/RasberryPi/Shift/lib | Bin 568 -> 0 bytes
macros/Hardware/RasberryPi/Soft/lib | Bin 636 -> 0 bytes
macros/Hardware/RasberryPi/Timing/lib | Bin 596 -> 0 bytes
macros/Hardware/RasberryPi/gertBoard/lib | Bin 656 -> 0 bytes
macros/Hardware/RasberryPi/lcd/lib | Bin 776 -> 0 bytes
macros/Hardware/RasberryPi/lcd128x64/lib | Bin 800 -> 0 bytes
macros/Hardware/RasberryPi/lib | Bin 592 -> 0 bytes
macros/Hardware/RasberryPi/mcp/lib | Bin 608 -> 0 bytes
macros/Hardware/RasberryPi/pcf/lib | Bin 536 -> 0 bytes
macros/Hardware/RasberryPi/piGlow/lib | Bin 596 -> 0 bytes
macros/Hardware/RasberryPi/pinMap/lib | Bin 548 -> 0 bytes
macros/Hardware/RasberryPi/pwm/lib | Bin 608 -> 0 bytes
20 files changed, 0 insertions(+), 0 deletions(-)
delete mode 100644 macros/Hardware/AVR/lib
delete mode 100644 macros/Hardware/RasberryPi/Digital/lib
delete mode 100644 macros/Hardware/RasberryPi/I2C/lib
delete mode 100644 macros/Hardware/RasberryPi/Interrupt/lib
delete mode 100644 macros/Hardware/RasberryPi/Misc/lib
delete mode 100644 macros/Hardware/RasberryPi/SPI/lib
delete mode 100644 macros/Hardware/RasberryPi/Serial/lib
delete mode 100644 macros/Hardware/RasberryPi/Setup/lib
delete mode 100644 macros/Hardware/RasberryPi/Shift/lib
delete mode 100644 macros/Hardware/RasberryPi/Soft/lib
delete mode 100644 macros/Hardware/RasberryPi/Timing/lib
delete mode 100644 macros/Hardware/RasberryPi/gertBoard/lib
delete mode 100644 macros/Hardware/RasberryPi/lcd/lib
delete mode 100644 macros/Hardware/RasberryPi/lcd128x64/lib
delete mode 100644 macros/Hardware/RasberryPi/lib
delete mode 100644 macros/Hardware/RasberryPi/mcp/lib
delete mode 100644 macros/Hardware/RasberryPi/pcf/lib
delete mode 100644 macros/Hardware/RasberryPi/piGlow/lib
delete mode 100644 macros/Hardware/RasberryPi/pinMap/lib
delete mode 100644 macros/Hardware/RasberryPi/pwm/lib
(limited to 'macros/Hardware')
diff --git a/macros/Hardware/AVR/lib b/macros/Hardware/AVR/lib
deleted file mode 100644
index ed4c52b8..00000000
Binary files a/macros/Hardware/AVR/lib and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/Digital/lib b/macros/Hardware/RasberryPi/Digital/lib
deleted file mode 100644
index ba42ba7c..00000000
Binary files a/macros/Hardware/RasberryPi/Digital/lib and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/I2C/lib b/macros/Hardware/RasberryPi/I2C/lib
deleted file mode 100644
index 561476c1..00000000
Binary files a/macros/Hardware/RasberryPi/I2C/lib and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/Interrupt/lib b/macros/Hardware/RasberryPi/Interrupt/lib
deleted file mode 100644
index 97a61acb..00000000
Binary files a/macros/Hardware/RasberryPi/Interrupt/lib and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/Misc/lib b/macros/Hardware/RasberryPi/Misc/lib
deleted file mode 100644
index c718615f..00000000
Binary files a/macros/Hardware/RasberryPi/Misc/lib and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/SPI/lib b/macros/Hardware/RasberryPi/SPI/lib
deleted file mode 100644
index a16d474e..00000000
Binary files a/macros/Hardware/RasberryPi/SPI/lib and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/Serial/lib b/macros/Hardware/RasberryPi/Serial/lib
deleted file mode 100644
index a007f001..00000000
Binary files a/macros/Hardware/RasberryPi/Serial/lib and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/Setup/lib b/macros/Hardware/RasberryPi/Setup/lib
deleted file mode 100644
index 83655c94..00000000
Binary files a/macros/Hardware/RasberryPi/Setup/lib and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/Shift/lib b/macros/Hardware/RasberryPi/Shift/lib
deleted file mode 100644
index 2b12025f..00000000
Binary files a/macros/Hardware/RasberryPi/Shift/lib and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/Soft/lib b/macros/Hardware/RasberryPi/Soft/lib
deleted file mode 100644
index 09ecede9..00000000
Binary files a/macros/Hardware/RasberryPi/Soft/lib and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/Timing/lib b/macros/Hardware/RasberryPi/Timing/lib
deleted file mode 100644
index d271c900..00000000
Binary files a/macros/Hardware/RasberryPi/Timing/lib and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/gertBoard/lib b/macros/Hardware/RasberryPi/gertBoard/lib
deleted file mode 100644
index e8db080c..00000000
Binary files a/macros/Hardware/RasberryPi/gertBoard/lib and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/lcd/lib b/macros/Hardware/RasberryPi/lcd/lib
deleted file mode 100644
index c2b693fa..00000000
Binary files a/macros/Hardware/RasberryPi/lcd/lib and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/lcd128x64/lib b/macros/Hardware/RasberryPi/lcd128x64/lib
deleted file mode 100644
index 94dfda86..00000000
Binary files a/macros/Hardware/RasberryPi/lcd128x64/lib and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/lib b/macros/Hardware/RasberryPi/lib
deleted file mode 100644
index 49ed8116..00000000
Binary files a/macros/Hardware/RasberryPi/lib and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/mcp/lib b/macros/Hardware/RasberryPi/mcp/lib
deleted file mode 100644
index d411aad8..00000000
Binary files a/macros/Hardware/RasberryPi/mcp/lib and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/pcf/lib b/macros/Hardware/RasberryPi/pcf/lib
deleted file mode 100644
index da6a8dad..00000000
Binary files a/macros/Hardware/RasberryPi/pcf/lib and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/piGlow/lib b/macros/Hardware/RasberryPi/piGlow/lib
deleted file mode 100644
index 3f30f859..00000000
Binary files a/macros/Hardware/RasberryPi/piGlow/lib and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/pinMap/lib b/macros/Hardware/RasberryPi/pinMap/lib
deleted file mode 100644
index 133363e6..00000000
Binary files a/macros/Hardware/RasberryPi/pinMap/lib and /dev/null differ
diff --git a/macros/Hardware/RasberryPi/pwm/lib b/macros/Hardware/RasberryPi/pwm/lib
deleted file mode 100644
index 8711baf0..00000000
Binary files a/macros/Hardware/RasberryPi/pwm/lib and /dev/null differ
--
cgit