Updated to latest WiringPi
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..584c8ce
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,8 @@
+all: bindings
+ python setup.py build
+
+bindings:
+ swig2.0 -python wiringpi.i
+
+install:
+ sudo python setup.py install
diff --git a/WiringPi/People b/WiringPi/People
index 92d1ea4..b339494 100644
--- a/WiringPi/People
+++ b/WiringPi/People
@@ -28,3 +28,6 @@
Andre Crone
Suggested the __WIRING_PI.H__ round wiringPi.h
+
+Rik Teerling
+ Pointing out some silly mistooks in the I2C code...
diff --git a/WiringPi/build b/WiringPi/build
index 776c756..bac483a 100755
--- a/WiringPi/build
+++ b/WiringPi/build
@@ -1,7 +1,6 @@
-#!/bin/bash
+#!/bin/sh
-check-make-ok()
-{
+check_make_ok() {
if [ $? != 0 ]; then
echo ""
echo "Make Failed..."
@@ -28,6 +27,8 @@
echo -n "PiFace: " ; make clean
cd ../q2w
echo -n "Quick2Wire: " ; make clean
+ cd ../PiGlow
+ echo -n "PiGlow: " ; make clean
exit
fi
@@ -50,27 +51,39 @@
echo "WiringPi Library"
cd wiringPi
sudo make uninstall
- make
- check-make-ok
- sudo make install
- check-make-ok
+ if [ x$1 = "xstatic" ]; then
+ make static
+ check_make_ok
+ sudo make install-static
+ else
+ make
+ check_make_ok
+ sudo make install
+ fi
+ check_make_ok
echo
echo "WiringPi Devices Library"
cd ../devLib
sudo make uninstall
- make
- check-make-ok
- sudo make install
- check-make-ok
+ if [ x$1 = "xstatic" ]; then
+ make static
+ check_make_ok
+ sudo make install-static
+ else
+ make
+ check_make_ok
+ sudo make install
+ fi
+ check_make_ok
echo
echo "GPIO Utility"
cd ../gpio
make
- check-make-ok
+ check_make_ok
sudo make install
- check-make-ok
+ check_make_ok
# echo
# echo "Examples"
@@ -81,7 +94,10 @@
echo
echo All Done.
echo ""
-echo "NOTE: This is wiringPi v2, and if you need to use the lcd, Piface,"
-echo " Gertboard, MaxDetext, etc. routines then you must change your"
-echo " compile scripts to add -lwiringPiDev"
+echo "NOTE: To compile programs with wiringPi, you need to add:"
+echo " -lwiringPi"
+echo " to your compile line(s) To use the Gertboard, MaxDetect, etc."
+echo " code (the devLib), you need to also add:"
+echo " -lwiringPiDev"
+echo " to your compile line(s)."
echo ""
diff --git a/WiringPi/devLib/Makefile b/WiringPi/devLib/Makefile
index a106d93..a3c0d42 100644
--- a/WiringPi/devLib/Makefile
+++ b/WiringPi/devLib/Makefile
@@ -42,7 +42,8 @@
SRC = ds1302.c maxdetect.c piNes.c \
gertboard.c piFace.c \
- lcd128x64.c lcd.c
+ lcd128x64.c lcd.c \
+ piGlow.c
OBJ = $(SRC:.c=.o)
@@ -86,6 +87,7 @@
@install -m 0644 piFace.h $(DESTDIR)$(PREFIX)/include
@install -m 0644 lcd128x64.h $(DESTDIR)$(PREFIX)/include
@install -m 0644 lcd.h $(DESTDIR)$(PREFIX)/include
+ @install -m 0644 piGlow.h $(DESTDIR)$(PREFIX)/include
.PHONEY: install
install: $(DYNAMIC) install-headers
@@ -111,6 +113,7 @@
@rm -f $(DESTDIR)$(PREFIX)/include/piFace.h
@rm -f $(DESTDIR)$(PREFIX)/include/lcd128x64.h
@rm -f $(DESTDIR)$(PREFIX)/include/lcd.h
+ @rm -f $(DESTDIR)$(PREFIX)/include/piGlow.h
@rm -f $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.*
@ldconfig
@@ -128,3 +131,4 @@
piFace.o: piFace.h
lcd128x64.o: font.h lcd128x64.h
lcd.o: lcd.h
+piGlow.o: piGlow.h
diff --git a/WiringPi/examples/Makefile b/WiringPi/examples/Makefile
index 8cc256f..571e341 100644
--- a/WiringPi/examples/Makefile
+++ b/WiringPi/examples/Makefile
@@ -36,13 +36,14 @@
###############################################################################
SRC = blink.c blink8.c blink12.c \
+ blink12drcs.c \
pwm.c \
speed.c wfi.c isr.c isr-osc.c \
lcd.c lcd-adafruit.c clock.c \
nes.c \
softPwm.c softTone.c \
delayTest.c serialRead.c serialTest.c okLed.c ds1302.c \
- rht03.c
+ rht03.c piglow.c
OBJ = $(SRC:.c=.o)
@@ -63,6 +64,10 @@
@echo [link]
@$(CC) -o $@ blink8.o $(LDFLAGS) $(LDLIBS)
+blink12drcs: blink12drcs.o
+ @echo [link]
+ @$(CC) -o $@ blink12drcs.o $(LDFLAGS) $(LDLIBS)
+
blink12: blink12.o
@echo [link]
@$(CC) -o $@ blink12.o $(LDFLAGS) $(LDLIBS)
@@ -139,6 +144,10 @@
@echo [link]
@$(CC) -o $@ ds1302.o $(LDFLAGS) $(LDLIBS)
+piglow: piglow.o
+ @echo [link]
+ @$(CC) -o $@ piglow.o $(LDFLAGS) $(LDLIBS)
+
.c.o:
@echo [CC] $<
diff --git a/WiringPi/examples/PiGlow/Makefile b/WiringPi/examples/PiGlow/Makefile
new file mode 100644
index 0000000..8d31141
--- /dev/null
+++ b/WiringPi/examples/PiGlow/Makefile
@@ -0,0 +1,79 @@
+#
+# Makefile:
+# wiringPi - Wiring Compatable library for the Raspberry Pi
+# https://projects.drogon.net/wiring-pi
+#
+# Copyright (c) 2012-2013 Gordon Henderson
+#################################################################################
+# This file is part of wiringPi:
+# Wiring Compatable library for the Raspberry Pi
+#
+# wiringPi is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# wiringPi is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
+#################################################################################
+
+
+#DEBUG = -g -O0
+DEBUG = -O3
+CC = gcc
+INCLUDE = -I/usr/local/include
+CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
+
+LDFLAGS = -L/usr/local/lib
+LDLIBS = -lwiringPi -lwiringPiDev -lpthread -lm
+
+# Should not alter anything below this line
+###############################################################################
+
+SRC = piGlow0.c piGlow1.c piglow.c
+
+OBJ = $(SRC:.c=.o)
+
+BINS = $(SRC:.c=)
+
+all: $(BINS)
+
+piGlow0: piGlow0.o
+ @echo [link]
+ @$(CC) -o $@ piGlow0.o $(LDFLAGS) $(LDLIBS)
+
+piGlow1: piGlow1.o
+ @echo [link]
+ @$(CC) -o $@ piGlow1.o $(LDFLAGS) $(LDLIBS)
+
+piglow: piglow.o
+ @echo [link]
+ @$(CC) -o $@ piglow.o $(LDFLAGS) $(LDLIBS)
+
+.c.o:
+ @echo [CC] $<
+ @$(CC) -c $(CFLAGS) $< -o $@
+
+clean:
+ @echo "[Clean]"
+ @rm -f $(OBJ) *~ core tags $(BINS)
+
+tags: $(SRC)
+ @echo [ctags]
+ @ctags $(SRC)
+
+install: piglow
+ @echo Installing piglow into /usr/local/bin
+ @cp -a piglow /usr/local/bin/piglow
+ @chmod 755 /usr/local/bin/piglow
+ @echo Done. Remember to load the I2C drivers!
+
+depend:
+ makedepend -Y $(SRC)
+
+# DO NOT DELETE
diff --git a/WiringPi/examples/PiGlow/piGlow0.c b/WiringPi/examples/PiGlow/piGlow0.c
new file mode 100644
index 0000000..d3fe4b9
--- /dev/null
+++ b/WiringPi/examples/PiGlow/piGlow0.c
@@ -0,0 +1,51 @@
+/*
+ * piglow.c:
+ * Very simple demonstration of the PiGlow board.
+ * This uses the SN3218 directly - soon there will be a new PiGlow
+ * devLib device which will handle the PiGlow board on a more easy
+ * to use manner...
+ *
+ * Copyright (c) 2013 Gordon Henderson.
+ ***********************************************************************
+ * This file is part of wiringPi:
+ * https://projects.drogon.net/raspberry-pi/wiringpi/
+ *
+ * wiringPi is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * wiringPi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
+ ***********************************************************************
+ */
+
+#include <wiringPi.h>
+#include <sn3218.h>
+
+#define LED_BASE 533
+
+int main (void)
+{
+ int i, j ;
+
+ wiringPiSetupSys () ;
+
+ sn3218Setup (LED_BASE) ;
+
+ for (;;)
+ {
+ for (i = 0 ; i < 256 ; ++i)
+ for (j = 0 ; j < 18 ; ++j)
+ analogWrite (LED_BASE + j, i) ;
+
+ for (i = 255 ; i >= 0 ; --i)
+ for (j = 0 ; j < 18 ; ++j)
+ analogWrite (LED_BASE + j, i) ;
+ }
+}
diff --git a/WiringPi/examples/PiGlow/piGlow1.c b/WiringPi/examples/PiGlow/piGlow1.c
new file mode 100644
index 0000000..a00b31e
--- /dev/null
+++ b/WiringPi/examples/PiGlow/piGlow1.c
@@ -0,0 +1,258 @@
+/*
+ * piGlow1.c:
+ * Very simple demonstration of the PiGlow board.
+ * This uses the piGlow devLib.
+ *
+ * Copyright (c) 2013 Gordon Henderson.
+ ***********************************************************************
+ * This file is part of wiringPi:
+ * https://projects.drogon.net/raspberry-pi/wiringpi/
+ *
+ * wiringPi is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * wiringPi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
+ ***********************************************************************
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <poll.h>
+
+#include <wiringPi.h>
+#include <piGlow.h>
+
+#define PIGLOW_BASE 533
+
+#ifndef TRUE
+# define TRUE (1==1)
+# define FALSE (!TRUE)
+#endif
+
+
+/*
+ * keypressed: clearKeypressed:
+ * Simple but effective ways to tell if the enter key has been pressed
+ *********************************************************************************
+ */
+
+static int keypressed (void)
+{
+ struct pollfd polls ;
+
+ polls.fd = fileno (stdin) ;
+ polls.events = POLLIN ;
+
+ return poll (&polls, 1, 0) != 0 ;
+}
+
+static void clearKeypressed (void)
+{
+ while (keypressed ())
+ (void)getchar () ;
+}
+
+
+/*
+ * pulseLed:
+ * Pulses the LED at position leg, ring from off to a max. value,
+ * then off again
+ *********************************************************************************
+ */
+
+static void pulseLed (int leg, int ring)
+{
+ int i ;
+
+ for (i = 0 ; i < 140 ; ++i)
+ {
+ piGlow1 (leg, ring, i) ;
+ delay (1) ;
+ }
+ delay (10) ;
+ for (i = 140 ; i >= 0 ; --i)
+ {
+ piGlow1 (leg, ring, i) ;
+ delay (1) ;
+ }
+}
+
+/*
+ * pulseLeg:
+ * Same as above, but a whole leg at a time
+ *********************************************************************************
+ */
+
+static void pulseLeg (int leg)
+{
+ int i ;
+
+ for (i = 0 ; i < 140 ; ++i)
+ {
+ piGlowLeg (leg, i) ; delay (1) ;
+ }
+ delay (10) ;
+ for (i = 140 ; i >= 0 ; --i)
+ {
+ piGlowLeg (leg, i) ; delay (1) ;
+ }
+}
+
+
+/*
+ * pulse Ring:
+ * Same as above, but a whole ring at a time
+ *********************************************************************************
+ */
+
+static void pulseRing (int ring)
+{
+ int i ;
+
+ for (i = 0 ; i < 140 ; ++i)
+ {
+ piGlowRing (ring, i) ; delay (1) ;
+ }
+ delay (10) ;
+ for (i = 140 ; i >= 0 ; --i)
+ {
+ piGlowRing (ring, i) ; delay (1) ;
+ }
+}
+
+#define LEG_STEPS 3
+
+static int legSequence [] =
+{
+ 4, 12, 99,
+ 99, 4, 12,
+ 12, 99, 4,
+} ;
+
+
+#define RING_STEPS 16
+
+static int ringSequence [] =
+{
+ 0, 0, 0, 0, 0, 64,
+ 0, 0, 0, 0, 64, 64,
+ 0, 0, 0, 64, 64, 0,
+ 0, 0, 64, 64, 0, 0,
+ 0, 64, 64, 0, 0, 0,
+ 64, 64, 0, 0, 0, 0,
+ 64, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 64, 0, 0, 0, 0, 0,
+ 64, 64, 0, 0, 0, 0,
+ 0, 64, 64, 0, 0, 0,
+ 0, 0, 64, 64, 0, 0,
+ 0, 0, 0, 64, 64, 0,
+ 0, 0, 0, 0, 64, 64,
+ 0, 0, 0, 0, 0, 64,
+ 0, 0, 0, 0, 0, 0,
+} ;
+
+/*
+ * main:
+ * Our little demo prgoram
+ *********************************************************************************
+ */
+
+int main (void)
+{
+ int i ;
+ int step, ring, leg ;
+
+// Always initialise wiringPi:
+// Use the Sys method if you don't need to run as root
+
+ wiringPiSetupSys () ;
+
+// Initialise the piGlow devLib with our chosen pin base
+
+ piGlowSetup (1) ;
+
+// LEDs, one at a time
+
+ printf ("LEDs, one at a time\n") ;
+ for (; !keypressed () ;)
+ for (leg = 0 ; leg < 3 ; ++leg)
+ {
+ for (ring = 0 ; ring < 6 ; ++ring)
+ {
+ pulseLed (leg, ring) ;
+ if (keypressed ())
+ break ;
+ }
+ if (keypressed ())
+ break ;
+ }
+ clearKeypressed () ;
+
+// Rings, one at a time
+
+ printf ("Rings, one at a time\n") ;
+ for (; !keypressed () ;)
+ for (ring = 0 ; ring < 6 ; ++ring)
+ {
+ pulseRing (ring) ;
+ if (keypressed ())
+ break ;
+ }
+ clearKeypressed () ;
+
+// Legs, one at a time
+
+ printf ("Legs, one at a time\n") ;
+ for (; !keypressed () ;)
+ for (leg = 0 ; leg < 3 ; ++leg)
+ {
+ pulseLeg (leg) ;
+ if (keypressed ())
+ break ;
+ }
+ clearKeypressed () ;
+
+ delay (1000) ;
+
+// Sequence - alternating rings, legs and random
+
+ printf ("Sequence now\n") ;
+ for (; !keypressed () ;)
+ {
+ for (i = 0 ; i < 20 ; ++i)
+ for (step = 0 ; step < LEG_STEPS ; ++step)
+ {
+ for (leg = 0 ; leg < 3 ; ++leg)
+ piGlowLeg (leg, legSequence [step * 3 + leg]) ;
+ delay (80) ;
+ }
+
+ for (i = 0 ; i < 10 ; ++i)
+ for (step = 0 ; step < RING_STEPS ; ++step)
+ {
+ for (ring = 0 ; ring < 6 ; ++ring)
+ piGlowRing (ring, ringSequence [step * 6 + ring]) ;
+ delay (80) ;
+ }
+
+ for (i = 0 ; i < 1000 ; ++i)
+ {
+ leg = random () % 3 ;
+ ring = random () % 6 ;
+ piGlow1 (leg, ring, random () % 256) ;
+ delay (5) ;
+ piGlow1 (leg, ring, 0) ;
+ }
+ }
+
+ return 0 ;
+}
diff --git a/WiringPi/examples/PiGlow/piglow.c b/WiringPi/examples/PiGlow/piglow.c
new file mode 100644
index 0000000..e6a2db3
--- /dev/null
+++ b/WiringPi/examples/PiGlow/piglow.c
@@ -0,0 +1,176 @@
+/*
+ * piglow.c:
+ * Very simple demonstration of the PiGlow board.
+ * This uses the piGlow devLib.
+ *
+ * Copyright (c) 2013 Gordon Henderson.
+ ***********************************************************************
+ * This file is part of wiringPi:
+ * https://projects.drogon.net/raspberry-pi/wiringpi/
+ *
+ * wiringPi is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * wiringPi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
+ ***********************************************************************
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#ifndef TRUE
+# define TRUE (1==1)
+# define FALSE (!TRUE)
+#endif
+
+#include <wiringPi.h>
+#include <piGlow.h>
+
+static void failUsage (void)
+{
+ fprintf (stderr, "Usage examples:\n") ;
+ fprintf (stderr, " piglow off # All off\n") ;
+ fprintf (stderr, " piglow red 50 # Light the 3 red LEDs to 50%%\n") ;
+ fprintf (stderr, " colours are: red, yellow, orange, green, blue and white\n") ;
+ fprintf (stderr, " piglow all 75 # Light all to 75%%\n") ;
+ fprintf (stderr, " piglow leg 0 25 # Light leg 0 to 25%%\n") ;
+ fprintf (stderr, " piglow ring 3 100 # Light ring 3 to 100%%\n") ;
+ fprintf (stderr, " piglow led 2 5 100 # Light the single LED on Leg 2, ring 5 to 100%%\n") ;
+
+ exit (EXIT_FAILURE) ;
+}
+
+static int getPercent (char *typed)
+{
+ int percent ;
+
+ percent = atoi (typed) ;
+ if ((percent < 0) || (percent > 100))
+ {
+ fprintf (stderr, "piglow: percent value out of range\n") ;
+ exit (EXIT_FAILURE) ;
+ }
+ return (percent * 255) / 100 ;
+}
+
+
+/*
+ * main:
+ * Our little demo prgoram
+ *********************************************************************************
+ */
+
+int main (int argc, char *argv [])
+{
+ int percent ;
+ int ring, leg ;
+
+// Always initialise wiringPi:
+// Use the Sys method if you don't need to run as root
+
+ wiringPiSetupSys () ;
+
+// Initialise the piGlow devLib
+
+ piGlowSetup (FALSE) ;
+
+ if (argc == 1)
+ failUsage () ;
+
+ if ((argc == 2) && (strcasecmp (argv [1], "off") == 0))
+ {
+ for (leg = 0 ; leg < 3 ; ++leg)
+ piGlowLeg (leg, 0) ;
+ return 0 ;
+ }
+
+ if (argc == 3)
+ {
+ percent = getPercent (argv [2]) ;
+
+ /**/ if (strcasecmp (argv [1], "red") == 0)
+ piGlowRing (PIGLOW_RED, percent) ;
+ else if (strcasecmp (argv [1], "yellow") == 0)
+ piGlowRing (PIGLOW_YELLOW, percent) ;
+ else if (strcasecmp (argv [1], "orange") == 0)
+ piGlowRing (PIGLOW_ORANGE, percent) ;
+ else if (strcasecmp (argv [1], "green") == 0)
+ piGlowRing (PIGLOW_GREEN, percent) ;
+ else if (strcasecmp (argv [1], "blue") == 0)
+ piGlowRing (PIGLOW_BLUE, percent) ;
+ else if (strcasecmp (argv [1], "white") == 0)
+ piGlowRing (PIGLOW_WHITE, percent) ;
+ else if (strcasecmp (argv [1], "all") == 0)
+ for (ring = 0 ; ring < 6 ; ++ring)
+ piGlowRing (ring, percent) ;
+ else
+ {
+ fprintf (stderr, "piglow: invalid colour\n") ;
+ exit (EXIT_FAILURE) ;
+ }
+ return 0 ;
+ }
+
+ if (argc == 4)
+ {
+ /**/ if (strcasecmp (argv [1], "leg") == 0)
+ {
+ leg = atoi (argv [2]) ;
+ if ((leg < 0) || (leg > 2))
+ {
+ fprintf (stderr, "piglow: leg value out of range\n") ;
+ exit (EXIT_FAILURE) ;
+ }
+ percent = getPercent (argv [3]) ;
+ piGlowLeg (leg, percent) ;
+ }
+ else if (strcasecmp (argv [1], "ring") == 0)
+ {
+ ring = atoi (argv [2]) ;
+ if ((ring < 0) || (ring > 5))
+ {
+ fprintf (stderr, "piglow: ring value out of range\n") ;
+ exit (EXIT_FAILURE) ;
+ }
+ percent = getPercent (argv [3]) ;
+ piGlowRing (ring, percent) ;
+ }
+ return 0 ;
+ }
+
+ if (argc == 5)
+ {
+ if (strcasecmp (argv [1], "led") != 0)
+ failUsage () ;
+
+ leg = atoi (argv [2]) ;
+ if ((leg < 0) || (leg > 2))
+ {
+ fprintf (stderr, "piglow: leg value out of range\n") ;
+ exit (EXIT_FAILURE) ;
+ }
+ ring = atoi (argv [3]) ;
+ if ((ring < 0) || (ring > 5))
+ {
+ fprintf (stderr, "piglow: ring value out of range\n") ;
+ exit (EXIT_FAILURE) ;
+ }
+ percent = getPercent (argv [4]) ;
+ piGlow1 (leg, ring, percent) ;
+ return 0 ;
+ }
+
+ failUsage () ;
+ return 0 ;
+}
+
+
diff --git a/WiringPi/examples/blink.sh b/WiringPi/examples/blink.sh
index 2aa378a..7755383 100644
--- a/WiringPi/examples/blink.sh
+++ b/WiringPi/examples/blink.sh
@@ -25,7 +25,7 @@
# LED Pin - wiringPi pin 0 is BCM_GPIO 17.
-LED=0
+PIN=0
gpio mode $PIN out
diff --git a/WiringPi/examples/blink12drcs.c b/WiringPi/examples/blink12drcs.c
new file mode 100644
index 0000000..6ee11fd
--- /dev/null
+++ b/WiringPi/examples/blink12drcs.c
@@ -0,0 +1,125 @@
+/*
+ * blink12drcs.c:
+ * Simple sequence over the first 12 GPIO pins - LEDs
+ * Aimed at the Gertboard, but it's fairly generic.
+ * This version uses DRC totalk to the ATmega on the Gertboard
+ *
+ * Copyright (c) 2012-2013 Gordon Henderson. <projects@drogon.net>
+ ***********************************************************************
+ * This file is part of wiringPi:
+ * https://projects.drogon.net/raspberry-pi/wiringpi/
+ *
+ * wiringPi is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * wiringPi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
+ ***********************************************************************
+ */
+
+#include <stdio.h>
+#include <wiringPi.h>
+#include <drcSerial.h>
+
+#define GERT_BASE 100
+
+static int pinMap [] =
+{
+ 0, 1, 2, 3, // Pi Native
+ GERT_BASE + 2, GERT_BASE + 3, GERT_BASE + 4, GERT_BASE + 5,
+ GERT_BASE + 6, GERT_BASE + 7, GERT_BASE + 8, GERT_BASE + 9,
+} ;
+
+// Simple sequencer data
+// Triplets of LED, On/Off and delay
+
+
+int data [] =
+{
+ 0, 1, 1,
+ 1, 1, 1,
+ 0, 0, 0, 2, 1, 1,
+ 1, 0, 0, 3, 1, 1,
+ 2, 0, 0, 4, 1, 1,
+ 3, 0, 0, 5, 1, 1,
+ 4, 0, 0, 6, 1, 1,
+ 5, 0, 0, 7, 1, 1,
+ 6, 0, 0, 8, 1, 1,
+ 7, 0, 0, 9, 1, 1,
+ 8, 0, 0, 10, 1, 1,
+ 9, 0, 0, 11, 1, 1,
+ 10, 0, 1,
+ 11, 0, 1,
+
+ 0, 0, 1, // Extra delay
+
+// Back again
+
+ 11, 1, 1,
+ 10, 1, 1,
+ 11, 0, 0, 9, 1, 1,
+ 10, 0, 0, 8, 1, 1,
+ 9, 0, 0, 7, 1, 1,
+ 8, 0, 0, 6, 1, 1,
+ 7, 0, 0, 5, 1, 1,
+ 6, 0, 0, 4, 1, 1,
+ 5, 0, 0, 3, 1, 1,
+ 4, 0, 0, 2, 1, 1,
+ 3, 0, 0, 1, 1, 1,
+ 2, 0, 0, 0, 1, 1,
+ 1, 0, 1,
+ 0, 0, 1,
+
+ 0, 0, 1, // Extra delay
+
+ 0, 9, 0, // End marker
+
+} ;
+
+
+int main (void)
+{
+ int pin ;
+ int dataPtr ;
+ int l, s, d ;
+
+ printf ("Raspberry Pi - 12-LED Sequence\n") ;
+ printf ("==============================\n") ;
+ printf ("\n") ;
+ printf ("Connect LEDs up to the first 4 Pi pins and 8 pins on the ATmega\n") ;
+ printf (" from PD2 through PB1 in that order,\n") ;
+ printf (" then sit back and watch the show!\n") ;
+
+ wiringPiSetup () ;
+ drcSetupSerial (GERT_BASE, 20, "/dev/ttyAMA0", 115200) ;
+
+ for (pin = 0 ; pin < 12 ; ++pin)
+ pinMode (pinMap [pin], OUTPUT) ;
+
+ dataPtr = 0 ;
+
+ for (;;)
+ {
+ l = data [dataPtr++] ; // LED
+ s = data [dataPtr++] ; // State
+ d = data [dataPtr++] ; // Duration (10ths)
+
+ if (s == 9) // 9 -> End Marker
+ {
+ dataPtr = 0 ;
+ continue ;
+ }
+
+ digitalWrite (pinMap [l], s) ;
+ delay (d * analogRead (GERT_BASE) / 4) ;
+ }
+
+ return 0 ;
+}
diff --git a/WiringPi/examples/blink6drcs.c b/WiringPi/examples/blink6drcs.c
new file mode 100644
index 0000000..32f4921
--- /dev/null
+++ b/WiringPi/examples/blink6drcs.c
@@ -0,0 +1,115 @@
+/*
+ * blink6drcs.c:
+ * Simple sequence over 6 pins on a remote DRC board.
+ * Aimed at the Gertduino, but it's fairly generic.
+ * This version uses DRC to talk to the ATmega on the Gertduino
+ *
+ * Copyright (c) 2012-2014 Gordon Henderson. <projects@drogon.net>
+ ***********************************************************************
+ * This file is part of wiringPi:
+ * https://projects.drogon.net/raspberry-pi/wiringpi/
+ *
+ * wiringPi is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * wiringPi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
+ ***********************************************************************
+ */
+
+#include <stdio.h>
+#include <wiringPi.h>
+#include <drcSerial.h>
+
+#define GERT_BASE 100
+
+static int pinMap [] =
+{
+ GERT_BASE + 6, GERT_BASE + 5, GERT_BASE + 3, GERT_BASE + 10, GERT_BASE + 9, GERT_BASE + 13,
+} ;
+
+// Simple sequencer data
+// Triplets of LED, On/Off and delay
+
+
+int data [] =
+{
+ 0, 1, 1,
+ 1, 1, 1,
+ 0, 0, 0, 2, 1, 1,
+ 1, 0, 0, 3, 1, 1,
+ 2, 0, 0, 4, 1, 1,
+ 3, 0, 0, 5, 1, 1,
+ 4, 0, 1,
+ 5, 0, 1,
+
+ 0, 0, 1, // Extra delay
+
+// Back again
+
+ 5, 1, 1,
+ 4, 1, 1,
+ 5, 0, 0, 3, 1, 1,
+ 4, 0, 0, 2, 1, 1,
+ 3, 0, 0, 1, 1, 1,
+ 2, 0, 0, 0, 1, 1,
+ 1, 0, 1,
+ 0, 0, 1,
+
+ 0, 0, 1, // Extra delay
+
+ 0, 9, 0, // End marker
+
+} ;
+
+
+int main (void)
+{
+ int pin ;
+ int dataPtr ;
+ int l, s, d ;
+
+ printf ("Raspberry Pi - 6-LED Sequence\n") ;
+ printf ("=============================\n") ;
+ printf ("\n") ;
+ printf (" Use the 2 buttons to temporarily speed up the sequence\n") ;
+
+ wiringPiSetupSys () ; // Not using the Pi's GPIO here
+ drcSetupSerial (GERT_BASE, 20, "/dev/ttyAMA0", 115200) ;
+
+ for (pin = 0 ; pin < 6 ; ++pin)
+ pinMode (pinMap [pin], OUTPUT) ;
+
+ pinMode (GERT_BASE + 16, INPUT) ; // Buttons
+ pinMode (GERT_BASE + 17, INPUT) ;
+
+ pullUpDnControl (GERT_BASE + 16, PUD_UP) ;
+ pullUpDnControl (GERT_BASE + 17, PUD_UP) ;
+
+ dataPtr = 0 ;
+
+ for (;;)
+ {
+ l = data [dataPtr++] ; // LED
+ s = data [dataPtr++] ; // State
+ d = data [dataPtr++] ; // Duration (10ths)
+
+ if (s == 9) // 9 -> End Marker
+ {
+ dataPtr = 0 ;
+ continue ;
+ }
+
+ digitalWrite (pinMap [l], s) ;
+ delay (d * digitalRead (GERT_BASE + 16) * 15 + digitalRead (GERT_BASE + 17) * 20) ;
+ }
+
+ return 0 ;
+}
diff --git a/WiringPi/examples/ds1302.c b/WiringPi/examples/ds1302.c
new file mode 100644
index 0000000..f1e9e20
--- /dev/null
+++ b/WiringPi/examples/ds1302.c
@@ -0,0 +1,238 @@
+/*
+ * ds1302.c:
+ * Real Time clock
+ *
+ * Copyright (c) 2013 Gordon Henderson.
+ ***********************************************************************
+ * This file is part of wiringPi:
+ * https://projects.drogon.net/raspberry-pi/wiringpi/
+ *
+ * wiringPi is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * wiringPi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
+ ***********************************************************************
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <time.h>
+
+#include <wiringPi.h>
+#include <ds1302.h>
+
+// Register defines
+
+#define RTC_SECS 0
+#define RTC_MINS 1
+#define RTC_HOURS 2
+#define RTC_DATE 3
+#define RTC_MONTH 4
+#define RTC_DAY 5
+#define RTC_YEAR 6
+#define RTC_WP 7
+#define RTC_TC 8
+#define RTC_BM 31
+
+
+static unsigned int masks [] = { 0x7F, 0x7F, 0x3F, 0x3F, 0x1F, 0x07, 0xFF } ;
+
+
+/*
+ * bcdToD: dToBCD:
+ * BCD decode/encode
+ *********************************************************************************
+ */
+
+static int bcdToD (unsigned int byte, unsigned int mask)
+{
+ unsigned int b1, b2 ;
+ byte &= mask ;
+ b1 = byte & 0x0F ;
+ b2 = ((byte >> 4) & 0x0F) * 10 ;
+ return b1 + b2 ;
+}
+
+static unsigned int dToBcd (unsigned int byte)
+{
+ return ((byte / 10) << 4) + (byte % 10) ;
+}
+
+
+/*
+ * ramTest:
+ * Simple test of the 31 bytes of RAM inside the DS1302 chip
+ *********************************************************************************
+ */
+
+static int ramTestValues [] =
+ { 0x00, 0xFF, 0xAA, 0x55, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x00, 0xF0, 0x0F, -1 } ;
+
+static int ramTest (void)
+{
+ int addr ;
+ int got ;
+ int i = 0 ;
+ int errors = 0 ;
+ int testVal ;
+
+ printf ("DS1302 RAM TEST\n") ;
+
+ testVal = ramTestValues [i] ;
+
+ while (testVal != -1)
+ {
+ for (addr = 0 ; addr < 31 ; ++addr)
+ ds1302ramWrite (addr, testVal) ;
+
+ for (addr = 0 ; addr < 31 ; ++addr)
+ if ((got = ds1302ramRead (addr)) != testVal)
+ {
+ printf ("DS1302 RAM Failure: Address: %2d, Expected: 0x%02X, Got: 0x%02X\n",
+ addr, testVal, got) ;
+ ++errors ;
+ }
+ testVal = ramTestValues [++i] ;
+ }
+
+ for (addr = 0 ; addr < 31 ; ++addr)
+ ds1302ramWrite (addr, addr) ;
+
+ for (addr = 0 ; addr < 31 ; ++addr)
+ if ((got = ds1302ramRead (addr)) != addr)
+ {
+ printf ("DS1302 RAM Failure: Address: %2d, Expected: 0x%02X, Got: 0x%02X\n",
+ addr, addr, got) ;
+ ++errors ;
+ }
+
+ if (errors == 0)
+ printf ("-- DS1302 RAM TEST: OK\n") ;
+ else
+ printf ("-- DS1302 RAM TEST FAILURE. %d errors.\n", errors) ;
+
+ return 0 ;
+}
+
+/*
+ * setLinuxClock:
+ * Set the Linux clock from the hardware
+ *********************************************************************************
+ */
+
+static int setLinuxClock (void)
+{
+ char dateTime [20] ;
+ char command [64] ;
+ int clock [8] ;
+
+
+ printf ("Setting the Linux Clock from the DS1302... ") ; fflush (stdout) ;
+
+ ds1302clockRead (clock) ;
+
+// [MMDDhhmm[[CC]YY][.ss]]
+
+ sprintf (dateTime, "%02d%02d%02d%02d%02d%02d.%02d",
+ bcdToD (clock [RTC_MONTH], masks [RTC_MONTH]),
+ bcdToD (clock [RTC_DATE], masks [RTC_DATE]),
+ bcdToD (clock [RTC_HOURS], masks [RTC_HOURS]),
+ bcdToD (clock [RTC_MINS], masks [RTC_MINS]),
+ 20,
+ bcdToD (clock [RTC_YEAR], masks [RTC_YEAR]),
+ bcdToD (clock [RTC_SECS], masks [RTC_SECS])) ;
+
+ sprintf (command, "/bin/date %s", dateTime) ;
+ system (command) ;
+
+ return 0 ;
+}
+
+
+/*
+ * setDSclock:
+ * Set the DS1302 block from Linux time
+ *********************************************************************************
+ */
+
+static int setDSclock (void)
+{
+ struct tm t ;
+ time_t now ;
+ int clock [8] ;
+
+ printf ("Setting the clock in the DS1302 from Linux time... ") ;
+
+ now = time (NULL) ;
+ gmtime_r (&now, &t) ;
+
+ clock [ 0] = dToBcd (t.tm_sec) ; // seconds
+ clock [ 1] = dToBcd (t.tm_min) ; // mins
+ clock [ 2] = dToBcd (t.tm_hour) ; // hours
+ clock [ 3] = dToBcd (t.tm_mday) ; // date
+ clock [ 4] = dToBcd (t.tm_mon + 1) ; // months 0-11 --> 1-12
+ clock [ 5] = dToBcd (t.tm_wday + 1) ; // weekdays (sun 0)
+ clock [ 6] = dToBcd (t.tm_year - 100) ; // years
+ clock [ 7] = 0 ; // W-Protect off
+
+ ds1302clockWrite (clock) ;
+
+ printf ("OK\n") ;
+
+ return 0 ;
+}
+
+
+
+
+int main (int argc, char *argv [])
+{
+ int i ;
+ int clock [8] ;
+
+ wiringPiSetup () ;
+ ds1302setup (0, 1, 2) ;
+
+ if (argc == 2)
+ {
+ /**/ if (strcmp (argv [1], "-slc") == 0)
+ return setLinuxClock () ;
+ else if (strcmp (argv [1], "-sdsc") == 0)
+ return setDSclock () ;
+ else if (strcmp (argv [1], "-rtest") == 0)
+ return ramTest () ;
+ else
+ {
+ printf ("Usage: ds1302 [-slc | -sdsc | -rtest]\n") ;
+ return EXIT_FAILURE ;
+ }
+ }
+
+ for (i = 0 ;; ++i)
+ {
+ printf ("%5d: ", i) ;
+
+ ds1302clockRead (clock) ;
+ printf (" %2d:%02d:%02d",
+ bcdToD (clock [2], masks [2]), bcdToD (clock [1], masks [1]), bcdToD (clock [0], masks [0])) ;
+
+ printf (" %2d/%02d/%04d",
+ bcdToD (clock [3], masks [3]), bcdToD (clock [4], masks [4]), bcdToD (clock [6], masks [6]) + 2000) ;
+
+ printf ("\n") ;
+
+ delay (200) ;
+ }
+
+ return 0 ;
+}
diff --git a/WiringPi/examples/rht03.c b/WiringPi/examples/rht03.c
index e0cc116..566e954 100644
--- a/WiringPi/examples/rht03.c
+++ b/WiringPi/examples/rht03.c
@@ -56,6 +56,11 @@
{
temp = newTemp ;
rh = newRh ;
+ if ((temp & 0x8000) != 0) // Negative
+ {
+ temp &= 0x7FFF ;
+ temp = -temp ;
+ }
printf ("Temp: %5.1f, RH: %5.1f%%\n", temp / 10.0, rh / 10.0) ;
}
}
diff --git a/WiringPi/gpio/Makefile b/WiringPi/gpio/Makefile
index 52b0150..37b4887 100644
--- a/WiringPi/gpio/Makefile
+++ b/WiringPi/gpio/Makefile
@@ -1,9 +1,10 @@
#
# Makefile:
-# wiringPi - Wiring Compatable library for the Raspberry Pi
+# The gpio command:
+# A swiss-army knige of GPIO shenanigans.
# https://projects.drogon.net/wiring-pi
#
-# Copyright (c) 2012 Gordon Henderson
+# Copyright (c) 2012-2013 Gordon Henderson
#################################################################################
# This file is part of wiringPi:
# Wiring Compatable library for the Raspberry Pi
@@ -22,20 +23,22 @@
# along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
#################################################################################
+DESTDIR=/usr
+PREFIX=/local
#DEBUG = -g -O0
DEBUG = -O2
CC = gcc
-INCLUDE = -I/usr/local/include
+INCLUDE = -I$(DESTDIR)$(PREFIX)/include
CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
-LDFLAGS = -L/usr/local/lib
+LDFLAGS = -L$(DESTDIR)$(PREFIX)/lib
LIBS = -lwiringPi -lwiringPiDev -lpthread -lm
# May not need to alter anything below this line
###############################################################################
-SRC = gpio.c extensions.c
+SRC = gpio.c extensions.c readall.c pins.c
OBJ = $(SRC:.c=.o)
@@ -49,32 +52,32 @@
@echo [Compile] $<
@$(CC) -c $(CFLAGS) $< -o $@
-.PHONEY: clean
+.PHONY: clean
clean:
@echo "[Clean]"
@rm -f $(OBJ) gpio *~ core tags *.bak
-.PHONEY: tags
+.PHONY: tags
tags: $(SRC)
@echo [ctags]
@ctags $(SRC)
-.PHONEY: install
+.PHONY: install
install:
@echo "[Install]"
- @cp gpio /usr/local/bin
- @chown root.root /usr/local/bin/gpio
- @chmod 4755 /usr/local/bin/gpio
- @mkdir -p /usr/local/man/man1
- @cp gpio.1 /usr/local/man/man1
+ @cp gpio $(DESTDIR)$(PREFIX)/bin
+ @chown root.root $(DESTDIR)$(PREFIX)/bin/gpio
+ @chmod 4755 $(DESTDIR)$(PREFIX)/bin/gpio
+ @mkdir -p $(DESTDIR)$(PREFIX)/man/man1
+ @cp gpio.1 $(DESTDIR)$(PREFIX)/man/man1
-.PHONEY: uninstall
+.PHONY: uninstall
uninstall:
@echo "[UnInstall]"
- @rm -f /usr/local/bin/gpio
- @rm -f /usr/local/man/man1/gpio.1
+ @rm -f $(DESTDIR)$(PREFIX)/bin/gpio
+ @rm -f $(DESTDIR)$(PREFIX)/man/man1/gpio.1
-.PHONEY: depend
+.PHONY: depend
depend:
makedepend -Y $(SRC)
diff --git a/WiringPi/gpio/extensions.c b/WiringPi/gpio/extensions.c
index dae1eac..96d6255 100644
--- a/WiringPi/gpio/extensions.c
+++ b/WiringPi/gpio/extensions.c
@@ -43,6 +43,14 @@
#include <sr595.h>
#include <pcf8591.h>
#include <pcf8574.h>
+#include <max31855.h>
+#include <max5322.h>
+#include <mcp3002.h>
+#include <mcp3004.h>
+#include <mcp4802.h>
+#include <mcp3422.h>
+#include <sn3218.h>
+#include <drcSerial.h>
#include "extensions.h"
@@ -92,6 +100,43 @@
}
+/*
+ * extractStr:
+ * Check & return a string at the given location (prefixed by a :)
+ *********************************************************************************
+ */
+
+static char *extractStr (char *progName, char *p, char **str)
+{
+ char *q, *r ;
+
+ if (*p != ':')
+ {
+ fprintf (stderr, "%s: colon expected\n", progName) ;
+ return NULL ;
+ }
+
+ ++p ;
+
+ if (!isprint (*p))
+ {
+ fprintf (stderr, "%s: character expected\n", progName) ;
+ return NULL ;
+ }
+
+ q = p ;
+ while ((*q != 0) && (*q != ':'))
+ ++q ;
+
+ *str = r = calloc (q - p + 2, 1) ; // Zeros it
+
+ while (p != q)
+ *r++ = *p++ ;
+
+ return p ;
+}
+
+
/*
* doExtensionMcp23008:
@@ -331,6 +376,239 @@
/*
+ * doExtensionMax31855:
+ * Analog IO
+ * max31855:base:spiChan
+ *********************************************************************************
+ */
+
+static int doExtensionMax31855 (char *progName, int pinBase, char *params)
+{
+ int spi ;
+
+ if ((params = extractInt (progName, params, &spi)) == NULL)
+ return FALSE ;
+
+ if ((spi < 0) || (spi > 1))
+ {
+ fprintf (stderr, "%s: SPI channel (%d) out of range\n", progName, spi) ;
+ return FALSE ;
+ }
+
+ max31855Setup (pinBase, spi) ;
+
+ return TRUE ;
+}
+
+
+/*
+ * doExtensionMcp3002:
+ * Analog IO
+ * mcp3002:base:spiChan
+ *********************************************************************************
+ */
+
+static int doExtensionMcp3002 (char *progName, int pinBase, char *params)
+{
+ int spi ;
+
+ if ((params = extractInt (progName, params, &spi)) == NULL)
+ return FALSE ;
+
+ if ((spi < 0) || (spi > 1))
+ {
+ fprintf (stderr, "%s: SPI channel (%d) out of range\n", progName, spi) ;
+ return FALSE ;
+ }
+
+ mcp3002Setup (pinBase, spi) ;
+
+ return TRUE ;
+}
+
+
+/*
+ * doExtensionMcp3004:
+ * Analog IO
+ * mcp3004:base:spiChan
+ *********************************************************************************
+ */
+
+static int doExtensionMcp3004 (char *progName, int pinBase, char *params)
+{
+ int spi ;
+
+ if ((params = extractInt (progName, params, &spi)) == NULL)
+ return FALSE ;
+
+ if ((spi < 0) || (spi > 1))
+ {
+ fprintf (stderr, "%s: SPI channel (%d) out of range\n", progName, spi) ;
+ return FALSE ;
+ }
+
+ mcp3004Setup (pinBase, spi) ;
+
+ return TRUE ;
+}
+
+
+/*
+ * doExtensionMax5322:
+ * Analog O
+ * max5322:base:spiChan
+ *********************************************************************************
+ */
+
+static int doExtensionMax5322 (char *progName, int pinBase, char *params)
+{
+ int spi ;
+
+ if ((params = extractInt (progName, params, &spi)) == NULL)
+ return FALSE ;
+
+ if ((spi < 0) || (spi > 1))
+ {
+ fprintf (stderr, "%s: SPI channel (%d) out of range\n", progName, spi) ;
+ return FALSE ;
+ }
+
+ max5322Setup (pinBase, spi) ;
+
+ return TRUE ;
+}
+
+
+/*
+ * doExtensionMcp4802:
+ * Analog IO
+ * mcp4802:base:spiChan
+ *********************************************************************************
+ */
+
+static int doExtensionMcp4802 (char *progName, int pinBase, char *params)
+{
+ int spi ;
+
+ if ((params = extractInt (progName, params, &spi)) == NULL)
+ return FALSE ;
+
+ if ((spi < 0) || (spi > 1))
+ {
+ fprintf (stderr, "%s: SPI channel (%d) out of range\n", progName, spi) ;
+ return FALSE ;
+ }
+
+ mcp4802Setup (pinBase, spi) ;
+
+ return TRUE ;
+}
+
+
+/*
+ * doExtensionSn3218:
+ * Analog Output (LED Driver)
+ * sn3218:base
+ *********************************************************************************
+ */
+
+static int doExtensionSn3218 (char *progName, int pinBase, char *params)
+{
+ sn3218Setup (pinBase) ;
+ return TRUE ;
+}
+
+
+/*
+ * doExtensionMcp3422:
+ * Analog IO
+ * mcp3422:base:i2cAddr
+ *********************************************************************************
+ */
+
+static int doExtensionMcp3422 (char *progName, int pinBase, char *params)
+{
+ int i2c, sampleRate, gain ;
+
+ if ((params = extractInt (progName, params, &i2c)) == NULL)
+ return FALSE ;
+
+ if ((i2c < 0x03) || (i2c > 0x77))
+ {
+ fprintf (stderr, "%s: i2c address (0x%X) out of range\n", progName, i2c) ;
+ return FALSE ;
+ }
+
+ if ((params = extractInt (progName, params, &sampleRate)) == NULL)
+ return FALSE ;
+
+ if ((sampleRate < 0) || (sampleRate > 3))
+ {
+ fprintf (stderr, "%s: sample rate (%d) out of range\n", progName, sampleRate) ;
+ return FALSE ;
+ }
+
+ if ((params = extractInt (progName, params, &gain)) == NULL)
+ return FALSE ;
+
+ if ((gain < 0) || (gain > 3))
+ {
+ fprintf (stderr, "%s: gain (%d) out of range\n", progName, gain) ;
+ return FALSE ;
+ }
+
+ mcp3422Setup (pinBase, i2c, sampleRate, gain) ;
+
+ return TRUE ;
+}
+
+/*
+ * doExtensionDrcS:
+ * Interface to a DRC Serial system
+ * drcs:base:pins:serialPort:baud
+ *********************************************************************************
+ */
+
+static int doExtensionDrcS (char *progName, int pinBase, char *params)
+{
+ char *port ;
+ int pins, baud ;
+
+ if ((params = extractInt (progName, params, &pins)) == NULL)
+ return FALSE ;
+
+ if ((pins < 1) || (pins > 100))
+ {
+ fprintf (stderr, "%s: pins (%d) out of range (2-100)\n", progName, pins) ;
+ return FALSE ;
+ }
+
+ if ((params = extractStr (progName, params, &port)) == NULL)
+ return FALSE ;
+
+ if (strlen (port) == 0)
+ {
+ fprintf (stderr, "%s: serial port device name required\n", progName) ;
+ return FALSE ;
+ }
+
+ if ((params = extractInt (progName, params, &baud)) == NULL)
+ return FALSE ;
+
+ if ((baud < 1) || (baud > 4000000))
+ {
+ fprintf (stderr, "%s: baud rate (%d) out of range\n", progName, baud) ;
+ return FALSE ;
+ }
+
+ drcSetupSerial (pinBase, pins, port, baud) ;
+
+ return TRUE ;
+}
+
+
+
+/*
* Function list
*********************************************************************************
*/
@@ -345,6 +623,14 @@
{ "sr595", &doExtensionSr595 },
{ "pcf8574", &doExtensionPcf8574 },
{ "pcf8591", &doExtensionPcf8591 },
+ { "mcp3002", &doExtensionMcp3002 },
+ { "mcp3004", &doExtensionMcp3004 },
+ { "mcp4802", &doExtensionMcp4802 },
+ { "mcp3422", &doExtensionMcp3422 },
+ { "max31855", &doExtensionMax31855 },
+ { "max5322", &doExtensionMax5322 },
+ { "sn3218", &doExtensionSn3218 },
+ { "drcs", &doExtensionDrcS },
{ NULL, NULL },
} ;
diff --git a/WiringPi/gpio/gpio.1 b/WiringPi/gpio/gpio.1
index ae4df4e..e7131c1 100644
--- a/WiringPi/gpio/gpio.1
+++ b/WiringPi/gpio/gpio.1
@@ -13,11 +13,11 @@
.PP
.B gpio
.B [ \-x extension:params ]
-.B mode/read/write/aread/awrite/pwm ...
+.B mode/read/write/aread/awrite/pwm/pwmTone ...
.PP
.B gpio
.B [ \-p ]
-.B read/write/wb
+.B read/write/toggle/wb
.B ...
.PP
.B gpio
@@ -39,6 +39,10 @@
group value
.PP
.B gpio
+.B usbp
+high | low
+.PP
+.B gpio
.B pwm-bal/pwm-ms
.PP
.B gpio
@@ -115,6 +119,28 @@
to output mode first.
.TP
+.B aread <pin>
+Read the analog value of the given pin. This needs to be uses in
+conjunction with a -x flag to add in an extension that handles analog
+inputs. respective logic levels.
+
+e.g. gpio -x mcp3002:200:0 aread 200
+
+will read the first analog input on an mcp3002 SPI ADC chip.
+
+.TP
+.B awrite <pin> <value>
+Write the analog value to the given pin. This needs to be used in
+conjunction with a -x flag to add in an extension that handles analog
+inputs. respective logic levels.
+
+e.g. gpio -x mcp4802:200:0 awrite 200 128
+
+will write the value 128 to the first DAC port on an mcp4802 chip on
+the Pi's SPI bus 0.
+
+
+.TP
.B wb <value>
Write the given byte to the 8 main GPIO pins. You can prefix it with 0x
to specify a hexadecimal number. You need to set pins to output mode
@@ -126,10 +152,19 @@
if the pin is in input mode, or the last value written if the pin is in output
mode.
+The readall command is usable with an extension module (via the -x parameter),
+but it's unable to determine pin modes or states, so will perform both a
+digital and analog read on each pin in-turn.
+
.TP
.B reset
-Resets the GPIO - As much as it's possible to do. All pins are set to input
-mode and all the internal pull-up/down resistors are disconnected (tristate mode).
+Resets the GPIO - As much as it's possible to do. All pins are set to
+input mode and all the internal pull-up/down resistors are disconnected
+(tristate mode).
+
+The reset command is usable with an extension module (via the -x parameter),
+but it's limited to turning the pin into input mode (if applicable) and
+removing any pull up/down resistor.
.TP
.B pwm <pin> <value>
@@ -201,6 +236,13 @@
absolutely sure you know what you're doing.
.TP
+.B usbp
+high | low
+
+Change the USB current limiter to high (1.2 amps) or low (the default, 600mA)
+This is only applicable to the model B+
+
+.TP
.B pwm-bal/pwm-ms
Change the PWM mode to balanced (the default) or mark:space ratio (traditional)
@@ -212,8 +254,8 @@
.B load i2c [baudrate]
This loads the i2c or drivers into the kernel and changes the permissions
on the associated /dev/ entries so that the current user has access to
-them. Optionally it will set the I2C baudrate to that supplied (or as
-close as the Pi can manage) The default speed is 100Kb/sec.
+them. Optionally it will set the I2C baudrate to that supplied in Kb/sec
+(or as close as the Pi can manage) The default speed is 100Kb/sec.
.TP
.B load spi [buffer size in KB]
diff --git a/WiringPi/gpio/gpio.c b/WiringPi/gpio/gpio.c
index 871548e..c440874 100644
--- a/WiringPi/gpio/gpio.c
+++ b/WiringPi/gpio/gpio.c
@@ -43,15 +43,21 @@
extern int wiringPiDebug ;
+// External functions I can't be bothered creating a separate .h file for:
+
+extern void doReadall (void) ;
+extern void doPins (void) ;
+
#ifndef TRUE
# define TRUE (1==1)
# define FALSE (1==2)
#endif
-#define VERSION "2.05"
-#define I2CDETECT "/usr/sbin/i2cdetect"
+#define VERSION "2.20"
+#define PI_USB_POWER_CONTROL 38
+#define I2CDETECT "/usr/sbin/i2cdetect"
-static int wpMode ;
+int wpMode ;
char *usage = "Usage: gpio -v\n"
" gpio -h\n"
@@ -68,10 +74,32 @@
" gpio pwmc <divider> \n"
" gpio load spi/i2c\n"
" gpio i2cd/i2cdetect\n"
+ " gpio usbp high/low\n"
" gpio gbr <channel>\n"
" gpio gbw <channel> <value>" ; // No trailing newline needed here.
+#ifdef NOT_FOR_NOW
+/*
+ * decodePin:
+ * Decode a pin "number" which can actually be a pin name to represent
+ * one of the Pi's on-board pins.
+ *********************************************************************************
+ */
+
+static int decodePin (const char *str)
+{
+
+// The first case - see if it's a number:
+
+ if (isdigit (str [0]))
+ return atoi (str) ;
+
+ return 0 ;
+}
+#endif
+
+
/*
* changeOwner:
* Change the ownership of the file to the real userId of the calling
@@ -237,62 +265,6 @@
/*
- * doReadall:
- * Read all the GPIO pins
- *********************************************************************************
- */
-
-static char *pinNames [] =
-{
- "GPIO 0", "GPIO 1", "GPIO 2", "GPIO 3", "GPIO 4", "GPIO 5", "GPIO 6", "GPIO 7",
- "SDA ", "SCL ",
- "CE0 ", "CE1 ", "MOSI ", "MISO ", "SCLK ",
- "TxD ", "RxD ",
- "GPIO 8", "GPIO 9", "GPIO10", "GPIO11",
-} ;
-
-static char *alts [] =
-{
- "IN ", "OUT ", "ALT5", "ALT4", "ALT0", "ALT1", "ALT2", "ALT3"
-} ;
-
-static int wpiToPhys [64] =
-{
- 11, 12, 13, 15, 16, 18, 22, 7, // 0...7
- 3, 5, // 8...9
- 24, 26, 19, 21, 23, // 10..14
- 8, 10, // 15..16
- 3, 4, 5, 6, // 17..20
- 0,0,0,0,0,0,0,0,0,0,0, // 20..31
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 32..47
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 47..63
-} ;
-
-static void doReadall (void)
-{
- int pin ;
-
- printf ("+----------+-Rev%d-+------+--------+------+-------+\n", piBoardRev ()) ;
- printf ("| wiringPi | GPIO | Phys | Name | Mode | Value |\n") ;
- printf ("+----------+------+------+--------+------+-------+\n") ;
-
- for (pin = 0 ; pin < 64 ; ++pin) // Crude, but effective
- {
- if (wpiPinToGpio (pin) == -1)
- continue ;
-
- printf ("| %6d | %3d | %3d | %s | %s | %s |\n",
- pin, wpiPinToGpio (pin), wpiToPhys [pin],
- pinNames [pin],
- alts [getAlt (pin)],
- digitalRead (pin) == HIGH ? "High" : "Low ") ;
- }
-
- printf ("+----------+------+------+--------+------+-------+\n") ;
-}
-
-
-/*
* doExports:
* List all GPIO exports
*********************************************************************************
@@ -615,6 +587,24 @@
/*
+ * doResetExternal:
+ * Load readallExternal, we try to do this with an external device.
+ *********************************************************************************
+ */
+
+static void doResetExternal (void)
+{
+ int pin ;
+
+ for (pin = wiringPiNodes->pinBase ; pin <= wiringPiNodes->pinMax ; ++pin)
+ {
+ pinMode (pin, INPUT) ;
+ pullUpDnControl (pin, PUD_OFF) ;
+ }
+}
+
+
+/*
* doReset:
* Reset the GPIO pins - as much as we can do
*********************************************************************************
@@ -624,16 +614,21 @@
{
int pin ;
- doUnexportall (progName) ;
-
- for (pin = 0 ; pin < 64 ; ++pin)
+ if (wiringPiNodes != NULL) // External reset
+ doResetExternal () ;
+ else
{
- if (wpiPinToGpio (pin) == -1)
- continue ;
+ doUnexportall (progName) ;
- digitalWrite (pin, LOW) ;
- pinMode (pin, INPUT) ;
- pullUpDnControl (pin, PUD_OFF) ;
+ for (pin = 0 ; pin < 64 ; ++pin)
+ {
+ if (wpiPinToGpio (pin) == -1)
+ continue ;
+
+ digitalWrite (pin, LOW) ;
+ pinMode (pin, INPUT) ;
+ pullUpDnControl (pin, PUD_OFF) ;
+ }
}
}
@@ -659,13 +654,26 @@
mode = argv [3] ;
- /**/ if (strcasecmp (mode, "in") == 0) pinMode (pin, INPUT) ;
- else if (strcasecmp (mode, "out") == 0) pinMode (pin, OUTPUT) ;
- else if (strcasecmp (mode, "pwm") == 0) pinMode (pin, PWM_OUTPUT) ;
- else if (strcasecmp (mode, "clock") == 0) pinMode (pin, GPIO_CLOCK) ;
- else if (strcasecmp (mode, "up") == 0) pullUpDnControl (pin, PUD_UP) ;
- else if (strcasecmp (mode, "down") == 0) pullUpDnControl (pin, PUD_DOWN) ;
- else if (strcasecmp (mode, "tri") == 0) pullUpDnControl (pin, PUD_OFF) ;
+ /**/ if (strcasecmp (mode, "in") == 0) pinMode (pin, INPUT) ;
+ else if (strcasecmp (mode, "input") == 0) pinMode (pin, INPUT) ;
+ else if (strcasecmp (mode, "out") == 0) pinMode (pin, OUTPUT) ;
+ else if (strcasecmp (mode, "output") == 0) pinMode (pin, OUTPUT) ;
+ else if (strcasecmp (mode, "pwm") == 0) pinMode (pin, PWM_OUTPUT) ;
+ else if (strcasecmp (mode, "pwmTone") == 0) pinMode (pin, PWM_TONE_OUTPUT) ;
+ else if (strcasecmp (mode, "clock") == 0) pinMode (pin, GPIO_CLOCK) ;
+ else if (strcasecmp (mode, "up") == 0) pullUpDnControl (pin, PUD_UP) ;
+ else if (strcasecmp (mode, "down") == 0) pullUpDnControl (pin, PUD_DOWN) ;
+ else if (strcasecmp (mode, "tri") == 0) pullUpDnControl (pin, PUD_OFF) ;
+ else if (strcasecmp (mode, "off") == 0) pullUpDnControl (pin, PUD_OFF) ;
+
+// Undocumented
+
+ else if (strcasecmp (mode, "alt0") == 0) pinModeAlt (pin, 0b100) ;
+ else if (strcasecmp (mode, "alt1") == 0) pinModeAlt (pin, 0b101) ;
+ else if (strcasecmp (mode, "alt2") == 0) pinModeAlt (pin, 0b110) ;
+ else if (strcasecmp (mode, "alt3") == 0) pinModeAlt (pin, 0b111) ;
+ else if (strcasecmp (mode, "alt4") == 0) pinModeAlt (pin, 0b011) ;
+ else if (strcasecmp (mode, "alt5") == 0) pinModeAlt (pin, 0b010) ;
else
{
fprintf (stderr, "%s: Invalid mode: %s. Should be in/out/pwm/clock/up/down/tri\n", argv [1], mode) ;
@@ -710,6 +718,58 @@
/*
+ * doUsbP:
+ * Control USB Power - High (1.2A) or Low (600mA)
+ * gpio usbp high/low
+ *********************************************************************************
+ */
+
+static void doUsbP (int argc, char *argv [])
+{
+ int model, rev, mem, maker, overVolted ;
+
+ if (argc != 3)
+ {
+ fprintf (stderr, "Usage: %s usbp high|low\n", argv [0]) ;
+ exit (1) ;
+ }
+
+// Make sure we're on a B+
+
+ piBoardId (&model, &rev, &mem, &maker, &overVolted) ;
+
+ if (model != PI_MODEL_BP)
+ {
+ fprintf (stderr, "USB power contol is applicable to B+ boards only.\n") ;
+ exit (1) ;
+ }
+
+// Need to force BCM_GPIO mode:
+
+ wiringPiSetupGpio () ;
+
+ if ((strcasecmp (argv [2], "high") == 0) || (strcasecmp (argv [2], "hi") == 0))
+ {
+ digitalWrite (PI_USB_POWER_CONTROL, 1) ;
+ pinMode (PI_USB_POWER_CONTROL, OUTPUT) ;
+ printf ("Switched to HIGH current USB (1.2A)\n") ;
+ return ;
+ }
+
+ if ((strcasecmp (argv [2], "low") == 0) || (strcasecmp (argv [2], "lo") == 0))
+ {
+ digitalWrite (PI_USB_POWER_CONTROL, 0) ;
+ pinMode (PI_USB_POWER_CONTROL, OUTPUT) ;
+ printf ("Switched to LOW current USB (600mA)\n") ;
+ return ;
+ }
+
+ fprintf (stderr, "Usage: %s usbp high|low\n", argv [0]) ;
+ exit (1) ;
+}
+
+
+/*
* doGbw:
* gpio gbw channel value
* Gertboard Write - To the Analog output
@@ -735,7 +795,7 @@
exit (1) ;
}
- if ((value < 0) || (value > 1023))
+ if ((value < 0) || (value > 255))
{
fprintf (stderr, "%s: gbw: Value must be from 0 to 255\n", argv [0]) ;
exit (1) ;
@@ -926,6 +986,30 @@
digitalWrite (pin, !digitalRead (pin)) ;
}
+
+/*
+ * doPwmTone:
+ * Output a tone in a PWM pin
+ *********************************************************************************
+ */
+
+void doPwmTone (int argc, char *argv [])
+{
+ int pin, freq ;
+
+ if (argc != 4)
+ {
+ fprintf (stderr, "Usage: %s pwmTone <pin> <freq>\n", argv [0]) ;
+ exit (1) ;
+ }
+
+ pin = atoi (argv [2]) ;
+ freq = atoi (argv [3]) ;
+
+ pwmToneWrite (pin, freq) ;
+}
+
+
/*
* doClock:
* Output a clock on a pin
@@ -1037,6 +1121,7 @@
int main (int argc, char *argv [])
{
int i ;
+ int model, rev, mem, maker, overVolted ;
if (getenv ("WIRINGPI_DEBUG") != NULL)
{
@@ -1077,18 +1162,30 @@
if (strcmp (argv [1], "-v") == 0)
{
printf ("gpio version: %s\n", VERSION) ;
- printf ("Copyright (c) 2012-2013 Gordon Henderson\n") ;
+ printf ("Copyright (c) 2012-2014 Gordon Henderson\n") ;
printf ("This is free software with ABSOLUTELY NO WARRANTY.\n") ;
printf ("For details type: %s -warranty\n", argv [0]) ;
printf ("\n") ;
- printf ("This Raspberry Pi is a revision %d board.\n", piBoardRev ()) ;
+ piBoardId (&model, &rev, &mem, &maker, &overVolted) ;
+ if (model == PI_MODEL_UNKNOWN)
+ {
+ printf ("Your Raspberry Pi has an unknown model type. Please report this to\n") ;
+ printf (" projects@drogon.net\n") ;
+ printf ("with a copy of your /proc/cpuinfo if possible\n") ;
+ }
+ else
+ {
+ printf ("Raspberry Pi Details:\n") ;
+ printf (" Type: %s, Revision: %s, Memory: %dMB, Maker: %s %s\n",
+ piModelNames [model], piRevisionNames [rev], mem, piMakerNames [maker], overVolted ? "[OV]" : "") ;
+ }
return 0 ;
}
if (strcasecmp (argv [1], "-warranty") == 0)
{
printf ("gpio version: %s\n", VERSION) ;
- printf ("Copyright (c) 2012-2013 Gordon Henderson\n") ;
+ printf ("Copyright (c) 2012-2014 Gordon Henderson\n") ;
printf ("\n") ;
printf (" This program is free software; you can redistribute it and/or modify\n") ;
printf (" it under the terms of the GNU Leser General Public License as published\n") ;
@@ -1212,18 +1309,22 @@
// Pi Specifics
- else if (strcasecmp (argv [1], "pwm-bal" ) == 0) doPwmMode (PWM_MODE_BAL) ;
- else if (strcasecmp (argv [1], "pwm-ms" ) == 0) doPwmMode (PWM_MODE_MS) ;
- else if (strcasecmp (argv [1], "pwmr" ) == 0) doPwmRange (argc, argv) ;
- else if (strcasecmp (argv [1], "pwmc" ) == 0) doPwmClock (argc, argv) ;
- else if (strcasecmp (argv [1], "drive" ) == 0) doPadDrive (argc, argv) ;
- else if (strcasecmp (argv [1], "readall" ) == 0) doReadall () ;
- else if (strcasecmp (argv [1], "i2cdetect") == 0) doI2Cdetect (argc, argv) ;
- else if (strcasecmp (argv [1], "i2cd" ) == 0) doI2Cdetect (argc, argv) ;
- else if (strcasecmp (argv [1], "reset" ) == 0) doReset (argv [0]) ;
- else if (strcasecmp (argv [1], "wb" ) == 0) doWriteByte (argc, argv) ;
- else if (strcasecmp (argv [1], "clock" ) == 0) doClock (argc, argv) ;
- else if (strcasecmp (argv [1], "wfi" ) == 0) doWfi (argc, argv) ;
+ else if (strcasecmp (argv [1], "pwm-bal" ) == 0) doPwmMode (PWM_MODE_BAL) ;
+ else if (strcasecmp (argv [1], "pwm-ms" ) == 0) doPwmMode (PWM_MODE_MS) ;
+ else if (strcasecmp (argv [1], "pwmr" ) == 0) doPwmRange (argc, argv) ;
+ else if (strcasecmp (argv [1], "pwmc" ) == 0) doPwmClock (argc, argv) ;
+ else if (strcasecmp (argv [1], "pwmTone" ) == 0) doPwmTone (argc, argv) ;
+ else if (strcasecmp (argv [1], "drive" ) == 0) doPadDrive (argc, argv) ;
+ else if (strcasecmp (argv [1], "usbp" ) == 0) doUsbP (argc, argv) ;
+ else if (strcasecmp (argv [1], "readall" ) == 0) doReadall () ;
+ else if (strcasecmp (argv [1], "nreadall" ) == 0) doReadall () ;
+ else if (strcasecmp (argv [1], "pins" ) == 0) doPins () ;
+ else if (strcasecmp (argv [1], "i2cdetect") == 0) doI2Cdetect (argc, argv) ;
+ else if (strcasecmp (argv [1], "i2cd" ) == 0) doI2Cdetect (argc, argv) ;
+ else if (strcasecmp (argv [1], "reset" ) == 0) doReset (argv [0]) ;
+ else if (strcasecmp (argv [1], "wb" ) == 0) doWriteByte (argc, argv) ;
+ else if (strcasecmp (argv [1], "clock" ) == 0) doClock (argc, argv) ;
+ else if (strcasecmp (argv [1], "wfi" ) == 0) doWfi (argc, argv) ;
else
{
fprintf (stderr, "%s: Unknown command: %s.\n", argv [0], argv [1]) ;
diff --git a/WiringPi/gpio/pins.c b/WiringPi/gpio/pins.c
new file mode 100644
index 0000000..19fcc1a
--- /dev/null
+++ b/WiringPi/gpio/pins.c
@@ -0,0 +1,33 @@
+/*
+ * pins.c:
+ * Just display a handy Pi pinnout diagram.
+ * Copyright (c) 2012-2013 Gordon Henderson
+ ***********************************************************************
+ * This file is part of wiringPi:
+ * https://projects.drogon.net/raspberry-pi/wiringpi/
+ *
+ * wiringPi is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * wiringPi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
+ ***********************************************************************
+ */
+
+
+#include <stdio.h>
+
+void doPins (void)
+{
+ printf ("The pins command has been deprecated - sorry. Please use the\n") ;
+ printf (" gpio readall\n") ;
+ printf ("command to get a list of the pinnouts for your Pi.\n") ;
+}
+
diff --git a/WiringPi/gpio/readall.c b/WiringPi/gpio/readall.c
new file mode 100644
index 0000000..76b5cfc
--- /dev/null
+++ b/WiringPi/gpio/readall.c
@@ -0,0 +1,321 @@
+/*
+ * readall.c:
+ * The readall functions - getting a bit big, so split them out.
+ * Copyright (c) 2012-2013 Gordon Henderson
+ ***********************************************************************
+ * This file is part of wiringPi:
+ * https://projects.drogon.net/raspberry-pi/wiringpi/
+ *
+ * wiringPi is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * wiringPi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
+ ***********************************************************************
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <ctype.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include <wiringPi.h>
+
+extern int wpMode ;
+
+#ifndef TRUE
+# define TRUE (1==1)
+# define FALSE (1==2)
+#endif
+
+/*
+ * doReadallExternal:
+ * A relatively crude way to read the pins on an external device.
+ * We don't know the input/output mode of pins, but we can tell
+ * if it's an analog pin or a digital one...
+ *********************************************************************************
+ */
+
+static void doReadallExternal (void)
+{
+ int pin ;
+
+ printf ("+------+---------+--------+\n") ;
+ printf ("| Pin | Digital | Analog |\n") ;
+ printf ("+------+---------+--------+\n") ;
+
+ for (pin = wiringPiNodes->pinBase ; pin <= wiringPiNodes->pinMax ; ++pin)
+ printf ("| %4d | %4d | %4d |\n", pin, digitalRead (pin), analogRead (pin)) ;
+
+ printf ("+------+---------+--------+\n") ;
+}
+
+
+/*
+ * doReadall:
+ * Read all the GPIO pins
+ * We also want to use this to read the state of pins on an externally
+ * connected device, so we need to do some fiddling with the internal
+ * wiringPi node structures - since the gpio command can only use
+ * one external device at a time, we'll use that to our advantage...
+ *********************************************************************************
+ */
+
+static char *alts [] =
+{
+ "IN", "OUT", "ALT5", "ALT4", "ALT0", "ALT1", "ALT2", "ALT3"
+} ;
+
+static int physToWpi [64] =
+{
+ -1, // 0
+ -1, -1, // 1, 2
+ 8, -1,
+ 9, -1,
+ 7, 15,
+ -1, 16,
+ 0, 1,
+ 2, -1,
+ 3, 4,
+ -1, 5,
+ 12, -1,
+ 13, 6,
+ 14, 10,
+ -1, 11, // 25, 26
+ 30, 31, // Actually I2C, but not used
+ 21, -1,
+ 22, 26,
+ 23, -1,
+ 24, 27,
+ 25, 28,
+ -1, 29,
+ -1, -1,
+ -1, -1,
+ -1, -1,
+ -1, -1,
+ -1, -1,
+ 17, 18,
+ 19, 20,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1
+} ;
+
+static char *physNames [64] =
+{
+ NULL,
+
+ " 3.3v", "5v ",
+ " SDA.1", "5V ",
+ " SCL.1", "0v ",
+ "GPIO. 7", "TxD ",
+ " 0v", "RxD ",
+ "GPIO. 0", "GPIO. 1",
+ "GPIO. 2", "0v ",
+ "GPIO. 3", "GPIO. 4",
+ " 3.3v", "GPIO. 5",
+ " MOSI", "0v ",
+ " MISO", "GPIO. 6",
+ " SCLK", "CE0 ",
+ " 0v", "CE1 ",
+ " SDA.0", "SCL.0 ",
+ "GPIO.21", "0v ",
+ "GPIO.22", "GPIO.26",
+ "GPIO.23", "0v ",
+ "GPIO.24", "GPIO.27",
+ "GPIO.25", "GPIO.28",
+ " 0v", "GPIO.29",
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ NULL, NULL,
+ "GPIO.17", "GPIO.18",
+ "GPIO.19", "GPIO.20",
+ NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+} ;
+
+
+/*
+ * readallPhys:
+ * Given a physical pin output the data on it and the next pin:
+ *| BCM | wPi | Name | Mode | Val| Physical |Val | Mode | Name | wPi | BCM |
+ *********************************************************************************
+ */
+
+static void readallPhys (int physPin)
+{
+ int pin ;
+
+ if (physPinToGpio (physPin) == -1)
+ printf (" | | ") ;
+ else
+ printf (" | %3d | %3d", physPinToGpio (physPin), physToWpi [physPin]) ;
+
+ printf (" | %s", physNames [physPin]) ;
+
+ if (physToWpi [physPin] == -1)
+ printf (" | | ") ;
+ else
+ {
+ /**/ if (wpMode == WPI_MODE_GPIO)
+ pin = physPinToGpio (physPin) ;
+ else if (wpMode == WPI_MODE_PHYS)
+ pin = physPin ;
+ else
+ pin = physToWpi [physPin] ;
+
+ printf (" | %4s", alts [getAlt (pin)]) ;
+ printf (" | %d", digitalRead (pin)) ;
+ }
+
+// Pin numbers:
+
+ printf (" | %2d", physPin) ;
+ ++physPin ;
+ printf (" || %-2d", physPin) ;
+
+// Same, reversed
+
+ if (physToWpi [physPin] == -1)
+ printf (" | | ") ;
+ else
+ {
+ /**/ if (wpMode == WPI_MODE_GPIO)
+ pin = physPinToGpio (physPin) ;
+ else if (wpMode == WPI_MODE_PHYS)
+ pin = physPin ;
+ else
+ pin = physToWpi [physPin] ;
+
+ printf (" | %d", digitalRead (pin)) ;
+ printf (" | %-4s", alts [getAlt (pin)]) ;
+ }
+
+ printf (" | %-5s", physNames [physPin]) ;
+
+ if (physToWpi [physPin] == -1)
+ printf (" | | ") ;
+ else
+ printf (" | %-3d | %-3d", physToWpi [physPin], physPinToGpio (physPin)) ;
+
+ printf (" |\n") ;
+}
+
+
+void cmReadall (void)
+{
+ int pin ;
+
+ printf ("+-----+------+-------+ +-----+------+-------+\n") ;
+ printf ("| Pin | Mode | Value | | Pin | Mode | Value |\n") ;
+ printf ("+-----+------+-------+ +-----+------+-------+\n") ;
+
+ for (pin = 0 ; pin < 28 ; ++pin)
+ {
+ printf ("| %3d ", pin) ;
+ printf ("| %-4s ", alts [getAlt (pin)]) ;
+ printf ("| %s ", digitalRead (pin) == HIGH ? "High" : "Low ") ;
+ printf ("| ") ;
+ printf ("| %3d ", pin + 28) ;
+ printf ("| %-4s ", alts [getAlt (pin + 28)]) ;
+ printf ("| %s ", digitalRead (pin + 28) == HIGH ? "High" : "Low ") ;
+ printf ("|\n") ;
+ }
+
+ printf ("+-----+------+-------+ +-----+------+-------+\n") ;
+}
+
+
+/*
+ * abReadall:
+ * Read all the pins on the model A or B.
+ *********************************************************************************
+ */
+
+void abReadall (int model, int rev)
+{
+ int pin ;
+ char *type ;
+
+ if (model == PI_MODEL_A)
+ type = " A" ;
+ else
+ if (rev == PI_VERSION_2)
+ type = "B2" ;
+ else
+ type = "B1" ;
+
+ printf (" +-----+-----+---------+------+---+-Model %s-+---+------+---------+-----+-----+\n", type) ;
+ printf (" | BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |\n") ;
+ printf (" +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+\n") ;
+ for (pin = 1 ; pin <= 26 ; pin += 2)
+ readallPhys (pin) ;
+
+ if (rev == PI_VERSION_2) // B version 2
+ {
+ printf (" +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+\n") ;
+ for (pin = 51 ; pin <= 54 ; pin += 2)
+ readallPhys (pin) ;
+ }
+
+ printf (" +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+\n") ;
+ printf (" | BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |\n") ;
+ printf (" +-----+-----+---------+------+---+-Model %s-+---+------+---------+-----+-----+\n", type) ;
+}
+
+
+/*
+ * bPlusReadall:
+ * Read all the pins on the model B+
+ *********************************************************************************
+ */
+
+void bPlusReadall (void)
+{
+ int pin ;
+
+ printf (" +-----+-----+---------+------+---+--B Plus--+---+------+---------+-----+-----+\n") ;
+ printf (" | BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |\n") ;
+ printf (" +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+\n") ;
+ for (pin = 1 ; pin <= 40 ; pin += 2)
+ readallPhys (pin) ;
+ printf (" +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+\n") ;
+ printf (" | BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |\n") ;
+ printf (" +-----+-----+---------+------+---+--B Plus--+---+------+---------+-----+-----+\n") ;
+}
+
+
+void doReadall (void)
+{
+ int model, rev, mem, maker, overVolted ;
+
+ if (wiringPiNodes != NULL) // External readall
+ {
+ doReadallExternal () ;
+ return ;
+ }
+
+ piBoardId (&model, &rev, &mem, &maker, &overVolted) ;
+
+ /**/ if ((model == PI_MODEL_A) || (model == PI_MODEL_B))
+ abReadall (model, rev) ;
+ else if (model == PI_MODEL_BP)
+ bPlusReadall () ;
+ else if (model == PI_MODEL_CM)
+ cmReadall () ;
+ else
+ printf ("Oops - unable to determine board type... model: %d\n", model) ;
+}
diff --git a/WiringPi/wiringPi/Makefile b/WiringPi/wiringPi/Makefile
index f0120bb..78d3612 100644
--- a/WiringPi/wiringPi/Makefile
+++ b/WiringPi/wiringPi/Makefile
@@ -35,7 +35,8 @@
DEBUG = -O2
CC = gcc
INCLUDE = -I.
-CFLAGS = $(DEBUG) -Wformat=2 -Wall $(INCLUDE) -Winline -pipe -fPIC
+DEFS = -D_GNU_SOURCE
+CFLAGS = $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC
LIBS =
@@ -51,8 +52,10 @@
mcp23s08.c mcp23s17.c \
sr595.c \
pcf8574.c pcf8591.c \
- mcp3002.c mcp4802.c mcp3422.c \
- drc.c
+ mcp3002.c mcp3004.c mcp4802.c mcp3422.c \
+ max31855.c max5322.c \
+ sn3218.c \
+ drcSerial.c
OBJ = $(SRC:.c=.o)
@@ -96,17 +99,22 @@
@install -m 0644 softTone.h $(DESTDIR)$(PREFIX)/include
@install -m 0644 wiringPiSPI.h $(DESTDIR)$(PREFIX)/include
@install -m 0644 wiringPiI2C.h $(DESTDIR)$(PREFIX)/include
+ @install -m 0644 drcSerial.h $(DESTDIR)$(PREFIX)/include
@install -m 0644 mcp23008.h $(DESTDIR)$(PREFIX)/include
@install -m 0644 mcp23016.h $(DESTDIR)$(PREFIX)/include
@install -m 0644 mcp23017.h $(DESTDIR)$(PREFIX)/include
@install -m 0644 mcp23s08.h $(DESTDIR)$(PREFIX)/include
@install -m 0644 mcp23s17.h $(DESTDIR)$(PREFIX)/include
+ @install -m 0644 max31855.h $(DESTDIR)$(PREFIX)/include
+ @install -m 0644 max5322.h $(DESTDIR)$(PREFIX)/include
@install -m 0644 mcp3002.h $(DESTDIR)$(PREFIX)/include
+ @install -m 0644 mcp3004.h $(DESTDIR)$(PREFIX)/include
@install -m 0644 mcp4802.h $(DESTDIR)$(PREFIX)/include
@install -m 0644 mcp3422.h $(DESTDIR)$(PREFIX)/include
@install -m 0644 sr595.h $(DESTDIR)$(PREFIX)/include
@install -m 0644 pcf8574.h $(DESTDIR)$(PREFIX)/include
@install -m 0644 pcf8591.h $(DESTDIR)$(PREFIX)/include
+ @install -m 0644 sn3218.h $(DESTDIR)$(PREFIX)/include
.PHONEY: install
install: $(DYNAMIC) install-headers
@@ -132,17 +140,22 @@
@rm -f $(DESTDIR)$(PREFIX)/include/softTone.h
@rm -f $(DESTDIR)$(PREFIX)/include/wiringPiSPI.h
@rm -f $(DESTDIR)$(PREFIX)/include/wiringPiI2C.h
+ @rm -f $(DESTDIR)$(PREFIX)/include/drcSerial.h
@rm -f $(DESTDIR)$(PREFIX)/include/mcp23008.h
@rm -f $(DESTDIR)$(PREFIX)/include/mcp23016.h
@rm -f $(DESTDIR)$(PREFIX)/include/mcp23017.h
@rm -f $(DESTDIR)$(PREFIX)/include/mcp23s08.h
@rm -f $(DESTDIR)$(PREFIX)/include/mcp23s17.h
+ @rm -f $(DESTDIR)$(PREFIX)/include/max31855.h
+ @rm -f $(DESTDIR)$(PREFIX)/include/max5322.h
@rm -f $(DESTDIR)$(PREFIX)/include/mcp3002.h
+ @rm -f $(DESTDIR)$(PREFIX)/include/mcp3004.h
@rm -f $(DESTDIR)$(PREFIX)/include/mcp4802.h
@rm -f $(DESTDIR)$(PREFIX)/include/mcp3422.h
@rm -f $(DESTDIR)$(PREFIX)/include/sr595.h
@rm -f $(DESTDIR)$(PREFIX)/include/pcf8574.h
@rm -f $(DESTDIR)$(PREFIX)/include/pcf8591.h
+ @rm -f $(DESTDIR)$(PREFIX)/include/sn3218.h
@rm -f $(DESTDIR)$(PREFIX)/lib/libwiringPi.*
@ldconfig
@@ -153,7 +166,7 @@
# DO NOT DELETE
-wiringPi.o: wiringPi.h
+wiringPi.o: softPwm.h softTone.h wiringPi.h
wiringSerial.o: wiringSerial.h
wiringShift.o: wiringPi.h wiringShift.h
piHiPri.o: wiringPi.h
@@ -171,6 +184,10 @@
pcf8574.o: wiringPi.h wiringPiI2C.h pcf8574.h
pcf8591.o: wiringPi.h wiringPiI2C.h pcf8591.h
mcp3002.o: wiringPi.h wiringPiSPI.h mcp3002.h
+mcp3004.o: wiringPi.h wiringPiSPI.h mcp3004.h
mcp4802.o: wiringPi.h wiringPiSPI.h mcp4802.h
mcp3422.o: wiringPi.h wiringPiI2C.h mcp3422.h
-drc.o: wiringPi.h wiringSerial.h drc.h
+max31855.o: wiringPi.h wiringPiSPI.h max31855.h
+max5322.o: wiringPi.h wiringPiSPI.h max5322.h
+sn3218.o: wiringPi.h wiringPiI2C.h sn3218.h
+drcSerial.o: wiringPi.h wiringSerial.h drcSerial.h
diff --git a/WiringPi/wiringPi/drc.c b/WiringPi/wiringPi/drcSerial.c
similarity index 90%
rename from WiringPi/wiringPi/drc.c
rename to WiringPi/wiringPi/drcSerial.c
index 07baf17..6491a98 100644
--- a/WiringPi/wiringPi/drc.c
+++ b/WiringPi/wiringPi/drcSerial.c
@@ -1,6 +1,6 @@
/*
- * drc.c:
- * Extend wiringPi with the DRC control protocll to Arduino
+ * drcSerial.c:
+ * Extend wiringPi with the DRC Serial protocol (e.g. to Arduino)
* Copyright (c) 2013 Gordon Henderson
***********************************************************************
* This file is part of wiringPi:
@@ -30,7 +30,7 @@
#include "wiringPi.h"
#include "wiringSerial.h"
-#include "drc.h"
+#include "drcSerial.h"
#ifndef TRUE
# define TRUE (1==1)
@@ -69,7 +69,7 @@
// Force pin into input mode
serialPutchar (node->fd, 'i' ) ;
- serialPutchar (node->fd, pin) ;
+ serialPutchar (node->fd, pin - node->pinBase) ;
/**/ if (mode == PUD_UP)
{
@@ -148,14 +148,14 @@
*********************************************************************************
*/
-int drcSetup (const int pinBase, const int numPins, const char *device)
+int drcSetupSerial (const int pinBase, const int numPins, const char *device, const int baud)
{
int fd ;
int ok, tries ;
time_t then ;
struct wiringPiNodeStruct *node ;
- if ((fd = serialOpen (device, 115200)) < 0)
+ if ((fd = serialOpen (device, baud)) < 0)
return wiringPiFailure (WPI_ALMOST, "Unable to open DRC device (%s): %s", device, strerror (errno)) ;
delay (10) ; // May need longer if it's an Uno that reboots on the open...
@@ -166,9 +166,9 @@
(void)serialGetchar (fd) ;
ok = FALSE ;
- for (tries = 1 ; tries < 5 ; ++tries)
+ for (tries = 1 ; (tries < 5) && (!ok) ; ++tries)
{
- serialPutchar (fd, '@') ;
+ serialPutchar (fd, '@') ; // Ping
then = time (NULL) + 2 ;
while (time (NULL) < then)
if (serialDataAvail (fd))
@@ -179,14 +179,12 @@
break ;
}
}
- if (ok)
- break ;
}
if (!ok)
{
serialClose (fd) ;
- return wiringPiFailure (WPI_FATAL, "Unable to communidate with DRC device") ;
+ return wiringPiFailure (WPI_FATAL, "Unable to communicate with DRC serial device") ;
}
node = wiringPiNewNode (pinBase, numPins) ;
diff --git a/WiringPi/wiringPi/drc.h b/WiringPi/wiringPi/drcSerial.h
similarity index 84%
rename from WiringPi/wiringPi/drc.h
rename to WiringPi/wiringPi/drcSerial.h
index c2c4ff3..29e988e 100644
--- a/WiringPi/wiringPi/drc.h
+++ b/WiringPi/wiringPi/drcSerial.h
@@ -1,6 +1,6 @@
/*
- * drc.h:
- * Extend wiringPi with the DRC control protocll to Arduino
+ * drcSerial.h:
+ * Extend wiringPi with the DRC Serial protocol (e.g. to Arduino)
* Copyright (c) 2013 Gordon Henderson
***********************************************************************
* This file is part of wiringPi:
@@ -26,8 +26,7 @@
extern "C" {
#endif
-int drcSetup (const int pinBase, const int numPins, const char *device) ;
-
+extern int drcSetupSerial (const int pinBase, const int numPins, const char *device, const int baud) ;
#ifdef __cplusplus
}
diff --git a/WiringPi/wiringPi/mcp3002.c b/WiringPi/wiringPi/mcp3002.c
index 2e7d5cf..5d44940 100644
--- a/WiringPi/wiringPi/mcp3002.c
+++ b/WiringPi/wiringPi/mcp3002.c
@@ -55,7 +55,7 @@
/*
* mcp3002Setup:
- * Create a new wiringPi device node for an mcp2003 on the Pi's
+ * Create a new wiringPi device node for an mcp3002 on the Pi's
* SPI interface.
*********************************************************************************
*/
diff --git a/WiringPi/wiringPi/mcp3422.c b/WiringPi/wiringPi/mcp3422.c
index 8e26d76..831aece 100644
--- a/WiringPi/wiringPi/mcp3422.c
+++ b/WiringPi/wiringPi/mcp3422.c
@@ -1,6 +1,7 @@
/*
* mcp3422.c:
* Extend wiringPi with the MCP3422 I2C ADC chip
+ * Also works for the MCP3423 and MCP3224 (4 channel) chips
* Copyright (c) 2013 Gordon Henderson
***********************************************************************
* This file is part of wiringPi:
@@ -24,6 +25,7 @@
#include <stdio.h>
+#include <unistd.h>
#include <stdint.h>
#include <fcntl.h>
#include <sys/ioctl.h>
@@ -43,7 +45,8 @@
int myAnalogRead (struct wiringPiNodeStruct *node, int chan)
{
- unsigned char config, b0, b1, b2, b3 ;
+ unsigned char config ;
+ unsigned char buffer [4] ;
int value = 0 ;
// One-shot mode, trigger plus the other configs.
@@ -56,35 +59,26 @@
{
case MCP3422_SR_3_75: // 18 bits
delay (270) ;
- b0 = wiringPiI2CRead (node->fd) ;
- b1 = wiringPiI2CRead (node->fd) ;
- b2 = wiringPiI2CRead (node->fd) ;
- b3 = wiringPiI2CRead (node->fd) ;
- value = ((b0 & 3) << 16) | (b1 << 8) | b2 ;
+ read (node->fd, buffer, 4) ;
+ value = ((buffer [0] & 3) << 16) | (buffer [1] << 8) | buffer [0] ;
break ;
case MCP3422_SR_15: // 16 bits
delay ( 70) ;
- b0 = wiringPiI2CRead (node->fd) ;
- b1 = wiringPiI2CRead (node->fd) ;
- b2 = wiringPiI2CRead (node->fd) ;
- value = (b0 << 8) | b1 ;
+ read (node->fd, buffer, 3) ;
+ value = (buffer [0] << 8) | buffer [1] ;
break ;
case MCP3422_SR_60: // 14 bits
delay ( 17) ;
- b0 = wiringPiI2CRead (node->fd) ;
- b1 = wiringPiI2CRead (node->fd) ;
- b2 = wiringPiI2CRead (node->fd) ;
- value = ((b0 & 0x3F) << 8) | b1 ;
+ read (node->fd, buffer, 3) ;
+ value = ((buffer [0] & 0x3F) << 8) | buffer [1] ;
break ;
case MCP3422_SR_240: // 12 bits
delay ( 5) ;
- b0 = wiringPiI2CRead (node->fd) ;
- b1 = wiringPiI2CRead (node->fd) ;
- b2 = wiringPiI2CRead (node->fd) ;
- value = ((b0 & 0x0F) << 8) | b1 ;
+ read (node->fd, buffer, 3) ;
+ value = ((buffer [0] & 0x0F) << 8) | buffer [0] ;
break ;
}
@@ -98,7 +92,7 @@
*********************************************************************************
*/
-int mcp3422Setup (int pinBase, int i2cAddress, int channels, int sampleRate, int gain)
+int mcp3422Setup (int pinBase, int i2cAddress, int sampleRate, int gain)
{
int fd ;
struct wiringPiNodeStruct *node ;
@@ -106,7 +100,7 @@
if ((fd = wiringPiI2CSetup (i2cAddress)) < 0)
return fd ;
- node = wiringPiNewNode (pinBase, channels) ;
+ node = wiringPiNewNode (pinBase, 4) ;
node->data0 = sampleRate ;
node->data1 = gain ;
diff --git a/WiringPi/wiringPi/mcp3422.h b/WiringPi/wiringPi/mcp3422.h
index 8b4e350..bb4692d 100644
--- a/WiringPi/wiringPi/mcp3422.h
+++ b/WiringPi/wiringPi/mcp3422.h
@@ -36,7 +36,7 @@
extern "C" {
#endif
-extern int mcp3422Setup (int pinBase, int i2cAddress, int channels, int sampleRate, int gain) ;
+extern int mcp3422Setup (int pinBase, int i2cAddress, int sampleRate, int gain) ;
#ifdef __cplusplus
}
diff --git a/WiringPi/wiringPi/softPwm.c b/WiringPi/wiringPi/softPwm.c
index a4f0fc4..3c79ba7 100644
--- a/WiringPi/wiringPi/softPwm.c
+++ b/WiringPi/wiringPi/softPwm.c
@@ -1,7 +1,7 @@
/*
* softPwm.c:
* Provide 2 channels of software driven PWM.
- * Copyright (c) 2012 Gordon Henderson
+ * Copyright (c) 2012-2014 Gordon Henderson
***********************************************************************
* This file is part of wiringPi:
* https://projects.drogon.net/raspberry-pi/wiringpi/
@@ -28,17 +28,22 @@
#include "wiringPi.h"
#include "softPwm.h"
+// MAX_PINS:
+// This is more than the number of Pi pins because we can actually softPwm
+// pins that are on GPIO expanders. It's not that efficient and more than 1 or
+// 2 pins on e.g. (SPI) mcp23s17 won't really be that effective, however...
+
#define MAX_PINS 1024
// The PWM Frequency is derived from the "pulse time" below. Essentially,
// the frequency is a function of the range and this pulse time.
-// The total period will be range * pulse time in uS, so a pulse time
-// of 100 and a range of 100 gives a period of 100 * 100 = 10,000 uS
+// The total period will be range * pulse time in µS, so a pulse time
+// of 100 and a range of 100 gives a period of 100 * 100 = 10,000 µS
// which is a frequency of 100Hz.
//
// It's possible to get a higher frequency by lowering the pulse time,
// however CPU uage will skyrocket as wiringPi uses a hard-loop to time
-// periods under 100uS - this is because the Linux timer calls are just
+// periods under 100µS - this is because the Linux timer calls are just
// accurate at all, and have an overhead.
//
// Another way to increase the frequency is to reduce the range - however
@@ -46,8 +51,9 @@
#define PULSE_TIME 100
-static int marks [MAX_PINS] ;
-static int range [MAX_PINS] ;
+static int marks [MAX_PINS] ;
+static int range [MAX_PINS] ;
+static pthread_t threads [MAX_PINS] ;
int newPin = -1 ;
@@ -61,11 +67,15 @@
static PI_THREAD (softPwmThread)
{
int pin, mark, space ;
+ struct sched_param param ;
+
+ param.sched_priority = sched_get_priority_max (SCHED_RR) ;
+ pthread_setschedparam (pthread_self (), SCHED_RR, ¶m) ;
pin = newPin ;
newPin = -1 ;
- piHiPri (50) ;
+ piHiPri (90) ;
for (;;)
{
@@ -106,13 +116,20 @@
/*
* softPwmCreate:
- * Create a new PWM thread.
+ * Create a new softPWM thread.
*********************************************************************************
*/
int softPwmCreate (int pin, int initialValue, int pwmRange)
{
int res ;
+ pthread_t myThread ;
+
+ if (range [pin] != 0) // Already running on this pin
+ return -1 ;
+
+ if (range <= 0)
+ return -1 ;
pinMode (pin, OUTPUT) ;
digitalWrite (pin, LOW) ;
@@ -121,10 +138,30 @@
range [pin] = pwmRange ;
newPin = pin ;
- res = piThreadCreate (softPwmThread) ;
+ res = pthread_create (&myThread, NULL, softPwmThread, NULL) ;
while (newPin != -1)
delay (1) ;
+ threads [pin] = myThread ;
+
return res ;
}
+
+
+/*
+ * softPwmStop:
+ * Stop an existing softPWM thread
+ *********************************************************************************
+ */
+
+void softPwmStop (int pin)
+{
+ if (range [pin] != 0)
+ {
+ pthread_cancel (threads [pin]) ;
+ pthread_join (threads [pin], NULL) ;
+ range [pin] = 0 ;
+ digitalWrite (pin, LOW) ;
+ }
+}
diff --git a/WiringPi/wiringPi/softPwm.h b/WiringPi/wiringPi/softPwm.h
index 28ad299..0351da5 100644
--- a/WiringPi/wiringPi/softPwm.h
+++ b/WiringPi/wiringPi/softPwm.h
@@ -28,6 +28,7 @@
extern int softPwmCreate (int pin, int value, int range) ;
extern void softPwmWrite (int pin, int value) ;
+extern void softPwmStop (int pin) ;
#ifdef __cplusplus
}
diff --git a/WiringPi/wiringPi/softTone.c b/WiringPi/wiringPi/softTone.c
index b4a89f8..e2fb737 100644
--- a/WiringPi/wiringPi/softTone.c
+++ b/WiringPi/wiringPi/softTone.c
@@ -36,7 +36,8 @@
#define PULSE_TIME 100
-static int freqs [MAX_PINS] ;
+static int freqs [MAX_PINS] ;
+static pthread_t threads [MAX_PINS] ;
static int newPin = -1 ;
@@ -50,6 +51,10 @@
static PI_THREAD (softToneThread)
{
int pin, freq, halfPeriod ;
+ struct sched_param param ;
+
+ param.sched_priority = sched_get_priority_max (SCHED_RR) ;
+ pthread_setschedparam (pthread_self (), SCHED_RR, ¶m) ;
pin = newPin ;
newPin = -1 ;
@@ -105,17 +110,41 @@
int softToneCreate (int pin)
{
int res ;
+ pthread_t myThread ;
pinMode (pin, OUTPUT) ;
digitalWrite (pin, LOW) ;
+ if (threads [pin] != 0)
+ return -1 ;
+
freqs [pin] = 0 ;
newPin = pin ;
- res = piThreadCreate (softToneThread) ;
+ res = pthread_create (&myThread, NULL, softToneThread, NULL) ;
while (newPin != -1)
delay (1) ;
+ threads [pin] = myThread ;
+
return res ;
}
+
+
+/*
+ * softToneStop:
+ * Stop an existing softTone thread
+ *********************************************************************************
+ */
+
+void softToneStop (int pin)
+{
+ if (threads [pin] != 0)
+ {
+ pthread_cancel (threads [pin]) ;
+ pthread_join (threads [pin], NULL) ;
+ threads [pin] = 0 ;
+ digitalWrite (pin, LOW) ;
+ }
+}
diff --git a/WiringPi/wiringPi/softTone.h b/WiringPi/wiringPi/softTone.h
index d8b4e54..a93c5af 100644
--- a/WiringPi/wiringPi/softTone.h
+++ b/WiringPi/wiringPi/softTone.h
@@ -31,6 +31,7 @@
#endif
extern int softToneCreate (int pin) ;
+extern void softToneStop (int pin) ;
extern void softToneWrite (int pin, int freq) ;
#ifdef __cplusplus
diff --git a/WiringPi/wiringPi/wiringPi.c b/WiringPi/wiringPi/wiringPi.c
index b54ad29..e7ae386 100644
--- a/WiringPi/wiringPi/wiringPi.c
+++ b/WiringPi/wiringPi/wiringPi.c
@@ -70,6 +70,9 @@
#include <sys/wait.h>
#include <sys/ioctl.h>
+#include "softPwm.h"
+#include "softTone.h"
+
#include "wiringPi.h"
#ifndef TRUE
@@ -194,6 +197,39 @@
static volatile uint32_t *timerIrqRaw ;
#endif
+
+// Data for use with the boardId functions.
+// The order of entries here to correspond with the PI_MODEL_X
+// and PI_VERSION_X defines in wiringPi.h
+// Only intended for the gpio command - use at your own risk!
+
+const char *piModelNames [5] =
+{
+ "Unknown",
+ "Model A",
+ "Model B",
+ "Model B+",
+ "Compute Module",
+} ;
+
+const char *piRevisionNames [5] =
+{
+ "Unknown",
+ "1",
+ "1.1",
+ "1.2",
+ "2",
+} ;
+
+const char *piMakerNames [4] =
+{
+ "Unknown",
+ "Egoman",
+ "Sony",
+ "Qusda",
+} ;
+
+
// Time for easy calculations
static uint64_t epochMilli, epochMicro ;
@@ -231,14 +267,16 @@
// pinToGpio:
// Take a Wiring pin (0 through X) and re-map it to the BCM_GPIO pin
-// Cope for 2 different board revisions here.
+// Cope for 3 different board revisions here.
static int *pinToGpio ;
+// Revision 1, 1.1:
+
static int pinToGpioR1 [64] =
{
17, 18, 21, 22, 23, 24, 25, 4, // From the Original Wiki - GPIO 0 through 7: wpi 0 - 7
- 0, 1, // I2C - SDA0, SCL0 wpi 8 - 9
+ 0, 1, // I2C - SDA1, SCL1 wpi 8 - 9
8, 7, // SPI - CE1, CE0 wpi 10 - 11
10, 9, 11, // SPI - MOSI, MISO, SCLK wpi 12 - 14
14, 15, // UART - Tx, Rx wpi 15 - 16
@@ -250,6 +288,8 @@
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // ... 63
} ;
+// Revision 2:
+
static int pinToGpioR2 [64] =
{
17, 18, 27, 22, 23, 24, 25, 4, // From the Original Wiki - GPIO 0 through 7: wpi 0 - 7
@@ -257,11 +297,13 @@
8, 7, // SPI - CE1, CE0 wpi 10 - 11
10, 9, 11, // SPI - MOSI, MISO, SCLK wpi 12 - 14
14, 15, // UART - Tx, Rx wpi 15 - 16
- 28, 29, 30, 31, // New GPIOs 8 though 11 wpi 17 - 20
+ 28, 29, 30, 31, // Rev 2: New GPIOs 8 though 11 wpi 17 - 20
+ 5, 6, 13, 19, 26, // B+ wpi 21, 22, 23, 24, 25
+ 12, 16, 20, 21, // B+ wpi 26, 27, 28, 29
+ 0, 1, // B+ wpi 30, 31
// Padding:
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // ... 31
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // ... 47
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // ... 63
} ;
@@ -270,6 +312,7 @@
// physToGpio:
// Take a physical pin (1 through 26) and re-map it to the BCM_GPIO pin
// Cope for 2 different board revisions here.
+// Also add in the P5 connector, so the P5 pins are 3,4,5,6, so 53,54,55,56
static int *physToGpio ;
@@ -290,8 +333,6 @@
11, 8,
-1, 7, // 25, 26
-// Padding:
-
-1, -1, -1, -1, -1, // ... 31
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // ... 47
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // ... 63
@@ -314,14 +355,31 @@
11, 8,
-1, 7, // 25, 26
-// Padding:
+// B+
- -1, -1, -1, -1, -1, // ... 31
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // ... 47
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // ... 63
+ 0, 1,
+ 5, -1,
+ 6, 12,
+ 13, -1,
+ 19, 16,
+ 26, 20,
+ -1, 21,
+
+// the P5 connector on the Rev 2 boards:
+
+ -1, -1,
+ -1, -1,
+ -1, -1,
+ -1, -1,
+ -1, -1,
+ 28, 29,
+ 30, 31,
+ -1, -1,
+ -1, -1,
+ -1, -1,
+ -1, -1,
} ;
-
// gpioToGPFSEL:
// Map a BCM_GPIO pin to it's Function Selection
// control port. (GPFSEL 0-5)
@@ -391,7 +449,7 @@
} ;
// gpioToREN
-// (Word) offset to the Rising edgde ENable register
+// (Word) offset to the Rising edge ENable register
static uint8_t gpioToREN [] =
{
@@ -541,26 +599,36 @@
/*
* piBoardRev:
* Return a number representing the hardware revision of the board.
- * Revision is currently 1 or 2.
*
- * Much confusion here )-:
+ * Revision 1 really means the early Model B's.
+ * Revision 2 is everything else - it covers the B, B+ and CM.
+ *
* Seems there are some boards with 0000 in them (mistake in manufacture)
- * and some board with 0005 in them (another mistake in manufacture?)
* So the distinction between boards that I can see is:
* 0000 - Error
- * 0001 - Not used
- * 0002 - Rev 1
- * 0003 - Rev 1
- * 0004 - Rev 2 (Early reports?
- * 0005 - Rev 2 (but error?)
- * 0006 - Rev 2
- * 0008 - Rev 2 - Model A
- * 000e - Rev 2 + 512MB
- * 000f - Rev 2 + 512MB
+ * 0001 - Not used
+ * 0002 - Model B, Rev 1, 256MB, Egoman
+ * 0003 - Model B, Rev 1.1, 256MB, Egoman, Fuses/D14 removed.
+ * 0004 - Model B, Rev 2, 256MB, Sony
+ * 0005 - Model B, Rev 2, 256MB, Qisda
+ * 0006 - Model B, Rev 2, 256MB, Egoman
+ * 0007 - Model A, Rev 2, 256MB, Egoman
+ * 0008 - Model A, Rev 2, 256MB, Sony
+ * 0009 - Model A, Rev 2, 256MB, Qisda
+ * 000d - Model B, Rev 2, 512MB, Egoman
+ * 000e - Model B, Rev 2, 512MB, Sony
+ * 000f - Model B, Rev 2, 512MB, Qisda
+ * 0010 - Model B+, Rev 1.2, 512MB, Sony
+ * 0011 - Pi CM, Rev 1.2, 512MB, Sony
*
* A small thorn is the olde style overvolting - that will add in
* 1000000
*
+ * The Pi compute module has an revision of 0011 - since we only check the
+ * last digit, then it's 1, therefore it'll default to not 2 or 3 for a
+ * Rev 1, so will appear as a Rev 2. This is fine for the most part, but
+ * we'll properly detect the Compute Module later and adjust accordingly.
+ *
*********************************************************************************
*/
@@ -577,7 +645,7 @@
{
FILE *cpuFd ;
char line [120] ;
- char *c, lastChar ;
+ char *c ;
static int boardRev = -1 ;
if (boardRev != -1) // No point checking twice
@@ -595,12 +663,16 @@
if (strncmp (line, "Revision", 8) != 0)
piBoardRevOops ("No \"Revision\" line") ;
+// Chomp trailing CR/NL
+
for (c = &line [strlen (line) - 1] ; (*c == '\n') || (*c == '\r') ; --c)
*c = 0 ;
if (wiringPiDebug)
printf ("piboardRev: Revision string: %s\n", line) ;
+// Scan to first digit
+
for (c = line ; *c ; ++c)
if (isdigit (*c))
break ;
@@ -608,6 +680,11 @@
if (!isdigit (*c))
piBoardRevOops ("No numeric revision string") ;
+// Make sure its long enough
+
+ if (strlen (c) < 4)
+ piBoardRevOops ("Bogus \"Revision\" line (too small)") ;
+
// If you have overvolted the Pi, then it appears that the revision
// has 100000 added to it!
@@ -615,12 +692,14 @@
if (strlen (c) != 4)
printf ("piboardRev: This Pi has/is overvolted!\n") ;
- lastChar = line [strlen (line) - 1] ;
+// Isolate last 4 characters:
+
+ c = c + strlen (c) - 4 ;
if (wiringPiDebug)
- printf ("piboardRev: lastChar is: '%c' (%d, 0x%02X)\n", lastChar, lastChar, lastChar) ;
+ printf ("piboardRev: last4Chars are: \"%s\"\n", c) ;
- /**/ if ((lastChar == '2') || (lastChar == '3'))
+ if ( (strcmp (c, "0002") == 0) || (strcmp (c, "0003") == 0))
boardRev = 1 ;
else
boardRev = 2 ;
@@ -633,6 +712,82 @@
/*
+ * piBoardId:
+ * Do more digging into the board revision string as above, but return
+ * as much details as we can.
+ * This is undocumented and really only intended for the GPIO command.
+ * Use at your own risk!
+ *********************************************************************************
+ */
+
+void piBoardId (int *model, int *rev, int *mem, int *maker, int *overVolted)
+{
+ FILE *cpuFd ;
+ char line [120] ;
+ char *c ;
+
+ (void)piBoardRev () ; // Call this first to make sure all's OK. Don't care about the result.
+
+ if ((cpuFd = fopen ("/proc/cpuinfo", "r")) == NULL)
+ piBoardRevOops ("Unable to open /proc/cpuinfo") ;
+
+ while (fgets (line, 120, cpuFd) != NULL)
+ if (strncmp (line, "Revision", 8) == 0)
+ break ;
+
+ fclose (cpuFd) ;
+
+ if (strncmp (line, "Revision", 8) != 0)
+ piBoardRevOops ("No \"Revision\" line") ;
+
+// Chomp trailing CR/NL
+
+ for (c = &line [strlen (line) - 1] ; (*c == '\n') || (*c == '\r') ; --c)
+ *c = 0 ;
+
+ if (wiringPiDebug)
+ printf ("piboardId: Revision string: %s\n", line) ;
+
+// Scan to first digit
+
+ for (c = line ; *c ; ++c)
+ if (isdigit (*c))
+ break ;
+
+// Make sure its long enough
+
+ if (strlen (c) < 4)
+ piBoardRevOops ("Bogus \"Revision\" line") ;
+
+// If longer than 4, we'll assume it's been overvolted
+
+ *overVolted = strlen (c) > 4 ;
+
+// Extract last 4 characters:
+
+ c = c + strlen (c) - 4 ;
+
+// Fill out the replys as appropriate
+
+ /**/ if (strcmp (c, "0002") == 0) { *model = PI_MODEL_B ; *rev = PI_VERSION_1 ; *mem = 256 ; *maker = PI_MAKER_EGOMAN ; }
+ else if (strcmp (c, "0003") == 0) { *model = PI_MODEL_B ; *rev = PI_VERSION_1_1 ; *mem = 256 ; *maker = PI_MAKER_EGOMAN ; }
+ else if (strcmp (c, "0004") == 0) { *model = PI_MODEL_B ; *rev = PI_VERSION_2 ; *mem = 256 ; *maker = PI_MAKER_SONY ; }
+ else if (strcmp (c, "0005") == 0) { *model = PI_MODEL_B ; *rev = PI_VERSION_2 ; *mem = 256 ; *maker = PI_MAKER_QISDA ; }
+ else if (strcmp (c, "0006") == 0) { *model = PI_MODEL_B ; *rev = PI_VERSION_2 ; *mem = 256 ; *maker = PI_MAKER_EGOMAN ; }
+ else if (strcmp (c, "0007") == 0) { *model = PI_MODEL_A ; *rev = PI_VERSION_2 ; *mem = 256 ; *maker = PI_MAKER_EGOMAN ; }
+ else if (strcmp (c, "0008") == 0) { *model = PI_MODEL_A ; *rev = PI_VERSION_2 ; *mem = 256 ; *maker = PI_MAKER_SONY ; ; }
+ else if (strcmp (c, "0009") == 0) { *model = PI_MODEL_B ; *rev = PI_VERSION_2 ; *mem = 256 ; *maker = PI_MAKER_QISDA ; }
+ else if (strcmp (c, "000d") == 0) { *model = PI_MODEL_B ; *rev = PI_VERSION_2 ; *mem = 512 ; *maker = PI_MAKER_EGOMAN ; }
+ else if (strcmp (c, "000e") == 0) { *model = PI_MODEL_B ; *rev = PI_VERSION_2 ; *mem = 512 ; *maker = PI_MAKER_SONY ; }
+ else if (strcmp (c, "000f") == 0) { *model = PI_MODEL_B ; *rev = PI_VERSION_2 ; *mem = 512 ; *maker = PI_MAKER_EGOMAN ; }
+ else if (strcmp (c, "0010") == 0) { *model = PI_MODEL_BP ; *rev = PI_VERSION_1_2 ; *mem = 512 ; *maker = PI_MAKER_SONY ; }
+ else if (strcmp (c, "0011") == 0) { *model = PI_MODEL_CM ; *rev = PI_VERSION_1_2 ; *mem = 512 ; *maker = PI_MAKER_SONY ; }
+ else { *model = 0 ; *rev = 0 ; *mem = 0 ; *maker = 0 ; }
+}
+
+
+
+/*
* wpiPinToGpio:
* Translate a wiringPi Pin number to native GPIO pin number.
* Provided for external support.
@@ -961,6 +1116,7 @@
{
int fSel, shift, alt ;
struct wiringPiNodeStruct *node = wiringPiNodes ;
+ int origPin = pin ;
if ((pin & PI_GPIO_MASK) == 0) // On-board pin
{
@@ -971,6 +1127,9 @@
else if (wiringPiMode != WPI_MODE_GPIO)
return ;
+ softPwmStop (origPin) ;
+ softToneStop (origPin) ;
+
fSel = gpioToGPFSEL [pin] ;
shift = gpioToShift [pin] ;
@@ -978,9 +1137,18 @@
*(gpio + fSel) = (*(gpio + fSel) & ~(7 << shift)) ; // Sets bits to zero = input
else if (mode == OUTPUT)
*(gpio + fSel) = (*(gpio + fSel) & ~(7 << shift)) | (1 << shift) ;
+ else if (mode == SOFT_PWM_OUTPUT)
+ softPwmCreate (origPin, 0, 100) ;
+ else if (mode == SOFT_TONE_OUTPUT)
+ softToneCreate (origPin) ;
+ else if (mode == PWM_TONE_OUTPUT)
+ {
+ pinMode (origPin, PWM_OUTPUT) ; // Call myself to enable PWM mode
+ pwmSetMode (PWM_MODE_MS) ;
+ }
else if (mode == PWM_OUTPUT)
{
- if ((alt = gpioToPwmALT [pin]) == 0) // Not a PWM pin
+ if ((alt = gpioToPwmALT [pin]) == 0) // Not a hardware capable PWM pin
return ;
// Set pin to PWM mode
@@ -990,7 +1158,7 @@
pwmSetMode (PWM_MODE_BAL) ; // Pi default mode
pwmSetRange (1024) ; // Default range of 1024
- pwmSetClock (32) ; // 19.2 / 32 = 600KHz - Also starts the PWM
+ pwmSetClock (32) ; // 19.2 / 32 = 600KHz - Also starts the PWM
}
else if (mode == GPIO_CLOCK)
{
@@ -1203,6 +1371,28 @@
}
+/*
+ * pwmToneWrite:
+ * Pi Specific.
+ * Output the given frequency on the Pi's PWM pin
+ *********************************************************************************
+ */
+
+void pwmToneWrite (int pin, int freq)
+{
+ int range ;
+
+ if (freq == 0)
+ pwmWrite (pin, 0) ; // Off
+ else
+ {
+ range = 600000 / freq ;
+ pwmSetRange (range) ;
+ pwmWrite (pin, freq / 2) ;
+ }
+}
+
+
/*
* digitalWriteByte:
@@ -1369,8 +1559,18 @@
if (pid == 0) // Child, exec
{
- execl ("/usr/local/bin/gpio", "gpio", "edge", pinS, modeS, (char *)NULL) ;
- return wiringPiFailure (WPI_FATAL, "wiringPiISR: execl failed: %s\n", strerror (errno)) ;
+ /**/ if (access ("/usr/local/bin/gpio", X_OK) == 0)
+ {
+ execl ("/usr/local/bin/gpio", "gpio", "edge", pinS, modeS, (char *)NULL) ;
+ return wiringPiFailure (WPI_FATAL, "wiringPiISR: execl failed: %s\n", strerror (errno)) ;
+ }
+ else if (access ("/usr/bin/gpio", X_OK) == 0)
+ {
+ execl ("/usr/bin/gpio", "gpio", "edge", pinS, modeS, (char *)NULL) ;
+ return wiringPiFailure (WPI_FATAL, "wiringPiISR: execl failed: %s\n", strerror (errno)) ;
+ }
+ else
+ return wiringPiFailure (WPI_FATAL, "wiringPiISR: Can't find gpio program\n") ;
}
else // Parent, wait
wait (NULL) ;
@@ -1531,13 +1731,16 @@
*
* Default setup: Initialises the system into wiringPi Pin mode and uses the
* memory mapped hardware directly.
+ *
+ * Changed now to revert to "gpio" mode if we're running on a Compute Module.
*********************************************************************************
*/
int wiringPiSetup (void)
{
- int fd ;
- int boardRev ;
+ int fd ;
+ int boardRev ;
+ int model, rev, mem, maker, overVolted ;
if (getenv (ENV_DEBUG) != NULL)
wiringPiDebug = TRUE ;
@@ -1553,12 +1756,12 @@
boardRev = piBoardRev () ;
- if (boardRev == 1)
+ /**/ if (boardRev == 1) // A, B, Rev 1, 1.1
{
pinToGpio = pinToGpioR1 ;
physToGpio = physToGpioR1 ;
}
- else
+ else // A, B, Rev 2, B+, CM
{
pinToGpio = pinToGpioR2 ;
physToGpio = physToGpioR2 ;
@@ -1611,7 +1814,13 @@
initialiseEpoch () ;
- wiringPiMode = WPI_MODE_PINS ;
+// If we're running on a compute module, then wiringPi pin numbers don't really many anything...
+
+ piBoardId (&model, &rev, &mem, &maker, &overVolted) ;
+ if (model == PI_MODEL_CM)
+ wiringPiMode = WPI_MODE_GPIO ;
+ else
+ wiringPiMode = WPI_MODE_PINS ;
return 0 ;
}
diff --git a/WiringPi/wiringPi/wiringPi.h b/WiringPi/wiringPi/wiringPi.h
index 7cfd2e5..2bc63ba 100644
--- a/WiringPi/wiringPi/wiringPi.h
+++ b/WiringPi/wiringPi/wiringPi.h
@@ -24,9 +24,6 @@
#ifndef __WIRING_PI_H__
#define __WIRING_PI_H__
-#ifndef O_CLOEXEC
-#define O_CLOEXEC 0
-#endif
// Handy defines
// Deprecated
@@ -45,6 +42,9 @@
#define OUTPUT 1
#define PWM_OUTPUT 2
#define GPIO_CLOCK 3
+#define SOFT_PWM_OUTPUT 4
+#define SOFT_TONE_OUTPUT 5
+#define PWM_TONE_OUTPUT 6
#define LOW 0
#define HIGH 1
@@ -67,6 +67,33 @@
#define INT_EDGE_RISING 2
#define INT_EDGE_BOTH 3
+// Pi model types and version numbers
+// Intended for the GPIO program Use at your own risk.
+
+#define PI_MODEL_UNKNOWN 0
+#define PI_MODEL_A 1
+#define PI_MODEL_B 2
+#define PI_MODEL_BP 3
+#define PI_MODEL_CM 4
+
+#define PI_VERSION_UNKNOWN 0
+#define PI_VERSION_1 1
+#define PI_VERSION_1_1 2
+#define PI_VERSION_1_2 3
+#define PI_VERSION_2 4
+
+#define PI_MAKER_UNKNOWN 0
+#define PI_MAKER_EGOMAN 1
+#define PI_MAKER_SONY 2
+#define PI_MAKER_QISDA 3
+
+extern const char *piModelNames [5] ;
+extern const char *piRevisionNames [5] ;
+extern const char *piMakerNames [4] ;
+
+
+// Intended for the GPIO program Use at your own risk.
+
// Threads
#define PI_THREAD(X) void *X (void *dummy)
@@ -118,6 +145,11 @@
extern "C" {
#endif
+// Data
+
+//extern const char *piModelNames [] ;
+//extern const char *piRevisionNames[] ;
+
// Internal
extern int wiringPiFailure (int fatal, const char *message, ...) ;
@@ -150,10 +182,12 @@
// On-Board Raspberry Pi hardware specific stuff
extern int piBoardRev (void) ;
+extern void piBoardId (int *model, int *rev, int *mem, int *maker, int *overVolted) ;
extern int wpiPinToGpio (int wpiPin) ;
extern int physPinToGpio (int physPin) ;
extern void setPadDrive (int group, int value) ;
extern int getAlt (int pin) ;
+extern void pwmToneWrite (int pin, int freq) ;
extern void digitalWriteByte (int value) ;
extern void pwmSetMode (int mode) ;
extern void pwmSetRange (unsigned int range) ;
diff --git a/setup.py b/setup.py
index ac52a91..22ce8eb 100644
--- a/setup.py
+++ b/setup.py
@@ -4,41 +4,42 @@
_wiringpi2 = Extension(
'_wiringpi2',
+ include_dirs=['WiringPi/wiringPi','WiringPi/devLib'],
sources=[
- 'WiringPi/wiringPi/wiringPi.c',
- 'WiringPi/wiringPi/wiringPiSPI.c',
+ 'WiringPi/devLib/ds1302.c',
+ 'WiringPi/devLib/gertboard.c',
+ 'WiringPi/devLib/lcd128x64.c',
+ 'WiringPi/devLib/lcd.c',
+ 'WiringPi/devLib/maxdetect.c',
+ 'WiringPi/devLib/piFace.c',
+ 'WiringPi/devLib/piGlow.c',
+ 'WiringPi/devLib/piNes.c',
+ 'WiringPi/wiringPi/drcSerial.c',
'WiringPi/wiringPi/max31855.c',
'WiringPi/wiringPi/max5322.c',
- 'WiringPi/wiringPi/drc.c',
- 'WiringPi/wiringPi/sn3218.c',
- 'WiringPi/wiringPi/mcp23s17.c',
- 'WiringPi/wiringPi/pcf8591.c',
- 'WiringPi/wiringPi/softTone.c',
- 'WiringPi/wiringPi/wiringSerial.c',
'WiringPi/wiringPi/mcp23008.c',
+ 'WiringPi/wiringPi/mcp23016.c',
+ 'WiringPi/wiringPi/mcp23017.c',
+ 'WiringPi/wiringPi/mcp23s08.c',
+ 'WiringPi/wiringPi/mcp23s17.c',
'WiringPi/wiringPi/mcp3002.c',
'WiringPi/wiringPi/mcp3004.c',
- 'WiringPi/wiringPi/piHiPri.c',
- 'WiringPi/wiringPi/sr595.c',
- 'WiringPi/wiringPi/wiringShift.c',
- 'WiringPi/wiringPi/mcp23016.c',
'WiringPi/wiringPi/mcp3422.c',
- 'WiringPi/wiringPi/piThread.c',
- 'WiringPi/wiringPi/mcp23017.c',
'WiringPi/wiringPi/mcp4802.c',
- 'WiringPi/wiringPi/softPwm.c',
- 'WiringPi/wiringPi/wiringPiI2C.c',
- 'WiringPi/wiringPi/mcp23s08.c',
'WiringPi/wiringPi/pcf8574.c',
+ 'WiringPi/wiringPi/pcf8591.c',
+ 'WiringPi/wiringPi/piHiPri.c',
+ 'WiringPi/wiringPi/piThread.c',
+ 'WiringPi/wiringPi/sn3218.c',
+ 'WiringPi/wiringPi/softPwm.c',
'WiringPi/wiringPi/softServo.c',
- 'WiringPi/devLib/ds1302.c',
- 'WiringPi/devLib/lcd128x64.c',
- 'WiringPi/devLib/maxdetect.c',
- 'WiringPi/devLib/gertboard.c',
- 'WiringPi/devLib/lcd.c',
- 'WiringPi/devLib/piFace.c',
- 'WiringPi/devLib/piNes.c',
- 'WiringPi/devLib/piGlow.c',
+ 'WiringPi/wiringPi/softTone.c',
+ 'WiringPi/wiringPi/sr595.c',
+ 'WiringPi/wiringPi/wiringPi.c',
+ 'WiringPi/wiringPi/wiringPiI2C.c',
+ 'WiringPi/wiringPi/wiringPiSPI.c',
+ 'WiringPi/wiringPi/wiringSerial.c',
+ 'WiringPi/wiringPi/wiringShift.c',
'wiringpi_wrap.c'
],
)
@@ -58,40 +59,41 @@
install_requires=[],
headers=[
'WiringPi/wiringPi/wiringPi.h',
+ 'WiringPi/wiringPi/wiringPi.h',
'WiringPi/wiringPi/wiringPiI2C.h',
+ 'WiringPi/wiringPi/wiringPiSPI.h',
+ 'WiringPi/wiringPi/wiringSerial.h',
+ 'WiringPi/wiringPi/wiringShift.h',
+ 'WiringPi/devLib/ds1302.h',
+ 'WiringPi/devLib/font.h',
+ 'WiringPi/devLib/gertboard.h',
+ 'WiringPi/devLib/lcd128x64.h',
+ 'WiringPi/devLib/lcd.h',
+ 'WiringPi/devLib/maxdetect.h',
+ 'WiringPi/devLib/piFace.h',
+ 'WiringPi/devLib/piGlow.h',
+ 'WiringPi/devLib/piNes.h',
+ 'WiringPi/wiringPi/drcSerial.h',
'WiringPi/wiringPi/max31855.h',
'WiringPi/wiringPi/max5322.h',
- 'WiringPi/wiringPi/drc.h',
- 'WiringPi/wiringPi/sn3218.h',
- 'WiringPi/wiringPi/mcp23s08.h',
- 'WiringPi/wiringPi/mcp3422.h',
- 'WiringPi/wiringPi/softServo.h',
- 'WiringPi/wiringPi/wiringPiSPI.h',
'WiringPi/wiringPi/mcp23008.h',
- 'WiringPi/wiringPi/mcp23s17.h',
- 'WiringPi/wiringPi/mcp4802.h',
- 'WiringPi/wiringPi/softTone.h',
- 'WiringPi/wiringPi/wiringSerial.h',
'WiringPi/wiringPi/mcp23016.h',
- 'WiringPi/wiringPi/mcp23x0817.h',
- 'WiringPi/wiringPi/pcf8574.h',
- 'WiringPi/wiringPi/sr595.h',
- 'WiringPi/wiringPi/wiringShift.h',
'WiringPi/wiringPi/mcp23016reg.h',
- 'WiringPi/wiringPi/mcp23x08.h',
- 'WiringPi/wiringPi/pcf8591.h',
'WiringPi/wiringPi/mcp23017.h',
+ 'WiringPi/wiringPi/mcp23s08.h',
+ 'WiringPi/wiringPi/mcp23s17.h',
+ 'WiringPi/wiringPi/mcp23x0817.h',
+ 'WiringPi/wiringPi/mcp23x08.h',
'WiringPi/wiringPi/mcp3002.h',
'WiringPi/wiringPi/mcp3004.h',
+ 'WiringPi/wiringPi/mcp3422.h',
+ 'WiringPi/wiringPi/mcp4802.h',
+ 'WiringPi/wiringPi/pcf8574.h',
+ 'WiringPi/wiringPi/pcf8591.h',
+ 'WiringPi/wiringPi/sn3218.h',
'WiringPi/wiringPi/softPwm.h',
- 'WiringPi/devLib/ds1302.h',
- 'WiringPi/devLib/gertboard.h',
- 'WiringPi/devLib/lcd.h',
- 'WiringPi/devLib/piFace.h',
- 'WiringPi/devLib/font.h',
- 'WiringPi/devLib/lcd128x64.h',
- 'WiringPi/devLib/maxdetect.h',
- 'WiringPi/devLib/piNes.h'
- 'WiringPi/devLib/piGlow.h',
+ 'WiringPi/wiringPi/softServo.h',
+ 'WiringPi/wiringPi/softTone.h',
+ 'WiringPi/wiringPi/sr595.h'
]
)
diff --git a/wiringpi.i b/wiringpi.i
index 6132a36..89832b4 100644
--- a/wiringpi.i
+++ b/wiringpi.i
@@ -2,54 +2,60 @@
%{
#include "WiringPi/wiringPi/wiringPi.h"
-#include "WiringPi/wiringPi/wiringPiSPI.h"
#include "WiringPi/wiringPi/wiringPiI2C.h"
+#include "WiringPi/wiringPi/wiringPiSPI.h"
#include "WiringPi/wiringPi/wiringSerial.h"
#include "WiringPi/wiringPi/wiringShift.h"
+#include "WiringPi/wiringPi/drcSerial.h"
#include "WiringPi/wiringPi/max31855.h"
#include "WiringPi/wiringPi/max5322.h"
-#include "WiringPi/wiringPi/mcp23017.h"
-#include "WiringPi/wiringPi/mcp4802.h"
-#include "WiringPi/wiringPi/mcp3422.h"
-#include "WiringPi/wiringPi/mcp23s08.h"
#include "WiringPi/wiringPi/mcp23008.h"
-#include "WiringPi/wiringPi/mcp23x08.h"
#include "WiringPi/wiringPi/mcp23016.h"
+#include "WiringPi/wiringPi/mcp23016reg.h"
+#include "WiringPi/wiringPi/mcp23017.h"
+#include "WiringPi/wiringPi/mcp23s08.h"
+#include "WiringPi/wiringPi/mcp23s17.h"
+#include "WiringPi/wiringPi/mcp23x0817.h"
+#include "WiringPi/wiringPi/mcp23x08.h"
#include "WiringPi/wiringPi/mcp3002.h"
#include "WiringPi/wiringPi/mcp3004.h"
-#include "WiringPi/wiringPi/mcp23016reg.h"
-#include "WiringPi/wiringPi/sn3218.h"
-#include "WiringPi/wiringPi/mcp23x0817.h"
-#include "WiringPi/wiringPi/mcp23s17.h"
+#include "WiringPi/wiringPi/mcp3422.h"
+#include "WiringPi/wiringPi/mcp4802.h"
#include "WiringPi/wiringPi/pcf8574.h"
#include "WiringPi/wiringPi/pcf8591.h"
-#include "WiringPi/wiringPi/drc.h"
+#include "WiringPi/wiringPi/sn3218.h"
#include "WiringPi/wiringPi/softPwm.h"
#include "WiringPi/wiringPi/softServo.h"
#include "WiringPi/wiringPi/softTone.h"
#include "WiringPi/wiringPi/sr595.h"
+#include "WiringPi/devLib/ds1302.h"
+#include "WiringPi/devLib/font.h"
#include "WiringPi/devLib/gertboard.h"
#include "WiringPi/devLib/lcd128x64.h"
-#include "WiringPi/devLib/font.h"
#include "WiringPi/devLib/lcd.h"
#include "WiringPi/devLib/maxdetect.h"
#include "WiringPi/devLib/piFace.h"
-#include "WiringPi/devLib/ds1302.h"
-#include "WiringPi/devLib/piNes.h"
#include "WiringPi/devLib/piGlow.h"
+#include "WiringPi/devLib/piNes.h"
%}
%apply unsigned char { uint8_t };
+%typemap(in) (unsigned char *data, int len) {
+ $1 = (unsigned char *) PyString_AsString($input);
+ $2 = PyString_Size($input);
+};
+
+extern int wiringPiFailure (int fatal, const char *message, ...) ;
+extern struct wiringPiNodeStruct *wiringPiFindNode (int pin) ;
+extern struct wiringPiNodeStruct *wiringPiNewNode (int pinBase, int numPins) ;
// Core wiringPi functions
-
extern int wiringPiSetup (void) ;
extern int wiringPiSetupSys (void) ;
extern int wiringPiSetupGpio (void) ;
extern int wiringPiSetupPhys (void) ;
-extern int piFaceSetup (const int pinBase) ;
-
+extern void pinModeAlt (int pin, int mode) ;
extern void pinMode (int pin, int mode) ;
extern void pullUpDnControl (int pin, int pud) ;
extern int digitalRead (int pin) ;
@@ -59,11 +65,13 @@
extern void analogWrite (int pin, int value) ;
// On-Board Raspberry Pi hardware specific stuff
-
extern int piBoardRev (void) ;
+extern void piBoardId (int *model, int *rev, int *mem, int *maker, int *overVolted) ;
extern int wpiPinToGpio (int wpiPin) ;
+extern int physPinToGpio (int physPin) ;
extern void setPadDrive (int group, int value) ;
extern int getAlt (int pin) ;
+extern void pwmToneWrite (int pin, int freq) ;
extern void digitalWriteByte (int value) ;
extern void pwmSetMode (int mode) ;
extern void pwmSetRange (unsigned int range) ;
@@ -71,112 +79,24 @@
extern void gpioClockSet (int pin, int freq) ;
// Interrupts
-
-extern int (*waitForInterrupt) (int pin, int mS) ;
+extern int waitForInterrupt (int pin, int mS) ;
extern int wiringPiISR (int pin, int mode, void (*function)(void)) ;
// Threads
-
-extern int piThreadCreate (void *(*fn)(void *)) ;
-extern void piLock (int key) ;
-extern void piUnlock (int key) ;
+extern int piThreadCreate (void *(*fn)(void *)) ;
+extern void piLock (int key) ;
+extern void piUnlock (int key) ;
// Schedulling priority
-extern int piHiPri (int pri) ;
+extern int piHiPri (const int pri) ;
-// Extras from arduino land
-
+// Delays and Timing
extern void delay (unsigned int howLong) ;
extern void delayMicroseconds (unsigned int howLong) ;
extern unsigned int millis (void) ;
extern unsigned int micros (void) ;
-// WiringSerial
-
-extern int serialOpen (const char *device, const int baud) ;
-extern void serialClose (const int fd) ;
-extern void serialFlush (const int fd) ;
-extern void serialPutchar (const int fd, const unsigned char c) ;
-extern void serialPuts (const int fd, const char *s) ;
-extern void serialPrintf (const int fd, const char *message, ...) ;
-extern int serialDataAvail (const int fd) ;
-extern int serialGetchar (const int fd) ;
-
-// Shifting
-
-extern void shiftOut (uint8_t dPin, uint8_t cPin, uint8_t order, uint8_t val);
-extern uint8_t shiftIn (uint8_t dPin, uint8_t cPin, uint8_t order);
-
-// Spi
-
-%typemap(in) (unsigned char *data, int len) {
- $1 = (unsigned char *) PyString_AsString($input);
- $2 = PyString_Size($input);
-};
-
-int wiringPiSPIGetFd (int channel) ;
-int wiringPiSPIDataRW (int channel, unsigned char *data, int len) ;
-int wiringPiSPISetup (int channel, int speed) ;
-
-// i2c
-
-extern int wiringPiI2CSetupInterface (char *device, int devId) ;
-extern int wiringPiI2CSetup (int devId) ;
-
-extern int wiringPiI2CRead (int fd) ;
-extern int wiringPiI2CReadReg8 (int fd, int reg) ;
-extern int wiringPiI2CReadReg16 (int fd, int reg) ;
-
-extern int wiringPiI2CWrite (int fd, int data) ;
-extern int wiringPiI2CWriteReg8 (int fd, int reg, int data) ;
-extern int wiringPiI2CWriteReg16 (int fd, int reg, int data) ;
-
-// Soft Tone
-
-extern int softToneCreate (int pin) ;
-extern void softToneWrite (int pin, int frewq) ;
-
-// Soft Servo
-
-extern void softServoWrite (int pin, int value) ;
-extern int softServoSetup (int p0, int p1, int p2, int p3, int p4, int p5, int p6, int p7) ;
-
-// Soft PWM
-
-extern int softPwmCreate (int pin, int value, int range) ;
-extern void softPwmWrite (int pin, int value) ;
-
-// MCP and stuff
-
-extern int mcp23008Setup (const int pinBase, const int i2cAddress) ;
-extern int mcp23016Setup (const int pinBase, const int i2cAddress) ;
-extern int mcp23017Setup (const int pinBase, const int i2cAddress) ;
-extern int mcp23s08Setup (const int pinBase, const int spiPort, const int devId) ;
-extern int mcp23s17Setup (int pinBase, int spiPort, int devId) ;
-extern int mcp3002Setup (int pinBase, int spiChannel) ;
-extern int mcp3422Setup (int pinBase, int i2cAddress, int channels, int sampleRate, int gain) ;
-extern int mcp4802Setup (int pinBase, int spiChannel) ;
-extern int pcf8574Setup (const int pinBase, const int i2cAddress) ;
-extern int pcf8591Setup (const int pinBase, const int i2cAddress) ;
-
-extern int sr595Setup (int pinBase, int numPins, int dataPin, int clockPin, int latchPin) ;
-
-// LCD
-extern void lcdHome (const int fd) ;
-extern void lcdClear (const int fd) ;
-extern void lcdDisplay (const int fd, int state) ;
-extern void lcdCursor (const int fd, int state) ;
-extern void lcdCursorBlink (const int fd, int state) ;
-extern void lcdSendCommand (const int fd, unsigned char command) ;
-extern void lcdPosition (const int fd, int x, int y) ;
-extern void lcdCharDef (const int fd, int index, unsigned char data [8]) ;
-extern void lcdPutchar (const int fd, unsigned char data) ;
-extern void lcdPuts (const int fd, const char *string) ;
-extern void lcdPrintf (const int fd, const char *message, ...) ;
-extern int lcdInit (int rows, int cols, int bits, int rs, int strb,
- int d0, int d1, int d2, int d3, int d4, int d5, int d6, int d7) ;
-
// ds1302
extern unsigned int ds1302rtcRead (const int reg) ;
extern void ds1302rtcWrite (const int reg, const unsigned int data) ;
@@ -193,7 +113,7 @@
extern int gertboardSPISetup (void) ;
extern int gertboardAnalogSetup (const int pinBase) ;
-// LCD128x64
+// LCD 128x64
extern void lcd128x64setOrigin (int x, int y) ;
extern void lcd128x64setOrientation (int orientation) ;
extern void lcd128x64orientCoordinates (int *x, int *y) ;
@@ -210,9 +130,25 @@
extern void lcd128x64clear (int colour) ;
extern int lcd128x64setup (void) ;
-// NES Joystick
-extern int setupNesJoystick (int dPin, int cPin, int lPin) ;
-extern unsigned int readNesJoystick (int joystick) ;
+// LCD
+extern void lcdHome (const int fd) ;
+extern void lcdClear (const int fd) ;
+extern void lcdDisplay (const int fd, int state) ;
+extern void lcdCursor (const int fd, int state) ;
+extern void lcdCursorBlink (const int fd, int state) ;
+extern void lcdSendCommand (const int fd, unsigned char command) ;
+extern void lcdPosition (const int fd, int x, int y) ;
+extern void lcdCharDef (const int fd, int index, unsigned char data [8]) ;
+extern void lcdPutchar (const int fd, unsigned char data) ;
+extern void lcdPuts (const int fd, const char *string) ;
+extern void lcdPrintf (const int fd, const char *message, ...) ;
+extern int lcdInit (const int rows, const int cols, const int bits,
+ const int rs, const int strb,
+ const int d0, const int d1, const int d2, const int d3, const int d4,
+ const int d5, const int d6, const int d7) ;
+
+// PiFace
+extern int piFaceSetup (const int pinBase) ;
// PiGlow
extern void piGlow1 (const int leg, const int ring, const int intensity) ;
@@ -220,4 +156,69 @@
extern void piGlowRing (const int ring, const int intensity) ;
extern void piGlowSetup (int clear) ;
+// NES
+extern int setupNesJoystick (int dPin, int cPin, int lPin) ;
+extern unsigned int readNesJoystick (int joystick) ;
+
+// Various IC setup functions
+extern int sr595Setup (const int pinBase, const int numPins, const int dataPin, const int clockPin, const int latchPin) ;
+extern int drcSetupSerial (const int pinBase, const int numPins, const char *device, const int baud) ;
+extern int max31855Setup (int pinBase, int spiChannel) ;
+extern int max5322Setup (int pinBase, int spiChannel) ;
+extern int mcp23008Setup (const int pinBase, const int i2cAddress) ;
+extern int mcp23016Setup (const int pinBase, const int i2cAddress) ;
+extern int mcp23017Setup (const int pinBase, const int i2cAddress) ;
+extern int mcp23s08Setup (const int pinBase, const int spiPort, const int devId) ;
+extern int mcp23s17Setup (int pinBase, int spiPort, int devId) ;
+extern int mcp3002Setup (int pinBase, int spiChannel) ;
+extern int mcp3004Setup (int pinBase, int spiChannel) ;
+extern int mcp3422Setup (int pinBase, int i2cAddress, int sampleRate, int gain) ;
+extern int mcp4802Setup (int pinBase, int spiChannel) ;
+extern int pcf8574Setup (const int pinBase, const int i2cAddress) ;
+extern int pcf8591Setup (const int pinBase, const int i2cAddress) ;
+extern int sn3218Setup (int pinBase) ;
+
+// Soft PWM
+extern int softPwmCreate (int pin, int value, int range) ;
+extern void softPwmWrite (int pin, int value) ;
+extern void softPwmStop (int pin) ;
+
+// Soft Servo
+extern void softServoWrite (int pin, int value) ;
+extern int softServoSetup (int p0, int p1, int p2, int p3, int p4, int p5, int p6, int p7) ;
+
+// Soft Tone
+extern int softToneCreate (int pin) ;
+extern void softToneStop (int pin) ;
+extern void softToneWrite (int pin, int freq) ;
+
+// SPI
+int wiringPiSPIGetFd (int channel) ;
+int wiringPiSPIDataRW (int channel, unsigned char *data, int len) ;
+int wiringPiSPISetup (int channel, int speed) ;
+
+// I2C
+extern int wiringPiI2CRead (int fd) ;
+extern int wiringPiI2CReadReg8 (int fd, int reg) ;
+extern int wiringPiI2CReadReg16 (int fd, int reg) ;
+extern int wiringPiI2CWrite (int fd, int data) ;
+extern int wiringPiI2CWriteReg8 (int fd, int reg, int data) ;
+extern int wiringPiI2CWriteReg16 (int fd, int reg, int data) ;
+extern int wiringPiI2CSetupInterface (const char *device, int devId) ;
+extern int wiringPiI2CSetup (const int devId) ;
+
+// WiringSerial
+extern int serialOpen (const char *device, const int baud) ;
+extern void serialClose (const int fd) ;
+extern void serialFlush (const int fd) ;
+extern void serialPutchar (const int fd, const unsigned char c) ;
+extern void serialPuts (const int fd, const char *s) ;
+extern void serialPrintf (const int fd, const char *message, ...) ;
+extern int serialDataAvail (const int fd) ;
+extern int serialGetchar (const int fd) ;
+
+// Shift Register
+extern uint8_t shiftIn (uint8_t dPin, uint8_t cPin, uint8_t order) ;
+extern void shiftOut (uint8_t dPin, uint8_t cPin, uint8_t order, uint8_t val) ;
+
%include "wiringpi2-class.py"
diff --git a/wiringpi2.py b/wiringpi2.py
index b01b882..b9002ce 100644
--- a/wiringpi2.py
+++ b/wiringpi2.py
@@ -68,6 +68,18 @@
+def wiringPiFailure(*args):
+ return _wiringpi2.wiringPiFailure(*args)
+wiringPiFailure = _wiringpi2.wiringPiFailure
+
+def wiringPiFindNode(*args):
+ return _wiringpi2.wiringPiFindNode(*args)
+wiringPiFindNode = _wiringpi2.wiringPiFindNode
+
+def wiringPiNewNode(*args):
+ return _wiringpi2.wiringPiNewNode(*args)
+wiringPiNewNode = _wiringpi2.wiringPiNewNode
+
def wiringPiSetup():
return _wiringpi2.wiringPiSetup()
wiringPiSetup = _wiringpi2.wiringPiSetup
@@ -84,9 +96,9 @@
return _wiringpi2.wiringPiSetupPhys()
wiringPiSetupPhys = _wiringpi2.wiringPiSetupPhys
-def piFaceSetup(*args):
- return _wiringpi2.piFaceSetup(*args)
-piFaceSetup = _wiringpi2.piFaceSetup
+def pinModeAlt(*args):
+ return _wiringpi2.pinModeAlt(*args)
+pinModeAlt = _wiringpi2.pinModeAlt
def pinMode(*args):
return _wiringpi2.pinMode(*args)
@@ -120,10 +132,18 @@
return _wiringpi2.piBoardRev()
piBoardRev = _wiringpi2.piBoardRev
+def piBoardId(*args):
+ return _wiringpi2.piBoardId(*args)
+piBoardId = _wiringpi2.piBoardId
+
def wpiPinToGpio(*args):
return _wiringpi2.wpiPinToGpio(*args)
wpiPinToGpio = _wiringpi2.wpiPinToGpio
+def physPinToGpio(*args):
+ return _wiringpi2.physPinToGpio(*args)
+physPinToGpio = _wiringpi2.physPinToGpio
+
def setPadDrive(*args):
return _wiringpi2.setPadDrive(*args)
setPadDrive = _wiringpi2.setPadDrive
@@ -132,6 +152,10 @@
return _wiringpi2.getAlt(*args)
getAlt = _wiringpi2.getAlt
+def pwmToneWrite(*args):
+ return _wiringpi2.pwmToneWrite(*args)
+pwmToneWrite = _wiringpi2.pwmToneWrite
+
def digitalWriteByte(*args):
return _wiringpi2.digitalWriteByte(*args)
digitalWriteByte = _wiringpi2.digitalWriteByte
@@ -152,6 +176,10 @@
return _wiringpi2.gpioClockSet(*args)
gpioClockSet = _wiringpi2.gpioClockSet
+def waitForInterrupt(*args):
+ return _wiringpi2.waitForInterrupt(*args)
+waitForInterrupt = _wiringpi2.waitForInterrupt
+
def wiringPiISR(*args):
return _wiringpi2.wiringPiISR(*args)
wiringPiISR = _wiringpi2.wiringPiISR
@@ -188,206 +216,6 @@
return _wiringpi2.micros()
micros = _wiringpi2.micros
-def serialOpen(*args):
- return _wiringpi2.serialOpen(*args)
-serialOpen = _wiringpi2.serialOpen
-
-def serialClose(*args):
- return _wiringpi2.serialClose(*args)
-serialClose = _wiringpi2.serialClose
-
-def serialFlush(*args):
- return _wiringpi2.serialFlush(*args)
-serialFlush = _wiringpi2.serialFlush
-
-def serialPutchar(*args):
- return _wiringpi2.serialPutchar(*args)
-serialPutchar = _wiringpi2.serialPutchar
-
-def serialPuts(*args):
- return _wiringpi2.serialPuts(*args)
-serialPuts = _wiringpi2.serialPuts
-
-def serialPrintf(*args):
- return _wiringpi2.serialPrintf(*args)
-serialPrintf = _wiringpi2.serialPrintf
-
-def serialDataAvail(*args):
- return _wiringpi2.serialDataAvail(*args)
-serialDataAvail = _wiringpi2.serialDataAvail
-
-def serialGetchar(*args):
- return _wiringpi2.serialGetchar(*args)
-serialGetchar = _wiringpi2.serialGetchar
-
-def shiftOut(*args):
- return _wiringpi2.shiftOut(*args)
-shiftOut = _wiringpi2.shiftOut
-
-def shiftIn(*args):
- return _wiringpi2.shiftIn(*args)
-shiftIn = _wiringpi2.shiftIn
-
-def wiringPiSPIGetFd(*args):
- return _wiringpi2.wiringPiSPIGetFd(*args)
-wiringPiSPIGetFd = _wiringpi2.wiringPiSPIGetFd
-
-def wiringPiSPIDataRW(*args):
- return _wiringpi2.wiringPiSPIDataRW(*args)
-wiringPiSPIDataRW = _wiringpi2.wiringPiSPIDataRW
-
-def wiringPiSPISetup(*args):
- return _wiringpi2.wiringPiSPISetup(*args)
-wiringPiSPISetup = _wiringpi2.wiringPiSPISetup
-
-def wiringPiI2CSetupInterface(*args):
- return _wiringpi2.wiringPiI2CSetupInterface(*args)
-wiringPiI2CSetupInterface = _wiringpi2.wiringPiI2CSetupInterface
-
-def wiringPiI2CSetup(*args):
- return _wiringpi2.wiringPiI2CSetup(*args)
-wiringPiI2CSetup = _wiringpi2.wiringPiI2CSetup
-
-def wiringPiI2CRead(*args):
- return _wiringpi2.wiringPiI2CRead(*args)
-wiringPiI2CRead = _wiringpi2.wiringPiI2CRead
-
-def wiringPiI2CReadReg8(*args):
- return _wiringpi2.wiringPiI2CReadReg8(*args)
-wiringPiI2CReadReg8 = _wiringpi2.wiringPiI2CReadReg8
-
-def wiringPiI2CReadReg16(*args):
- return _wiringpi2.wiringPiI2CReadReg16(*args)
-wiringPiI2CReadReg16 = _wiringpi2.wiringPiI2CReadReg16
-
-def wiringPiI2CWrite(*args):
- return _wiringpi2.wiringPiI2CWrite(*args)
-wiringPiI2CWrite = _wiringpi2.wiringPiI2CWrite
-
-def wiringPiI2CWriteReg8(*args):
- return _wiringpi2.wiringPiI2CWriteReg8(*args)
-wiringPiI2CWriteReg8 = _wiringpi2.wiringPiI2CWriteReg8
-
-def wiringPiI2CWriteReg16(*args):
- return _wiringpi2.wiringPiI2CWriteReg16(*args)
-wiringPiI2CWriteReg16 = _wiringpi2.wiringPiI2CWriteReg16
-
-def softToneCreate(*args):
- return _wiringpi2.softToneCreate(*args)
-softToneCreate = _wiringpi2.softToneCreate
-
-def softToneWrite(*args):
- return _wiringpi2.softToneWrite(*args)
-softToneWrite = _wiringpi2.softToneWrite
-
-def softServoWrite(*args):
- return _wiringpi2.softServoWrite(*args)
-softServoWrite = _wiringpi2.softServoWrite
-
-def softServoSetup(*args):
- return _wiringpi2.softServoSetup(*args)
-softServoSetup = _wiringpi2.softServoSetup
-
-def softPwmCreate(*args):
- return _wiringpi2.softPwmCreate(*args)
-softPwmCreate = _wiringpi2.softPwmCreate
-
-def softPwmWrite(*args):
- return _wiringpi2.softPwmWrite(*args)
-softPwmWrite = _wiringpi2.softPwmWrite
-
-def mcp23008Setup(*args):
- return _wiringpi2.mcp23008Setup(*args)
-mcp23008Setup = _wiringpi2.mcp23008Setup
-
-def mcp23016Setup(*args):
- return _wiringpi2.mcp23016Setup(*args)
-mcp23016Setup = _wiringpi2.mcp23016Setup
-
-def mcp23017Setup(*args):
- return _wiringpi2.mcp23017Setup(*args)
-mcp23017Setup = _wiringpi2.mcp23017Setup
-
-def mcp23s08Setup(*args):
- return _wiringpi2.mcp23s08Setup(*args)
-mcp23s08Setup = _wiringpi2.mcp23s08Setup
-
-def mcp23s17Setup(*args):
- return _wiringpi2.mcp23s17Setup(*args)
-mcp23s17Setup = _wiringpi2.mcp23s17Setup
-
-def mcp3002Setup(*args):
- return _wiringpi2.mcp3002Setup(*args)
-mcp3002Setup = _wiringpi2.mcp3002Setup
-
-def mcp3422Setup(*args):
- return _wiringpi2.mcp3422Setup(*args)
-mcp3422Setup = _wiringpi2.mcp3422Setup
-
-def mcp4802Setup(*args):
- return _wiringpi2.mcp4802Setup(*args)
-mcp4802Setup = _wiringpi2.mcp4802Setup
-
-def pcf8574Setup(*args):
- return _wiringpi2.pcf8574Setup(*args)
-pcf8574Setup = _wiringpi2.pcf8574Setup
-
-def pcf8591Setup(*args):
- return _wiringpi2.pcf8591Setup(*args)
-pcf8591Setup = _wiringpi2.pcf8591Setup
-
-def sr595Setup(*args):
- return _wiringpi2.sr595Setup(*args)
-sr595Setup = _wiringpi2.sr595Setup
-
-def lcdHome(*args):
- return _wiringpi2.lcdHome(*args)
-lcdHome = _wiringpi2.lcdHome
-
-def lcdClear(*args):
- return _wiringpi2.lcdClear(*args)
-lcdClear = _wiringpi2.lcdClear
-
-def lcdDisplay(*args):
- return _wiringpi2.lcdDisplay(*args)
-lcdDisplay = _wiringpi2.lcdDisplay
-
-def lcdCursor(*args):
- return _wiringpi2.lcdCursor(*args)
-lcdCursor = _wiringpi2.lcdCursor
-
-def lcdCursorBlink(*args):
- return _wiringpi2.lcdCursorBlink(*args)
-lcdCursorBlink = _wiringpi2.lcdCursorBlink
-
-def lcdSendCommand(*args):
- return _wiringpi2.lcdSendCommand(*args)
-lcdSendCommand = _wiringpi2.lcdSendCommand
-
-def lcdPosition(*args):
- return _wiringpi2.lcdPosition(*args)
-lcdPosition = _wiringpi2.lcdPosition
-
-def lcdCharDef(*args):
- return _wiringpi2.lcdCharDef(*args)
-lcdCharDef = _wiringpi2.lcdCharDef
-
-def lcdPutchar(*args):
- return _wiringpi2.lcdPutchar(*args)
-lcdPutchar = _wiringpi2.lcdPutchar
-
-def lcdPuts(*args):
- return _wiringpi2.lcdPuts(*args)
-lcdPuts = _wiringpi2.lcdPuts
-
-def lcdPrintf(*args):
- return _wiringpi2.lcdPrintf(*args)
-lcdPrintf = _wiringpi2.lcdPrintf
-
-def lcdInit(*args):
- return _wiringpi2.lcdInit(*args)
-lcdInit = _wiringpi2.lcdInit
-
def ds1302rtcRead(*args):
return _wiringpi2.ds1302rtcRead(*args)
ds1302rtcRead = _wiringpi2.ds1302rtcRead
@@ -496,13 +324,57 @@
return _wiringpi2.lcd128x64setup()
lcd128x64setup = _wiringpi2.lcd128x64setup
-def setupNesJoystick(*args):
- return _wiringpi2.setupNesJoystick(*args)
-setupNesJoystick = _wiringpi2.setupNesJoystick
+def lcdHome(*args):
+ return _wiringpi2.lcdHome(*args)
+lcdHome = _wiringpi2.lcdHome
-def readNesJoystick(*args):
- return _wiringpi2.readNesJoystick(*args)
-readNesJoystick = _wiringpi2.readNesJoystick
+def lcdClear(*args):
+ return _wiringpi2.lcdClear(*args)
+lcdClear = _wiringpi2.lcdClear
+
+def lcdDisplay(*args):
+ return _wiringpi2.lcdDisplay(*args)
+lcdDisplay = _wiringpi2.lcdDisplay
+
+def lcdCursor(*args):
+ return _wiringpi2.lcdCursor(*args)
+lcdCursor = _wiringpi2.lcdCursor
+
+def lcdCursorBlink(*args):
+ return _wiringpi2.lcdCursorBlink(*args)
+lcdCursorBlink = _wiringpi2.lcdCursorBlink
+
+def lcdSendCommand(*args):
+ return _wiringpi2.lcdSendCommand(*args)
+lcdSendCommand = _wiringpi2.lcdSendCommand
+
+def lcdPosition(*args):
+ return _wiringpi2.lcdPosition(*args)
+lcdPosition = _wiringpi2.lcdPosition
+
+def lcdCharDef(*args):
+ return _wiringpi2.lcdCharDef(*args)
+lcdCharDef = _wiringpi2.lcdCharDef
+
+def lcdPutchar(*args):
+ return _wiringpi2.lcdPutchar(*args)
+lcdPutchar = _wiringpi2.lcdPutchar
+
+def lcdPuts(*args):
+ return _wiringpi2.lcdPuts(*args)
+lcdPuts = _wiringpi2.lcdPuts
+
+def lcdPrintf(*args):
+ return _wiringpi2.lcdPrintf(*args)
+lcdPrintf = _wiringpi2.lcdPrintf
+
+def lcdInit(*args):
+ return _wiringpi2.lcdInit(*args)
+lcdInit = _wiringpi2.lcdInit
+
+def piFaceSetup(*args):
+ return _wiringpi2.piFaceSetup(*args)
+piFaceSetup = _wiringpi2.piFaceSetup
def piGlow1(*args):
return _wiringpi2.piGlow1(*args)
@@ -519,6 +391,194 @@
def piGlowSetup(*args):
return _wiringpi2.piGlowSetup(*args)
piGlowSetup = _wiringpi2.piGlowSetup
+
+def setupNesJoystick(*args):
+ return _wiringpi2.setupNesJoystick(*args)
+setupNesJoystick = _wiringpi2.setupNesJoystick
+
+def readNesJoystick(*args):
+ return _wiringpi2.readNesJoystick(*args)
+readNesJoystick = _wiringpi2.readNesJoystick
+
+def sr595Setup(*args):
+ return _wiringpi2.sr595Setup(*args)
+sr595Setup = _wiringpi2.sr595Setup
+
+def drcSetupSerial(*args):
+ return _wiringpi2.drcSetupSerial(*args)
+drcSetupSerial = _wiringpi2.drcSetupSerial
+
+def max31855Setup(*args):
+ return _wiringpi2.max31855Setup(*args)
+max31855Setup = _wiringpi2.max31855Setup
+
+def max5322Setup(*args):
+ return _wiringpi2.max5322Setup(*args)
+max5322Setup = _wiringpi2.max5322Setup
+
+def mcp23008Setup(*args):
+ return _wiringpi2.mcp23008Setup(*args)
+mcp23008Setup = _wiringpi2.mcp23008Setup
+
+def mcp23016Setup(*args):
+ return _wiringpi2.mcp23016Setup(*args)
+mcp23016Setup = _wiringpi2.mcp23016Setup
+
+def mcp23017Setup(*args):
+ return _wiringpi2.mcp23017Setup(*args)
+mcp23017Setup = _wiringpi2.mcp23017Setup
+
+def mcp23s08Setup(*args):
+ return _wiringpi2.mcp23s08Setup(*args)
+mcp23s08Setup = _wiringpi2.mcp23s08Setup
+
+def mcp23s17Setup(*args):
+ return _wiringpi2.mcp23s17Setup(*args)
+mcp23s17Setup = _wiringpi2.mcp23s17Setup
+
+def mcp3002Setup(*args):
+ return _wiringpi2.mcp3002Setup(*args)
+mcp3002Setup = _wiringpi2.mcp3002Setup
+
+def mcp3004Setup(*args):
+ return _wiringpi2.mcp3004Setup(*args)
+mcp3004Setup = _wiringpi2.mcp3004Setup
+
+def mcp3422Setup(*args):
+ return _wiringpi2.mcp3422Setup(*args)
+mcp3422Setup = _wiringpi2.mcp3422Setup
+
+def mcp4802Setup(*args):
+ return _wiringpi2.mcp4802Setup(*args)
+mcp4802Setup = _wiringpi2.mcp4802Setup
+
+def pcf8574Setup(*args):
+ return _wiringpi2.pcf8574Setup(*args)
+pcf8574Setup = _wiringpi2.pcf8574Setup
+
+def pcf8591Setup(*args):
+ return _wiringpi2.pcf8591Setup(*args)
+pcf8591Setup = _wiringpi2.pcf8591Setup
+
+def sn3218Setup(*args):
+ return _wiringpi2.sn3218Setup(*args)
+sn3218Setup = _wiringpi2.sn3218Setup
+
+def softPwmCreate(*args):
+ return _wiringpi2.softPwmCreate(*args)
+softPwmCreate = _wiringpi2.softPwmCreate
+
+def softPwmWrite(*args):
+ return _wiringpi2.softPwmWrite(*args)
+softPwmWrite = _wiringpi2.softPwmWrite
+
+def softPwmStop(*args):
+ return _wiringpi2.softPwmStop(*args)
+softPwmStop = _wiringpi2.softPwmStop
+
+def softServoWrite(*args):
+ return _wiringpi2.softServoWrite(*args)
+softServoWrite = _wiringpi2.softServoWrite
+
+def softServoSetup(*args):
+ return _wiringpi2.softServoSetup(*args)
+softServoSetup = _wiringpi2.softServoSetup
+
+def softToneCreate(*args):
+ return _wiringpi2.softToneCreate(*args)
+softToneCreate = _wiringpi2.softToneCreate
+
+def softToneStop(*args):
+ return _wiringpi2.softToneStop(*args)
+softToneStop = _wiringpi2.softToneStop
+
+def softToneWrite(*args):
+ return _wiringpi2.softToneWrite(*args)
+softToneWrite = _wiringpi2.softToneWrite
+
+def wiringPiSPIGetFd(*args):
+ return _wiringpi2.wiringPiSPIGetFd(*args)
+wiringPiSPIGetFd = _wiringpi2.wiringPiSPIGetFd
+
+def wiringPiSPIDataRW(*args):
+ return _wiringpi2.wiringPiSPIDataRW(*args)
+wiringPiSPIDataRW = _wiringpi2.wiringPiSPIDataRW
+
+def wiringPiSPISetup(*args):
+ return _wiringpi2.wiringPiSPISetup(*args)
+wiringPiSPISetup = _wiringpi2.wiringPiSPISetup
+
+def wiringPiI2CRead(*args):
+ return _wiringpi2.wiringPiI2CRead(*args)
+wiringPiI2CRead = _wiringpi2.wiringPiI2CRead
+
+def wiringPiI2CReadReg8(*args):
+ return _wiringpi2.wiringPiI2CReadReg8(*args)
+wiringPiI2CReadReg8 = _wiringpi2.wiringPiI2CReadReg8
+
+def wiringPiI2CReadReg16(*args):
+ return _wiringpi2.wiringPiI2CReadReg16(*args)
+wiringPiI2CReadReg16 = _wiringpi2.wiringPiI2CReadReg16
+
+def wiringPiI2CWrite(*args):
+ return _wiringpi2.wiringPiI2CWrite(*args)
+wiringPiI2CWrite = _wiringpi2.wiringPiI2CWrite
+
+def wiringPiI2CWriteReg8(*args):
+ return _wiringpi2.wiringPiI2CWriteReg8(*args)
+wiringPiI2CWriteReg8 = _wiringpi2.wiringPiI2CWriteReg8
+
+def wiringPiI2CWriteReg16(*args):
+ return _wiringpi2.wiringPiI2CWriteReg16(*args)
+wiringPiI2CWriteReg16 = _wiringpi2.wiringPiI2CWriteReg16
+
+def wiringPiI2CSetupInterface(*args):
+ return _wiringpi2.wiringPiI2CSetupInterface(*args)
+wiringPiI2CSetupInterface = _wiringpi2.wiringPiI2CSetupInterface
+
+def wiringPiI2CSetup(*args):
+ return _wiringpi2.wiringPiI2CSetup(*args)
+wiringPiI2CSetup = _wiringpi2.wiringPiI2CSetup
+
+def serialOpen(*args):
+ return _wiringpi2.serialOpen(*args)
+serialOpen = _wiringpi2.serialOpen
+
+def serialClose(*args):
+ return _wiringpi2.serialClose(*args)
+serialClose = _wiringpi2.serialClose
+
+def serialFlush(*args):
+ return _wiringpi2.serialFlush(*args)
+serialFlush = _wiringpi2.serialFlush
+
+def serialPutchar(*args):
+ return _wiringpi2.serialPutchar(*args)
+serialPutchar = _wiringpi2.serialPutchar
+
+def serialPuts(*args):
+ return _wiringpi2.serialPuts(*args)
+serialPuts = _wiringpi2.serialPuts
+
+def serialPrintf(*args):
+ return _wiringpi2.serialPrintf(*args)
+serialPrintf = _wiringpi2.serialPrintf
+
+def serialDataAvail(*args):
+ return _wiringpi2.serialDataAvail(*args)
+serialDataAvail = _wiringpi2.serialDataAvail
+
+def serialGetchar(*args):
+ return _wiringpi2.serialGetchar(*args)
+serialGetchar = _wiringpi2.serialGetchar
+
+def shiftIn(*args):
+ return _wiringpi2.shiftIn(*args)
+shiftIn = _wiringpi2.shiftIn
+
+def shiftOut(*args):
+ return _wiringpi2.shiftOut(*args)
+shiftOut = _wiringpi2.shiftOut
class nes(object):
def setupNesJoystick(self,*args):
return setupNesJoystick(*args)
@@ -674,7 +734,7 @@
def softPwmCreate(self,*args):
return softPwmCreate(*args)
def softPwmWrite(self,*args):
- return softPwmWrite(*args)
+ return sofPwmWrite(*args)
def softToneCreate(self,*args):
return softToneCreate(*args)
@@ -708,5 +768,4 @@
# This file is compatible with both classic and new-style classes.
-cvar = _wiringpi2.cvar
diff --git a/wiringpi2.pyc b/wiringpi2.pyc
index ce0c5cc..a989bd1 100644
--- a/wiringpi2.pyc
+++ b/wiringpi2.pyc
Binary files differ
diff --git a/wiringpi_wrap.c b/wiringpi_wrap.c
index 0eb71f3..a0f47a7 100644
--- a/wiringpi_wrap.c
+++ b/wiringpi_wrap.c
@@ -2929,11 +2929,11 @@
/* -------- TYPES TABLE (BEGIN) -------- */
#define SWIGTYPE_p_char swig_types[0]
-#define SWIGTYPE_p_f_int_int__int swig_types[1]
-#define SWIGTYPE_p_f_p_void__p_void swig_types[2]
-#define SWIGTYPE_p_f_void__void swig_types[3]
-#define SWIGTYPE_p_int swig_types[4]
-#define SWIGTYPE_p_unsigned_char swig_types[5]
+#define SWIGTYPE_p_f_p_void__p_void swig_types[1]
+#define SWIGTYPE_p_f_void__void swig_types[2]
+#define SWIGTYPE_p_int swig_types[3]
+#define SWIGTYPE_p_unsigned_char swig_types[4]
+#define SWIGTYPE_p_wiringPiNodeStruct swig_types[5]
static swig_type_info *swig_types[7];
static swig_module_info swig_module = {swig_types, 6, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
@@ -2968,48 +2968,41 @@
#include "WiringPi/wiringPi/wiringPi.h"
-#include "WiringPi/wiringPi/wiringPiSPI.h"
#include "WiringPi/wiringPi/wiringPiI2C.h"
+#include "WiringPi/wiringPi/wiringPiSPI.h"
#include "WiringPi/wiringPi/wiringSerial.h"
#include "WiringPi/wiringPi/wiringShift.h"
+#include "WiringPi/wiringPi/drcSerial.h"
#include "WiringPi/wiringPi/max31855.h"
#include "WiringPi/wiringPi/max5322.h"
-#include "WiringPi/wiringPi/mcp23017.h"
-#include "WiringPi/wiringPi/mcp4802.h"
-#include "WiringPi/wiringPi/mcp3422.h"
-#include "WiringPi/wiringPi/mcp23s08.h"
#include "WiringPi/wiringPi/mcp23008.h"
-#include "WiringPi/wiringPi/mcp23x08.h"
#include "WiringPi/wiringPi/mcp23016.h"
+#include "WiringPi/wiringPi/mcp23016reg.h"
+#include "WiringPi/wiringPi/mcp23017.h"
+#include "WiringPi/wiringPi/mcp23s08.h"
+#include "WiringPi/wiringPi/mcp23s17.h"
+#include "WiringPi/wiringPi/mcp23x0817.h"
+#include "WiringPi/wiringPi/mcp23x08.h"
#include "WiringPi/wiringPi/mcp3002.h"
#include "WiringPi/wiringPi/mcp3004.h"
-#include "WiringPi/wiringPi/mcp23016reg.h"
-#include "WiringPi/wiringPi/sn3218.h"
-#include "WiringPi/wiringPi/mcp23x0817.h"
-#include "WiringPi/wiringPi/mcp23s17.h"
+#include "WiringPi/wiringPi/mcp3422.h"
+#include "WiringPi/wiringPi/mcp4802.h"
#include "WiringPi/wiringPi/pcf8574.h"
#include "WiringPi/wiringPi/pcf8591.h"
-#include "WiringPi/wiringPi/drc.h"
+#include "WiringPi/wiringPi/sn3218.h"
#include "WiringPi/wiringPi/softPwm.h"
#include "WiringPi/wiringPi/softServo.h"
#include "WiringPi/wiringPi/softTone.h"
#include "WiringPi/wiringPi/sr595.h"
+#include "WiringPi/devLib/ds1302.h"
+#include "WiringPi/devLib/font.h"
#include "WiringPi/devLib/gertboard.h"
#include "WiringPi/devLib/lcd128x64.h"
-#include "WiringPi/devLib/font.h"
#include "WiringPi/devLib/lcd.h"
#include "WiringPi/devLib/maxdetect.h"
#include "WiringPi/devLib/piFace.h"
-#include "WiringPi/devLib/ds1302.h"
-#include "WiringPi/devLib/piNes.h"
#include "WiringPi/devLib/piGlow.h"
-
-
-SWIGINTERNINLINE PyObject*
- SWIG_From_int (int value)
-{
- return PyInt_FromLong((long) value);
-}
+#include "WiringPi/devLib/piNes.h"
#include <limits.h>
@@ -3157,73 +3150,6 @@
}
-SWIGINTERN int
-SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val)
-{
- if (PyInt_Check(obj)) {
- long v = PyInt_AsLong(obj);
- if (v >= 0) {
- if (val) *val = v;
- return SWIG_OK;
- } else {
- return SWIG_OverflowError;
- }
- } else if (PyLong_Check(obj)) {
- unsigned long v = PyLong_AsUnsignedLong(obj);
- if (!PyErr_Occurred()) {
- if (val) *val = v;
- return SWIG_OK;
- } else {
- PyErr_Clear();
- }
- }
-#ifdef SWIG_PYTHON_CAST_MODE
- {
- int dispatch = 0;
- unsigned long v = PyLong_AsUnsignedLong(obj);
- if (!PyErr_Occurred()) {
- if (val) *val = v;
- return SWIG_AddCast(SWIG_OK);
- } else {
- PyErr_Clear();
- }
- if (!dispatch) {
- double d;
- int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
- if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
- if (val) *val = (unsigned long)(d);
- return res;
- }
- }
- }
-#endif
- return SWIG_TypeError;
-}
-
-
-SWIGINTERN int
-SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val)
-{
- unsigned long v;
- int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
- if (SWIG_IsOK(res)) {
- if ((v > UINT_MAX)) {
- return SWIG_OverflowError;
- } else {
- if (val) *val = (unsigned int)(v);
- }
- }
- return res;
-}
-
-
-SWIGINTERNINLINE PyObject*
- SWIG_From_unsigned_SS_int (unsigned int value)
-{
- return PyInt_FromSize_t((size_t) value);
-}
-
-
SWIGINTERN swig_type_info*
SWIG_pchar_descriptor(void)
{
@@ -3316,6 +3242,80 @@
+SWIGINTERNINLINE PyObject*
+ SWIG_From_int (int value)
+{
+ return PyInt_FromLong((long) value);
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val)
+{
+ if (PyInt_Check(obj)) {
+ long v = PyInt_AsLong(obj);
+ if (v >= 0) {
+ if (val) *val = v;
+ return SWIG_OK;
+ } else {
+ return SWIG_OverflowError;
+ }
+ } else if (PyLong_Check(obj)) {
+ unsigned long v = PyLong_AsUnsignedLong(obj);
+ if (!PyErr_Occurred()) {
+ if (val) *val = v;
+ return SWIG_OK;
+ } else {
+ PyErr_Clear();
+ }
+ }
+#ifdef SWIG_PYTHON_CAST_MODE
+ {
+ int dispatch = 0;
+ unsigned long v = PyLong_AsUnsignedLong(obj);
+ if (!PyErr_Occurred()) {
+ if (val) *val = v;
+ return SWIG_AddCast(SWIG_OK);
+ } else {
+ PyErr_Clear();
+ }
+ if (!dispatch) {
+ double d;
+ int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
+ if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
+ if (val) *val = (unsigned long)(d);
+ return res;
+ }
+ }
+ }
+#endif
+ return SWIG_TypeError;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val)
+{
+ unsigned long v;
+ int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
+ if (SWIG_IsOK(res)) {
+ if ((v > UINT_MAX)) {
+ return SWIG_OverflowError;
+ } else {
+ if (val) *val = (unsigned int)(v);
+ }
+ }
+ return res;
+}
+
+
+SWIGINTERNINLINE PyObject*
+ SWIG_From_unsigned_SS_int (unsigned int value)
+{
+ return PyInt_FromSize_t((size_t) value);
+}
+
+
SWIGINTERN int
SWIG_AsVal_unsigned_SS_char (PyObject * obj, unsigned char *val)
{
@@ -3352,6 +3352,108 @@
#ifdef __cplusplus
extern "C" {
#endif
+SWIGINTERN PyObject *_wrap_wiringPiFailure__varargs__(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *varargs) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ char *arg2 = (char *) 0 ;
+ void *arg3 = 0 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:wiringPiFailure",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiFailure" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "wiringPiFailure" "', argument " "2"" of type '" "char const *""'");
+ }
+ arg2 = (char *)(buf2);
+ result = (int)wiringPiFailure(arg1,(char const *)arg2,arg3);
+ resultobj = SWIG_From_int((int)(result));
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+ return resultobj;
+fail:
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_wiringPiFailure(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj;
+ PyObject *varargs;
+ PyObject *newargs;
+
+ newargs = PyTuple_GetSlice(args,0,2);
+ varargs = PyTuple_GetSlice(args,2,PyTuple_Size(args)+1);
+ resultobj = _wrap_wiringPiFailure__varargs__(NULL,newargs,varargs);
+ Py_XDECREF(newargs);
+ Py_XDECREF(varargs);
+ return resultobj;
+}
+
+
+SWIGINTERN PyObject *_wrap_wiringPiFindNode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+ struct wiringPiNodeStruct *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:wiringPiFindNode",&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiFindNode" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ result = (struct wiringPiNodeStruct *)wiringPiFindNode(arg1);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_wiringPiNodeStruct, 0 | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_wiringPiNewNode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ struct wiringPiNodeStruct *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:wiringPiNewNode",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiNewNode" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wiringPiNewNode" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ result = (struct wiringPiNodeStruct *)wiringPiNewNode(arg1,arg2);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_wiringPiNodeStruct, 0 | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
SWIGINTERN PyObject *_wrap_wiringPiSetup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
int result;
@@ -3404,22 +3506,30 @@
}
-SWIGINTERN PyObject *_wrap_piFaceSetup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_pinModeAlt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
int arg1 ;
+ int arg2 ;
int val1 ;
int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
PyObject * obj0 = 0 ;
- int result;
+ PyObject * obj1 = 0 ;
- if (!PyArg_ParseTuple(args,(char *)"O:piFaceSetup",&obj0)) SWIG_fail;
+ if (!PyArg_ParseTuple(args,(char *)"OO:pinModeAlt",&obj0,&obj1)) SWIG_fail;
ecode1 = SWIG_AsVal_int(obj0, &val1);
if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "piFaceSetup" "', argument " "1"" of type '" "int""'");
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pinModeAlt" "', argument " "1"" of type '" "int""'");
}
arg1 = (int)(val1);
- result = (int)piFaceSetup(arg1);
- resultobj = SWIG_From_int((int)(result));
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pinModeAlt" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ pinModeAlt(arg1,arg2);
+ resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
@@ -3633,6 +3743,63 @@
}
+SWIGINTERN PyObject *_wrap_piBoardId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int *arg1 = (int *) 0 ;
+ int *arg2 = (int *) 0 ;
+ int *arg3 = (int *) 0 ;
+ int *arg4 = (int *) 0 ;
+ int *arg5 = (int *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ void *argp2 = 0 ;
+ int res2 = 0 ;
+ void *argp3 = 0 ;
+ int res3 = 0 ;
+ void *argp4 = 0 ;
+ int res4 = 0 ;
+ void *argp5 = 0 ;
+ int res5 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+ PyObject * obj4 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOOOO:piBoardId",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_int, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "piBoardId" "', argument " "1"" of type '" "int *""'");
+ }
+ arg1 = (int *)(argp1);
+ res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 | 0 );
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "piBoardId" "', argument " "2"" of type '" "int *""'");
+ }
+ arg2 = (int *)(argp2);
+ res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 | 0 );
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "piBoardId" "', argument " "3"" of type '" "int *""'");
+ }
+ arg3 = (int *)(argp3);
+ res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_int, 0 | 0 );
+ if (!SWIG_IsOK(res4)) {
+ SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "piBoardId" "', argument " "4"" of type '" "int *""'");
+ }
+ arg4 = (int *)(argp4);
+ res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 | 0 );
+ if (!SWIG_IsOK(res5)) {
+ SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "piBoardId" "', argument " "5"" of type '" "int *""'");
+ }
+ arg5 = (int *)(argp5);
+ piBoardId(arg1,arg2,arg3,arg4,arg5);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
SWIGINTERN PyObject *_wrap_wpiPinToGpio(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
int arg1 ;
@@ -3655,6 +3822,28 @@
}
+SWIGINTERN PyObject *_wrap_physPinToGpio(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:physPinToGpio",&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "physPinToGpio" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ result = (int)physPinToGpio(arg1);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
SWIGINTERN PyObject *_wrap_setPadDrive(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
int arg1 ;
@@ -3707,6 +3896,36 @@
}
+SWIGINTERN PyObject *_wrap_pwmToneWrite(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:pwmToneWrite",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pwmToneWrite" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pwmToneWrite" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ pwmToneWrite(arg1,arg2);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
SWIGINTERN PyObject *_wrap_digitalWriteByte(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
int arg1 ;
@@ -3821,24 +4040,34 @@
}
-SWIGINTERN int Swig_var_waitForInterrupt_set(PyObject *_val) {
- {
- int res = SWIG_ConvertFunctionPtr(_val, (void**)(&waitForInterrupt), SWIGTYPE_p_f_int_int__int);
- if (!SWIG_IsOK(res)) {
- SWIG_exception_fail(SWIG_ArgError(res), "in variable '""waitForInterrupt""' of type '""int (*)(int,int)""'");
- }
- }
- return 0;
-fail:
- return 1;
-}
-
-
-SWIGINTERN PyObject *Swig_var_waitForInterrupt_get(void) {
- PyObject *pyobj = 0;
+SWIGINTERN PyObject *_wrap_waitForInterrupt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ int result;
- pyobj = SWIG_NewFunctionPtrObj((void *)(waitForInterrupt), SWIGTYPE_p_f_int_int__int);
- return pyobj;
+ if (!PyArg_ParseTuple(args,(char *)"OO:waitForInterrupt",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "waitForInterrupt" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "waitForInterrupt" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ result = (int)waitForInterrupt(arg1,arg2);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
}
@@ -4034,1789 +4263,6 @@
}
-SWIGINTERN PyObject *_wrap_serialOpen(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- char *arg1 = (char *) 0 ;
- int arg2 ;
- int res1 ;
- char *buf1 = 0 ;
- int alloc1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:serialOpen",&obj0,&obj1)) SWIG_fail;
- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "serialOpen" "', argument " "1"" of type '" "char const *""'");
- }
- arg1 = (char *)(buf1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "serialOpen" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- result = (int)serialOpen((char const *)arg1,arg2);
- resultobj = SWIG_From_int((int)(result));
- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
- return resultobj;
-fail:
- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_serialClose(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int val1 ;
- int ecode1 = 0 ;
- PyObject * obj0 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"O:serialClose",&obj0)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "serialClose" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- serialClose(arg1);
- resultobj = SWIG_Py_Void();
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_serialFlush(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int val1 ;
- int ecode1 = 0 ;
- PyObject * obj0 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"O:serialFlush",&obj0)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "serialFlush" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- serialFlush(arg1);
- resultobj = SWIG_Py_Void();
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_serialPutchar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- unsigned char arg2 ;
- int val1 ;
- int ecode1 = 0 ;
- unsigned char val2 ;
- int ecode2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:serialPutchar",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "serialPutchar" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "serialPutchar" "', argument " "2"" of type '" "unsigned char""'");
- }
- arg2 = (unsigned char)(val2);
- serialPutchar(arg1,arg2);
- resultobj = SWIG_Py_Void();
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_serialPuts(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- char *arg2 = (char *) 0 ;
- int val1 ;
- int ecode1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:serialPuts",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "serialPuts" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "serialPuts" "', argument " "2"" of type '" "char const *""'");
- }
- arg2 = (char *)(buf2);
- serialPuts(arg1,(char const *)arg2);
- resultobj = SWIG_Py_Void();
- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
- return resultobj;
-fail:
- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_serialPrintf__varargs__(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *varargs) {
- PyObject *resultobj = 0;
- int arg1 ;
- char *arg2 = (char *) 0 ;
- void *arg3 = 0 ;
- int val1 ;
- int ecode1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:serialPrintf",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "serialPrintf" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "serialPrintf" "', argument " "2"" of type '" "char const *""'");
- }
- arg2 = (char *)(buf2);
- serialPrintf(arg1,(char const *)arg2,arg3);
- resultobj = SWIG_Py_Void();
- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
- return resultobj;
-fail:
- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_serialPrintf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj;
- PyObject *varargs;
- PyObject *newargs;
-
- newargs = PyTuple_GetSlice(args,0,2);
- varargs = PyTuple_GetSlice(args,2,PyTuple_Size(args)+1);
- resultobj = _wrap_serialPrintf__varargs__(NULL,newargs,varargs);
- Py_XDECREF(newargs);
- Py_XDECREF(varargs);
- return resultobj;
-}
-
-
-SWIGINTERN PyObject *_wrap_serialDataAvail(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int val1 ;
- int ecode1 = 0 ;
- PyObject * obj0 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"O:serialDataAvail",&obj0)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "serialDataAvail" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- result = (int)serialDataAvail(arg1);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_serialGetchar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int val1 ;
- int ecode1 = 0 ;
- PyObject * obj0 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"O:serialGetchar",&obj0)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "serialGetchar" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- result = (int)serialGetchar(arg1);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_shiftOut(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- uint8_t arg1 ;
- uint8_t arg2 ;
- uint8_t arg3 ;
- uint8_t arg4 ;
- unsigned char val1 ;
- int ecode1 = 0 ;
- unsigned char val2 ;
- int ecode2 = 0 ;
- unsigned char val3 ;
- int ecode3 = 0 ;
- unsigned char val4 ;
- int ecode4 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
- PyObject * obj3 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"OOOO:shiftOut",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
- ecode1 = SWIG_AsVal_unsigned_SS_char(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "shiftOut" "', argument " "1"" of type '" "uint8_t""'");
- }
- arg1 = (uint8_t)(val1);
- ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "shiftOut" "', argument " "2"" of type '" "uint8_t""'");
- }
- arg2 = (uint8_t)(val2);
- ecode3 = SWIG_AsVal_unsigned_SS_char(obj2, &val3);
- if (!SWIG_IsOK(ecode3)) {
- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "shiftOut" "', argument " "3"" of type '" "uint8_t""'");
- }
- arg3 = (uint8_t)(val3);
- ecode4 = SWIG_AsVal_unsigned_SS_char(obj3, &val4);
- if (!SWIG_IsOK(ecode4)) {
- SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "shiftOut" "', argument " "4"" of type '" "uint8_t""'");
- }
- arg4 = (uint8_t)(val4);
- shiftOut(arg1,arg2,arg3,arg4);
- resultobj = SWIG_Py_Void();
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_shiftIn(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- uint8_t arg1 ;
- uint8_t arg2 ;
- uint8_t arg3 ;
- unsigned char val1 ;
- int ecode1 = 0 ;
- unsigned char val2 ;
- int ecode2 = 0 ;
- unsigned char val3 ;
- int ecode3 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
- uint8_t result;
-
- if (!PyArg_ParseTuple(args,(char *)"OOO:shiftIn",&obj0,&obj1,&obj2)) SWIG_fail;
- ecode1 = SWIG_AsVal_unsigned_SS_char(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "shiftIn" "', argument " "1"" of type '" "uint8_t""'");
- }
- arg1 = (uint8_t)(val1);
- ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "shiftIn" "', argument " "2"" of type '" "uint8_t""'");
- }
- arg2 = (uint8_t)(val2);
- ecode3 = SWIG_AsVal_unsigned_SS_char(obj2, &val3);
- if (!SWIG_IsOK(ecode3)) {
- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "shiftIn" "', argument " "3"" of type '" "uint8_t""'");
- }
- arg3 = (uint8_t)(val3);
- result = shiftIn(arg1,arg2,arg3);
- resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_wiringPiSPIGetFd(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int val1 ;
- int ecode1 = 0 ;
- PyObject * obj0 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"O:wiringPiSPIGetFd",&obj0)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiSPIGetFd" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- result = (int)wiringPiSPIGetFd(arg1);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_wiringPiSPIDataRW(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- unsigned char *arg2 = (unsigned char *) 0 ;
- int arg3 ;
- int val1 ;
- int ecode1 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:wiringPiSPIDataRW",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiSPIDataRW" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- {
- arg2 = (unsigned char *) PyString_AsString(obj1);
- arg3 = PyString_Size(obj1);
- }
- result = (int)wiringPiSPIDataRW(arg1,arg2,arg3);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_wiringPiSPISetup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:wiringPiSPISetup",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiSPISetup" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wiringPiSPISetup" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- result = (int)wiringPiSPISetup(arg1,arg2);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_wiringPiI2CSetupInterface(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- char *arg1 = (char *) 0 ;
- int arg2 ;
- int res1 ;
- char *buf1 = 0 ;
- int alloc1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:wiringPiI2CSetupInterface",&obj0,&obj1)) SWIG_fail;
- res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "wiringPiI2CSetupInterface" "', argument " "1"" of type '" "char *""'");
- }
- arg1 = (char *)(buf1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wiringPiI2CSetupInterface" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- result = (int)wiringPiI2CSetupInterface(arg1,arg2);
- resultobj = SWIG_From_int((int)(result));
- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
- return resultobj;
-fail:
- if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_wiringPiI2CSetup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int val1 ;
- int ecode1 = 0 ;
- PyObject * obj0 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"O:wiringPiI2CSetup",&obj0)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiI2CSetup" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- result = (int)wiringPiI2CSetup(arg1);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_wiringPiI2CRead(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int val1 ;
- int ecode1 = 0 ;
- PyObject * obj0 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"O:wiringPiI2CRead",&obj0)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiI2CRead" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- result = (int)wiringPiI2CRead(arg1);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_wiringPiI2CReadReg8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:wiringPiI2CReadReg8",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiI2CReadReg8" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wiringPiI2CReadReg8" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- result = (int)wiringPiI2CReadReg8(arg1,arg2);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_wiringPiI2CReadReg16(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:wiringPiI2CReadReg16",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiI2CReadReg16" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wiringPiI2CReadReg16" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- result = (int)wiringPiI2CReadReg16(arg1,arg2);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_wiringPiI2CWrite(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:wiringPiI2CWrite",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiI2CWrite" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wiringPiI2CWrite" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- result = (int)wiringPiI2CWrite(arg1,arg2);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_wiringPiI2CWriteReg8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int arg3 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- int val3 ;
- int ecode3 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"OOO:wiringPiI2CWriteReg8",&obj0,&obj1,&obj2)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiI2CWriteReg8" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wiringPiI2CWriteReg8" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- ecode3 = SWIG_AsVal_int(obj2, &val3);
- if (!SWIG_IsOK(ecode3)) {
- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "wiringPiI2CWriteReg8" "', argument " "3"" of type '" "int""'");
- }
- arg3 = (int)(val3);
- result = (int)wiringPiI2CWriteReg8(arg1,arg2,arg3);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_wiringPiI2CWriteReg16(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int arg3 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- int val3 ;
- int ecode3 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"OOO:wiringPiI2CWriteReg16",&obj0,&obj1,&obj2)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiI2CWriteReg16" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wiringPiI2CWriteReg16" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- ecode3 = SWIG_AsVal_int(obj2, &val3);
- if (!SWIG_IsOK(ecode3)) {
- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "wiringPiI2CWriteReg16" "', argument " "3"" of type '" "int""'");
- }
- arg3 = (int)(val3);
- result = (int)wiringPiI2CWriteReg16(arg1,arg2,arg3);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_softToneCreate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int val1 ;
- int ecode1 = 0 ;
- PyObject * obj0 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"O:softToneCreate",&obj0)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "softToneCreate" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- result = (int)softToneCreate(arg1);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_softToneWrite(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:softToneWrite",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "softToneWrite" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "softToneWrite" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- softToneWrite(arg1,arg2);
- resultobj = SWIG_Py_Void();
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_softServoWrite(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:softServoWrite",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "softServoWrite" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "softServoWrite" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- softServoWrite(arg1,arg2);
- resultobj = SWIG_Py_Void();
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_softServoSetup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int arg3 ;
- int arg4 ;
- int arg5 ;
- int arg6 ;
- int arg7 ;
- int arg8 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- int val3 ;
- int ecode3 = 0 ;
- int val4 ;
- int ecode4 = 0 ;
- int val5 ;
- int ecode5 = 0 ;
- int val6 ;
- int ecode6 = 0 ;
- int val7 ;
- int ecode7 = 0 ;
- int val8 ;
- int ecode8 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
- PyObject * obj3 = 0 ;
- PyObject * obj4 = 0 ;
- PyObject * obj5 = 0 ;
- PyObject * obj6 = 0 ;
- PyObject * obj7 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:softServoSetup",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "softServoSetup" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "softServoSetup" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- ecode3 = SWIG_AsVal_int(obj2, &val3);
- if (!SWIG_IsOK(ecode3)) {
- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "softServoSetup" "', argument " "3"" of type '" "int""'");
- }
- arg3 = (int)(val3);
- ecode4 = SWIG_AsVal_int(obj3, &val4);
- if (!SWIG_IsOK(ecode4)) {
- SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "softServoSetup" "', argument " "4"" of type '" "int""'");
- }
- arg4 = (int)(val4);
- ecode5 = SWIG_AsVal_int(obj4, &val5);
- if (!SWIG_IsOK(ecode5)) {
- SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "softServoSetup" "', argument " "5"" of type '" "int""'");
- }
- arg5 = (int)(val5);
- ecode6 = SWIG_AsVal_int(obj5, &val6);
- if (!SWIG_IsOK(ecode6)) {
- SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "softServoSetup" "', argument " "6"" of type '" "int""'");
- }
- arg6 = (int)(val6);
- ecode7 = SWIG_AsVal_int(obj6, &val7);
- if (!SWIG_IsOK(ecode7)) {
- SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "softServoSetup" "', argument " "7"" of type '" "int""'");
- }
- arg7 = (int)(val7);
- ecode8 = SWIG_AsVal_int(obj7, &val8);
- if (!SWIG_IsOK(ecode8)) {
- SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "softServoSetup" "', argument " "8"" of type '" "int""'");
- }
- arg8 = (int)(val8);
- result = (int)softServoSetup(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_softPwmCreate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int arg3 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- int val3 ;
- int ecode3 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"OOO:softPwmCreate",&obj0,&obj1,&obj2)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "softPwmCreate" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "softPwmCreate" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- ecode3 = SWIG_AsVal_int(obj2, &val3);
- if (!SWIG_IsOK(ecode3)) {
- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "softPwmCreate" "', argument " "3"" of type '" "int""'");
- }
- arg3 = (int)(val3);
- result = (int)softPwmCreate(arg1,arg2,arg3);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_softPwmWrite(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:softPwmWrite",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "softPwmWrite" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "softPwmWrite" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- softPwmWrite(arg1,arg2);
- resultobj = SWIG_Py_Void();
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_mcp23008Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:mcp23008Setup",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "mcp23008Setup" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "mcp23008Setup" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- result = (int)mcp23008Setup(arg1,arg2);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_mcp23016Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:mcp23016Setup",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "mcp23016Setup" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "mcp23016Setup" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- result = (int)mcp23016Setup(arg1,arg2);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_mcp23017Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:mcp23017Setup",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "mcp23017Setup" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "mcp23017Setup" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- result = (int)mcp23017Setup(arg1,arg2);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_mcp23s08Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int arg3 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- int val3 ;
- int ecode3 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"OOO:mcp23s08Setup",&obj0,&obj1,&obj2)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "mcp23s08Setup" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "mcp23s08Setup" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- ecode3 = SWIG_AsVal_int(obj2, &val3);
- if (!SWIG_IsOK(ecode3)) {
- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "mcp23s08Setup" "', argument " "3"" of type '" "int""'");
- }
- arg3 = (int)(val3);
- result = (int)mcp23s08Setup(arg1,arg2,arg3);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_mcp23s17Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int arg3 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- int val3 ;
- int ecode3 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"OOO:mcp23s17Setup",&obj0,&obj1,&obj2)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "mcp23s17Setup" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "mcp23s17Setup" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- ecode3 = SWIG_AsVal_int(obj2, &val3);
- if (!SWIG_IsOK(ecode3)) {
- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "mcp23s17Setup" "', argument " "3"" of type '" "int""'");
- }
- arg3 = (int)(val3);
- result = (int)mcp23s17Setup(arg1,arg2,arg3);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_mcp3002Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:mcp3002Setup",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "mcp3002Setup" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "mcp3002Setup" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- result = (int)mcp3002Setup(arg1,arg2);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_mcp3422Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int arg3 ;
- int arg4 ;
- int arg5 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- int val3 ;
- int ecode3 = 0 ;
- int val4 ;
- int ecode4 = 0 ;
- int val5 ;
- int ecode5 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
- PyObject * obj3 = 0 ;
- PyObject * obj4 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"OOOOO:mcp3422Setup",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "mcp3422Setup" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "mcp3422Setup" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- ecode3 = SWIG_AsVal_int(obj2, &val3);
- if (!SWIG_IsOK(ecode3)) {
- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "mcp3422Setup" "', argument " "3"" of type '" "int""'");
- }
- arg3 = (int)(val3);
- ecode4 = SWIG_AsVal_int(obj3, &val4);
- if (!SWIG_IsOK(ecode4)) {
- SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "mcp3422Setup" "', argument " "4"" of type '" "int""'");
- }
- arg4 = (int)(val4);
- ecode5 = SWIG_AsVal_int(obj4, &val5);
- if (!SWIG_IsOK(ecode5)) {
- SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "mcp3422Setup" "', argument " "5"" of type '" "int""'");
- }
- arg5 = (int)(val5);
- result = (int)mcp3422Setup(arg1,arg2,arg3,arg4,arg5);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_mcp4802Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:mcp4802Setup",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "mcp4802Setup" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "mcp4802Setup" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- result = (int)mcp4802Setup(arg1,arg2);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_pcf8574Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:pcf8574Setup",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pcf8574Setup" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pcf8574Setup" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- result = (int)pcf8574Setup(arg1,arg2);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_pcf8591Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:pcf8591Setup",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pcf8591Setup" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pcf8591Setup" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- result = (int)pcf8591Setup(arg1,arg2);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_sr595Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int arg3 ;
- int arg4 ;
- int arg5 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- int val3 ;
- int ecode3 = 0 ;
- int val4 ;
- int ecode4 = 0 ;
- int val5 ;
- int ecode5 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
- PyObject * obj3 = 0 ;
- PyObject * obj4 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"OOOOO:sr595Setup",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "sr595Setup" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sr595Setup" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- ecode3 = SWIG_AsVal_int(obj2, &val3);
- if (!SWIG_IsOK(ecode3)) {
- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "sr595Setup" "', argument " "3"" of type '" "int""'");
- }
- arg3 = (int)(val3);
- ecode4 = SWIG_AsVal_int(obj3, &val4);
- if (!SWIG_IsOK(ecode4)) {
- SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "sr595Setup" "', argument " "4"" of type '" "int""'");
- }
- arg4 = (int)(val4);
- ecode5 = SWIG_AsVal_int(obj4, &val5);
- if (!SWIG_IsOK(ecode5)) {
- SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "sr595Setup" "', argument " "5"" of type '" "int""'");
- }
- arg5 = (int)(val5);
- result = (int)sr595Setup(arg1,arg2,arg3,arg4,arg5);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_lcdHome(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int val1 ;
- int ecode1 = 0 ;
- PyObject * obj0 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"O:lcdHome",&obj0)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "lcdHome" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- lcdHome(arg1);
- resultobj = SWIG_Py_Void();
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_lcdClear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int val1 ;
- int ecode1 = 0 ;
- PyObject * obj0 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"O:lcdClear",&obj0)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "lcdClear" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- lcdClear(arg1);
- resultobj = SWIG_Py_Void();
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_lcdDisplay(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:lcdDisplay",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "lcdDisplay" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "lcdDisplay" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- lcdDisplay(arg1,arg2);
- resultobj = SWIG_Py_Void();
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_lcdCursor(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:lcdCursor",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "lcdCursor" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "lcdCursor" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- lcdCursor(arg1,arg2);
- resultobj = SWIG_Py_Void();
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_lcdCursorBlink(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:lcdCursorBlink",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "lcdCursorBlink" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "lcdCursorBlink" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- lcdCursorBlink(arg1,arg2);
- resultobj = SWIG_Py_Void();
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_lcdSendCommand(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- unsigned char arg2 ;
- int val1 ;
- int ecode1 = 0 ;
- unsigned char val2 ;
- int ecode2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:lcdSendCommand",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "lcdSendCommand" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "lcdSendCommand" "', argument " "2"" of type '" "unsigned char""'");
- }
- arg2 = (unsigned char)(val2);
- lcdSendCommand(arg1,arg2);
- resultobj = SWIG_Py_Void();
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_lcdPosition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int arg3 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- int val3 ;
- int ecode3 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"OOO:lcdPosition",&obj0,&obj1,&obj2)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "lcdPosition" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "lcdPosition" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- ecode3 = SWIG_AsVal_int(obj2, &val3);
- if (!SWIG_IsOK(ecode3)) {
- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "lcdPosition" "', argument " "3"" of type '" "int""'");
- }
- arg3 = (int)(val3);
- lcdPosition(arg1,arg2,arg3);
- resultobj = SWIG_Py_Void();
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_lcdCharDef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- unsigned char *arg3 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- void *argp3 = 0 ;
- int res3 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"OOO:lcdCharDef",&obj0,&obj1,&obj2)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "lcdCharDef" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "lcdCharDef" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 );
- if (!SWIG_IsOK(res3)) {
- SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "lcdCharDef" "', argument " "3"" of type '" "unsigned char [8]""'");
- }
- arg3 = (unsigned char *)(argp3);
- lcdCharDef(arg1,arg2,arg3);
- resultobj = SWIG_Py_Void();
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_lcdPutchar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- unsigned char arg2 ;
- int val1 ;
- int ecode1 = 0 ;
- unsigned char val2 ;
- int ecode2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:lcdPutchar",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "lcdPutchar" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "lcdPutchar" "', argument " "2"" of type '" "unsigned char""'");
- }
- arg2 = (unsigned char)(val2);
- lcdPutchar(arg1,arg2);
- resultobj = SWIG_Py_Void();
- return resultobj;
-fail:
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_lcdPuts(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- char *arg2 = (char *) 0 ;
- int val1 ;
- int ecode1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:lcdPuts",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "lcdPuts" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "lcdPuts" "', argument " "2"" of type '" "char const *""'");
- }
- arg2 = (char *)(buf2);
- lcdPuts(arg1,(char const *)arg2);
- resultobj = SWIG_Py_Void();
- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
- return resultobj;
-fail:
- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_lcdPrintf__varargs__(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *varargs) {
- PyObject *resultobj = 0;
- int arg1 ;
- char *arg2 = (char *) 0 ;
- void *arg3 = 0 ;
- int val1 ;
- int ecode1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"OO:lcdPrintf",&obj0,&obj1)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "lcdPrintf" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "lcdPrintf" "', argument " "2"" of type '" "char const *""'");
- }
- arg2 = (char *)(buf2);
- lcdPrintf(arg1,(char const *)arg2,arg3);
- resultobj = SWIG_Py_Void();
- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
- return resultobj;
-fail:
- if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
- return NULL;
-}
-
-
-SWIGINTERN PyObject *_wrap_lcdPrintf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj;
- PyObject *varargs;
- PyObject *newargs;
-
- newargs = PyTuple_GetSlice(args,0,2);
- varargs = PyTuple_GetSlice(args,2,PyTuple_Size(args)+1);
- resultobj = _wrap_lcdPrintf__varargs__(NULL,newargs,varargs);
- Py_XDECREF(newargs);
- Py_XDECREF(varargs);
- return resultobj;
-}
-
-
-SWIGINTERN PyObject *_wrap_lcdInit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- int arg1 ;
- int arg2 ;
- int arg3 ;
- int arg4 ;
- int arg5 ;
- int arg6 ;
- int arg7 ;
- int arg8 ;
- int arg9 ;
- int arg10 ;
- int arg11 ;
- int arg12 ;
- int arg13 ;
- int val1 ;
- int ecode1 = 0 ;
- int val2 ;
- int ecode2 = 0 ;
- int val3 ;
- int ecode3 = 0 ;
- int val4 ;
- int ecode4 = 0 ;
- int val5 ;
- int ecode5 = 0 ;
- int val6 ;
- int ecode6 = 0 ;
- int val7 ;
- int ecode7 = 0 ;
- int val8 ;
- int ecode8 = 0 ;
- int val9 ;
- int ecode9 = 0 ;
- int val10 ;
- int ecode10 = 0 ;
- int val11 ;
- int ecode11 = 0 ;
- int val12 ;
- int ecode12 = 0 ;
- int val13 ;
- int ecode13 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
- PyObject * obj3 = 0 ;
- PyObject * obj4 = 0 ;
- PyObject * obj5 = 0 ;
- PyObject * obj6 = 0 ;
- PyObject * obj7 = 0 ;
- PyObject * obj8 = 0 ;
- PyObject * obj9 = 0 ;
- PyObject * obj10 = 0 ;
- PyObject * obj11 = 0 ;
- PyObject * obj12 = 0 ;
- int result;
-
- if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOOOO:lcdInit",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11,&obj12)) SWIG_fail;
- ecode1 = SWIG_AsVal_int(obj0, &val1);
- if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "lcdInit" "', argument " "1"" of type '" "int""'");
- }
- arg1 = (int)(val1);
- ecode2 = SWIG_AsVal_int(obj1, &val2);
- if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "lcdInit" "', argument " "2"" of type '" "int""'");
- }
- arg2 = (int)(val2);
- ecode3 = SWIG_AsVal_int(obj2, &val3);
- if (!SWIG_IsOK(ecode3)) {
- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "lcdInit" "', argument " "3"" of type '" "int""'");
- }
- arg3 = (int)(val3);
- ecode4 = SWIG_AsVal_int(obj3, &val4);
- if (!SWIG_IsOK(ecode4)) {
- SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "lcdInit" "', argument " "4"" of type '" "int""'");
- }
- arg4 = (int)(val4);
- ecode5 = SWIG_AsVal_int(obj4, &val5);
- if (!SWIG_IsOK(ecode5)) {
- SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "lcdInit" "', argument " "5"" of type '" "int""'");
- }
- arg5 = (int)(val5);
- ecode6 = SWIG_AsVal_int(obj5, &val6);
- if (!SWIG_IsOK(ecode6)) {
- SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "lcdInit" "', argument " "6"" of type '" "int""'");
- }
- arg6 = (int)(val6);
- ecode7 = SWIG_AsVal_int(obj6, &val7);
- if (!SWIG_IsOK(ecode7)) {
- SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "lcdInit" "', argument " "7"" of type '" "int""'");
- }
- arg7 = (int)(val7);
- ecode8 = SWIG_AsVal_int(obj7, &val8);
- if (!SWIG_IsOK(ecode8)) {
- SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "lcdInit" "', argument " "8"" of type '" "int""'");
- }
- arg8 = (int)(val8);
- ecode9 = SWIG_AsVal_int(obj8, &val9);
- if (!SWIG_IsOK(ecode9)) {
- SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "lcdInit" "', argument " "9"" of type '" "int""'");
- }
- arg9 = (int)(val9);
- ecode10 = SWIG_AsVal_int(obj9, &val10);
- if (!SWIG_IsOK(ecode10)) {
- SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "lcdInit" "', argument " "10"" of type '" "int""'");
- }
- arg10 = (int)(val10);
- ecode11 = SWIG_AsVal_int(obj10, &val11);
- if (!SWIG_IsOK(ecode11)) {
- SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "lcdInit" "', argument " "11"" of type '" "int""'");
- }
- arg11 = (int)(val11);
- ecode12 = SWIG_AsVal_int(obj11, &val12);
- if (!SWIG_IsOK(ecode12)) {
- SWIG_exception_fail(SWIG_ArgError(ecode12), "in method '" "lcdInit" "', argument " "12"" of type '" "int""'");
- }
- arg12 = (int)(val12);
- ecode13 = SWIG_AsVal_int(obj12, &val13);
- if (!SWIG_IsOK(ecode13)) {
- SWIG_exception_fail(SWIG_ArgError(ecode13), "in method '" "lcdInit" "', argument " "13"" of type '" "int""'");
- }
- arg13 = (int)(val13);
- result = (int)lcdInit(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13);
- resultobj = SWIG_From_int((int)(result));
- return resultobj;
-fail:
- return NULL;
-}
-
-
SWIGINTERN PyObject *_wrap_ds1302rtcRead(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
int arg1 ;
@@ -6717,7 +5163,169 @@
}
-SWIGINTERN PyObject *_wrap_setupNesJoystick(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_lcdHome(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:lcdHome",&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "lcdHome" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ lcdHome(arg1);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_lcdClear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:lcdClear",&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "lcdClear" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ lcdClear(arg1);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_lcdDisplay(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:lcdDisplay",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "lcdDisplay" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "lcdDisplay" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ lcdDisplay(arg1,arg2);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_lcdCursor(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:lcdCursor",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "lcdCursor" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "lcdCursor" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ lcdCursor(arg1,arg2);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_lcdCursorBlink(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:lcdCursorBlink",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "lcdCursorBlink" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "lcdCursorBlink" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ lcdCursorBlink(arg1,arg2);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_lcdSendCommand(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ unsigned char arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ unsigned char val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:lcdSendCommand",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "lcdSendCommand" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "lcdSendCommand" "', argument " "2"" of type '" "unsigned char""'");
+ }
+ arg2 = (unsigned char)(val2);
+ lcdSendCommand(arg1,arg2);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_lcdPosition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
int arg1 ;
int arg2 ;
@@ -6731,25 +5339,304 @@
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
PyObject * obj2 = 0 ;
- int result;
- if (!PyArg_ParseTuple(args,(char *)"OOO:setupNesJoystick",&obj0,&obj1,&obj2)) SWIG_fail;
+ if (!PyArg_ParseTuple(args,(char *)"OOO:lcdPosition",&obj0,&obj1,&obj2)) SWIG_fail;
ecode1 = SWIG_AsVal_int(obj0, &val1);
if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "setupNesJoystick" "', argument " "1"" of type '" "int""'");
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "lcdPosition" "', argument " "1"" of type '" "int""'");
}
arg1 = (int)(val1);
ecode2 = SWIG_AsVal_int(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
- SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "setupNesJoystick" "', argument " "2"" of type '" "int""'");
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "lcdPosition" "', argument " "2"" of type '" "int""'");
}
arg2 = (int)(val2);
ecode3 = SWIG_AsVal_int(obj2, &val3);
if (!SWIG_IsOK(ecode3)) {
- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "setupNesJoystick" "', argument " "3"" of type '" "int""'");
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "lcdPosition" "', argument " "3"" of type '" "int""'");
}
arg3 = (int)(val3);
- result = (int)setupNesJoystick(arg1,arg2,arg3);
+ lcdPosition(arg1,arg2,arg3);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_lcdCharDef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ unsigned char *arg3 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ void *argp3 = 0 ;
+ int res3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:lcdCharDef",&obj0,&obj1,&obj2)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "lcdCharDef" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "lcdCharDef" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_unsigned_char, 0 | 0 );
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "lcdCharDef" "', argument " "3"" of type '" "unsigned char [8]""'");
+ }
+ arg3 = (unsigned char *)(argp3);
+ lcdCharDef(arg1,arg2,arg3);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_lcdPutchar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ unsigned char arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ unsigned char val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:lcdPutchar",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "lcdPutchar" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "lcdPutchar" "', argument " "2"" of type '" "unsigned char""'");
+ }
+ arg2 = (unsigned char)(val2);
+ lcdPutchar(arg1,arg2);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_lcdPuts(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ char *arg2 = (char *) 0 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:lcdPuts",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "lcdPuts" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "lcdPuts" "', argument " "2"" of type '" "char const *""'");
+ }
+ arg2 = (char *)(buf2);
+ lcdPuts(arg1,(char const *)arg2);
+ resultobj = SWIG_Py_Void();
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+ return resultobj;
+fail:
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_lcdPrintf__varargs__(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *varargs) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ char *arg2 = (char *) 0 ;
+ void *arg3 = 0 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:lcdPrintf",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "lcdPrintf" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "lcdPrintf" "', argument " "2"" of type '" "char const *""'");
+ }
+ arg2 = (char *)(buf2);
+ lcdPrintf(arg1,(char const *)arg2,arg3);
+ resultobj = SWIG_Py_Void();
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+ return resultobj;
+fail:
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_lcdPrintf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj;
+ PyObject *varargs;
+ PyObject *newargs;
+
+ newargs = PyTuple_GetSlice(args,0,2);
+ varargs = PyTuple_GetSlice(args,2,PyTuple_Size(args)+1);
+ resultobj = _wrap_lcdPrintf__varargs__(NULL,newargs,varargs);
+ Py_XDECREF(newargs);
+ Py_XDECREF(varargs);
+ return resultobj;
+}
+
+
+SWIGINTERN PyObject *_wrap_lcdInit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int arg3 ;
+ int arg4 ;
+ int arg5 ;
+ int arg6 ;
+ int arg7 ;
+ int arg8 ;
+ int arg9 ;
+ int arg10 ;
+ int arg11 ;
+ int arg12 ;
+ int arg13 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ int val3 ;
+ int ecode3 = 0 ;
+ int val4 ;
+ int ecode4 = 0 ;
+ int val5 ;
+ int ecode5 = 0 ;
+ int val6 ;
+ int ecode6 = 0 ;
+ int val7 ;
+ int ecode7 = 0 ;
+ int val8 ;
+ int ecode8 = 0 ;
+ int val9 ;
+ int ecode9 = 0 ;
+ int val10 ;
+ int ecode10 = 0 ;
+ int val11 ;
+ int ecode11 = 0 ;
+ int val12 ;
+ int ecode12 = 0 ;
+ int val13 ;
+ int ecode13 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+ PyObject * obj4 = 0 ;
+ PyObject * obj5 = 0 ;
+ PyObject * obj6 = 0 ;
+ PyObject * obj7 = 0 ;
+ PyObject * obj8 = 0 ;
+ PyObject * obj9 = 0 ;
+ PyObject * obj10 = 0 ;
+ PyObject * obj11 = 0 ;
+ PyObject * obj12 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOOOO:lcdInit",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11,&obj12)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "lcdInit" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "lcdInit" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ ecode3 = SWIG_AsVal_int(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "lcdInit" "', argument " "3"" of type '" "int""'");
+ }
+ arg3 = (int)(val3);
+ ecode4 = SWIG_AsVal_int(obj3, &val4);
+ if (!SWIG_IsOK(ecode4)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "lcdInit" "', argument " "4"" of type '" "int""'");
+ }
+ arg4 = (int)(val4);
+ ecode5 = SWIG_AsVal_int(obj4, &val5);
+ if (!SWIG_IsOK(ecode5)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "lcdInit" "', argument " "5"" of type '" "int""'");
+ }
+ arg5 = (int)(val5);
+ ecode6 = SWIG_AsVal_int(obj5, &val6);
+ if (!SWIG_IsOK(ecode6)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "lcdInit" "', argument " "6"" of type '" "int""'");
+ }
+ arg6 = (int)(val6);
+ ecode7 = SWIG_AsVal_int(obj6, &val7);
+ if (!SWIG_IsOK(ecode7)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "lcdInit" "', argument " "7"" of type '" "int""'");
+ }
+ arg7 = (int)(val7);
+ ecode8 = SWIG_AsVal_int(obj7, &val8);
+ if (!SWIG_IsOK(ecode8)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "lcdInit" "', argument " "8"" of type '" "int""'");
+ }
+ arg8 = (int)(val8);
+ ecode9 = SWIG_AsVal_int(obj8, &val9);
+ if (!SWIG_IsOK(ecode9)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "lcdInit" "', argument " "9"" of type '" "int""'");
+ }
+ arg9 = (int)(val9);
+ ecode10 = SWIG_AsVal_int(obj9, &val10);
+ if (!SWIG_IsOK(ecode10)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "lcdInit" "', argument " "10"" of type '" "int""'");
+ }
+ arg10 = (int)(val10);
+ ecode11 = SWIG_AsVal_int(obj10, &val11);
+ if (!SWIG_IsOK(ecode11)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "lcdInit" "', argument " "11"" of type '" "int""'");
+ }
+ arg11 = (int)(val11);
+ ecode12 = SWIG_AsVal_int(obj11, &val12);
+ if (!SWIG_IsOK(ecode12)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode12), "in method '" "lcdInit" "', argument " "12"" of type '" "int""'");
+ }
+ arg12 = (int)(val12);
+ ecode13 = SWIG_AsVal_int(obj12, &val13);
+ if (!SWIG_IsOK(ecode13)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode13), "in method '" "lcdInit" "', argument " "13"" of type '" "int""'");
+ }
+ arg13 = (int)(val13);
+ result = (int)lcdInit(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13);
resultobj = SWIG_From_int((int)(result));
return resultobj;
fail:
@@ -6757,22 +5644,22 @@
}
-SWIGINTERN PyObject *_wrap_readNesJoystick(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *_wrap_piFaceSetup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
int arg1 ;
int val1 ;
int ecode1 = 0 ;
PyObject * obj0 = 0 ;
- unsigned int result;
+ int result;
- if (!PyArg_ParseTuple(args,(char *)"O:readNesJoystick",&obj0)) SWIG_fail;
+ if (!PyArg_ParseTuple(args,(char *)"O:piFaceSetup",&obj0)) SWIG_fail;
ecode1 = SWIG_AsVal_int(obj0, &val1);
if (!SWIG_IsOK(ecode1)) {
- SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "readNesJoystick" "', argument " "1"" of type '" "int""'");
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "piFaceSetup" "', argument " "1"" of type '" "int""'");
}
arg1 = (int)(val1);
- result = (unsigned int)readNesJoystick(arg1);
- resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result));
+ result = (int)piFaceSetup(arg1);
+ resultobj = SWIG_From_int((int)(result));
return resultobj;
fail:
return NULL;
@@ -6899,13 +5786,1580 @@
}
+SWIGINTERN PyObject *_wrap_setupNesJoystick(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int arg3 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ int val3 ;
+ int ecode3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:setupNesJoystick",&obj0,&obj1,&obj2)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "setupNesJoystick" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "setupNesJoystick" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ ecode3 = SWIG_AsVal_int(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "setupNesJoystick" "', argument " "3"" of type '" "int""'");
+ }
+ arg3 = (int)(val3);
+ result = (int)setupNesJoystick(arg1,arg2,arg3);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_readNesJoystick(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+ unsigned int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:readNesJoystick",&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "readNesJoystick" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ result = (unsigned int)readNesJoystick(arg1);
+ resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_sr595Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int arg3 ;
+ int arg4 ;
+ int arg5 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ int val3 ;
+ int ecode3 = 0 ;
+ int val4 ;
+ int ecode4 = 0 ;
+ int val5 ;
+ int ecode5 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+ PyObject * obj4 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOOOO:sr595Setup",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "sr595Setup" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sr595Setup" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ ecode3 = SWIG_AsVal_int(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "sr595Setup" "', argument " "3"" of type '" "int""'");
+ }
+ arg3 = (int)(val3);
+ ecode4 = SWIG_AsVal_int(obj3, &val4);
+ if (!SWIG_IsOK(ecode4)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "sr595Setup" "', argument " "4"" of type '" "int""'");
+ }
+ arg4 = (int)(val4);
+ ecode5 = SWIG_AsVal_int(obj4, &val5);
+ if (!SWIG_IsOK(ecode5)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "sr595Setup" "', argument " "5"" of type '" "int""'");
+ }
+ arg5 = (int)(val5);
+ result = (int)sr595Setup(arg1,arg2,arg3,arg4,arg5);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_drcSetupSerial(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ char *arg3 = (char *) 0 ;
+ int arg4 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ int val4 ;
+ int ecode4 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOOO:drcSetupSerial",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "drcSetupSerial" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "drcSetupSerial" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "drcSetupSerial" "', argument " "3"" of type '" "char const *""'");
+ }
+ arg3 = (char *)(buf3);
+ ecode4 = SWIG_AsVal_int(obj3, &val4);
+ if (!SWIG_IsOK(ecode4)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "drcSetupSerial" "', argument " "4"" of type '" "int""'");
+ }
+ arg4 = (int)(val4);
+ result = (int)drcSetupSerial(arg1,arg2,(char const *)arg3,arg4);
+ resultobj = SWIG_From_int((int)(result));
+ if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+ return resultobj;
+fail:
+ if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_max31855Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:max31855Setup",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "max31855Setup" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "max31855Setup" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ result = (int)max31855Setup(arg1,arg2);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_max5322Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:max5322Setup",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "max5322Setup" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "max5322Setup" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ result = (int)max5322Setup(arg1,arg2);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_mcp23008Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:mcp23008Setup",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "mcp23008Setup" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "mcp23008Setup" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ result = (int)mcp23008Setup(arg1,arg2);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_mcp23016Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:mcp23016Setup",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "mcp23016Setup" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "mcp23016Setup" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ result = (int)mcp23016Setup(arg1,arg2);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_mcp23017Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:mcp23017Setup",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "mcp23017Setup" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "mcp23017Setup" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ result = (int)mcp23017Setup(arg1,arg2);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_mcp23s08Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int arg3 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ int val3 ;
+ int ecode3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:mcp23s08Setup",&obj0,&obj1,&obj2)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "mcp23s08Setup" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "mcp23s08Setup" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ ecode3 = SWIG_AsVal_int(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "mcp23s08Setup" "', argument " "3"" of type '" "int""'");
+ }
+ arg3 = (int)(val3);
+ result = (int)mcp23s08Setup(arg1,arg2,arg3);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_mcp23s17Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int arg3 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ int val3 ;
+ int ecode3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:mcp23s17Setup",&obj0,&obj1,&obj2)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "mcp23s17Setup" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "mcp23s17Setup" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ ecode3 = SWIG_AsVal_int(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "mcp23s17Setup" "', argument " "3"" of type '" "int""'");
+ }
+ arg3 = (int)(val3);
+ result = (int)mcp23s17Setup(arg1,arg2,arg3);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_mcp3002Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:mcp3002Setup",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "mcp3002Setup" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "mcp3002Setup" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ result = (int)mcp3002Setup(arg1,arg2);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_mcp3004Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:mcp3004Setup",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "mcp3004Setup" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "mcp3004Setup" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ result = (int)mcp3004Setup(arg1,arg2);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_mcp3422Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int arg3 ;
+ int arg4 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ int val3 ;
+ int ecode3 = 0 ;
+ int val4 ;
+ int ecode4 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOOO:mcp3422Setup",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "mcp3422Setup" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "mcp3422Setup" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ ecode3 = SWIG_AsVal_int(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "mcp3422Setup" "', argument " "3"" of type '" "int""'");
+ }
+ arg3 = (int)(val3);
+ ecode4 = SWIG_AsVal_int(obj3, &val4);
+ if (!SWIG_IsOK(ecode4)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "mcp3422Setup" "', argument " "4"" of type '" "int""'");
+ }
+ arg4 = (int)(val4);
+ result = (int)mcp3422Setup(arg1,arg2,arg3,arg4);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_mcp4802Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:mcp4802Setup",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "mcp4802Setup" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "mcp4802Setup" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ result = (int)mcp4802Setup(arg1,arg2);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_pcf8574Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:pcf8574Setup",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pcf8574Setup" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pcf8574Setup" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ result = (int)pcf8574Setup(arg1,arg2);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_pcf8591Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:pcf8591Setup",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pcf8591Setup" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pcf8591Setup" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ result = (int)pcf8591Setup(arg1,arg2);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_sn3218Setup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:sn3218Setup",&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "sn3218Setup" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ result = (int)sn3218Setup(arg1);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_softPwmCreate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int arg3 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ int val3 ;
+ int ecode3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:softPwmCreate",&obj0,&obj1,&obj2)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "softPwmCreate" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "softPwmCreate" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ ecode3 = SWIG_AsVal_int(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "softPwmCreate" "', argument " "3"" of type '" "int""'");
+ }
+ arg3 = (int)(val3);
+ result = (int)softPwmCreate(arg1,arg2,arg3);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_softPwmWrite(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:softPwmWrite",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "softPwmWrite" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "softPwmWrite" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ softPwmWrite(arg1,arg2);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_softPwmStop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:softPwmStop",&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "softPwmStop" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ softPwmStop(arg1);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_softServoWrite(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:softServoWrite",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "softServoWrite" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "softServoWrite" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ softServoWrite(arg1,arg2);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_softServoSetup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int arg3 ;
+ int arg4 ;
+ int arg5 ;
+ int arg6 ;
+ int arg7 ;
+ int arg8 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ int val3 ;
+ int ecode3 = 0 ;
+ int val4 ;
+ int ecode4 = 0 ;
+ int val5 ;
+ int ecode5 = 0 ;
+ int val6 ;
+ int ecode6 = 0 ;
+ int val7 ;
+ int ecode7 = 0 ;
+ int val8 ;
+ int ecode8 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+ PyObject * obj4 = 0 ;
+ PyObject * obj5 = 0 ;
+ PyObject * obj6 = 0 ;
+ PyObject * obj7 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:softServoSetup",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "softServoSetup" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "softServoSetup" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ ecode3 = SWIG_AsVal_int(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "softServoSetup" "', argument " "3"" of type '" "int""'");
+ }
+ arg3 = (int)(val3);
+ ecode4 = SWIG_AsVal_int(obj3, &val4);
+ if (!SWIG_IsOK(ecode4)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "softServoSetup" "', argument " "4"" of type '" "int""'");
+ }
+ arg4 = (int)(val4);
+ ecode5 = SWIG_AsVal_int(obj4, &val5);
+ if (!SWIG_IsOK(ecode5)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "softServoSetup" "', argument " "5"" of type '" "int""'");
+ }
+ arg5 = (int)(val5);
+ ecode6 = SWIG_AsVal_int(obj5, &val6);
+ if (!SWIG_IsOK(ecode6)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "softServoSetup" "', argument " "6"" of type '" "int""'");
+ }
+ arg6 = (int)(val6);
+ ecode7 = SWIG_AsVal_int(obj6, &val7);
+ if (!SWIG_IsOK(ecode7)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "softServoSetup" "', argument " "7"" of type '" "int""'");
+ }
+ arg7 = (int)(val7);
+ ecode8 = SWIG_AsVal_int(obj7, &val8);
+ if (!SWIG_IsOK(ecode8)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "softServoSetup" "', argument " "8"" of type '" "int""'");
+ }
+ arg8 = (int)(val8);
+ result = (int)softServoSetup(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_softToneCreate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:softToneCreate",&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "softToneCreate" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ result = (int)softToneCreate(arg1);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_softToneStop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:softToneStop",&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "softToneStop" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ softToneStop(arg1);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_softToneWrite(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:softToneWrite",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "softToneWrite" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "softToneWrite" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ softToneWrite(arg1,arg2);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_wiringPiSPIGetFd(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:wiringPiSPIGetFd",&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiSPIGetFd" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ result = (int)wiringPiSPIGetFd(arg1);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_wiringPiSPIDataRW(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ unsigned char *arg2 = (unsigned char *) 0 ;
+ int arg3 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:wiringPiSPIDataRW",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiSPIDataRW" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ {
+ arg2 = (unsigned char *) PyString_AsString(obj1);
+ arg3 = PyString_Size(obj1);
+ }
+ result = (int)wiringPiSPIDataRW(arg1,arg2,arg3);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_wiringPiSPISetup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:wiringPiSPISetup",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiSPISetup" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wiringPiSPISetup" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ result = (int)wiringPiSPISetup(arg1,arg2);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_wiringPiI2CRead(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:wiringPiI2CRead",&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiI2CRead" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ result = (int)wiringPiI2CRead(arg1);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_wiringPiI2CReadReg8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:wiringPiI2CReadReg8",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiI2CReadReg8" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wiringPiI2CReadReg8" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ result = (int)wiringPiI2CReadReg8(arg1,arg2);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_wiringPiI2CReadReg16(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:wiringPiI2CReadReg16",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiI2CReadReg16" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wiringPiI2CReadReg16" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ result = (int)wiringPiI2CReadReg16(arg1,arg2);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_wiringPiI2CWrite(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:wiringPiI2CWrite",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiI2CWrite" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wiringPiI2CWrite" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ result = (int)wiringPiI2CWrite(arg1,arg2);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_wiringPiI2CWriteReg8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int arg3 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ int val3 ;
+ int ecode3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:wiringPiI2CWriteReg8",&obj0,&obj1,&obj2)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiI2CWriteReg8" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wiringPiI2CWriteReg8" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ ecode3 = SWIG_AsVal_int(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "wiringPiI2CWriteReg8" "', argument " "3"" of type '" "int""'");
+ }
+ arg3 = (int)(val3);
+ result = (int)wiringPiI2CWriteReg8(arg1,arg2,arg3);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_wiringPiI2CWriteReg16(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int arg2 ;
+ int arg3 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ int val3 ;
+ int ecode3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:wiringPiI2CWriteReg16",&obj0,&obj1,&obj2)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiI2CWriteReg16" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wiringPiI2CWriteReg16" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ ecode3 = SWIG_AsVal_int(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "wiringPiI2CWriteReg16" "', argument " "3"" of type '" "int""'");
+ }
+ arg3 = (int)(val3);
+ result = (int)wiringPiI2CWriteReg16(arg1,arg2,arg3);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_wiringPiI2CSetupInterface(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ char *arg1 = (char *) 0 ;
+ int arg2 ;
+ int res1 ;
+ char *buf1 = 0 ;
+ int alloc1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:wiringPiI2CSetupInterface",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "wiringPiI2CSetupInterface" "', argument " "1"" of type '" "char const *""'");
+ }
+ arg1 = (char *)(buf1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wiringPiI2CSetupInterface" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ result = (int)wiringPiI2CSetupInterface((char const *)arg1,arg2);
+ resultobj = SWIG_From_int((int)(result));
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+ return resultobj;
+fail:
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_wiringPiI2CSetup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:wiringPiI2CSetup",&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "wiringPiI2CSetup" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ result = (int)wiringPiI2CSetup(arg1);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_serialOpen(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ char *arg1 = (char *) 0 ;
+ int arg2 ;
+ int res1 ;
+ char *buf1 = 0 ;
+ int alloc1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:serialOpen",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "serialOpen" "', argument " "1"" of type '" "char const *""'");
+ }
+ arg1 = (char *)(buf1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "serialOpen" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = (int)(val2);
+ result = (int)serialOpen((char const *)arg1,arg2);
+ resultobj = SWIG_From_int((int)(result));
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+ return resultobj;
+fail:
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_serialClose(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:serialClose",&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "serialClose" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ serialClose(arg1);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_serialFlush(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:serialFlush",&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "serialFlush" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ serialFlush(arg1);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_serialPutchar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ unsigned char arg2 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ unsigned char val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:serialPutchar",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "serialPutchar" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "serialPutchar" "', argument " "2"" of type '" "unsigned char""'");
+ }
+ arg2 = (unsigned char)(val2);
+ serialPutchar(arg1,arg2);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_serialPuts(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ char *arg2 = (char *) 0 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:serialPuts",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "serialPuts" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "serialPuts" "', argument " "2"" of type '" "char const *""'");
+ }
+ arg2 = (char *)(buf2);
+ serialPuts(arg1,(char const *)arg2);
+ resultobj = SWIG_Py_Void();
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+ return resultobj;
+fail:
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_serialPrintf__varargs__(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *varargs) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ char *arg2 = (char *) 0 ;
+ void *arg3 = 0 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:serialPrintf",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "serialPrintf" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "serialPrintf" "', argument " "2"" of type '" "char const *""'");
+ }
+ arg2 = (char *)(buf2);
+ serialPrintf(arg1,(char const *)arg2,arg3);
+ resultobj = SWIG_Py_Void();
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+ return resultobj;
+fail:
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_serialPrintf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj;
+ PyObject *varargs;
+ PyObject *newargs;
+
+ newargs = PyTuple_GetSlice(args,0,2);
+ varargs = PyTuple_GetSlice(args,2,PyTuple_Size(args)+1);
+ resultobj = _wrap_serialPrintf__varargs__(NULL,newargs,varargs);
+ Py_XDECREF(newargs);
+ Py_XDECREF(varargs);
+ return resultobj;
+}
+
+
+SWIGINTERN PyObject *_wrap_serialDataAvail(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:serialDataAvail",&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "serialDataAvail" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ result = (int)serialDataAvail(arg1);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_serialGetchar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:serialGetchar",&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "serialGetchar" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = (int)(val1);
+ result = (int)serialGetchar(arg1);
+ resultobj = SWIG_From_int((int)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_shiftIn(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ uint8_t arg1 ;
+ uint8_t arg2 ;
+ uint8_t arg3 ;
+ unsigned char val1 ;
+ int ecode1 = 0 ;
+ unsigned char val2 ;
+ int ecode2 = 0 ;
+ unsigned char val3 ;
+ int ecode3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ uint8_t result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:shiftIn",&obj0,&obj1,&obj2)) SWIG_fail;
+ ecode1 = SWIG_AsVal_unsigned_SS_char(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "shiftIn" "', argument " "1"" of type '" "uint8_t""'");
+ }
+ arg1 = (uint8_t)(val1);
+ ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "shiftIn" "', argument " "2"" of type '" "uint8_t""'");
+ }
+ arg2 = (uint8_t)(val2);
+ ecode3 = SWIG_AsVal_unsigned_SS_char(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "shiftIn" "', argument " "3"" of type '" "uint8_t""'");
+ }
+ arg3 = (uint8_t)(val3);
+ result = shiftIn(arg1,arg2,arg3);
+ resultobj = SWIG_From_unsigned_SS_char((unsigned char)(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_shiftOut(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ uint8_t arg1 ;
+ uint8_t arg2 ;
+ uint8_t arg3 ;
+ uint8_t arg4 ;
+ unsigned char val1 ;
+ int ecode1 = 0 ;
+ unsigned char val2 ;
+ int ecode2 = 0 ;
+ unsigned char val3 ;
+ int ecode3 = 0 ;
+ unsigned char val4 ;
+ int ecode4 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOOO:shiftOut",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+ ecode1 = SWIG_AsVal_unsigned_SS_char(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "shiftOut" "', argument " "1"" of type '" "uint8_t""'");
+ }
+ arg1 = (uint8_t)(val1);
+ ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "shiftOut" "', argument " "2"" of type '" "uint8_t""'");
+ }
+ arg2 = (uint8_t)(val2);
+ ecode3 = SWIG_AsVal_unsigned_SS_char(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "shiftOut" "', argument " "3"" of type '" "uint8_t""'");
+ }
+ arg3 = (uint8_t)(val3);
+ ecode4 = SWIG_AsVal_unsigned_SS_char(obj3, &val4);
+ if (!SWIG_IsOK(ecode4)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "shiftOut" "', argument " "4"" of type '" "uint8_t""'");
+ }
+ arg4 = (uint8_t)(val4);
+ shiftOut(arg1,arg2,arg3,arg4);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
static PyMethodDef SwigMethods[] = {
{ (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL},
+ { (char *)"wiringPiFailure", _wrap_wiringPiFailure, METH_VARARGS, NULL},
+ { (char *)"wiringPiFindNode", _wrap_wiringPiFindNode, METH_VARARGS, NULL},
+ { (char *)"wiringPiNewNode", _wrap_wiringPiNewNode, METH_VARARGS, NULL},
{ (char *)"wiringPiSetup", _wrap_wiringPiSetup, METH_VARARGS, NULL},
{ (char *)"wiringPiSetupSys", _wrap_wiringPiSetupSys, METH_VARARGS, NULL},
{ (char *)"wiringPiSetupGpio", _wrap_wiringPiSetupGpio, METH_VARARGS, NULL},
{ (char *)"wiringPiSetupPhys", _wrap_wiringPiSetupPhys, METH_VARARGS, NULL},
- { (char *)"piFaceSetup", _wrap_piFaceSetup, METH_VARARGS, NULL},
+ { (char *)"pinModeAlt", _wrap_pinModeAlt, METH_VARARGS, NULL},
{ (char *)"pinMode", _wrap_pinMode, METH_VARARGS, NULL},
{ (char *)"pullUpDnControl", _wrap_pullUpDnControl, METH_VARARGS, NULL},
{ (char *)"digitalRead", _wrap_digitalRead, METH_VARARGS, NULL},
@@ -6914,14 +7368,18 @@
{ (char *)"analogRead", _wrap_analogRead, METH_VARARGS, NULL},
{ (char *)"analogWrite", _wrap_analogWrite, METH_VARARGS, NULL},
{ (char *)"piBoardRev", _wrap_piBoardRev, METH_VARARGS, NULL},
+ { (char *)"piBoardId", _wrap_piBoardId, METH_VARARGS, NULL},
{ (char *)"wpiPinToGpio", _wrap_wpiPinToGpio, METH_VARARGS, NULL},
+ { (char *)"physPinToGpio", _wrap_physPinToGpio, METH_VARARGS, NULL},
{ (char *)"setPadDrive", _wrap_setPadDrive, METH_VARARGS, NULL},
{ (char *)"getAlt", _wrap_getAlt, METH_VARARGS, NULL},
+ { (char *)"pwmToneWrite", _wrap_pwmToneWrite, METH_VARARGS, NULL},
{ (char *)"digitalWriteByte", _wrap_digitalWriteByte, METH_VARARGS, NULL},
{ (char *)"pwmSetMode", _wrap_pwmSetMode, METH_VARARGS, NULL},
{ (char *)"pwmSetRange", _wrap_pwmSetRange, METH_VARARGS, NULL},
{ (char *)"pwmSetClock", _wrap_pwmSetClock, METH_VARARGS, NULL},
{ (char *)"gpioClockSet", _wrap_gpioClockSet, METH_VARARGS, NULL},
+ { (char *)"waitForInterrupt", _wrap_waitForInterrupt, METH_VARARGS, NULL},
{ (char *)"wiringPiISR", _wrap_wiringPiISR, METH_VARARGS, NULL},
{ (char *)"piThreadCreate", _wrap_piThreadCreate, METH_VARARGS, NULL},
{ (char *)"piLock", _wrap_piLock, METH_VARARGS, NULL},
@@ -6931,56 +7389,6 @@
{ (char *)"delayMicroseconds", _wrap_delayMicroseconds, METH_VARARGS, NULL},
{ (char *)"millis", _wrap_millis, METH_VARARGS, NULL},
{ (char *)"micros", _wrap_micros, METH_VARARGS, NULL},
- { (char *)"serialOpen", _wrap_serialOpen, METH_VARARGS, NULL},
- { (char *)"serialClose", _wrap_serialClose, METH_VARARGS, NULL},
- { (char *)"serialFlush", _wrap_serialFlush, METH_VARARGS, NULL},
- { (char *)"serialPutchar", _wrap_serialPutchar, METH_VARARGS, NULL},
- { (char *)"serialPuts", _wrap_serialPuts, METH_VARARGS, NULL},
- { (char *)"serialPrintf", _wrap_serialPrintf, METH_VARARGS, NULL},
- { (char *)"serialDataAvail", _wrap_serialDataAvail, METH_VARARGS, NULL},
- { (char *)"serialGetchar", _wrap_serialGetchar, METH_VARARGS, NULL},
- { (char *)"shiftOut", _wrap_shiftOut, METH_VARARGS, NULL},
- { (char *)"shiftIn", _wrap_shiftIn, METH_VARARGS, NULL},
- { (char *)"wiringPiSPIGetFd", _wrap_wiringPiSPIGetFd, METH_VARARGS, NULL},
- { (char *)"wiringPiSPIDataRW", _wrap_wiringPiSPIDataRW, METH_VARARGS, NULL},
- { (char *)"wiringPiSPISetup", _wrap_wiringPiSPISetup, METH_VARARGS, NULL},
- { (char *)"wiringPiI2CSetupInterface", _wrap_wiringPiI2CSetupInterface, METH_VARARGS, NULL},
- { (char *)"wiringPiI2CSetup", _wrap_wiringPiI2CSetup, METH_VARARGS, NULL},
- { (char *)"wiringPiI2CRead", _wrap_wiringPiI2CRead, METH_VARARGS, NULL},
- { (char *)"wiringPiI2CReadReg8", _wrap_wiringPiI2CReadReg8, METH_VARARGS, NULL},
- { (char *)"wiringPiI2CReadReg16", _wrap_wiringPiI2CReadReg16, METH_VARARGS, NULL},
- { (char *)"wiringPiI2CWrite", _wrap_wiringPiI2CWrite, METH_VARARGS, NULL},
- { (char *)"wiringPiI2CWriteReg8", _wrap_wiringPiI2CWriteReg8, METH_VARARGS, NULL},
- { (char *)"wiringPiI2CWriteReg16", _wrap_wiringPiI2CWriteReg16, METH_VARARGS, NULL},
- { (char *)"softToneCreate", _wrap_softToneCreate, METH_VARARGS, NULL},
- { (char *)"softToneWrite", _wrap_softToneWrite, METH_VARARGS, NULL},
- { (char *)"softServoWrite", _wrap_softServoWrite, METH_VARARGS, NULL},
- { (char *)"softServoSetup", _wrap_softServoSetup, METH_VARARGS, NULL},
- { (char *)"softPwmCreate", _wrap_softPwmCreate, METH_VARARGS, NULL},
- { (char *)"softPwmWrite", _wrap_softPwmWrite, METH_VARARGS, NULL},
- { (char *)"mcp23008Setup", _wrap_mcp23008Setup, METH_VARARGS, NULL},
- { (char *)"mcp23016Setup", _wrap_mcp23016Setup, METH_VARARGS, NULL},
- { (char *)"mcp23017Setup", _wrap_mcp23017Setup, METH_VARARGS, NULL},
- { (char *)"mcp23s08Setup", _wrap_mcp23s08Setup, METH_VARARGS, NULL},
- { (char *)"mcp23s17Setup", _wrap_mcp23s17Setup, METH_VARARGS, NULL},
- { (char *)"mcp3002Setup", _wrap_mcp3002Setup, METH_VARARGS, NULL},
- { (char *)"mcp3422Setup", _wrap_mcp3422Setup, METH_VARARGS, NULL},
- { (char *)"mcp4802Setup", _wrap_mcp4802Setup, METH_VARARGS, NULL},
- { (char *)"pcf8574Setup", _wrap_pcf8574Setup, METH_VARARGS, NULL},
- { (char *)"pcf8591Setup", _wrap_pcf8591Setup, METH_VARARGS, NULL},
- { (char *)"sr595Setup", _wrap_sr595Setup, METH_VARARGS, NULL},
- { (char *)"lcdHome", _wrap_lcdHome, METH_VARARGS, NULL},
- { (char *)"lcdClear", _wrap_lcdClear, METH_VARARGS, NULL},
- { (char *)"lcdDisplay", _wrap_lcdDisplay, METH_VARARGS, NULL},
- { (char *)"lcdCursor", _wrap_lcdCursor, METH_VARARGS, NULL},
- { (char *)"lcdCursorBlink", _wrap_lcdCursorBlink, METH_VARARGS, NULL},
- { (char *)"lcdSendCommand", _wrap_lcdSendCommand, METH_VARARGS, NULL},
- { (char *)"lcdPosition", _wrap_lcdPosition, METH_VARARGS, NULL},
- { (char *)"lcdCharDef", _wrap_lcdCharDef, METH_VARARGS, NULL},
- { (char *)"lcdPutchar", _wrap_lcdPutchar, METH_VARARGS, NULL},
- { (char *)"lcdPuts", _wrap_lcdPuts, METH_VARARGS, NULL},
- { (char *)"lcdPrintf", _wrap_lcdPrintf, METH_VARARGS, NULL},
- { (char *)"lcdInit", _wrap_lcdInit, METH_VARARGS, NULL},
{ (char *)"ds1302rtcRead", _wrap_ds1302rtcRead, METH_VARARGS, NULL},
{ (char *)"ds1302rtcWrite", _wrap_ds1302rtcWrite, METH_VARARGS, NULL},
{ (char *)"ds1302ramRead", _wrap_ds1302ramRead, METH_VARARGS, NULL},
@@ -7008,12 +7416,70 @@
{ (char *)"lcd128x64update", _wrap_lcd128x64update, METH_VARARGS, NULL},
{ (char *)"lcd128x64clear", _wrap_lcd128x64clear, METH_VARARGS, NULL},
{ (char *)"lcd128x64setup", _wrap_lcd128x64setup, METH_VARARGS, NULL},
- { (char *)"setupNesJoystick", _wrap_setupNesJoystick, METH_VARARGS, NULL},
- { (char *)"readNesJoystick", _wrap_readNesJoystick, METH_VARARGS, NULL},
+ { (char *)"lcdHome", _wrap_lcdHome, METH_VARARGS, NULL},
+ { (char *)"lcdClear", _wrap_lcdClear, METH_VARARGS, NULL},
+ { (char *)"lcdDisplay", _wrap_lcdDisplay, METH_VARARGS, NULL},
+ { (char *)"lcdCursor", _wrap_lcdCursor, METH_VARARGS, NULL},
+ { (char *)"lcdCursorBlink", _wrap_lcdCursorBlink, METH_VARARGS, NULL},
+ { (char *)"lcdSendCommand", _wrap_lcdSendCommand, METH_VARARGS, NULL},
+ { (char *)"lcdPosition", _wrap_lcdPosition, METH_VARARGS, NULL},
+ { (char *)"lcdCharDef", _wrap_lcdCharDef, METH_VARARGS, NULL},
+ { (char *)"lcdPutchar", _wrap_lcdPutchar, METH_VARARGS, NULL},
+ { (char *)"lcdPuts", _wrap_lcdPuts, METH_VARARGS, NULL},
+ { (char *)"lcdPrintf", _wrap_lcdPrintf, METH_VARARGS, NULL},
+ { (char *)"lcdInit", _wrap_lcdInit, METH_VARARGS, NULL},
+ { (char *)"piFaceSetup", _wrap_piFaceSetup, METH_VARARGS, NULL},
{ (char *)"piGlow1", _wrap_piGlow1, METH_VARARGS, NULL},
{ (char *)"piGlowLeg", _wrap_piGlowLeg, METH_VARARGS, NULL},
{ (char *)"piGlowRing", _wrap_piGlowRing, METH_VARARGS, NULL},
{ (char *)"piGlowSetup", _wrap_piGlowSetup, METH_VARARGS, NULL},
+ { (char *)"setupNesJoystick", _wrap_setupNesJoystick, METH_VARARGS, NULL},
+ { (char *)"readNesJoystick", _wrap_readNesJoystick, METH_VARARGS, NULL},
+ { (char *)"sr595Setup", _wrap_sr595Setup, METH_VARARGS, NULL},
+ { (char *)"drcSetupSerial", _wrap_drcSetupSerial, METH_VARARGS, NULL},
+ { (char *)"max31855Setup", _wrap_max31855Setup, METH_VARARGS, NULL},
+ { (char *)"max5322Setup", _wrap_max5322Setup, METH_VARARGS, NULL},
+ { (char *)"mcp23008Setup", _wrap_mcp23008Setup, METH_VARARGS, NULL},
+ { (char *)"mcp23016Setup", _wrap_mcp23016Setup, METH_VARARGS, NULL},
+ { (char *)"mcp23017Setup", _wrap_mcp23017Setup, METH_VARARGS, NULL},
+ { (char *)"mcp23s08Setup", _wrap_mcp23s08Setup, METH_VARARGS, NULL},
+ { (char *)"mcp23s17Setup", _wrap_mcp23s17Setup, METH_VARARGS, NULL},
+ { (char *)"mcp3002Setup", _wrap_mcp3002Setup, METH_VARARGS, NULL},
+ { (char *)"mcp3004Setup", _wrap_mcp3004Setup, METH_VARARGS, NULL},
+ { (char *)"mcp3422Setup", _wrap_mcp3422Setup, METH_VARARGS, NULL},
+ { (char *)"mcp4802Setup", _wrap_mcp4802Setup, METH_VARARGS, NULL},
+ { (char *)"pcf8574Setup", _wrap_pcf8574Setup, METH_VARARGS, NULL},
+ { (char *)"pcf8591Setup", _wrap_pcf8591Setup, METH_VARARGS, NULL},
+ { (char *)"sn3218Setup", _wrap_sn3218Setup, METH_VARARGS, NULL},
+ { (char *)"softPwmCreate", _wrap_softPwmCreate, METH_VARARGS, NULL},
+ { (char *)"softPwmWrite", _wrap_softPwmWrite, METH_VARARGS, NULL},
+ { (char *)"softPwmStop", _wrap_softPwmStop, METH_VARARGS, NULL},
+ { (char *)"softServoWrite", _wrap_softServoWrite, METH_VARARGS, NULL},
+ { (char *)"softServoSetup", _wrap_softServoSetup, METH_VARARGS, NULL},
+ { (char *)"softToneCreate", _wrap_softToneCreate, METH_VARARGS, NULL},
+ { (char *)"softToneStop", _wrap_softToneStop, METH_VARARGS, NULL},
+ { (char *)"softToneWrite", _wrap_softToneWrite, METH_VARARGS, NULL},
+ { (char *)"wiringPiSPIGetFd", _wrap_wiringPiSPIGetFd, METH_VARARGS, NULL},
+ { (char *)"wiringPiSPIDataRW", _wrap_wiringPiSPIDataRW, METH_VARARGS, NULL},
+ { (char *)"wiringPiSPISetup", _wrap_wiringPiSPISetup, METH_VARARGS, NULL},
+ { (char *)"wiringPiI2CRead", _wrap_wiringPiI2CRead, METH_VARARGS, NULL},
+ { (char *)"wiringPiI2CReadReg8", _wrap_wiringPiI2CReadReg8, METH_VARARGS, NULL},
+ { (char *)"wiringPiI2CReadReg16", _wrap_wiringPiI2CReadReg16, METH_VARARGS, NULL},
+ { (char *)"wiringPiI2CWrite", _wrap_wiringPiI2CWrite, METH_VARARGS, NULL},
+ { (char *)"wiringPiI2CWriteReg8", _wrap_wiringPiI2CWriteReg8, METH_VARARGS, NULL},
+ { (char *)"wiringPiI2CWriteReg16", _wrap_wiringPiI2CWriteReg16, METH_VARARGS, NULL},
+ { (char *)"wiringPiI2CSetupInterface", _wrap_wiringPiI2CSetupInterface, METH_VARARGS, NULL},
+ { (char *)"wiringPiI2CSetup", _wrap_wiringPiI2CSetup, METH_VARARGS, NULL},
+ { (char *)"serialOpen", _wrap_serialOpen, METH_VARARGS, NULL},
+ { (char *)"serialClose", _wrap_serialClose, METH_VARARGS, NULL},
+ { (char *)"serialFlush", _wrap_serialFlush, METH_VARARGS, NULL},
+ { (char *)"serialPutchar", _wrap_serialPutchar, METH_VARARGS, NULL},
+ { (char *)"serialPuts", _wrap_serialPuts, METH_VARARGS, NULL},
+ { (char *)"serialPrintf", _wrap_serialPrintf, METH_VARARGS, NULL},
+ { (char *)"serialDataAvail", _wrap_serialDataAvail, METH_VARARGS, NULL},
+ { (char *)"serialGetchar", _wrap_serialGetchar, METH_VARARGS, NULL},
+ { (char *)"shiftIn", _wrap_shiftIn, METH_VARARGS, NULL},
+ { (char *)"shiftOut", _wrap_shiftOut, METH_VARARGS, NULL},
{ NULL, NULL, 0, NULL }
};
@@ -7021,35 +7487,35 @@
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_f_int_int__int = {"_p_f_int_int__int", "int (*)(int,int)", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_f_p_void__p_void = {"_p_f_p_void__p_void", "void *(*)(void *)", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_f_void__void = {"_p_f_void__void", "void (*)(void)", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_int = {"_p_int", "int *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_wiringPiNodeStruct = {"_p_wiringPiNodeStruct", "struct wiringPiNodeStruct *", 0, 0, (void*)0, 0};
static swig_type_info *swig_type_initial[] = {
&_swigt__p_char,
- &_swigt__p_f_int_int__int,
&_swigt__p_f_p_void__p_void,
&_swigt__p_f_void__void,
&_swigt__p_int,
&_swigt__p_unsigned_char,
+ &_swigt__p_wiringPiNodeStruct,
};
static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_f_int_int__int[] = { {&_swigt__p_f_int_int__int, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_f_p_void__p_void[] = { {&_swigt__p_f_p_void__p_void, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_f_void__void[] = { {&_swigt__p_f_void__void, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_wiringPiNodeStruct[] = { {&_swigt__p_wiringPiNodeStruct, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info *swig_cast_initial[] = {
_swigc__p_char,
- _swigc__p_f_int_int__int,
_swigc__p_f_p_void__p_void,
_swigc__p_f_void__void,
_swigc__p_int,
_swigc__p_unsigned_char,
+ _swigc__p_wiringPiNodeStruct,
};
@@ -7735,8 +8201,6 @@
SWIG_InstallConstants(d,swig_const_table);
- PyDict_SetItemString(md,(char*)"cvar", SWIG_globals());
- SWIG_addvarlink(SWIG_globals(),(char*)"waitForInterrupt",Swig_var_waitForInterrupt_get, Swig_var_waitForInterrupt_set);
#if PY_VERSION_HEX >= 0x03000000
return m;
#else