STM32F37 Standard Peripheral bibliotheek  1.0
ST Microelectronics bibliotheek documentatie voor de STM32F37 Standard Peripheral Library
 All Data Structures Files Functions Variables Enumerations Enumerator Groups

SDADC driver modules. More...

Modules

 SDADC_Exported_Constants
 
 SDADC_Private_Functions
 

Data Structures

struct  SDADC_InitTypeDef
 SDADC Init structure definition. More...
 
struct  SDADC_AINStructTypeDef
 SDADC Analog Inputs Configuration structure definition. More...
 

Macros

#define CR2_CLEAR_MASK   ((uint32_t)0xFE30FFFF)
 

Functions

void SDADC_DeInit (SDADC_TypeDef *SDADCx)
 Deinitializes SDADCx peripheral registers to their default reset values. More...
 
void SDADC_Init (SDADC_TypeDef *SDADCx, SDADC_InitTypeDef *SDADC_InitStruct)
 Initializes the SDADCx peripheral according to the specified parameters in the SDADC_InitStruct. More...
 
void SDADC_StructInit (SDADC_InitTypeDef *SDADC_InitStruct)
 Fills each SDADC_InitStruct member with its default value. More...
 
void SDADC_AINInit (SDADC_TypeDef *SDADCx, uint32_t SDADC_Conf, SDADC_AINStructTypeDef *SDADC_AINStruct)
 Configures the analog input mode. More...
 
void SDADC_AINStructInit (SDADC_AINStructTypeDef *SDADC_AINStruct)
 Fills each SDADC_AINStruct member with its default value. More...
 
void SDADC_ChannelConfig (SDADC_TypeDef *SDADCx, uint32_t SDADC_Channel, uint32_t SDADC_Conf)
 Configures the SDADCx channel. More...
 
void SDADC_Cmd (SDADC_TypeDef *SDADCx, FunctionalState NewState)
 Enables or disables the specified SDADC peripheral. More...
 
void SDADC_InitModeCmd (SDADC_TypeDef *SDADCx, FunctionalState NewState)
 Enables or disables the initialization mode for specified SDADC peripheral. More...
 
void SDADC_FastConversionCmd (SDADC_TypeDef *SDADCx, FunctionalState NewState)
 Enables or disables the fast conversion mode for the SDADC. More...
 
void SDADC_VREFSelect (uint32_t SDADC_VREF)
 Selects the reference voltage. More...
 
void SDADC_CalibrationSequenceConfig (SDADC_TypeDef *SDADCx, uint32_t SDADC_CalibrationSequence)
 Configures the calibration sequence. More...
 
void SDADC_StartCalibration (SDADC_TypeDef *SDADCx)
 Launches a request to start the calibration sequence. More...
 
void SDADC_ChannelSelect (SDADC_TypeDef *SDADCx, uint32_t SDADC_Channel)
 Selects the SDADC channel to be used for regular conversion. More...
 
void SDADC_ContinuousModeCmd (SDADC_TypeDef *SDADCx, FunctionalState NewState)
 Enables or disables the SDADC continuous conversion mode. When enabled, the regular channel is converted repeatedly after each conversion request. When disabled, the regular channel is converted once for each conversion request. More...
 
void SDADC_SoftwareStartConv (SDADC_TypeDef *SDADCx)
 Enables the selected SDADC software start conversion of the regular channels. More...
 
int16_t SDADC_GetConversionValue (SDADC_TypeDef *SDADCx)
 Returns the last SDADC conversion result data for regular channel. More...
 
void SDADC_RegularSynchroSDADC1 (SDADC_TypeDef *SDADCx, FunctionalState NewState)
 Launches SDADC2/SDADC3 regular conversion synchronously with SDADC1. More...
 
uint32_t SDADC_GetConversionSDADC12Value (void)
 Returns the last conversion result data for regular channel of SDADC1 and SDADC2. RSYNC bit of the SDADC2 should be already set. More...
 
uint32_t SDADC_GetConversionSDADC13Value (void)
 Returns the last conversion result data for regular channel of SDADC1 and SDADC3. RSYNC bit of the SDADC3 should be already set. More...
 
