From d3f4085123017c4ddf84c17251c3c847531cfb45 Mon Sep 17 00:00:00 2001
From: Neil Gershenfeld <gersh@cba.mit.edu>
Date: Sat, 19 Dec 2020 16:54:52 -0500
Subject: [PATCH] wip

---
 GPIO/bcm2835/ring.bcm2835.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 GPIO/bcm2835/ring.bcm2835.c

diff --git a/GPIO/bcm2835/ring.bcm2835.c b/GPIO/bcm2835/ring.bcm2835.c
new file mode 100644
index 0000000..c7941a8
--- /dev/null
+++ b/GPIO/bcm2835/ring.bcm2835.c
@@ -0,0 +1,30 @@
+//
+// ring.bcm2835.c
+//
+// bcm2835 ring oscillator test
+//    gcc ring.bcm2835.c -o ring.bcm2835 -l bcm2835
+//
+// Neil Gershenfeld 12/19/20
+//
+// This work may be reproduced, modified, distributed,
+// performed, and displayed for any purpose, but must
+// acknowledge this project. Copyright is retained and
+// must be preserved. The work is provided as is; no
+// warranty is provided, and users accept all liability.
+//
+//
+#include <bcm2835.h>
+#include <stdio.h>
+#define pinout RPI_GPIO_P1_16
+#define pinin RPI_GPIO_P1_18
+int main(int argc,char **argv) {
+   bcm2835_init();
+   bcm2835_gpio_fsel(pinout,BCM2835_GPIO_FSEL_OUTP);
+   bcm2835_gpio_fsel(pinin,BCM2835_GPIO_FSEL_INPT);
+   while (1) {
+      if (bcm2835_gpio_lev(pinin) == LOW)
+         bcm2835_gpio_write(pinout,HIGH);
+      else
+         bcm2835_gpio_write(pinout,LOW);
+      }
+   }
-- 
GitLab