Injected channels Configuration functions.
More...
Injected channels Configuration functions.
===============================================================================
##### Injected channels Configuration functions #####
===============================================================================
[..] This section provide functions allowing to configure the SDADC Injected
channels, it is composed of 2 sub sections:
(#) Configuration functions for Injected channels: This subsection provides
functions allowing to configure the SDADC injected channels:
(++) Select the configuration for the SDADC injected channel
(++) Activate the continuous Mode
(++) External/software trigger source
(++) External trigger edge (rising, falling, rising & falling)
(#) Get injected channel conversion data: This subsection provides an
important function in the SDADC peripheral since it returns the
converted data of a specific injected channel.
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
-
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
-
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
-
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
-
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
|
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
-
- Return values
-
The | Data 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
-
- Return values
-
The | Data 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
-
The | injected data conversion value. |
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
-
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
-
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
-
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
-