From 91e5f3be762398dfef29881ebd339c9deba11d92 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 21 Oct 2012 15:47:34 +0000 Subject: Kconfig changes to get a clean STM32 ADC example build git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5246 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/configs/shenzhou/README.txt | 28 ++++++++++++++++++++++++++++ nuttx/configs/shenzhou/src/up_adc.c | 13 +++++++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) (limited to 'nuttx/configs/shenzhou') diff --git a/nuttx/configs/shenzhou/README.txt b/nuttx/configs/shenzhou/README.txt index 7bf67710d..a60019a27 100644 --- a/nuttx/configs/shenzhou/README.txt +++ b/nuttx/configs/shenzhou/README.txt @@ -772,6 +772,34 @@ Where is one of the following: before the networking finally gives up and decides that no network is available. + 2. Enabling the ADC example: + + The only internal signal for ADC testing is the potentiometer input: + + ADC1_IN10(PC0) Potentiometer + + External signals are also available on CON5 CN14: + + ADC_IN8 (PB0) CON5 CN14 Pin2 + ADC_IN9 (PB1) CON5 CN14 Pin1 + + The signal selection is hard-coded in configs/shenzhou/src/up_adc.c: The + potentiometer input (only) is selected. + + These selections will enable sampling the potentiometer input at 100Hz using + Timer 1: + + CONFIG_ANALOG=y : Enable analog device support + CONFIG_ADC=y : Enable generic ADC driver support + CONFIG_ADC_DMA=n : ADC DMA is not supported + CONFIG_STM32_ADC1=y : Enable ADC 1 + CONFIG_STM32_TIM1=y : Enable Timer 1 + CONFIG_STM32_TIM1_ADC=y : Use Timer 1 for ADC + CONFIG_STM32_TIM1_ADC1=y : Allocate Timer 1 to ADC 1 + CONFIG_STM32_ADC1_SAMPLE_FREQUENCY=100 : Set sampling frequency to 100Hz + CONFIG_STM32_ADC1_TIMTRIG=0 : Trigger on timer output 0 + CONFIG_EXAMPLES_ADC=y : Enable the apps/examples/adc built-in + nxwm ---- This is a special configuration setup for the NxWM window manager diff --git a/nuttx/configs/shenzhou/src/up_adc.c b/nuttx/configs/shenzhou/src/up_adc.c index fb20c6940..e62289ca6 100644 --- a/nuttx/configs/shenzhou/src/up_adc.c +++ b/nuttx/configs/shenzhou/src/up_adc.c @@ -85,12 +85,21 @@ * Private Data ************************************************************************************/ -/* Identifying number of each ADC channel: Variable Resistor */ +/* Identifying number of each ADC channel. The only internal signal for ADC testing + * is the potentiometer input: + * + * ADC1_IN10(PC0) Potentiometer + * + * External signals are also available on CON5 CN14: + * + * ADC_IN8 (PB0) CON5 CN14 Pin2 + * ADC_IN9 (PB1) CON5 CN14 Pin1 + */ #ifdef CONFIG_STM32_ADC1 static const uint8_t g_chanlist[ADC1_NCHANNELS] = {10}; //{10, 8, 9}; -/* Configurations of pins used byte each ADC channels */ +/* Configurations of pins used by each ADC channel */ static const uint32_t g_pinlist[ADC1_NCHANNELS] = {GPIO_ADC12_IN10}; //{GPIO_ADC12_IN10, GPIO_ADC12_IN8, GPIO_ADC12_IN9}; #endif -- cgit v1.2.3