From f24f61dc0ee1dd8a4b538bdcbfaac870aa39816a Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 18 Mar 2013 10:47:25 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5450 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- testhal/STM32F37x/ADC/main.c | 36 +++++++++++++++++++----------------- testhal/STM32F37x/ADC/mcuconf.h | 6 +++--- testhal/STM32F37x/ADC/readme.txt | 3 ++- 3 files changed, 24 insertions(+), 21 deletions(-) (limited to 'testhal/STM32F37x') 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 ** -- cgit v1.2.3