summaryrefslogtreecommitdiff
path: root/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
diff options
context:
space:
mode:
Diffstat (limited to 'macros/Hardware/RasberryPi/RPI_DigitalSetup.sci')
-rw-r--r--macros/Hardware/RasberryPi/RPI_DigitalSetup.sci15
1 files changed, 10 insertions, 5 deletions
diff --git a/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci b/macros/Hardware/RasberryPi/RPI_DigitalSetup.sci
index 5ce48f0..aede0b7 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