3 * Arduino compatable (ish) Wiring library for the Raspberry Pi
4 * Copyright (c) 2012 Gordon Henderson
5 ***********************************************************************
6 * This file is part of wiringPi:
7 * https://projects.drogon.net/raspberry-pi/wiringpi/
9 * wiringPi is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
14 * wiringPi is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
21 ***********************************************************************
28 #define WPI_MODE_PINS 0
29 #define WPI_MODE_GPIO 1
30 #define WPI_MODE_GPIO_SYS 2
31 #define WPI_MODE_PIFACE 3
44 // Function prototypes
45 // c++ wrappers thanks to a commend by Nick Lott
46 // (and others on the Raspberry Pi forums)
52 // Basic wiringPi functions
54 extern int wiringPiSetup (void) ;
55 extern int wiringPiSetupSys (void) ;
56 extern int wiringPiSetupGpio (void) ;
57 extern int wiringPiSetupPiFace (void) ;
59 extern int wiringPiSetupPiFaceForGpioProg (void) ; // Don't use this - for gpio program only
61 extern void (*pinMode) (int pin, int mode) ;
62 extern void (*pullUpDnControl) (int pin, int pud) ;
63 extern void (*digitalWrite) (int pin, int value) ;
64 extern void (*pwmWrite) (int pin, int value) ;
65 extern void (*setPadDrive) (int group, int value) ;
66 extern int (*digitalRead) (int pin) ;
67 extern void (*delayMicroseconds) (unsigned int howLong) ;
71 extern int (*waitForInterrupt) (int pin, int mS) ;
75 #define PI_THREAD(X) void *X (void *dummy)
77 extern int piThreadCreate (void *(*fn)(void *)) ;
78 extern void piLock (int key) ;
79 extern void piUnlock (int key) ;
81 // Schedulling priority
83 extern int piHiPri (int pri) ;
86 // Extras from arduino land
88 extern void delay (unsigned int howLong) ;
89 extern unsigned int millis (void) ;