void SDADC_SoftwareStartInjectedConv (SDADC_TypeDef *SDADCx)
 Enables the selected SDADC software start conversion of the injected channels. More...
 
void SDADC_InjectedChannelSelect (SDADC_TypeDef *SDADCx, uint32_t SDADC_Channel)
 Selects the SDADC injected channel(s). More...
 
void SDADC_DelayStartInjectedConvCmd (SDADC_TypeDef *SDADCx, FunctionalState NewState)
 Enables or disables delayed start of injected conversions. More...
 
void SDADC_InjectedContinuousModeCmd (SDADC_TypeDef *SDADCx, FunctionalState NewState)
 Enables or disables the continuous mode for injected channels for the specified SDADC. More...
 
void SDADC_ExternalTrigInjectedConvConfig (SDADC_TypeDef *SDADCx, uint32_t SDADC_ExternalTrigInjecConv)
 Configures the SDADCx external trigger for injected channels conversion. More...
 
void SDADC_ExternalTrigInjectedConvEdgeConfig (SDADC_TypeDef *SDADCx, uint32_t SDADC_ExternalTrigInjecConvEdge)
 Configures the SDADCx external trigger edge for injected channels conversion. More...
 
uint32_t SDADC_GetInjectedChannel (SDADC_TypeDef *SDADCx)
 Returns the injected channel most recently converted for the specified SDADC. More...
 
int16_t SDADC_GetInjectedConversionValue (SDADC_TypeDef *SDADCx, uint32_t *SDADC_Channel)
 Returns the SDADC injected channel conversion result. More...
 
void SDADC_InjectedSynchroSDADC1 (SDADC_TypeDef *SDADCx, FunctionalState NewState)
 Launches injected conversion synchronously with SDADC1. More...
 
uint32_t SDADC_GetInjectedConversionSDADC12Value (void)
 Returns the last conversion result data for injected channel of SDADC1 and SDADC2. JSYNC bit of the SDADC2 should be already set. More...
 
uint32_t SDADC_GetInjectedConversionSDADC13Value (void)
 Returns the last conversion result data for injected channel of SDADC1 and SDADC3. JSYNC bit of the SDADC3 should be already set. More...
 
void SDADC_PowerDownCmd (SDADC_TypeDef *SDADCx, FunctionalState NewState)
 Enables or disables the SDADC power down mode when idle. More...
 
void SDADC_StandbyCmd (SDADC_TypeDef *SDADCx, FunctionalState NewState)
 Enables or disables the SDADC standby mode when idle. More...
 
void SDADC_SlowClockCmd (SDADC_TypeDef *SDADCx, FunctionalState NewState)
 Enables or disables the SDADC in slow clock mode. More...
 
void SDADC_DMAConfig (SDADC_TypeDef *SDADCx, uint32_t SDADC_DMATransfer, FunctionalState NewState)
 Configures the DMA transfer for regular/injected conversions. More...
 
void SDADC_ITConfig (SDADC_TypeDef *SDADCx, uint32_t SDADC_IT, FunctionalState NewState)
 Enables or disables the specified SDADC interrupts. More...
 
FlagStatus SDADC_GetFlagStatus (SDADC_TypeDef *SDADCx, uint32_t SDADC_FLAG)
 Checks whether the specified SDADC flag is set or not. More...
 
void SDADC_ClearFlag (SDADC_TypeDef *SDADCx, uint32_t SDADC_FLAG)
 Clears the SDADCx pending flags. More...
 
ITStatus SDADC_GetITStatus (SDADC_TypeDef *SDADCx, uint32_t SDADC_IT)
 Checks whether the specified SDADC interrupt has occurred or not. More...
 
void SDADC_ClearITPendingBit (SDADC_TypeDef *SDADCx, uint32_t SDADC_IT)
 Clears the SDADCx interrupt pending bits. More...
 

Detailed Description

SDADC driver modules.

Function Documentation

void SDADC_AINInit ( SDADC_TypeDef *  SDADCx,
uint32_t  SDADC_Conf,
SDADC_AINStructTypeDef SDADC_AINStruct 
)

Configures the analog input mode.

