aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/ClassDriver/AudioInput
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2012-05-13 21:01:23 +0000
committerDean Camera <dean@fourwalledcubicle.com>2012-05-13 21:01:23 +0000
commite9e6730d4999bea6e0eaefc2fce062ef090388b8 (patch)
tree5daf1ada1335d2781e144548b55d8253adff0c05 /Demos/Device/ClassDriver/AudioInput
parentae6a51492948d621907d3e62c03c2854e6fcc19c (diff)
downloadlufa-e9e6730d4999bea6e0eaefc2fce062ef090388b8.tar.gz
lufa-e9e6730d4999bea6e0eaefc2fce062ef090388b8.tar.bz2
lufa-e9e6730d4999bea6e0eaefc2fce062ef090388b8.zip
AppConfigHeaders: Move out the last of the demo/app configurations into new AppConfig.h header files.
Diffstat (limited to 'Demos/Device/ClassDriver/AudioInput')
-rw-r--r--Demos/Device/ClassDriver/AudioInput/AudioInput.c2
-rw-r--r--Demos/Device/ClassDriver/AudioInput/AudioInput.h7
-rw-r--r--Demos/Device/ClassDriver/AudioInput/AudioInput.txt5
-rw-r--r--Demos/Device/ClassDriver/AudioInput/Config/AppConfig.h2
4 files changed, 9 insertions, 7 deletions
diff --git a/Demos/Device/ClassDriver/AudioInput/AudioInput.c b/Demos/Device/ClassDriver/AudioInput/AudioInput.c
index 867a09eef..953ecf8b6 100644
--- a/Demos/Device/ClassDriver/AudioInput/AudioInput.c
+++ b/Demos/Device/ClassDriver/AudioInput/AudioInput.c
@@ -94,7 +94,7 @@ void SetupHardware(void)
USB_Init();
/* Start the ADC conversion in free running mode */
- ADC_StartReading(ADC_REFERENCE_AVCC | ADC_RIGHT_ADJUSTED | MIC_IN_ADC_MUX_MASK);
+ ADC_StartReading(ADC_REFERENCE_AVCC | ADC_RIGHT_ADJUSTED | ADC_GET_CHANNEL_MASK(MIC_IN_ADC_CHANNEL));
}
/** ISR to handle the reloading of the data endpoint with the next sample. */
diff --git a/Demos/Device/ClassDriver/AudioInput/AudioInput.h b/Demos/Device/ClassDriver/AudioInput/AudioInput.h
index 6bf5e882a..fb5e69c8b 100644
--- a/Demos/Device/ClassDriver/AudioInput/AudioInput.h
+++ b/Demos/Device/ClassDriver/AudioInput/AudioInput.h
@@ -49,14 +49,9 @@
#include <LUFA/Drivers/USB/USB.h>
#include "Descriptors.h"
+ #include "Config/AppConfig.h"
/* Macros: */
- /** ADC channel number for the microphone input. */
- #define MIC_IN_ADC_CHANNEL 2
-
- /** ADC channel MUX mask for the microphone input. */
- #define MIC_IN_ADC_MUX_MASK ADC_CHANNEL2
-
/** Maximum audio sample value for the microphone input. */
#define SAMPLE_MAX_RANGE 0xFFFF
diff --git a/Demos/Device/ClassDriver/AudioInput/AudioInput.txt b/Demos/Device/ClassDriver/AudioInput/AudioInput.txt
index 17b476e24..654536c80 100644
--- a/Demos/Device/ClassDriver/AudioInput/AudioInput.txt
+++ b/Demos/Device/ClassDriver/AudioInput/AudioInput.txt
@@ -72,6 +72,11 @@
* <td><b>Description:</b></td>
* </tr>
* <tr>
+ * <td>MIC_IN_ADC_CHANNEL</td>
+ * <td>AppConfig.h</td>
+ * <td>Sets the ADC channel used by the demo for the input audio samples from an attached microphone.</td>
+ * </tr>
+ * <tr>
* <td>USE_TEST_TONE</td>
* <td>AppConfig.h</td>
* <td>When defined, this alters the demo to produce a square wave test tone when the first board button is pressed
diff --git a/Demos/Device/ClassDriver/AudioInput/Config/AppConfig.h b/Demos/Device/ClassDriver/AudioInput/Config/AppConfig.h
index 01101649a..7702e259a 100644
--- a/Demos/Device/ClassDriver/AudioInput/Config/AppConfig.h
+++ b/Demos/Device/ClassDriver/AudioInput/Config/AppConfig.h
@@ -43,6 +43,8 @@
#ifndef _APP_CONFIG_H_
#define _APP_CONFIG_H_
+ #define MIC_IN_ADC_CHANNEL 2
+
#define MICROPHONE_BIASED_TO_HALF_RAIL
#define USE_TEST_TONE