ADC_InjectedChannelConfig( ADC1, ADC_Channel_2, 1, ADC_SampleTime_1Cycles5 ); // 9 as for curent A
ADC_InjectedChannelConfig( ADC1, ADC_Channel_2, 2, ADC_SampleTime_1Cycles5 );
ADC_InjectedChannelConfig( ADC1, ADC_Channel_2, 3, ADC_SampleTime_1Cycles5 );
ADC_InjectedChannelConfig( ADC1, ADC_Channel_2, 4, ADC_SampleTime_1Cycles5 );
ADC_InjectedChannelConfig( ADC2, ADC_Channel_1, 1, ADC_SampleTime_1Cycles5 ); // 8 as for curent B
ADC_InjectedChannelConfig( ADC2, ADC_Channel_1, 2, ADC_SampleTime_1Cycles5 );
ADC_InjectedChannelConfig( ADC2, ADC_Channel_1, 3, ADC_SampleTime_1Cycles5 );
ADC_InjectedChannelConfig( ADC2, ADC_Channel_1, 4, ADC_SampleTime_1Cycles5 );
//ADC_ExternalTrigInjectedConvConfig( ADC1, ADC_ExternalTrigInjecConv_T1_CC4 );
//ADC_ExternalTrigInjectedConvConfig( ADC2, ADC_ExternalTrigInjecConv_T1_CC4 );
//ADC_SetInjectedOffset( ADC1, ADC_InjectedChannel_1, 0xff );
//ADC_SetInjectedOffset( ADC2, ADC_InjectedChannel_1, 0xff );
ADC_InjectedSequencerLengthConfig( ADC1, 1 );
ADC_InjectedSequencerLengthConfig( ADC2, 1 );
ADC_ExternalTrigInjectedConvConfig( ADC1, ADC_ExternalTrigInjecConv_T1_CC4 );
ADC_ExternalTrigInjectedConvConfig( ADC2, ADC_ExternalTrigInjecConv_T1_CC4 );
ADC_ExternalTrigInjectedConvCmd( ADC1, ENABLE );
//ADC_AutoInjectedConvCmd( ADC1, ENABLE );
//ADC_AutoInjectedConvCmd( ADC2, ENABLE );
ADC_ITConfig( ADC1, ADC_IT_JEOC, ENABLE ); |