Ver código fonte

ad98xx readme and missing deps

boyska 5 anos atrás
pai
commit
569436d880
3 arquivos alterados com 33 adições e 0 exclusões
  1. 12 0
      ad9850/README.md
  2. 17 0
      ad9850/gpio_utils.c
  3. 4 0
      ad9850/gpio_utils.h

+ 12 - 0
ad9850/README.md

@@ -0,0 +1,12 @@
+AD98xx
+--------
+
+This library doesn't use SPI, just regular GPIO: this is simpler (imho) to implement and understand, and gives
+you freedom to use whichever pin you prefer.
+
+Notes
+-------
+Support for ad9833 is completely lacking (despite some code you might find).
+
+I am uncertain about ad9850/1: the two are similar, and I have some difficulties understanding which do I
+have. However, I think the implementation is correct.

+ 17 - 0
ad9850/gpio_utils.c

@@ -0,0 +1,17 @@
+#include <stdint.h>
+
+#include <libopencm3/stm32/gpio.h>
+
+#include "gpio_utils.h"
+
+void gpio_pulseHigh( uint32_t gpioport, uint16_t gpios) {
+    gpio_set(gpioport, gpios);
+    for (int x = 0; x < 1000; x++) __asm__("nop");
+    gpio_clear(gpioport, gpios);
+}
+
+void gpio_pulseLow( uint32_t gpioport, uint16_t gpios) {
+    gpio_clear(gpioport, gpios);
+    for (int x = 0; x < 1000; x++) __asm__("nop");
+    gpio_set(gpioport, gpios);
+}

+ 4 - 0
ad9850/gpio_utils.h

@@ -0,0 +1,4 @@
+#include <stdint.h>
+
+void gpio_pulseHigh( uint32_t gpioport, uint16_t gpios);
+void gpio_pulseLow( uint32_t gpioport, uint16_t gpios);