Signal Generator

Dependencies:   IniManager RA8875 Watchdog mbed-rtos mbed

Fork of speaker_demo_Analog by jim hamblen

Revision:
6:1f48212fbaf9
Parent:
5:49dd0c647a40
--- a/SignalGenDAC.h	Mon Jan 16 22:57:59 2017 +0000
+++ b/SignalGenDAC.h	Sat May 20 19:52:23 2017 +0000
@@ -1,7 +1,9 @@
-
+//
+// Signal Generator DAC Driver
 //
 // Derived from AN10917: Memory to DAC data transfers using the LPC1700's DMA
 //
+// 
 #ifndef SIGNALGENDAC_H
 #define SIGNALGENDAC_H
 
@@ -12,6 +14,24 @@
 
 #define SIGNAL_MEM_ENTRIES 2048     // size of the DAC buffer
 
+/// The Signal Generator DAC Driver
+///
+/// This class provides the interface to first configure the DAC hardware characteristics,
+/// and then to define and control the DAC output.
+///
+/// A choice of waveforms is available (Sine, Square, Triangle, Sawtooth, and User Defined.
+///
+/// @todo add support for User Defined waveform.
+///
+/// @code
+/// SignalGenDAC g_signal;            // defaults to LPC1768 mbed module (p18 and 3.3v)
+/// 
+/// g_signal.PrepareWaveform(SG_SINE, 1000, 50, 2.2, 1.5);
+/// g_signal.Start();
+/// wait_ms(1000);
+/// g_signal.Stop();
+/// @endcode
+///
 class SignalGenDAC {
 
 public:
@@ -40,7 +60,7 @@
     /// @param[in] voltage is the peak-to-peak voltage, and it range limited to 0 to 3.0.
     /// @param[in] offset is the offset voltage, and is range limited to 0 to 3.0.
     ///
-    void PrepareWaveform(SG_Mode mode, float frequency, float dutycycle, float voltage, float offset);
+    void PrepareWaveform(SG_Waveform mode, float frequency, float dutycycle, float voltage, float offset);
 
     /// Start the signal, in either a oneshot, or continuous mode.
     ///