diff options
Diffstat (limited to 'src/c/hardware')
-rw-r--r-- | src/c/hardware/rasberrypi/gpio/u8RPIDigitalIns.c | 48 | ||||
-rw-r--r-- | src/c/hardware/rasberrypi/gpio/u8RPIDigitalOuts.c | 45 | ||||
-rw-r--r-- | src/c/hardware/rasberrypi/gpio/u8RPIDigitalSetups.c | 54 | ||||
-rw-r--r-- | src/c/hardware/rasberrypi/includes/RPIPeripheralDigital.h | 14 | ||||
-rw-r--r-- | src/c/hardware/rasberrypi/includes/RPIPeripheralUtil.h | 14 | ||||
-rw-r--r-- | src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralDigital.h | 16 | ||||
-rw-r--r-- | src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralUtil.h | 16 | ||||
-rw-r--r-- | src/c/hardware/rasberrypi/libraries/libgsl.a | bin | 0 -> 11823192 bytes | |||
-rw-r--r-- | src/c/hardware/rasberrypi/util/u16RPIDelayMicros.c | 51 | ||||
-rw-r--r-- | src/c/hardware/rasberrypi/util/u16RPIDelayMillis.c | 51 |
10 files changed, 194 insertions, 115 deletions
diff --git a/src/c/hardware/rasberrypi/gpio/u8RPIDigitalIns.c b/src/c/hardware/rasberrypi/gpio/u8RPIDigitalIns.c index 6f06558..8ce0b3c 100644 --- a/src/c/hardware/rasberrypi/gpio/u8RPIDigitalIns.c +++ b/src/c/hardware/rasberrypi/gpio/u8RPIDigitalIns.c @@ -1,23 +1,31 @@ -// Function to read the state of the gpio pin -// -// Calling Sequence -// u8RPI_DigitalIn(pin) -// -// Parameters -// pin : pin of RPi to be read -// -// Returns -// state: Current state of the specified gpio pin -// -// Description -// There are few pins available on RPi as Gpio or digital i/o. These pins can be used as digital output or input. Using this function, current state (low/high) of any gpio pin can be read. 'pin' name must be provided from list provided. Please refer '' for complete list of pins. 'state' can be 0 or 1 depending upon state of the pin (Low/High). RPI_DigitalSetup with appropriate arguments must be called before using this function. -// Examples -// u8RPI_DigitalIn(RPI_GPIO_P1_03,1) //Returns the state of pin 3 of header P1 -// -// -// Authors -// Siddhesh Wani -// +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you 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 +*/ + +/* Function to read the state of the gpio pin + + Calling Sequence + u8RPI_DigitalIn(pin) + + Parameters + pin : pin of RPi to be read + + Returns + state: Current state of the specified gpio pin + + Description + There are few pins available on RPi as Gpio or digital i/o. These pins can be used as digital output or input. Using this function, current state (low/high) of any gpio pin can be read. 'pin' name must be provided from list provided. Please refer '' for complete list of pins. 'state' can be 0 or 1 depending upon state of the pin (Low/High). RPI_DigitalSetup with appropriate arguments must be called before using this function. + Examples + u8RPI_DigitalIn(RPI_GPIO_P1_03,1) //Returns the state of pin 3 of header P1 +*/ #include "types.h" #include "RPIPeripheralDigital.h" diff --git a/src/c/hardware/rasberrypi/gpio/u8RPIDigitalOuts.c b/src/c/hardware/rasberrypi/gpio/u8RPIDigitalOuts.c index 375ca89..d97f458 100644 --- a/src/c/hardware/rasberrypi/gpio/u8RPIDigitalOuts.c +++ b/src/c/hardware/rasberrypi/gpio/u8RPIDigitalOuts.c @@ -1,21 +1,30 @@ -// Function to change the output state of the gpio pin -// -// Calling Sequence -// u8RPI_DigitalOuts(pin,state) -// -// Parameters -// pin : pin of RPi to be used -// state : desired output state for pin (0 -> LOW, 1 -> HIGH) -// -// Description -// There are few pins available on RPi as Gpio or digital i/o. 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. 'state' can be 0 or 1 depending upon desired output (Low/High). RPI_DigitalSetup with appropriate arguments must be called before using this function. -// Examples -// u8RPI_DigitalOuts(RPI_GPIO_P1_03,1) //Sets pin 3 of header P1 as 'high' output -// -// -// Authors -// Siddhesh Wani -// +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you 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 +*/ + +/* Function to change the output state of the gpio pin + + Calling Sequence + u8RPI_DigitalOuts(pin,state) + + Parameters + pin : pin of RPi to be used + state : desired output state for pin (0 -> LOW, 1 -> HIGH) + + Description + There are few pins available on RPi as Gpio or digital i/o. 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. 'state' can be 0 or 1 depending upon desired output (Low/High). RPI_DigitalSetup with appropriate arguments must be called before using this function. + Examples + u8RPI_DigitalOuts(RPI_GPIO_P1_03,1) //Sets pin 3 of header P1 as 'high' output +*/ + #include "types.h" #include "RPIPeripheralDigital.h" diff --git a/src/c/hardware/rasberrypi/gpio/u8RPIDigitalSetups.c b/src/c/hardware/rasberrypi/gpio/u8RPIDigitalSetups.c index 277c620..657df3a 100644 --- a/src/c/hardware/rasberrypi/gpio/u8RPIDigitalSetups.c +++ b/src/c/hardware/rasberrypi/gpio/u8RPIDigitalSetups.c @@ -1,27 +1,33 @@ -// Function to setup digital pins. -// -// Calling Sequence -// u8RPI_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. +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you 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 +*/ + +/* Function to setup digital pins. + + Calling Sequence + u8RPI_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 +*/ + #include "types.h" #include "RPIPeripheralDigital.h" diff --git a/src/c/hardware/rasberrypi/includes/RPIPeripheralDigital.h b/src/c/hardware/rasberrypi/includes/RPIPeripheralDigital.h index 575a8b4..87fe7dc 100644 --- a/src/c/hardware/rasberrypi/includes/RPIPeripheralDigital.h +++ b/src/c/hardware/rasberrypi/includes/RPIPeripheralDigital.h @@ -1,3 +1,15 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you 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 +*/ + /* This file declares functions and constants related to GPIO pins*/ #ifndef __RPIPERIPHERALGPIO_H__ @@ -19,4 +31,4 @@ uint8 u8RPIDigitalIns(uint8 pin); } /* extern "C" */ #endif -#endif //__RPIPERIPHERALGPIO_H__ +#endif /*__RPIPERIPHERALGPIO_H__*/ diff --git a/src/c/hardware/rasberrypi/includes/RPIPeripheralUtil.h b/src/c/hardware/rasberrypi/includes/RPIPeripheralUtil.h index 809595f..0b20ad6 100644 --- a/src/c/hardware/rasberrypi/includes/RPIPeripheralUtil.h +++ b/src/c/hardware/rasberrypi/includes/RPIPeripheralUtil.h @@ -1,3 +1,15 @@ +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you 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 +*/ + /* This file declares functions and constants related to rasberrypi*/ #ifndef __RPIPERIPHERALUTIL_H__ @@ -17,4 +29,4 @@ uint8 u16RPIDelayMicros(uint16 time); } /* extern "C" */ #endif -#endif //__RPIPERIPHERALUTIL_H__ +#endif /*__RPIPERIPHERALUTIL_H__*/ diff --git a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralDigital.h b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralDigital.h index 022bed5..056f3cb 100644 --- a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralDigital.h +++ b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralDigital.h @@ -1,8 +1,14 @@ -//This file defines constants corresponding to gpios. -// -// Authors -// Siddhesh Wani -// +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you 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 +*/ #ifndef __INT_RPIPERIPHERALGPIO_H__ #define __INT_RPIPERIPHERALGPIO_H__ diff --git a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralUtil.h b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralUtil.h index 92020f9..c53db3b 100644 --- a/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralUtil.h +++ b/src/c/hardware/rasberrypi/interfaces/int_RPIPeripheralUtil.h @@ -1,7 +1,15 @@ -// -// Authors -// Siddhesh Wani -// +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you 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 +*/ + #ifndef __INT_RPIPERIPHERALUTIL_H__ #define __INT_RPIPERIPHERALUTIL_H__ diff --git a/src/c/hardware/rasberrypi/libraries/libgsl.a b/src/c/hardware/rasberrypi/libraries/libgsl.a Binary files differnew file mode 100644 index 0000000..1eb5d60 --- /dev/null +++ b/src/c/hardware/rasberrypi/libraries/libgsl.a diff --git a/src/c/hardware/rasberrypi/util/u16RPIDelayMicros.c b/src/c/hardware/rasberrypi/util/u16RPIDelayMicros.c index e564d88..f29635b 100644 --- a/src/c/hardware/rasberrypi/util/u16RPIDelayMicros.c +++ b/src/c/hardware/rasberrypi/util/u16RPIDelayMicros.c @@ -1,24 +1,33 @@ -// Function to insert some delay in code execution. -// -// Calling Sequence -// u16RPIDelayMicros(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 -// u16RPIDelayMicros(100) //This will delay the execution of next code by 100 ms. -// -// -// Authors -// Siddhesh Wani -// +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you 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 +*/ + +/* Function to insert some delay in code execution. + + Calling Sequence + u16RPIDelayMicros(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 + u16RPIDelayMicros(100) //This will delay the execution of next code by 100 ms. +*/ + #include "types.h" #include "RPIPeripheralUtil.h" diff --git a/src/c/hardware/rasberrypi/util/u16RPIDelayMillis.c b/src/c/hardware/rasberrypi/util/u16RPIDelayMillis.c index bc2e6dd..f03e8ba 100644 --- a/src/c/hardware/rasberrypi/util/u16RPIDelayMillis.c +++ b/src/c/hardware/rasberrypi/util/u16RPIDelayMillis.c @@ -1,24 +1,33 @@ -// Function to insert some delay in code execution. -// -// Calling Sequence -// u16RPIDelayMillis(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.'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 -// u16RPIDelayMillis(100) //This will delay the execution of next code by 100 ms. -// -// -// Authors -// Siddhesh Wani -// +/* Copyright (C) 2016 - IIT Bombay - FOSSEE + + This file must be used under the terms of the CeCILL. + This source file is licensed as described in the file COPYING, which + you 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 +*/ + +/* Function to insert some delay in code execution. + + Calling Sequence + u16RPIDelayMillis(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.'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 + u16RPIDelayMillis(100) //This will delay the execution of next code by 100 ms. +*/ + #include "types.h" #include "RPIPeripheralUtil.h" |