Enable the SDADC analog interface by calling
PWR_SDADCAnalogCmd(PWR_SDADCAnalog_x, Enable);
(#) Enable the SDADC APB clock to get write access to SDADC registers using
RCC_APB1PeriphClockCmd() function
e.g. To enable access to SDADC1 registers use
RCC_APB1PeriphClockCmd(RCC_APB1Periph_SDADC1, ENABLE);
(#) The SDADCs are clocked by APB1.
In order to get the SDADC running at the typical frequency (6 MHz
in fast mode), use SDADC prescaler by calling RCC_SDADCCLKConfig() function
e.g. if APB1 is clocked at 72MHz, to get the SDADC running at 6MHz
configure the SDADC prescaler at 12 by calling
RCC_SDADCCLKConfig(RCC_SDADCCLK_SYSCLK_Div12);
(#) If required, perform the following configurations:
(++) Select the reference voltage using SDADC_VREFSelect() function
(++) Enable the power-down and standby modes using SDADC_PowerDownCmd()
and SDADC_StandbyCmd() functions respectively
(++) Enable the slow clock mode (SDADC running at 1.5 MHz) using
RCC_SDADCCLKConfig() and SDADC_SlowClockCmd() function
-@@- These configurations are allowed only when the SDADC is disabled.
(#) Enable the SDADC peripheral using SDADC_Cmd() function.
(#) Enter initialization mode using SDADC_InitModeCmd() function
then wait for INITRDY flag to be set to confirm that the SDADC
is in initialization mode.
(#) Configure the analog inputs: gain, single ended mode, offset value and
commmon mode using SDADC_AINInit().
There are three possible configuration: SDADC_Conf_0, SDADC_Conf_1 and SDADC_Conf_2
(#) Associate the selected configuration to the channel using SDADC_ChannelConfig()
(#) For Regular channels group configuration
(++) use SDADC_Init() function to select the SDADC channel to be used
for regular conversion, the continuous mode...
-@@- Only software trigger or synchro with SDADC1 are possible
for regular conversion
(#) For Injected channels group configuration
(++) Select the SDADC channel to be used for injected conversion
using SDADC_InjectedChannelSelect()
(++) Select the external trigger SDADC_ExternalTrigInjectedConvConfig()
and the edge (rising, falling or both) using
SDADC_ExternalTrigInjectedConvEdgeConfig()
-@@- Software trigger and synchro with SDADC1 are possible
(#) Exit initialization mode using SDADC_InitModeCmd() function
PWR_SDADCAnalogCmd(PWR_SDADCAnalog_x, Enable);
(#) Enable the SDADC APB clock to get write access to SDADC registers using
RCC_APB1PeriphClockCmd() function
e.g. To enable access to SDADC1 registers use
RCC_APB1PeriphClockCmd(RCC_APB1Periph_SDADC1, ENABLE);
(#) The SDADCs are clocked by APB1.
In order to get the SDADC running at the typical frequency (6 MHz
in fast mode), use SDADC prescaler by calling RCC_SDADCCLKConfig() function
e.g. if APB1 is clocked at 72MHz, to get the SDADC running at 6MHz
configure the SDADC prescaler at 12 by calling
RCC_SDADCCLKConfig(RCC_SDADCCLK_SYSCLK_Div12);
(#) If required, perform the following configurations:
(++) Select the reference voltage using SDADC_VREFSelect() function
(++) Enable the power-down and standby modes using SDADC_PowerDownCmd()
and SDADC_StandbyCmd() functions respectively
(++) Enable the slow clock mode (SDADC running at 1.5 MHz) using
RCC_SDADCCLKConfig() and SDADC_SlowClockCmd() function
-@@- These configurations are allowed only when the SDADC is disabled.
(#) Enable the SDADC peripheral using SDADC_Cmd() function.
(#) Enter initialization mode using SDADC_InitModeCmd() function
then wait for INITRDY flag to be set to confirm that the SDADC
is in initialization mode.
(#) Configure the analog inputs: gain, single ended mode, offset value and
commmon mode using SDADC_AINInit().
There are three possible configuration: SDADC_Conf_0, SDADC_Conf_1 and SDADC_Conf_2
(#) Associate the selected configuration to the channel using SDADC_ChannelConfig()
(#) For Regular channels group configuration
(++) use SDADC_Init() function to select the SDADC channel to be used
for regular conversion, the continuous mode...
-@@- Only software trigger or synchro with SDADC1 are possible
for regular conversion
(#) For Injected channels group configuration
(++) Select the SDADC channel to be used for injected conversion
using SDADC_InjectedChannelSelect()
(++) Select the external trigger SDADC_ExternalTrigInjectedConvConfig()
and the edge (rising, falling or both) using
SDADC_ExternalTrigInjectedConvEdgeConfig()
-@@- Software trigger and synchro with SDADC1 are possible
(#) Exit initialization mode using SDADC_InitModeCmd() function
这是标准库里关于设置SDADC时钟的描述,HAL库应该有类似的函数
一周热门 更多>