Note
This function can be used only if the SDADC is disabled or the INITRDY flag is set. Otherwise the configuration can't be modified.
Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
SDADC_AINStruct,:pointer to an SDADC_AINStructTypeDef structure that contains the analog inputs configuration information for the specified SDADC peripheral.
Return values
None
void SDADC_AINStructInit ( SDADC_AINStructTypeDef SDADC_AINStruct)

Fills each SDADC_AINStruct member with its default value.

Parameters
SDADC_AINStruct,:pointer to an SDADC_AINStructTypeDef structure which will be initialized.
Return values
None
void SDADC_CalibrationSequenceConfig ( SDADC_TypeDef *  SDADCx,
uint32_t  SDADC_CalibrationSequence 
)

Configures the calibration sequence.

Note
After calling SDADC_CalibrationSequenceConfig(), use SDADC_StartCalibration() to start the calibration process.
Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
SDADC_CalibrationSequence,:Number of calibration sequence to be performed. This parameter can be one of the following values:
  • SDADC_CalibrationSequence_1: One calibration sequence will be performed to calculate OFFSET0[11:0] (offset that corresponds to conf0)
  • SDADC_CalibrationSequence_2: Two calibration sequences will be performed to calculate OFFSET0[11:0] and OFFSET1[11:0] (offsets that correspond to conf0 and conf1)
  • SDADC_CalibrationSequence_3: Three calibration sequences will be performed to calculate OFFSET0[11:0], OFFSET1[11:0], and OFFSET2[11:0] (offsets that correspond to conf0, conf1 and conf2)
Return values
None
void SDADC_ChannelConfig ( SDADC_TypeDef *  SDADCx,
uint32_t  SDADC_Channel,
uint32_t  SDADC_Conf 
)

Configures the SDADCx channel.

Note
SDADC channel configuration can be modified only if the SDADC is disabled or the INITRDY flag is set. Otherwise the configuration can't be modified.
Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
SDADC_Channel,:The SDADC injected channel. This parameter can be one of the following values:
  • SDADC_Channel_0: SDADC Channel 0 selected
  • SDADC_Channel_1: SDADC Channel 1 selected
  • SDADC_Channel_2: SDADC Channel 2 selected
  • SDADC_Channel_3: SDADC Channel 3 selected
  • SDADC_Channel_4: SDADC Channel 4 selected
  • SDADC_Channel_5: SDADC Channel 5 selected
  • SDADC_Channel_6: SDADC Channel 6 selected
  • SDADC_Channel_7: SDADC Channel 7 selected
  • SDADC_Channel_8: SDADC Channel 8 selected
SDADC_Conf,:The SDADC input configuration. This parameter can be one of the following values:
  • SDADC_Conf_0: SDADC Conf 0 selected
  • SDADC_Conf_1: SDADC Conf 1 selected
  • SDADC_Conf_2: SDADC Conf 2 selected
Note
The SDADC configuration (Conf 0, Conf 1, Conf 2) should be performed using SDADC_AINInit()
Return values
None
void SDADC_ChannelSelect ( SDADC_TypeDef *  SDADCx,
uint32_t  SDADC_Channel 
)

Selects the SDADC channel to be used for regular conversion.

Note
Just one channel of the 9 available channels can be selected.
Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
SDADC_Channel,:The SDADC regular channel. This parameter can be one of the following values:
  • SDADC_Channel_0: SDADC Channel 0 selected
  • SDADC_Channel_1: SDADC Channel 1 selected
  • SDADC_Channel_2: SDADC Channel 2 selected
  • SDADC_Channel_3: SDADC Channel 3 selected
  • SDADC_Channel_4: SDADC Channel 4 selected
  • SDADC_Channel_5: SDADC Channel 5 selected
  • SDADC_Channel_6: SDADC Channel 6 selected
  • SDADC_Channel_7: SDADC Channel 7 selected
  • SDADC_Channel_8: SDADC Channel 8 selected
Return values
None
void SDADC_ClearFlag ( SDADC_TypeDef *  SDADCx,
uint32_t  SDADC_FLAG 
)

Clears the SDADCx pending flags.

Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
SDADC_FLAG,:specifies the flag to clear. This parameter can be any combination of the following values:
  • SDADC_FLAG_EOCAL: End of calibration flag
  • SDADC_FLAG_JOVR: Injected conversion overrun flag
  • SDADC_FLAG_ROVR: Regular conversion overrun flag
