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
This commit is contained in:
parent
f5a42a8068
commit
0ea70c2f65
@ -772,6 +772,34 @@ Where <subdir> is one of the following:
|
|||||||
before the networking finally gives up and decides that no network is
|
before the networking finally gives up and decides that no network is
|
||||||
available.
|
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
|
nxwm
|
||||||
----
|
----
|
||||||
This is a special configuration setup for the NxWM window manager
|
This is a special configuration setup for the NxWM window manager
|
||||||
|
@ -85,12 +85,21 @@
|
|||||||
* Private Data
|
* 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
|
#ifdef CONFIG_STM32_ADC1
|
||||||
static const uint8_t g_chanlist[ADC1_NCHANNELS] = {10}; //{10, 8, 9};
|
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};
|
static const uint32_t g_pinlist[ADC1_NCHANNELS] = {GPIO_ADC12_IN10}; //{GPIO_ADC12_IN10, GPIO_ADC12_IN8, GPIO_ADC12_IN9};
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user