This library provides a class to generate differents signale wave form. Note that the maximum update rate of 1 MHz, so Fmax = 1MHz / _num_pixels (see UM10360 - Chapter 30: LPC17xx Digital-to-Analog Converter (DAC).

Files at this revision

API Documentation at this revision

Comitter:
Yann
Date:
Mon Nov 22 08:14:22 2010 +0000
Parent:
0:40051400cafe
Commit message:
V0.0.2

Changed in this revision

Debug.h Show diff for this revision Revisions of this file
SignalGenerator.cpp Show annotated file Show diff for this revision Revisions of this file
SignalGenerator.h Show annotated file Show diff for this revision Revisions of this file
diff -r 40051400cafe -r d6cbee8595e0 Debug.h
--- a/Debug.h	Tue Nov 16 10:08:20 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-/* mbed simplified access to Microchip 24LCxx Serial EEPROM devices
- * Copyright (c) 2010 ygarcia
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-#if !defined(__DEBUG_H__)
-#define __DEBUG_H__
-
-#include "mbed.h"
-
-//#define __DEBUG To activate debug message
-//#undef __DEBUG To deactivate debug message
-
-#if defined(__DEBUG)
-
-#define DEBUG_ENTER(a) printf(">> %s\r\n", a);
-#define DEBUG_LEAVE(a) printf("<< %s\r\n", a);
-
-#define DEBUG(a) printf("%s\r\n", a);
-
-#define DEBUG_1c(a, c) printf("%s%c\r\n", a, c);
-#define DEBUG_1x(a, x) printf("%s%x\r\n", a, x);
-#define DEBUG_1d(a, d) printf("%s%d\r\n", a, d);
-#define DEBUG_1f(a, d) printf("%s%f\r\n", a, d);
-#define DEBUG_1s(a, s) printf("%s%s\r\n", a, s);
-
-#else // __DEBUG
-
-#define DEBUG_ENTER(a)
-#define DEBUG_LEAVE(a)
-
-#define DEBUG(a)
-
-#define DEBUG_1c(a, c)
-#define DEBUG_1x(a, x)
-#define DEBUG_1d(a, d)
-#define DEBUG_1f(a, d)
-#define DEBUG_1s(a, s)
-
-#endif // __DEBUG
-  
-#endif // __DEBUG_H__
-
-/* mbed simplified access to Microchip 24LCxx Serial EEPROM devices
- * Copyright (c) 2010 ygarcia
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-#if !defined(__DEBUG_H__)
-#define __DEBUG_H__
-
-#include "mbed.h"
-
-//#define __DEBUG To activate debug message
-//#undef __DEBUG To deactivate debug message
-
-#if defined(__DEBUG)
-
-#define DEBUG_ENTER(a) printf(">> %s\r\n", a);
-#define DEBUG_LEAVE(a) printf("<< %s\r\n", a);
-
-#define DEBUG(a) printf("%s\r\n", a);
-
-#define DEBUG_1c(a, c) printf("%s%c\r\n", a, c);
-#define DEBUG_1x(a, x) printf("%s%x\r\n", a, x);
-#define DEBUG_1d(a, d) printf("%s%d\r\n", a, d);
-#define DEBUG_1f(a, d) printf("%s%f\r\n", a, d);
-#define DEBUG_1s(a, s) printf("%s%s\r\n", a, s);
-
-#else // __DEBUG
-
-#define DEBUG_ENTER(a)
-#define DEBUG_LEAVE(a)
-
-#define DEBUG(a)
-
-#define DEBUG_1c(a, c)
-#define DEBUG_1x(a, x)
-#define DEBUG_1d(a, d)
-#define DEBUG_1f(a, d)
-#define DEBUG_1s(a, s)
-
-#endif // __DEBUG
-  
-#endif // __DEBUG_H__
diff -r 40051400cafe -r d6cbee8595e0 SignalGenerator.cpp
--- a/SignalGenerator.cpp	Tue Nov 16 10:08:20 2010 +0000
+++ b/SignalGenerator.cpp	Mon Nov 22 08:14:22 2010 +0000
@@ -26,7 +26,7 @@
     _signalType = p_signalType;
     _frequency = p_frequency;
     _num_pixels = p_num_pixels;
-    DEBUG_1d("SignalGenerator::SetSignalFrequency: _frequency=", _frequency)
+    DEBUG("SignalGenerator::SetSignalFrequency: _frequency=%d", _frequency)
     if (_mode) {
         //_twait = 1000000.0f / (_frequency * _num_pixels); // _num_pixels is set to 1000 pixels/T
         _twait = 1.0f / (_frequency * _num_pixels); // _num_pixels is set to 1000 pixels/T
@@ -34,8 +34,8 @@
         _twait = 0.000001f; // 1us
         _num_pixels = (int)(1.0f / (_frequency * _twait)); // t_w is set to 1us and we fix at least 1000 pixels per period (T >> t_w): T >= 1000 * t_w ==> F < 1KHz
     }
-    DEBUG_1f("SignalGenerator::SetSignalFrequency: _twait=", _twait)
-    DEBUG_1d("SignalGenerator::SetSignalFrequency: _num_pixels=", _num_pixels)
+    DEBUG("SignalGenerator::SetSignalFrequency: _twait=%f", _twait)
+    DEBUG("SignalGenerator::SetSignalFrequency: _num_pixels=%d", _num_pixels)
     _values = new float[_num_pixels];
     PrepareSignal();
     DEBUG_LEAVE("SignalGenerator::SetSignalFrequency")
diff -r 40051400cafe -r d6cbee8595e0 SignalGenerator.h
--- a/SignalGenerator.h	Tue Nov 16 10:08:20 2010 +0000
+++ b/SignalGenerator.h	Mon Nov 22 08:14:22 2010 +0000
@@ -23,10 +23,9 @@
 #if !defined(__SIGNALGERNERATOR_H__)
 #define __SIGNALGERNERATOR_H__
 
-#define __DEBUG
 #include "Debug.h"
 
-/** This class provides methods to generate differents signale wave form. V0.0.0.1
+/** This class provides methods to generate differents signale wave form. V0.0.0.2
  *
  * Note that the maximum update rate of 1 MHz, so Fmax = 1MHz / _num_pixels
  *