Return values
None
void SDADC_ClearITPendingBit ( SDADC_TypeDef *  SDADCx,
uint32_t  SDADC_IT 
)

Clears the SDADCx interrupt pending bits.

Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
SDADC_IT,:specifies the SDADC interrupt pending bit to clear. This parameter can be any combination of the following values:
  • SDADC_IT_EOCAL: End of calibration flag
  • SDADC_IT_JOVR: Injected conversion overrun flag
  • SDADC_IT_ROVR: Regular conversion overrun flag
Return values
None
void SDADC_Cmd ( SDADC_TypeDef *  SDADCx,
FunctionalState  NewState 
)

Enables or disables the specified SDADC peripheral.

Note
When disabled, power down mode is entered, the flags and the data are cleared.
Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
NewState,:new state of the SDADCx peripheral. This parameter can be: ENABLE or DISABLE.
Return values
None
void SDADC_ContinuousModeCmd ( SDADC_TypeDef *  SDADCx,
FunctionalState  NewState 
)

Enables or disables the SDADC continuous conversion mode. When enabled, the regular channel is converted repeatedly after each conversion request. When disabled, the regular channel is converted once for each conversion request.

Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
NewState,:new state of the selected SDADC continuous conversion mode This parameter can be: ENABLE or DISABLE.
Return values
None
void SDADC_DeInit ( SDADC_TypeDef *  SDADCx)

Deinitializes SDADCx peripheral registers to their default reset values.

Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
Return values
None
void SDADC_DelayStartInjectedConvCmd ( SDADC_TypeDef *  SDADCx,
FunctionalState  NewState 
)

Enables or disables delayed start of injected conversions.

Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
NewState,:new state of the selected SDADC delay start of injected conversions. This parameter can be: ENABLE or DISABLE. When disabled, injected conversions begin as soon as possible after the request. When enabled, after a request for injected conversion the SDADC waits a fixed interval before launching the conversion.
Return values
None
void SDADC_DMAConfig ( SDADC_TypeDef *  SDADCx,
uint32_t  SDADC_DMATransfer,
FunctionalState  NewState 
)

Configures the DMA transfer for regular/injected conversions.

Note
DMA requests can't be enabled for both regular and injected conversions.
Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
SDADC_DMATransfer,:Specifies the SDADC DMA transfer. This parameter can be one of the following values:
  • SDADC_DMATransfer_Regular: When enabled, DMA manages reading the data for the regular channel.
  • SDADC_DMATransfer_Injected: When enabled, DMA manages reading the data for the injected channel.
NewStateIndicates the new state of the SDADC DMA interface. This parameter can be: ENABLE or DISABLE.
Return values
None
void SDADC_ExternalTrigInjectedConvConfig ( SDADC_TypeDef *  SDADCx,
uint32_t  SDADC_ExternalTrigInjecConv 
)

Configures the SDADCx external trigger for injected channels conversion.

Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
SDADC_ExternalTrigInjecConv,:specifies the SDADC trigger to start injected conversion. This parameter can be one of the following values:
  • SDADC_ExternalTrigInjecConv_T13_CC1: Timer13 capture compare1 selected
  • SDADC_ExternalTrigInjecConv_T14_CC1: Timer14 TRGO event selected
  • SDADC_ExternalTrigInjecConv_T16_CC1: Timer16 TRGO event selected
  • SDADC_ExternalTrigInjecConv_T17_CC1: Timer17 capture compare1 selected
  • SDADC_ExternalTrigInjecConv_T12_CC1: Timer12 capture compare1 selected
  • SDADC_ExternalTrigInjecConv_T12_CC2: Timer12 capture compare2 selected
  • SDADC_ExternalTrigInjecConv_T15_CC2: Timer15 capture compare2 selected
  • SDADC_ExternalTrigInjecConv_T2_CC3: Timer2 capture compare3 selected
  • SDADC_ExternalTrigInjecConv_T2_CC4: Timer2 capture compare4 selected
  • SDADC_ExternalTrigInjecConv_T3_CC1: Timer3 capture compare1 selected
  • SDADC_ExternalTrigInjecConv_T3_CC2: Timer3 capture compare2 selected
  • SDADC_ExternalTrigInjecConv_T3_CC3: Timer3 capture compare3 selected
  • SDADC_ExternalTrigInjecConv_T4_CC1: Timer4 capture compare1 selected
  • SDADC_ExternalTrigInjecConv_T4_CC2: Timer4 capture compare2 selected
  • SDADC_ExternalTrigInjecConv_T4_CC3: Timer4 capture compare3 selected
  • SDADC_ExternalTrigInjecConv_T19_CC2: Timer19 capture compare2 selected
  • SDADC_ExternalTrigInjecConv_T19_CC3: Timer19 capture compare3 selected
  • SDADC_ExternalTrigInjecConv_T19_CC4: Timer19 capture compare4 selected
  • SDADC_ExternalTrigInjecConv_T4_CC4: Timer4 capture compare4 selected
  • SDADC_ExternalTrigInjecConv_Ext_IT11: External interrupt line 11 event selected
  • SDADC_ExternalTrigInjecConv_Ext_IT15: External interrupt line 15 event selected
