The official mbed C/C SDK provides the software platform and libraries to build your applications.
Fork of mbed by
TARGET_NUCLEO_F411RE/stm32f4xx_hal_adc_ex.h@86:04dd9b1680ae, 2014-07-02 (annotated)
- Committer:
- bogdanm
- Date:
- Wed Jul 02 13:22:23 2014 +0100
- Revision:
- 86:04dd9b1680ae
Release 86 of the mbed library
Main changes:
- bug fixes in various backends
- mbed "error" replaced by assert logic (mbed_assert)
- new ST Nucleo targets
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bogdanm | 86:04dd9b1680ae | 1 | /** |
bogdanm | 86:04dd9b1680ae | 2 | ****************************************************************************** |
bogdanm | 86:04dd9b1680ae | 3 | * @file stm32f4xx_hal_adc.h |
bogdanm | 86:04dd9b1680ae | 4 | * @author MCD Application Team |
bogdanm | 86:04dd9b1680ae | 5 | * @version V1.1.0 |
bogdanm | 86:04dd9b1680ae | 6 | * @date 19-June-2014 |
bogdanm | 86:04dd9b1680ae | 7 | * @brief Header file of ADC HAL module. |
bogdanm | 86:04dd9b1680ae | 8 | ****************************************************************************** |
bogdanm | 86:04dd9b1680ae | 9 | * @attention |
bogdanm | 86:04dd9b1680ae | 10 | * |
bogdanm | 86:04dd9b1680ae | 11 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
bogdanm | 86:04dd9b1680ae | 12 | * |
bogdanm | 86:04dd9b1680ae | 13 | * Redistribution and use in source and binary forms, with or without modification, |
bogdanm | 86:04dd9b1680ae | 14 | * are permitted provided that the following conditions are met: |
bogdanm | 86:04dd9b1680ae | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
bogdanm | 86:04dd9b1680ae | 16 | * this list of conditions and the following disclaimer. |
bogdanm | 86:04dd9b1680ae | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
bogdanm | 86:04dd9b1680ae | 18 | * this list of conditions and the following disclaimer in the documentation |
bogdanm | 86:04dd9b1680ae | 19 | * and/or other materials provided with the distribution. |
bogdanm | 86:04dd9b1680ae | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
bogdanm | 86:04dd9b1680ae | 21 | * may be used to endorse or promote products derived from this software |
bogdanm | 86:04dd9b1680ae | 22 | * without specific prior written permission. |
bogdanm | 86:04dd9b1680ae | 23 | * |
bogdanm | 86:04dd9b1680ae | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
bogdanm | 86:04dd9b1680ae | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
bogdanm | 86:04dd9b1680ae | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
bogdanm | 86:04dd9b1680ae | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
bogdanm | 86:04dd9b1680ae | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
bogdanm | 86:04dd9b1680ae | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
bogdanm | 86:04dd9b1680ae | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
bogdanm | 86:04dd9b1680ae | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
bogdanm | 86:04dd9b1680ae | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
bogdanm | 86:04dd9b1680ae | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
bogdanm | 86:04dd9b1680ae | 34 | * |
bogdanm | 86:04dd9b1680ae | 35 | ****************************************************************************** |
bogdanm | 86:04dd9b1680ae | 36 | */ |
bogdanm | 86:04dd9b1680ae | 37 | |
bogdanm | 86:04dd9b1680ae | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
bogdanm | 86:04dd9b1680ae | 39 | #ifndef __STM32F4xx_ADC_EX_H |
bogdanm | 86:04dd9b1680ae | 40 | #define __STM32F4xx_ADC_EX_H |
bogdanm | 86:04dd9b1680ae | 41 | |
bogdanm | 86:04dd9b1680ae | 42 | #ifdef __cplusplus |
bogdanm | 86:04dd9b1680ae | 43 | extern "C" { |
bogdanm | 86:04dd9b1680ae | 44 | #endif |
bogdanm | 86:04dd9b1680ae | 45 | |
bogdanm | 86:04dd9b1680ae | 46 | /* Includes ------------------------------------------------------------------*/ |
bogdanm | 86:04dd9b1680ae | 47 | #include "stm32f4xx_hal_def.h" |
bogdanm | 86:04dd9b1680ae | 48 | |
bogdanm | 86:04dd9b1680ae | 49 | /** @addtogroup STM32F4xx_HAL_Driver |
bogdanm | 86:04dd9b1680ae | 50 | * @{ |
bogdanm | 86:04dd9b1680ae | 51 | */ |
bogdanm | 86:04dd9b1680ae | 52 | |
bogdanm | 86:04dd9b1680ae | 53 | /** @addtogroup ADCEx |
bogdanm | 86:04dd9b1680ae | 54 | * @{ |
bogdanm | 86:04dd9b1680ae | 55 | */ |
bogdanm | 86:04dd9b1680ae | 56 | |
bogdanm | 86:04dd9b1680ae | 57 | /* Exported types ------------------------------------------------------------*/ |
bogdanm | 86:04dd9b1680ae | 58 | |
bogdanm | 86:04dd9b1680ae | 59 | /** |
bogdanm | 86:04dd9b1680ae | 60 | * @brief ADC Configuration injected Channel structure definition |
bogdanm | 86:04dd9b1680ae | 61 | */ |
bogdanm | 86:04dd9b1680ae | 62 | typedef struct |
bogdanm | 86:04dd9b1680ae | 63 | { |
bogdanm | 86:04dd9b1680ae | 64 | uint32_t InjectedChannel; /*!< Configure the ADC injected channel. |
bogdanm | 86:04dd9b1680ae | 65 | This parameter can be a value of @ref ADC_channels */ |
bogdanm | 86:04dd9b1680ae | 66 | uint32_t InjectedRank; /*!< The rank in the injected group sequencer |
bogdanm | 86:04dd9b1680ae | 67 | This parameter must be a number between Min_Data = 1 and Max_Data = 4. */ |
bogdanm | 86:04dd9b1680ae | 68 | uint32_t InjectedSamplingTime; /*!< The sample time value to be set for the selected channel. |
bogdanm | 86:04dd9b1680ae | 69 | This parameter can be a value of @ref ADC_sampling_times */ |
bogdanm | 86:04dd9b1680ae | 70 | uint32_t InjectedOffset; /*!< Defines the offset to be subtracted from the raw converted data when convert injected channels. |
bogdanm | 86:04dd9b1680ae | 71 | This parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFF. */ |
bogdanm | 86:04dd9b1680ae | 72 | uint32_t InjectedNbrOfConversion; /*!< Specifies the number of ADC conversions that will be done using the sequencer for |
bogdanm | 86:04dd9b1680ae | 73 | injected channel group. |
bogdanm | 86:04dd9b1680ae | 74 | This parameter must be a number between Min_Data = 1 and Max_Data = 4. */ |
bogdanm | 86:04dd9b1680ae | 75 | uint32_t AutoInjectedConv; /*!< Enables or disables the selected ADC automatic injected group |
bogdanm | 86:04dd9b1680ae | 76 | conversion after regular one */ |
bogdanm | 86:04dd9b1680ae | 77 | uint32_t InjectedDiscontinuousConvMode; /*!< Specifies whether the conversion is performed in Discontinuous mode or not for injected channels. |
bogdanm | 86:04dd9b1680ae | 78 | This parameter can be set to ENABLE or DISABLE. */ |
bogdanm | 86:04dd9b1680ae | 79 | uint32_t ExternalTrigInjecConvEdge; /*!< Select the external trigger edge and enable the trigger of an injected channels. |
bogdanm | 86:04dd9b1680ae | 80 | This parameter can be a value of @ref ADCEx_External_trigger_edge_Injected */ |
bogdanm | 86:04dd9b1680ae | 81 | uint32_t ExternalTrigInjecConv; /*!< Select the external event used to trigger the start of conversion of a injected channels. |
bogdanm | 86:04dd9b1680ae | 82 | This parameter can be a value of @ref ADCEx_External_trigger_Source_Injected */ |
bogdanm | 86:04dd9b1680ae | 83 | }ADC_InjectionConfTypeDef; |
bogdanm | 86:04dd9b1680ae | 84 | |
bogdanm | 86:04dd9b1680ae | 85 | /** |
bogdanm | 86:04dd9b1680ae | 86 | * @brief ADC Configuration multi-mode structure definition |
bogdanm | 86:04dd9b1680ae | 87 | */ |
bogdanm | 86:04dd9b1680ae | 88 | typedef struct |
bogdanm | 86:04dd9b1680ae | 89 | { |
bogdanm | 86:04dd9b1680ae | 90 | uint32_t Mode; /*!< Configures the ADC to operate in independent or multi mode. |
bogdanm | 86:04dd9b1680ae | 91 | This parameter can be a value of @ref ADCEx_Common_mode */ |
bogdanm | 86:04dd9b1680ae | 92 | uint32_t DMAAccessMode; /*!< Configures the Direct memory access mode for multi ADC mode. |
bogdanm | 86:04dd9b1680ae | 93 | This parameter can be a value of @ref ADCEx_Direct_memory_access_mode_for_multi_mode */ |
bogdanm | 86:04dd9b1680ae | 94 | uint32_t TwoSamplingDelay; /*!< Configures the Delay between 2 sampling phases. |
bogdanm | 86:04dd9b1680ae | 95 | This parameter can be a value of @ref ADC_delay_between_2_sampling_phases */ |
bogdanm | 86:04dd9b1680ae | 96 | }ADC_MultiModeTypeDef; |
bogdanm | 86:04dd9b1680ae | 97 | |
bogdanm | 86:04dd9b1680ae | 98 | /* Exported constants --------------------------------------------------------*/ |
bogdanm | 86:04dd9b1680ae | 99 | |
bogdanm | 86:04dd9b1680ae | 100 | /** @defgroup ADCEx_Exported_Constants |
bogdanm | 86:04dd9b1680ae | 101 | * @{ |
bogdanm | 86:04dd9b1680ae | 102 | */ |
bogdanm | 86:04dd9b1680ae | 103 | |
bogdanm | 86:04dd9b1680ae | 104 | |
bogdanm | 86:04dd9b1680ae | 105 | /** @defgroup ADCEx_Common_mode |
bogdanm | 86:04dd9b1680ae | 106 | * @{ |
bogdanm | 86:04dd9b1680ae | 107 | */ |
bogdanm | 86:04dd9b1680ae | 108 | #define ADC_MODE_INDEPENDENT ((uint32_t)0x00000000) |
bogdanm | 86:04dd9b1680ae | 109 | #define ADC_DUALMODE_REGSIMULT_INJECSIMULT ((uint32_t)ADC_CCR_MULTI_0) |
bogdanm | 86:04dd9b1680ae | 110 | #define ADC_DUALMODE_REGSIMULT_ALTERTRIG ((uint32_t)ADC_CCR_MULTI_1) |
bogdanm | 86:04dd9b1680ae | 111 | #define ADC_DUALMODE_INJECSIMULT ((uint32_t)(ADC_CCR_MULTI_2 | ADC_CCR_MULTI_0)) |
bogdanm | 86:04dd9b1680ae | 112 | #define ADC_DUALMODE_REGSIMULT ((uint32_t)(ADC_CCR_MULTI_2 | ADC_CCR_MULTI_1)) |
bogdanm | 86:04dd9b1680ae | 113 | #define ADC_DUALMODE_INTERL ((uint32_t)(ADC_CCR_MULTI_2 | ADC_CCR_MULTI_1 | ADC_CCR_MULTI_0)) |
bogdanm | 86:04dd9b1680ae | 114 | #define ADC_DUALMODE_ALTERTRIG ((uint32_t)(ADC_CCR_MULTI_3 | ADC_CCR_MULTI_0)) |
bogdanm | 86:04dd9b1680ae | 115 | #define ADC_TRIPLEMODE_REGSIMULT_INJECSIMULT ((uint32_t)(ADC_CCR_MULTI_4 | ADC_CCR_MULTI_0)) |
bogdanm | 86:04dd9b1680ae | 116 | #define ADC_TRIPLEMODE_REGSIMULT_AlterTrig ((uint32_t)(ADC_CCR_MULTI_4 | ADC_CCR_MULTI_1)) |
bogdanm | 86:04dd9b1680ae | 117 | #define ADC_TRIPLEMODE_INJECSIMULT ((uint32_t)(ADC_CCR_MULTI_4 | ADC_CCR_MULTI_2 | ADC_CCR_MULTI_0)) |
bogdanm | 86:04dd9b1680ae | 118 | #define ADC_TRIPLEMODE_REGSIMULT ((uint32_t)(ADC_CCR_MULTI_4 | ADC_CCR_MULTI_2 | ADC_CCR_MULTI_1)) |
bogdanm | 86:04dd9b1680ae | 119 | #define ADC_TRIPLEMODE_INTERL ((uint32_t)(ADC_CCR_MULTI_4 | ADC_CCR_MULTI_2 | ADC_CCR_MULTI_1 | ADC_CCR_MULTI_0)) |
bogdanm | 86:04dd9b1680ae | 120 | #define ADC_TRIPLEMODE_ALTERTRIG ((uint32_t)(ADC_CCR_MULTI_4 | ADC_CCR_MULTI_3 | ADC_CCR_MULTI_0)) |
bogdanm | 86:04dd9b1680ae | 121 | |
bogdanm | 86:04dd9b1680ae | 122 | #define IS_ADC_MODE(MODE) (((MODE) == ADC_MODE_INDEPENDENT) || \ |
bogdanm | 86:04dd9b1680ae | 123 | ((MODE) == ADC_DUALMODE_REGSIMULT_INJECSIMULT) || \ |
bogdanm | 86:04dd9b1680ae | 124 | ((MODE) == ADC_DUALMODE_REGSIMULT_ALTERTRIG) || \ |
bogdanm | 86:04dd9b1680ae | 125 | ((MODE) == ADC_DUALMODE_INJECSIMULT) || \ |
bogdanm | 86:04dd9b1680ae | 126 | ((MODE) == ADC_DUALMODE_REGSIMULT) || \ |
bogdanm | 86:04dd9b1680ae | 127 | ((MODE) == ADC_DUALMODE_INTERL) || \ |
bogdanm | 86:04dd9b1680ae | 128 | ((MODE) == ADC_DUALMODE_ALTERTRIG) || \ |
bogdanm | 86:04dd9b1680ae | 129 | ((MODE) == ADC_TRIPLEMODE_REGSIMULT_INJECSIMULT) || \ |
bogdanm | 86:04dd9b1680ae | 130 | ((MODE) == ADC_TRIPLEMODE_REGSIMULT_AlterTrig) || \ |
bogdanm | 86:04dd9b1680ae | 131 | ((MODE) == ADC_TRIPLEMODE_INJECSIMULT) || \ |
bogdanm | 86:04dd9b1680ae | 132 | ((MODE) == ADC_TRIPLEMODE_REGSIMULT) || \ |
bogdanm | 86:04dd9b1680ae | 133 | ((MODE) == ADC_TRIPLEMODE_INTERL) || \ |
bogdanm | 86:04dd9b1680ae | 134 | ((MODE) == ADC_TRIPLEMODE_ALTERTRIG)) |
bogdanm | 86:04dd9b1680ae | 135 | /** |
bogdanm | 86:04dd9b1680ae | 136 | * @} |
bogdanm | 86:04dd9b1680ae | 137 | */ |
bogdanm | 86:04dd9b1680ae | 138 | |
bogdanm | 86:04dd9b1680ae | 139 | /** @defgroup ADCEx_Direct_memory_access_mode_for_multi_mode |
bogdanm | 86:04dd9b1680ae | 140 | * @{ |
bogdanm | 86:04dd9b1680ae | 141 | */ |
bogdanm | 86:04dd9b1680ae | 142 | #define ADC_DMAACCESSMODE_DISABLED ((uint32_t)0x00000000) /*!< DMA mode disabled */ |
bogdanm | 86:04dd9b1680ae | 143 | #define ADC_DMAACCESSMODE_1 ((uint32_t)ADC_CCR_DMA_0) /*!< DMA mode 1 enabled (2 / 3 half-words one by one - 1 then 2 then 3)*/ |
bogdanm | 86:04dd9b1680ae | 144 | #define ADC_DMAACCESSMODE_2 ((uint32_t)ADC_CCR_DMA_1) /*!< DMA mode 2 enabled (2 / 3 half-words by pairs - 2&1 then 1&3 then 3&2)*/ |
bogdanm | 86:04dd9b1680ae | 145 | #define ADC_DMAACCESSMODE_3 ((uint32_t)ADC_CCR_DMA) /*!< DMA mode 3 enabled (2 / 3 bytes by pairs - 2&1 then 1&3 then 3&2) */ |
bogdanm | 86:04dd9b1680ae | 146 | |
bogdanm | 86:04dd9b1680ae | 147 | #define IS_ADC_DMA_ACCESS_MODE(MODE) (((MODE) == ADC_DMAACCESSMODE_DISABLED) || \ |
bogdanm | 86:04dd9b1680ae | 148 | ((MODE) == ADC_DMAACCESSMODE_1) || \ |
bogdanm | 86:04dd9b1680ae | 149 | ((MODE) == ADC_DMAACCESSMODE_2) || \ |
bogdanm | 86:04dd9b1680ae | 150 | ((MODE) == ADC_DMAACCESSMODE_3)) |
bogdanm | 86:04dd9b1680ae | 151 | /** |
bogdanm | 86:04dd9b1680ae | 152 | * @} |
bogdanm | 86:04dd9b1680ae | 153 | */ |
bogdanm | 86:04dd9b1680ae | 154 | |
bogdanm | 86:04dd9b1680ae | 155 | /** @defgroup ADCEx_External_trigger_edge_Injected |
bogdanm | 86:04dd9b1680ae | 156 | * @{ |
bogdanm | 86:04dd9b1680ae | 157 | */ |
bogdanm | 86:04dd9b1680ae | 158 | #define ADC_EXTERNALTRIGINJECCONVEDGE_NONE ((uint32_t)0x00000000) |
bogdanm | 86:04dd9b1680ae | 159 | #define ADC_EXTERNALTRIGINJECCONVEDGE_RISING ((uint32_t)ADC_CR2_JEXTEN_0) |
bogdanm | 86:04dd9b1680ae | 160 | #define ADC_EXTERNALTRIGINJECCONVEDGE_FALLING ((uint32_t)ADC_CR2_JEXTEN_1) |
bogdanm | 86:04dd9b1680ae | 161 | #define ADC_EXTERNALTRIGINJECCONVEDGE_RISINGFALLING ((uint32_t)ADC_CR2_JEXTEN) |
bogdanm | 86:04dd9b1680ae | 162 | |
bogdanm | 86:04dd9b1680ae | 163 | #define IS_ADC_EXT_INJEC_TRIG_EDGE(EDGE) (((EDGE) == ADC_EXTERNALTRIGINJECCONVEDGE_NONE) || \ |
bogdanm | 86:04dd9b1680ae | 164 | ((EDGE) == ADC_EXTERNALTRIGINJECCONVEDGE_RISING) || \ |
bogdanm | 86:04dd9b1680ae | 165 | ((EDGE) == ADC_EXTERNALTRIGINJECCONVEDGE_FALLING) || \ |
bogdanm | 86:04dd9b1680ae | 166 | ((EDGE) == ADC_EXTERNALTRIGINJECCONVEDGE_RISINGFALLING)) |
bogdanm | 86:04dd9b1680ae | 167 | /** |
bogdanm | 86:04dd9b1680ae | 168 | * @} |
bogdanm | 86:04dd9b1680ae | 169 | */ |
bogdanm | 86:04dd9b1680ae | 170 | |
bogdanm | 86:04dd9b1680ae | 171 | /** @defgroup ADCEx_External_trigger_Source_Injected |
bogdanm | 86:04dd9b1680ae | 172 | * @{ |
bogdanm | 86:04dd9b1680ae | 173 | */ |
bogdanm | 86:04dd9b1680ae | 174 | #define ADC_EXTERNALTRIGINJECCONV_T1_CC4 ((uint32_t)0x00000000) |
bogdanm | 86:04dd9b1680ae | 175 | #define ADC_EXTERNALTRIGINJECCONV_T1_TRGO ((uint32_t)ADC_CR2_JEXTSEL_0) |
bogdanm | 86:04dd9b1680ae | 176 | #define ADC_EXTERNALTRIGINJECCONV_T2_CC1 ((uint32_t)ADC_CR2_JEXTSEL_1) |
bogdanm | 86:04dd9b1680ae | 177 | #define ADC_EXTERNALTRIGINJECCONV_T2_TRGO ((uint32_t)(ADC_CR2_JEXTSEL_1 | ADC_CR2_JEXTSEL_0)) |
bogdanm | 86:04dd9b1680ae | 178 | #define ADC_EXTERNALTRIGINJECCONV_T3_CC2 ((uint32_t)ADC_CR2_JEXTSEL_2) |
bogdanm | 86:04dd9b1680ae | 179 | #define ADC_EXTERNALTRIGINJECCONV_T3_CC4 ((uint32_t)(ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_0)) |
bogdanm | 86:04dd9b1680ae | 180 | #define ADC_EXTERNALTRIGINJECCONV_T4_CC1 ((uint32_t)(ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_1)) |
bogdanm | 86:04dd9b1680ae | 181 | #define ADC_EXTERNALTRIGINJECCONV_T4_CC2 ((uint32_t)(ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_1 | ADC_CR2_JEXTSEL_0)) |
bogdanm | 86:04dd9b1680ae | 182 | #define ADC_EXTERNALTRIGINJECCONV_T4_CC3 ((uint32_t)ADC_CR2_JEXTSEL_3) |
bogdanm | 86:04dd9b1680ae | 183 | #define ADC_EXTERNALTRIGINJECCONV_T4_TRGO ((uint32_t)(ADC_CR2_JEXTSEL_3 | ADC_CR2_JEXTSEL_0)) |
bogdanm | 86:04dd9b1680ae | 184 | #define ADC_EXTERNALTRIGINJECCONV_T5_CC4 ((uint32_t)(ADC_CR2_JEXTSEL_3 | ADC_CR2_JEXTSEL_1)) |
bogdanm | 86:04dd9b1680ae | 185 | #define ADC_EXTERNALTRIGINJECCONV_T5_TRGO ((uint32_t)(ADC_CR2_JEXTSEL_3 | ADC_CR2_JEXTSEL_1 | ADC_CR2_JEXTSEL_0)) |
bogdanm | 86:04dd9b1680ae | 186 | #define ADC_EXTERNALTRIGINJECCONV_T8_CC2 ((uint32_t)(ADC_CR2_JEXTSEL_3 | ADC_CR2_JEXTSEL_2)) |
bogdanm | 86:04dd9b1680ae | 187 | #define ADC_EXTERNALTRIGINJECCONV_T8_CC3 ((uint32_t)(ADC_CR2_JEXTSEL_3 | ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_0)) |
bogdanm | 86:04dd9b1680ae | 188 | #define ADC_EXTERNALTRIGINJECCONV_T8_CC4 ((uint32_t)(ADC_CR2_JEXTSEL_3 | ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_1)) |
bogdanm | 86:04dd9b1680ae | 189 | #define ADC_EXTERNALTRIGINJECCONV_EXT_IT15 ((uint32_t)ADC_CR2_JEXTSEL) |
bogdanm | 86:04dd9b1680ae | 190 | |
bogdanm | 86:04dd9b1680ae | 191 | #define IS_ADC_EXT_INJEC_TRIG(INJTRIG) (((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_CC4) || \ |
bogdanm | 86:04dd9b1680ae | 192 | ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_TRGO) || \ |
bogdanm | 86:04dd9b1680ae | 193 | ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_CC1) || \ |
bogdanm | 86:04dd9b1680ae | 194 | ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_TRGO) || \ |
bogdanm | 86:04dd9b1680ae | 195 | ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC2) || \ |
bogdanm | 86:04dd9b1680ae | 196 | ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC4) || \ |
bogdanm | 86:04dd9b1680ae | 197 | ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC1) || \ |
bogdanm | 86:04dd9b1680ae | 198 | ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC2) || \ |
bogdanm | 86:04dd9b1680ae | 199 | ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC3) || \ |
bogdanm | 86:04dd9b1680ae | 200 | ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_TRGO) || \ |
bogdanm | 86:04dd9b1680ae | 201 | ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T5_CC4) || \ |
bogdanm | 86:04dd9b1680ae | 202 | ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T5_TRGO) || \ |
bogdanm | 86:04dd9b1680ae | 203 | ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_CC2) || \ |
bogdanm | 86:04dd9b1680ae | 204 | ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_CC3) || \ |
bogdanm | 86:04dd9b1680ae | 205 | ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_CC4) || \ |
bogdanm | 86:04dd9b1680ae | 206 | ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_EXT_IT15)) |
bogdanm | 86:04dd9b1680ae | 207 | /** |
bogdanm | 86:04dd9b1680ae | 208 | * @} |
bogdanm | 86:04dd9b1680ae | 209 | */ |
bogdanm | 86:04dd9b1680ae | 210 | |
bogdanm | 86:04dd9b1680ae | 211 | /** @defgroup ADCEx_injected_channel_selection |
bogdanm | 86:04dd9b1680ae | 212 | * @{ |
bogdanm | 86:04dd9b1680ae | 213 | */ |
bogdanm | 86:04dd9b1680ae | 214 | #define ADC_INJECTED_RANK_1 ((uint32_t)0x00000001) |
bogdanm | 86:04dd9b1680ae | 215 | #define ADC_INJECTED_RANK_2 ((uint32_t)0x00000002) |
bogdanm | 86:04dd9b1680ae | 216 | #define ADC_INJECTED_RANK_3 ((uint32_t)0x00000003) |
bogdanm | 86:04dd9b1680ae | 217 | #define ADC_INJECTED_RANK_4 ((uint32_t)0x00000004) |
bogdanm | 86:04dd9b1680ae | 218 | |
bogdanm | 86:04dd9b1680ae | 219 | /** |
bogdanm | 86:04dd9b1680ae | 220 | * @} |
bogdanm | 86:04dd9b1680ae | 221 | */ |
bogdanm | 86:04dd9b1680ae | 222 | |
bogdanm | 86:04dd9b1680ae | 223 | /** @defgroup ADCEx_injected_length |
bogdanm | 86:04dd9b1680ae | 224 | * @{ |
bogdanm | 86:04dd9b1680ae | 225 | */ |
bogdanm | 86:04dd9b1680ae | 226 | #define IS_ADC_INJECTED_LENGTH(LENGTH) (((LENGTH) >= ((uint32_t)1)) && ((LENGTH) <= ((uint32_t)4))) |
bogdanm | 86:04dd9b1680ae | 227 | /** |
bogdanm | 86:04dd9b1680ae | 228 | * @} |
bogdanm | 86:04dd9b1680ae | 229 | */ |
bogdanm | 86:04dd9b1680ae | 230 | |
bogdanm | 86:04dd9b1680ae | 231 | /** @defgroup ADCEx_injected_rank |
bogdanm | 86:04dd9b1680ae | 232 | * @{ |
bogdanm | 86:04dd9b1680ae | 233 | */ |
bogdanm | 86:04dd9b1680ae | 234 | #define IS_ADC_INJECTED_RANK(RANK) (((RANK) >= ((uint32_t)1)) && ((RANK) <= ((uint32_t)4))) |
bogdanm | 86:04dd9b1680ae | 235 | /** |
bogdanm | 86:04dd9b1680ae | 236 | * @} |
bogdanm | 86:04dd9b1680ae | 237 | */ |
bogdanm | 86:04dd9b1680ae | 238 | |
bogdanm | 86:04dd9b1680ae | 239 | /** |
bogdanm | 86:04dd9b1680ae | 240 | * @} |
bogdanm | 86:04dd9b1680ae | 241 | */ |
bogdanm | 86:04dd9b1680ae | 242 | |
bogdanm | 86:04dd9b1680ae | 243 | /* Exported macro ------------------------------------------------------------*/ |
bogdanm | 86:04dd9b1680ae | 244 | |
bogdanm | 86:04dd9b1680ae | 245 | /** |
bogdanm | 86:04dd9b1680ae | 246 | * @brief Set the selected injected Channel rank. |
bogdanm | 86:04dd9b1680ae | 247 | * @param _CHANNELNB_: Channel number. |
bogdanm | 86:04dd9b1680ae | 248 | * @param _RANKNB_: Rank number. |
bogdanm | 86:04dd9b1680ae | 249 | * @param _JSQR_JL_: Sequence length. |
bogdanm | 86:04dd9b1680ae | 250 | * @retval None |
bogdanm | 86:04dd9b1680ae | 251 | */ |
bogdanm | 86:04dd9b1680ae | 252 | #define __HAL_ADC_JSQR(_CHANNELNB_, _RANKNB_,_JSQR_JL_) \ |
bogdanm | 86:04dd9b1680ae | 253 | ((_CHANNELNB_) << (5 * (uint8_t)(((_RANKNB_) + 3) - (_JSQR_JL_)))) |
bogdanm | 86:04dd9b1680ae | 254 | |
bogdanm | 86:04dd9b1680ae | 255 | /* Exported functions --------------------------------------------------------*/ |
bogdanm | 86:04dd9b1680ae | 256 | |
bogdanm | 86:04dd9b1680ae | 257 | /* I/O operation functions ******************************************************/ |
bogdanm | 86:04dd9b1680ae | 258 | HAL_StatusTypeDef HAL_ADCEx_InjectedStop(ADC_HandleTypeDef* hadc); |
bogdanm | 86:04dd9b1680ae | 259 | HAL_StatusTypeDef HAL_ADCEx_InjectedPollForConversion(ADC_HandleTypeDef* hadc, uint32_t Timeout); |
bogdanm | 86:04dd9b1680ae | 260 | HAL_StatusTypeDef HAL_ADCEx_InjectedStop_IT(ADC_HandleTypeDef* hadc); |
bogdanm | 86:04dd9b1680ae | 261 | HAL_StatusTypeDef HAL_ADCEx_InjectedStart(ADC_HandleTypeDef* hadc); |
bogdanm | 86:04dd9b1680ae | 262 | HAL_StatusTypeDef HAL_ADCEx_InjectedStart_IT(ADC_HandleTypeDef* hadc); |
bogdanm | 86:04dd9b1680ae | 263 | uint32_t HAL_ADCEx_InjectedGetValue(ADC_HandleTypeDef* hadc, uint32_t InjectedRank); |
bogdanm | 86:04dd9b1680ae | 264 | HAL_StatusTypeDef HAL_ADCEx_MultiModeStart_DMA(ADC_HandleTypeDef* hadc, uint32_t* pData, uint32_t Length); |
bogdanm | 86:04dd9b1680ae | 265 | HAL_StatusTypeDef HAL_ADCEx_MultiModeStop_DMA(ADC_HandleTypeDef* hadc); |
bogdanm | 86:04dd9b1680ae | 266 | uint32_t HAL_ADCEx_MultiModeGetValue(ADC_HandleTypeDef* hadc); |
bogdanm | 86:04dd9b1680ae | 267 | void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef* hadc); |
bogdanm | 86:04dd9b1680ae | 268 | |
bogdanm | 86:04dd9b1680ae | 269 | /* Peripheral Control functions *************************************************/ |
bogdanm | 86:04dd9b1680ae | 270 | HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc,ADC_InjectionConfTypeDef* sConfigInjected); |
bogdanm | 86:04dd9b1680ae | 271 | HAL_StatusTypeDef HAL_ADCEx_MultiModeConfigChannel(ADC_HandleTypeDef* hadc, ADC_MultiModeTypeDef* multimode); |
bogdanm | 86:04dd9b1680ae | 272 | |
bogdanm | 86:04dd9b1680ae | 273 | /** |
bogdanm | 86:04dd9b1680ae | 274 | * @} |
bogdanm | 86:04dd9b1680ae | 275 | */ |
bogdanm | 86:04dd9b1680ae | 276 | |
bogdanm | 86:04dd9b1680ae | 277 | /** |
bogdanm | 86:04dd9b1680ae | 278 | * @} |
bogdanm | 86:04dd9b1680ae | 279 | */ |
bogdanm | 86:04dd9b1680ae | 280 | |
bogdanm | 86:04dd9b1680ae | 281 | #ifdef __cplusplus |
bogdanm | 86:04dd9b1680ae | 282 | } |
bogdanm | 86:04dd9b1680ae | 283 | #endif |
bogdanm | 86:04dd9b1680ae | 284 | |
bogdanm | 86:04dd9b1680ae | 285 | #endif /*__STM32F4xx_ADC_EX_H */ |
bogdanm | 86:04dd9b1680ae | 286 | |
bogdanm | 86:04dd9b1680ae | 287 | |
bogdanm | 86:04dd9b1680ae | 288 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |