3131import java .util .Map ;
3232
3333
34+ /**
35+ * @webref
36+ */
3437public class GPIO {
3538
3639 // those constants are generally the same as in Arduino.h
@@ -99,6 +102,7 @@ public static void analogWrite(int pin, int value) {
99102 * @see noInterrupts
100103 * @see interrupts
101104 * @see releaseInterrupt
105+ * @webref
102106 */
103107 public static void attachInterrupt (int pin , PApplet parent , String method , int mode ) {
104108 if (irqThreads .containsKey (pin )) {
@@ -159,6 +163,7 @@ public void run() {
159163 * Board-specific classes, such as RPI, assign -1 to pins that carry power,
160164 * ground and the like.
161165 * @param pin GPIO pin
166+ * @webref
162167 */
163168 protected static void checkValidPin (int pin ) {
164169 if (pin < 0 ) {
@@ -176,6 +181,7 @@ protected static void checkValidPin(int pin) {
176181 * @return GPIO.HIGH (1) or GPIO.LOW (0)
177182 * @see pinMode
178183 * @see digitalWrite
184+ * @webref
179185 */
180186 public static int digitalRead (int pin ) {
181187 checkValidPin (pin );
@@ -211,6 +217,7 @@ public static int digitalRead(int pin) {
211217 * @param value GPIO.HIGH or GPIO.LOW
212218 * @see pinMode
213219 * @see digitalRead
220+ * @webref
214221 */
215222 public static void digitalWrite (int pin , int value ) {
216223 checkValidPin (pin );
@@ -250,6 +257,7 @@ public static void digitalWrite(int pin, int value) {
250257 * @param value true or false
251258 * @see pinMode
252259 * @see digitalRead
260+ * @webref
253261 */
254262 public static void digitalWrite (int pin , boolean value ) {
255263 if (value ) {
@@ -269,6 +277,7 @@ public static void digitalWrite(int pin, boolean value) {
269277 * @param pin GPIO pin
270278 * @see enableInterrupt
271279 * @see waitForInterrupt
280+ * @webref
272281 */
273282 public static void disableInterrupt (int pin ) {
274283 enableInterrupt (pin , NONE );
@@ -284,6 +293,7 @@ public static void disableInterrupt(int pin) {
284293 * @param mode what to wait for: GPIO.CHANGE, GPIO.FALLING or GPIO.RISING
285294 * @see waitForInterrupt
286295 * @see disableInterrupt
296+ * @webref
287297 */
288298 public static void enableInterrupt (int pin , int mode ) {
289299 checkValidPin (pin );
@@ -322,6 +332,7 @@ public static void enableInterrupt(int pin, int mode) {
322332 * @see attachInterrupt
323333 * @see noInterrupts
324334 * @see releaseInterrupt
335+ * @webref
325336 */
326337 public static void interrupts () {
327338 serveInterrupts = true ;
@@ -338,6 +349,7 @@ public static void interrupts() {
338349 * @see attachInterrupt
339350 * @see interrupts
340351 * @see releaseInterrupt
352+ * @webref
341353 */
342354 public static void noInterrupts () {
343355 serveInterrupts = false ;
@@ -355,6 +367,7 @@ public static void noInterrupts() {
355367 * @see digitalRead
356368 * @see digitalWrite
357369 * @see releasePin
370+ * @webref
358371 */
359372 public static void pinMode (int pin , int mode ) {
360373 checkValidPin (pin );
@@ -416,6 +429,7 @@ public static void pinMode(int pin, int mode) {
416429 * @see attachInterrupt
417430 * @see noInterrupts
418431 * @see interrupts
432+ * @webref
419433 */
420434 public static void releaseInterrupt (int pin ) {
421435 Thread t = irqThreads .get (pin );
@@ -443,6 +457,7 @@ public static void releaseInterrupt(int pin) {
443457 * state even after the sketch has been closed.
444458 * @param pin GPIO pin
445459 * @see pinMode
460+ * @webref
446461 */
447462 public static void releasePin (int pin ) {
448463 checkValidPin (pin );
@@ -471,6 +486,7 @@ public static void releasePin(int pin) {
471486 * @return true if the interrupt occured, false if the timeout occured
472487 * @see enableInterrupt
473488 * @see disableInterrupt
489+ * @webref
474490 */
475491 public static boolean waitForInterrupt (int pin , int timeout ) {
476492 checkValidPin (pin );
@@ -501,6 +517,7 @@ public static boolean waitForInterrupt(int pin, int timeout) {
501517 * @parm pin GPIO pin
502518 * @see enableInterrupt
503519 * @see disableInterrupt
520+ * @webref
504521 */
505522 public static void waitForInterrupt (int pin ) {
506523 waitForInterrupt (pin , -1 );
0 commit comments