Return values
None
void SDADC_ExternalTrigInjectedConvEdgeConfig ( SDADC_TypeDef *  SDADCx,
uint32_t  SDADC_ExternalTrigInjecConvEdge 
)

Configures the SDADCx external trigger edge for injected channels conversion.

Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
SDADC_ExternalTrigInjecConvEdge,:specifies the SDADC external trigger edge to start injected conversion. This parameter can be one of the following values:
  • SDADC_ExternalTrigInjecConvEdge_None: external trigger disabled for injected conversion
  • SDADC_ExternalTrigInjecConvEdge_Rising: Each rising edge on the selected trigger makes a request to launch a injected conversion
  • SDADC_ExternalTrigInjecConvEdge_Falling: Each falling edge on the selected trigger makes a request to launch a injected conversion
  • SDADC_ExternalTrigInjecConvEdge_RisingFalling: Both rising edges and falling edges on the selected trigger make requests to launch injected conversions.
Return values
None
void SDADC_FastConversionCmd ( SDADC_TypeDef *  SDADCx,
FunctionalState  NewState 
)

Enables or disables the fast conversion mode for the SDADC.

Note
When converting a single channel in continuous mode, having enabled fast mode causes each conversion (except for the first) to execute 3 times faster (taking 120 SDADC cycles rather than 360). Fast conversion mode has no meaning for conversions which are not continuous.
fast conversion mode can be modified only if the SDADC is disabled or the INITRDY flag is set. Otherwise the configuration can't be modified.
Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
NewState,:new state of the selected SDADC fast conversion mode This parameter can be: ENABLE or DISABLE.
Return values
None
uint32_t SDADC_GetConversionSDADC12Value ( void  )

Returns the last conversion result data for regular channel of SDADC1 and SDADC2. RSYNC bit of the SDADC2 should be already set.

Parameters
None
Return values
TheData conversion value for SDADC1 and SDADC2. In 16-bit MSB: the regular conversion data for SDADC2. This data is valid only when the flag SDADC_FLAG_REOC of SDADC2 is set. In 16-bit LSB: the regular conversion data for SDADC1. This data is valid only when the flag SDADC_FLAG_REOC of SDADC1 is set.
uint32_t SDADC_GetConversionSDADC13Value ( void  )

Returns the last conversion result data for regular channel of SDADC1 and SDADC3. RSYNC bit of the SDADC3 should be already set.

Parameters
None
Return values
TheData conversion value for SDADC1 and SDADC3. In 16-bit MSB: the regular conversion data for SDADC3. This data is valid only when the flag SDADC_FLAG_REOC of SDADC3 is set. In 16-bit LSB: the regular conversion data for SDADC1. This data is valid only when the flag SDADC_FLAG_REOC of SDADC1 is set.
int16_t SDADC_GetConversionValue ( SDADC_TypeDef *  SDADCx)

Returns the last SDADC conversion result data for regular channel.

Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
Return values
TheData conversion value.
FlagStatus SDADC_GetFlagStatus ( SDADC_TypeDef *  SDADCx,
uint32_t  SDADC_FLAG 
)

