diff --git a/ad9850/README.md b/ad9850/README.md new file mode 100644 index 0000000..0635fc9 --- /dev/null +++ b/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. diff --git a/ad9850/gpio_utils.c b/ad9850/gpio_utils.c new file mode 100644 index 0000000..c81dd3b --- /dev/null +++ b/ad9850/gpio_utils.c @@ -0,0 +1,17 @@ +#include + +#include + +#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); +} diff --git a/ad9850/gpio_utils.h b/ad9850/gpio_utils.h new file mode 100644 index 0000000..3f2a6fa --- /dev/null +++ b/ad9850/gpio_utils.h @@ -0,0 +1,4 @@ +#include + +void gpio_pulseHigh( uint32_t gpioport, uint16_t gpios); +void gpio_pulseLow( uint32_t gpioport, uint16_t gpios);