需要用到STM32F373中的SDADC1和SDADC2,而且需要把SDADC1的增益设置为32,而SDADC2设置增益为1;程序如下,发现SDADC1的增益设置不成功,不知哪里出错了
/*Analog Input configuration conf0: use single ended zero reference */
SDADC_AINStructTypeDef SDADC1_AINStructure;
SDADC_AINStructTypeDef SDADC2_AINStructure;
SDADC2_AINStructure.SDADC_InputMode = SDADC_InputMode_SEZeroReference;
SDADC2_AINStructure.SDADC_Gain = SDADC_Gain_1;
SDADC2_AINStructure.SDADC_CommonMode = SDADC_CommonMode_VSSA;
SDADC2_AINStructure.SDADC_Offset = 0;
SDADC_AINInit(POT_SDADC2, SDADC_Conf_0, &SDADC2_AINStructure);
SDADC1_AINStructure.SDADC_InputMode = SDADC_InputMode_SEZeroReference;
SDADC1_AINStructure.SDADC_Gain = SDADC_Gain_32;
SDADC1_AINStructure.SDADC_CommonMode = SDADC_CommonMode_VSSA;
SDADC1_AINStructure.SDADC_Offset = 0;
SDADC_AINInit(POT_SDADC1, SDADC_Conf_0, &SDADC1_AINStructure); |