Checks whether the specified SDADC flag is set or not.

Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
SDADC_FLAG,:specifies the flag to check. This parameter can be one of the following values:
  • SDADC_FLAG_EOCAL: End of calibration flag
  • SDADC_FLAG_JEOC: End of injected conversion flag
  • SDADC_FLAG_JOVR: Injected conversion overrun flag
  • SDADC_FLAG_REOC: End of regular conversion flag
  • SDADC_FLAG_ROVR: Regular conversion overrun flag
  • SDADC_FLAG_CALIBIP:Calibration in progress status flag
  • SDADC_FLAG_JCIP: Injected conversion in progress status flag
  • SDADC_FLAG_RCIP: Regular conversion in progress status flag
  • SDADC_FLAG_STABIP: Stabilization in progress status flag
  • SDADC_FLAG_INITRDY: Initialization mode is ready
Return values
Thenew state of SDADC_FLAG (SET or RESET).
uint32_t SDADC_GetInjectedChannel ( SDADC_TypeDef *  SDADCx)

Returns the injected channel most recently converted for the specified SDADC.

Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
Return values
Themost recently converted SDADC injected channel. This parameter can be one of the following values:
  • 0x00000001: SDADC_Channel_0 is recently converted
  • 0x00010002: SDADC_Channel_1 is recently converted
  • 0x00020004: SDADC_Channel_2 is recently converted
  • 0x00030008: SDADC_Channel_3 is recently converted
  • 0x00040010: SDADC_Channel_4 is recently converted
  • 0x00050020: SDADC_Channel_5 is recently converted
  • 0x00060040: SDADC_Channel_6 is recently converted
  • 0x00070080: SDADC_Channel_7 is recently converted
  • 0x00080100: SDADC_Channel_8 is recently converted
uint32_t SDADC_GetInjectedConversionSDADC12Value ( void  )

Returns the last conversion result data for injected channel of SDADC1 and SDADC2. JSYNC bit of the SDADC2 should be already set.

Parameters
None
Return values
TheData conversion value for SDADC1 and SDADC2. In 16-bit MSB: the regular conversion data for SDADC2. This data is valid only when the flag SDADC_FLAG_JEOC of SDADC2 is set. In 16-bit LSB: the regular conversion data for SDADC1. This data is valid only when the flag SDADC_FLAG_JEOC of SDADC1 is set.
uint32_t SDADC_GetInjectedConversionSDADC13Value ( void  )

Returns the last conversion result data for injected channel of SDADC1 and SDADC3. JSYNC bit of the SDADC3 should be already set.

Parameters
None
Return values
TheData conversion value for SDADC1 and SDADC3. In 16-bit MSB: the injected conversion data for SDADC3. This data is valid only when the flag SDADC_FLAG_JEOC of SDADC3 is set. In 16-bit LSB: the injected conversion data for SDADC1. This data is valid only when the flag SDADC_FLAG_JEOC of SDADC1 is set.
int16_t SDADC_GetInjectedConversionValue ( SDADC_TypeDef *  SDADCx,
uint32_t *  SDADC_Channel 
)

Returns the SDADC injected channel conversion result.

Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
SDADC_Channel,:the most recently converted SDADC injected channel. This parameter can be one of the following values:
  • 0x00000001: SDADC_Channel_0 is recently converted
  • 0x00010002: SDADC_Channel_1 is recently converted
  • 0x00020004: SDADC_Channel_2 is recently converted
  • 0x00030008: SDADC_Channel_3 is recently converted
  • 0x00040010: SDADC_Channel_4 is recently converted
  • 0x00050020: SDADC_Channel_5 is recently converted
  • 0x00060040: SDADC_Channel_6 is recently converted
  • 0x00070080: SDADC_Channel_7 is recently converted
  • 0x00080100: SDADC_Channel_8 is recently converted
Return values
Theinjected data conversion value.
ITStatus SDADC_GetITStatus ( SDADC_TypeDef *  SDADCx,
uint32_t  SDADC_IT 
)

