Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MAX5216_16_Bit_DAC_SPI_Bus_Driver USBDevice max32630fthr
Revision 2:5f8cd1facd15, committed 2018-08-18
- Comitter:
- phonemacro
- Date:
- Sat Aug 18 09:38:25 2018 +0000
- Parent:
- 1:fe0cd2999f95
- Child:
- 3:601454551d3a
- Commit message:
- Updated comments for MAX5216, MAX5214 16,14-bit DAC sample SPI bus source code.
Changed in this revision
| MAX5216_16_Bit_DAC_SPI_Bus_Driver.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/MAX5216_16_Bit_DAC_SPI_Bus_Driver.lib Mon Aug 13 04:18:41 2018 +0000 +++ b/MAX5216_16_Bit_DAC_SPI_Bus_Driver.lib Sat Aug 18 09:38:25 2018 +0000 @@ -1,1 +1,1 @@ -https://os.mbed.com/teams/MaximIntegrated/code/MAX5216_16_Bit_DAC_SPI_Bus_Driver/#bd8dbd9be2ac +https://os.mbed.com/teams/MaximIntegrated/code/MAX5216_16_Bit_DAC_SPI_Bus_Driver/#cd8d96483262
--- 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