diff options
author | imushir | 2016-02-09 17:00:34 +0530 |
---|---|---|
committer | imushir | 2016-02-09 17:00:34 +0530 |
commit | 65ca99dd846281e3d1c3066697ad260df0d0909e (patch) | |
tree | 53b01af3e50678970b009c774479bc43b4c15bc4 /2.3-1/src/c/hardware/rasberrypi/gpio/u8RPIDigitalOuts.c | |
parent | a6efab1a42eda8c1e3902c2f2d030a9cb9cfd25e (diff) | |
parent | 58b8656a350fed1a1e59caa484e6d9967dd1bc4d (diff) | |
download | Scilab2C-65ca99dd846281e3d1c3066697ad260df0d0909e.tar.gz Scilab2C-65ca99dd846281e3d1c3066697ad260df0d0909e.tar.bz2 Scilab2C-65ca99dd846281e3d1c3066697ad260df0d0909e.zip |
merged RPi & diag
Diffstat (limited to '2.3-1/src/c/hardware/rasberrypi/gpio/u8RPIDigitalOuts.c')
-rw-r--r-- | 2.3-1/src/c/hardware/rasberrypi/gpio/u8RPIDigitalOuts.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/2.3-1/src/c/hardware/rasberrypi/gpio/u8RPIDigitalOuts.c b/2.3-1/src/c/hardware/rasberrypi/gpio/u8RPIDigitalOuts.c new file mode 100644 index 00000000..375ca891 --- /dev/null +++ b/2.3-1/src/c/hardware/rasberrypi/gpio/u8RPIDigitalOuts.c @@ -0,0 +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 +// + +#include "types.h" +#include "RPIPeripheralDigital.h" + + +uint8 u8RPIDigitalOuts(uint8 pin, uint8 state) +{ + if (state == 0) //low output + bcm2835_gpio_clr(pin); + if (state == 1) //high output + bcm2835_gpio_set(pin); +} |