Checks whether the specified SDADC interrupt has occurred or not.

Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
SDADC_IT,:specifies the SDADC interrupt source to check. This parameter can be one of the following values:
  • SDADC_IT_EOCAL: End of calibration flag
  • SDADC_IT_JEOC: End of injected conversion flag
  • SDADC_IT_JOVR: Injected conversion overrun flag
  • SDADC_IT_REOC: End of regular conversion flag
  • SDADC_IT_ROVR: Regular conversion overrun flag
Return values
Thenew state of SDADC_IT (SET or RESET).
void SDADC_Init ( SDADC_TypeDef *  SDADCx,
SDADC_InitTypeDef SDADC_InitStruct 
)

Initializes the SDADCx peripheral according to the specified parameters in the SDADC_InitStruct.

Note
SDADC_FastConversionMode can be modified only if the SDADC is disabled or the INITRDY flag is set. Otherwise the configuration can't be modified.
Channel selection and continuous mode configuration affect only the regular channel.
Fast conversion mode is regardless of regular/injected conversion mode.
Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
SDADC_InitStruct,:pointer to an SDADC_InitTypeDef structure that contains the configuration information for the specified SDADC peripheral.
Return values
None
void SDADC_InitModeCmd ( SDADC_TypeDef *  SDADCx,
FunctionalState  NewState 
)

Enables or disables the initialization mode for specified SDADC peripheral.

Note
Initialization mode should be enabled before setting the analog input configuration, the fast conversion mode, the external trigger...
Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
NewState,:new state of the SDADCx peripheral. This parameter can be: ENABLE or DISABLE. When enabled, the SDADCx is in initialization mode and the SDADCx can be configured (except: power down mode, standby mode, slow clock and VREF selection). When disabled, the SDADCx isn't in initialization mode and limited configurations are allowed (regular channel selection, software trigger)
Return values
None
void SDADC_InjectedChannelSelect ( SDADC_TypeDef *  SDADCx,
uint32_t  SDADC_Channel 
)

Selects the SDADC injected channel(s).

Note
When selected, the SDADC channel is part of the injected group By default, channel 0 is selected
Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
SDADC_Channel,:The SDADC injected channel. This parameter can be one or any combination of the following values:
  • SDADC_Channel_0: SDADC Channel 0 selected
  • SDADC_Channel_1: SDADC Channel 1 selected
  • SDADC_Channel_2: SDADC Channel 2 selected
  • SDADC_Channel_3: SDADC Channel 3 selected
  • SDADC_Channel_4: SDADC Channel 4 selected
  • SDADC_Channel_5: SDADC Channel 5 selected
  • SDADC_Channel_6: SDADC Channel 6 selected
  • SDADC_Channel_7: SDADC Channel 7 selected
  • SDADC_Channel_8: SDADC Channel 8 selected
Return values
None
void SDADC_InjectedContinuousModeCmd ( SDADC_TypeDef *  SDADCx,
FunctionalState  NewState 
)

Enables or disables the continuous mode for injected channels for the specified SDADC.

Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
NewState,:new state of the selected SDADC continuous mode on injected channels. This parameter can be: ENABLE or DISABLE.
Return values
None
void SDADC_InjectedSynchroSDADC1 ( SDADC_TypeDef *  SDADCx,
FunctionalState  NewState 
)

Launches injected conversion synchronously with SDADC1.

Note
This feature is available only on SDADC2 and SDADC3.
Parameters
SDADCx,:where x can be 2 or 3 to select the SDADC peripheral.
NewState,:new state of the selected SDADC synchronization with SDADC1 This parameter can be: ENABLE or DISABLE. When enabled, An injected conversion is launched at the same moment that an injected conversion is launched in SDADC1. When disabled, do not launch an injected conversion synchronously with SDADC1.
Return values
None
void SDADC_ITConfig ( SDADC_TypeDef *  SDADCx,
uint32_t  SDADC_IT,
FunctionalState  NewState 
)

Enables or disables the specified SDADC interrupts.

Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
SDADC_IT,:specifies the SDADC interrupt sources to be enabled or disabled. This parameter can be one of the following values:
  • SDADC_IT_EOCAL: End of calibration interrupt
  • SDADC_IT_JEOC: End of injected conversion interrupt
  • SDADC_IT_JOVR: Injected conversion overrun interrupt
  • SDADC_IT_REOC: End of regular conversion interrupt
  • SDADC_IT_ROVR: Regular conversion overrun interrupt
