summaryrefslogtreecommitdiff
path: root/macros/Hardware/RasberryPi/RPI_DigitalOut.sci
diff options
context:
space:
mode:
Diffstat (limited to 'macros/Hardware/RasberryPi/RPI_DigitalOut.sci')
-rw-r--r--macros/Hardware/RasberryPi/RPI_DigitalOut.sci21
1 files changed, 19 insertions, 2 deletions
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalOut.sci b/macros/Hardware/RasberryPi/RPI_DigitalOut.sci
index 4836f54..dde3c93 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