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