NewState,:new state of the specified SDADC interrupts. This parameter can be: ENABLE or DISABLE.
Return values
None
void SDADC_PowerDownCmd ( SDADC_TypeDef *  SDADCx,
FunctionalState  NewState 
)

Enables or disables the SDADC power down mode when idle.

Note
SDADC power down mode when idle is used to cut the consumption when the SDADC is not converting (when idle).
When the SDADC is in power down mode and a conversion is requested, the SDADC takes 100us to stabilize before launching the conversion.
Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
NewState,:new state of the selected SDADC power down mode when idle This parameter can be: ENABLE or DISABLE.
Return values
None
void SDADC_RegularSynchroSDADC1 ( SDADC_TypeDef *  SDADCx,
FunctionalState  NewState 
)

Launches SDADC2/SDADC3 regular conversion synchronously with SDADC1.

Note
This feature is available only on SDADC2 and SDADC3.
Parameters
SDADCx,:where x can be 2 or 3 to select the SDADC peripheral. When enabled, a regular conversion is launched at the same moment that a regular conversion is launched in SDADC1. When disabled, do not launch a regular conversion synchronously with SDADC1.
Return values
None
void SDADC_SlowClockCmd ( SDADC_TypeDef *  SDADCx,
FunctionalState  NewState 
)

Enables or disables the SDADC in slow clock mode.

Note
Slow clock mode (where the SDADC clock frequency should be 1.5MHz) allowing a lower level of current consumption as well as operation at a lower minimum voltage.
Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
NewState,:new state of the selected SDADC slow clock mode This parameter can be: ENABLE or DISABLE.
Return values
None
void SDADC_SoftwareStartConv ( SDADC_TypeDef *  SDADCx)

Enables the selected SDADC software start conversion of the regular channels.

Note
If the flag SDADC_FLAG_RCIP is set or INIT bit is set, calling this function SDADC_SoftwareStartConv() has no effect.
Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
Return values
None
void SDADC_SoftwareStartInjectedConv ( SDADC_TypeDef *  SDADCx)

Enables the selected SDADC software start conversion of the injected channels.

Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
Return values
None
void SDADC_StandbyCmd ( SDADC_TypeDef *  SDADCx,
FunctionalState  NewState 
)

Enables or disables the SDADC standby mode when idle.

Note
SDADC standby mode when idle is used to cut the consumption when the SDADC is not converting (when idle).
When the SDADC is in standby mode and a conversion is requested, the SDADC takes 50us to stabilize before launching the conversion.
Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
NewState,:new state of the selected SDADC standby mode when idle This parameter can be: ENABLE or DISABLE.
Return values
None
void SDADC_StartCalibration ( SDADC_TypeDef *  SDADCx)

Launches a request to start the calibration sequence.

Note
use SDADC_CalibrationSequenceConfig() function to configure the calibration sequence then call SDADC_StartCalibration() to start the calibration process.
Parameters
SDADCx,:where x can be 1, 2 or 3 to select the SDADC peripheral.
Return values
None
void SDADC_StructInit ( SDADC_InitTypeDef SDADC_InitStruct)

Fills each SDADC_InitStruct member with its default value.

Parameters
SDADC_InitStruct,:pointer to an SDADC_InitTypeDef structure which will be initialized.
Return values
None
void SDADC_VREFSelect ( uint32_t  SDADC_VREF)

Selects the reference voltage.

Note
The reference voltage is common to the all SDADCs (SDADC1, SDADC2 and SDADC3). The reference voltage selection is available only in SDADC1 and therefore to select the VREF for SDADC2/SDADC3, SDADC1 clock must be already enabled.
The reference voltage selection can be performed only when the SDADC is disabled.
Parameters
SDADC_VREF,:Reference voltage selection. This parameter can be one of the following values:
  • SDADC_VREF_Ext: The reference voltage is forced externally using VREF pin
  • SDADC_VREF_VREFINT1: The reference voltage is forced internally to 1.22V VREFINT
  • SDADC_VREF_VREFINT2: The reference voltage is forced internally to 1.8V VREFINT
  • SDADC_VREF_VDDA: The reference voltage is forced internally to VDDA
Return values
None