Example host software code for the Maxim Integrated MAX5216/MAX5214 16-bit/14-bit SPI bus DAC. Hosted on the MAX32630FTHR FeatherWing micro-controller board.

Dependencies:   MAX5216_16_Bit_DAC_SPI_Bus_Driver USBDevice max32630fthr

Revision:
2:5f8cd1facd15
Parent:
1:fe0cd2999f95
Child:
3:601454551d3a
--- a/main.cpp	Mon Aug 13 04:18:41 2018 +0000
+++ b/main.cpp	Sat Aug 18 09:38:25 2018 +0000
@@ -34,23 +34,23 @@
 #include "max32630fthr.h"
 #include "MAX5216.h"
 #include "USBSerial.h"
-
+ 
 MAX32630FTHR pegasus(MAX32630FTHR::VIO_3V3); 
-
+ 
 DigitalOut rLED(LED1);
 DigitalOut gLED(LED2);
 DigitalOut bLED(LED3);
-
+ 
 DigitalOut selectPin(P3_0); // Pin 3_0 is used to drive chip enable low
 SPI spi(P5_1, P5_2, P5_0); // mosi, miso, sclk
-
+ 
 // main() runs in its own thread in the OS
 // (note the calls to Thread::wait below for delays)
 /**
 * @brief Sample main program for MAX5214, MAX5216
 * @version 1.0000.1
 *
-* @details Sample main program for MAX30101.
+* @details Sample main program for MAX5214, MAX5216
 * The prints are sent to the terminal window (9600, 8n1).
 * The program sets the GPIOs to 3.3V and the program
 * issues various voltages to the DAC. Then the program
@@ -87,7 +87,7 @@
     wait(1.0);
     rLED = LED_ON;
     gLED = LED_ON;
-
+ 
     // Issue Power Down Commands
 //    dac.writeCommand(MAX5216::PwrDwn_Reg, MAX5216::PwrDwnNormalOp);
     dac.writeCommand(MAX5216::PwrDwn_Reg, MAX5216::PwrDwnHiZ);
@@ -95,9 +95,11 @@
 //    dac.writeCommand(MAX5216::PwrDwn_Reg, MAX5216::PwrDwn1K);
     wait(2.0);
     rLED = LED_OFF;
-
+ 
     while (true) {  // Blink the green LED 
         gLED = !gLED;
         wait(0.5);
     }
 }
+ 
+ 
\ No newline at end of file