diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-03-18 10:47:25 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-03-18 10:47:25 +0000 |
commit | f24f61dc0ee1dd8a4b538bdcbfaac870aa39816a (patch) | |
tree | 2f5c41385323a9c10ee668f58f4caeb28ecb91f4 /testhal/STM32F37x/ADC | |
parent | de8293ab3cdfd42fa4ac7f0deb7955bc8263202d (diff) | |
download | ChibiOS-f24f61dc0ee1dd8a4b538bdcbfaac870aa39816a.tar.gz ChibiOS-f24f61dc0ee1dd8a4b538bdcbfaac870aa39816a.tar.bz2 ChibiOS-f24f61dc0ee1dd8a4b538bdcbfaac870aa39816a.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5450 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32F37x/ADC')
-rw-r--r-- | testhal/STM32F37x/ADC/main.c | 36 | ||||
-rw-r--r-- | testhal/STM32F37x/ADC/mcuconf.h | 6 | ||||
-rw-r--r-- | testhal/STM32F37x/ADC/readme.txt | 3 |
3 files changed, 24 insertions, 21 deletions
diff --git a/testhal/STM32F37x/ADC/main.c b/testhal/STM32F37x/ADC/main.c index 528aa8cd1..fce807084 100644 --- a/testhal/STM32F37x/ADC/main.c +++ b/testhal/STM32F37x/ADC/main.c @@ -61,21 +61,22 @@ static const ADCConversionGroup adcgrpcfg1 = { ADC_GRP1_NUM_CHANNELS,
NULL,
adcerrorcallback,
- 0, /* CFGR */
- ADC_TR(0, 4095), /* TR1 */
- 0, /* CCR */
- { /* SMPR[2] */
- 0,
- 0
- },
- { /* SQR[4] */
- ADC_SQR1_SQ1_N(ADC_CHANNEL_IN7) | ADC_SQR1_SQ2_N(ADC_CHANNEL_IN8),
- 0,
- 0,
- 0
+ .u.adc = {
+ 0, /* CR1 */
+ 0, /* CR2 */
+ { /* SMPR[2] */
+ 0,
+ 0
+ },
+ { /* SQR[3] */
+ 0,
+ 0,
+ 0
+ }
}
};
+#if 0
/*
* ADC conversion group.
* Mode: Continuous, 16 samples of 8 channels, SW triggered.
@@ -104,6 +105,7 @@ static const ADCConversionGroup adcgrpcfg2 = { 0
}
};
+#endif
/*
* Red LEDs blinker thread, times are in milliseconds.
@@ -114,9 +116,9 @@ static msg_t Thread1(void *arg) { (void)arg;
chRegSetThreadName("blinker");
while (TRUE) {
- palSetPad(GPIOE, GPIOE_LED10_RED);
+ palClearPad(GPIOC, GPIOC_LED1);
chThdSleepMilliseconds(500);
- palClearPad(GPIOE, GPIOE_LED10_RED);
+ palSetPad(GPIOC, GPIOC_LED1);
chThdSleepMilliseconds(500);
}
return 0;
@@ -162,14 +164,14 @@ int main(void) { /*
* Starts an ADC continuous conversion.
*/
- adcStartConversion(&ADCD1, &adcgrpcfg2, samples2, ADC_GRP2_BUF_DEPTH);
+// adcStartConversion(&ADCD1, &adcgrpcfg2, samples2, ADC_GRP2_BUF_DEPTH);
/*
* Normal main() thread activity, in this demo it does nothing.
*/
while (TRUE) {
- if (palReadPad(GPIOA, GPIOA_BUTTON)) {
- adcStopConversion(&ADCD1);
+ if (palReadPad(GPIOA, GPIOA_WKUP_BUTTON)) {
+// adcStopConversion(&ADCD1);
}
chThdSleepMilliseconds(500);
}
diff --git a/testhal/STM32F37x/ADC/mcuconf.h b/testhal/STM32F37x/ADC/mcuconf.h index 9baddd2c2..bc1278129 100644 --- a/testhal/STM32F37x/ADC/mcuconf.h +++ b/testhal/STM32F37x/ADC/mcuconf.h @@ -67,9 +67,9 @@ * ADC driver system settings.
*/
#define STM32_ADC_USE_ADC1 TRUE
-#define STM32_ADC_USE_SDADC1 TRUE
-#define STM32_ADC_USE_SDADC2 TRUE
-#define STM32_ADC_USE_SDADC3 TRUE
+#define STM32_ADC_USE_SDADC1 FALSE
+#define STM32_ADC_USE_SDADC2 FALSE
+#define STM32_ADC_USE_SDADC3 FALSE
#define STM32_ADC_SDADC_SLOW_MODE FALSE
#define STM32_ADC_ADC1_DMA_PRIORITY 2
#define STM32_ADC_SDADC1_DMA_PRIORITY 2
diff --git a/testhal/STM32F37x/ADC/readme.txt b/testhal/STM32F37x/ADC/readme.txt index bce9cecb7..8cb97fdc2 100644 --- a/testhal/STM32F37x/ADC/readme.txt +++ b/testhal/STM32F37x/ADC/readme.txt @@ -8,7 +8,8 @@ The demo runs on an STMicroelectronics STM32373C-EVAL board. ** The Demo **
-The application demonstrates the use of the STM32F37x ADC/SDADC driver.
+The application demonstrates the use of the STM32F37x ADC driver on the
+ADC peripheral.
** Board Setup **
|