File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
libraries/mbed/targets/hal/TARGET_STM/TARGET_NUCLEO_L152RE Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,13 @@ void analogin_init(analogin_t *obj, PinName pin) {
75
75
RCC_APB2PeriphClockCmd (RCC_APB2Periph_ADC1 , ENABLE );
76
76
77
77
// Configure ADC
78
- ADC_StructInit (& ADC_InitStructure );
78
+ ADC_InitStructure .ADC_Resolution = ADC_Resolution_12b ;
79
+ ADC_InitStructure .ADC_ScanConvMode = DISABLE ;
80
+ ADC_InitStructure .ADC_ContinuousConvMode = DISABLE ;
81
+ ADC_InitStructure .ADC_ExternalTrigConvEdge = ADC_ExternalTrigConvEdge_None ;
82
+ ADC_InitStructure .ADC_ExternalTrigConv = ADC_ExternalTrigConv_T2_CC2 ;
83
+ ADC_InitStructure .ADC_DataAlign = ADC_DataAlign_Right ;
84
+ ADC_InitStructure .ADC_NbrOfConversion = 1 ;
79
85
ADC_Init (adc , & ADC_InitStructure );
80
86
81
87
// Enable ADC
You can’t perform that action at this time.
0 commit comments