Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
112:6f327212ef96
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 112:6f327212ef96 1 /**
Kojto 112:6f327212ef96 2 ******************************************************************************
Kojto 112:6f327212ef96 3 * @file stm32f4xx_hal_adc_ex.h
Kojto 112:6f327212ef96 4 * @author MCD Application Team
Kojto 112:6f327212ef96 5 * @version V1.4.1
Kojto 112:6f327212ef96 6 * @date 09-October-2015
Kojto 112:6f327212ef96 7 * @brief Header file of ADC HAL module.
Kojto 112:6f327212ef96 8 ******************************************************************************
Kojto 112:6f327212ef96 9 * @attention
Kojto 112:6f327212ef96 10 *
Kojto 112:6f327212ef96 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
Kojto 112:6f327212ef96 12 *
Kojto 112:6f327212ef96 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 112:6f327212ef96 14 * are permitted provided that the following conditions are met:
Kojto 112:6f327212ef96 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 112:6f327212ef96 16 * this list of conditions and the following disclaimer.
Kojto 112:6f327212ef96 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 112:6f327212ef96 18 * this list of conditions and the following disclaimer in the documentation
Kojto 112:6f327212ef96 19 * and/or other materials provided with the distribution.
Kojto 112:6f327212ef96 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 112:6f327212ef96 21 * may be used to endorse or promote products derived from this software
Kojto 112:6f327212ef96 22 * without specific prior written permission.
Kojto 112:6f327212ef96 23 *
Kojto 112:6f327212ef96 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 112:6f327212ef96 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 112:6f327212ef96 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 112:6f327212ef96 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 112:6f327212ef96 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 112:6f327212ef96 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 112:6f327212ef96 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 112:6f327212ef96 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 112:6f327212ef96 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 112:6f327212ef96 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 112:6f327212ef96 34 *
Kojto 112:6f327212ef96 35 ******************************************************************************
Kojto 112:6f327212ef96 36 */
Kojto 112:6f327212ef96 37
Kojto 112:6f327212ef96 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 112:6f327212ef96 39 #ifndef __STM32F4xx_ADC_EX_H
Kojto 112:6f327212ef96 40 #define __STM32F4xx_ADC_EX_H
Kojto 112:6f327212ef96 41
Kojto 112:6f327212ef96 42 #ifdef __cplusplus
Kojto 112:6f327212ef96 43 extern "C" {
Kojto 112:6f327212ef96 44 #endif
Kojto 112:6f327212ef96 45
Kojto 112:6f327212ef96 46 /* Includes ------------------------------------------------------------------*/
Kojto 112:6f327212ef96 47 #include "stm32f4xx_hal_def.h"
Kojto 112:6f327212ef96 48
Kojto 112:6f327212ef96 49 /** @addtogroup STM32F4xx_HAL_Driver
Kojto 112:6f327212ef96 50 * @{
Kojto 112:6f327212ef96 51 */
Kojto 112:6f327212ef96 52
Kojto 112:6f327212ef96 53 /** @addtogroup ADCEx
Kojto 112:6f327212ef96 54 * @{
Kojto 112:6f327212ef96 55 */
Kojto 112:6f327212ef96 56
Kojto 112:6f327212ef96 57 /* Exported types ------------------------------------------------------------*/
Kojto 112:6f327212ef96 58 /** @defgroup ADCEx_Exported_Types ADC Exported Types
Kojto 112:6f327212ef96 59 * @{
Kojto 112:6f327212ef96 60 */
Kojto 112:6f327212ef96 61
Kojto 112:6f327212ef96 62 /**
Kojto 112:6f327212ef96 63 * @brief ADC Configuration injected Channel structure definition
Kojto 112:6f327212ef96 64 */
Kojto 112:6f327212ef96 65 typedef struct
Kojto 112:6f327212ef96 66 {
Kojto 112:6f327212ef96 67 uint32_t InjectedChannel; /*!< Configure the ADC injected channel.
Kojto 112:6f327212ef96 68 This parameter can be a value of @ref ADC_channels */
Kojto 112:6f327212ef96 69 uint32_t InjectedRank; /*!< The rank in the injected group sequencer
Kojto 112:6f327212ef96 70 This parameter must be a number between Min_Data = 1 and Max_Data = 4. */
Kojto 112:6f327212ef96 71 uint32_t InjectedSamplingTime; /*!< The sample time value to be set for the selected channel.
Kojto 112:6f327212ef96 72 This parameter can be a value of @ref ADC_sampling_times */
Kojto 112:6f327212ef96 73 uint32_t InjectedOffset; /*!< Defines the offset to be subtracted from the raw converted data when convert injected channels.
Kojto 112:6f327212ef96 74 This parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFF. */
Kojto 112:6f327212ef96 75 uint32_t InjectedNbrOfConversion; /*!< Specifies the number of ADC conversions that will be done using the sequencer for
Kojto 112:6f327212ef96 76 injected channel group.
Kojto 112:6f327212ef96 77 This parameter must be a number between Min_Data = 1 and Max_Data = 4. */
Kojto 112:6f327212ef96 78 uint32_t AutoInjectedConv; /*!< Enables or disables the selected ADC automatic injected group
Kojto 112:6f327212ef96 79 conversion after regular one */
Kojto 112:6f327212ef96 80 uint32_t InjectedDiscontinuousConvMode; /*!< Specifies whether the conversion is performed in Discontinuous mode or not for injected channels.
Kojto 112:6f327212ef96 81 This parameter can be set to ENABLE or DISABLE. */
Kojto 112:6f327212ef96 82 uint32_t ExternalTrigInjecConvEdge; /*!< Select the external trigger edge and enable the trigger of an injected channels.
Kojto 112:6f327212ef96 83 This parameter can be a value of @ref ADCEx_External_trigger_edge_Injected */
Kojto 112:6f327212ef96 84 uint32_t ExternalTrigInjecConv; /*!< Select the external event used to trigger the start of conversion of a injected channels.
Kojto 112:6f327212ef96 85 This parameter can be a value of @ref ADCEx_External_trigger_Source_Injected */
Kojto 112:6f327212ef96 86 }ADC_InjectionConfTypeDef;
Kojto 112:6f327212ef96 87
Kojto 112:6f327212ef96 88 /**
Kojto 112:6f327212ef96 89 * @brief ADC Configuration multi-mode structure definition
Kojto 112:6f327212ef96 90 */
Kojto 112:6f327212ef96 91 typedef struct
Kojto 112:6f327212ef96 92 {
Kojto 112:6f327212ef96 93 uint32_t Mode; /*!< Configures the ADC to operate in independent or multi mode.
Kojto 112:6f327212ef96 94 This parameter can be a value of @ref ADCEx_Common_mode */
Kojto 112:6f327212ef96 95 uint32_t DMAAccessMode; /*!< Configures the Direct memory access mode for multi ADC mode.
Kojto 112:6f327212ef96 96 This parameter can be a value of @ref ADCEx_Direct_memory_access_mode_for_multi_mode */
Kojto 112:6f327212ef96 97 uint32_t TwoSamplingDelay; /*!< Configures the Delay between 2 sampling phases.
Kojto 112:6f327212ef96 98 This parameter can be a value of @ref ADC_delay_between_2_sampling_phases */
Kojto 112:6f327212ef96 99 }ADC_MultiModeTypeDef;
Kojto 112:6f327212ef96 100
Kojto 112:6f327212ef96 101 /**
Kojto 112:6f327212ef96 102 * @}
Kojto 112:6f327212ef96 103 */
Kojto 112:6f327212ef96 104
Kojto 112:6f327212ef96 105 /* Exported constants --------------------------------------------------------*/
Kojto 112:6f327212ef96 106 /** @defgroup ADCEx_Exported_Constants ADC Exported Constants
Kojto 112:6f327212ef96 107 * @{
Kojto 112:6f327212ef96 108 */
Kojto 112:6f327212ef96 109
Kojto 112:6f327212ef96 110 /** @defgroup ADCEx_Common_mode ADC Common Mode
Kojto 112:6f327212ef96 111 * @{
Kojto 112:6f327212ef96 112 */
Kojto 112:6f327212ef96 113 #define ADC_MODE_INDEPENDENT ((uint32_t)0x00000000)
Kojto 112:6f327212ef96 114 #define ADC_DUALMODE_REGSIMULT_INJECSIMULT ((uint32_t)ADC_CCR_MULTI_0)
Kojto 112:6f327212ef96 115 #define ADC_DUALMODE_REGSIMULT_ALTERTRIG ((uint32_t)ADC_CCR_MULTI_1)
Kojto 112:6f327212ef96 116 #define ADC_DUALMODE_INJECSIMULT ((uint32_t)(ADC_CCR_MULTI_2 | ADC_CCR_MULTI_0))
Kojto 112:6f327212ef96 117 #define ADC_DUALMODE_REGSIMULT ((uint32_t)(ADC_CCR_MULTI_2 | ADC_CCR_MULTI_1))
Kojto 112:6f327212ef96 118 #define ADC_DUALMODE_INTERL ((uint32_t)(ADC_CCR_MULTI_2 | ADC_CCR_MULTI_1 | ADC_CCR_MULTI_0))
Kojto 112:6f327212ef96 119 #define ADC_DUALMODE_ALTERTRIG ((uint32_t)(ADC_CCR_MULTI_3 | ADC_CCR_MULTI_0))
Kojto 112:6f327212ef96 120 #define ADC_TRIPLEMODE_REGSIMULT_INJECSIMULT ((uint32_t)(ADC_CCR_MULTI_4 | ADC_CCR_MULTI_0))
Kojto 112:6f327212ef96 121 #define ADC_TRIPLEMODE_REGSIMULT_AlterTrig ((uint32_t)(ADC_CCR_MULTI_4 | ADC_CCR_MULTI_1))
Kojto 112:6f327212ef96 122 #define ADC_TRIPLEMODE_INJECSIMULT ((uint32_t)(ADC_CCR_MULTI_4 | ADC_CCR_MULTI_2 | ADC_CCR_MULTI_0))
Kojto 112:6f327212ef96 123 #define ADC_TRIPLEMODE_REGSIMULT ((uint32_t)(ADC_CCR_MULTI_4 | ADC_CCR_MULTI_2 | ADC_CCR_MULTI_1))
Kojto 112:6f327212ef96 124 #define ADC_TRIPLEMODE_INTERL ((uint32_t)(ADC_CCR_MULTI_4 | ADC_CCR_MULTI_2 | ADC_CCR_MULTI_1 | ADC_CCR_MULTI_0))
Kojto 112:6f327212ef96 125 #define ADC_TRIPLEMODE_ALTERTRIG ((uint32_t)(ADC_CCR_MULTI_4 | ADC_CCR_MULTI_3 | ADC_CCR_MULTI_0))
Kojto 112:6f327212ef96 126 /**
Kojto 112:6f327212ef96 127 * @}
Kojto 112:6f327212ef96 128 */
Kojto 112:6f327212ef96 129
Kojto 112:6f327212ef96 130 /** @defgroup ADCEx_Direct_memory_access_mode_for_multi_mode ADC Direct Memory Access Mode For Multi Mode
Kojto 112:6f327212ef96 131 * @{
Kojto 112:6f327212ef96 132 */
Kojto 112:6f327212ef96 133 #define ADC_DMAACCESSMODE_DISABLED ((uint32_t)0x00000000) /*!< DMA mode disabled */
Kojto 112:6f327212ef96 134 #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)*/
Kojto 112:6f327212ef96 135 #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)*/
Kojto 112:6f327212ef96 136 #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) */
Kojto 112:6f327212ef96 137 /**
Kojto 112:6f327212ef96 138 * @}
Kojto 112:6f327212ef96 139 */
Kojto 112:6f327212ef96 140
Kojto 112:6f327212ef96 141 /** @defgroup ADCEx_External_trigger_edge_Injected ADC External Trigger Edge Injected
Kojto 112:6f327212ef96 142 * @{
Kojto 112:6f327212ef96 143 */
Kojto 112:6f327212ef96 144 #define ADC_EXTERNALTRIGINJECCONVEDGE_NONE ((uint32_t)0x00000000)
Kojto 112:6f327212ef96 145 #define ADC_EXTERNALTRIGINJECCONVEDGE_RISING ((uint32_t)ADC_CR2_JEXTEN_0)
Kojto 112:6f327212ef96 146 #define ADC_EXTERNALTRIGINJECCONVEDGE_FALLING ((uint32_t)ADC_CR2_JEXTEN_1)
Kojto 112:6f327212ef96 147 #define ADC_EXTERNALTRIGINJECCONVEDGE_RISINGFALLING ((uint32_t)ADC_CR2_JEXTEN)
Kojto 112:6f327212ef96 148 /**
Kojto 112:6f327212ef96 149 * @}
Kojto 112:6f327212ef96 150 */
Kojto 112:6f327212ef96 151
Kojto 112:6f327212ef96 152 /** @defgroup ADCEx_External_trigger_Source_Injected ADC External Trigger Source Injected
Kojto 112:6f327212ef96 153 * @{
Kojto 112:6f327212ef96 154 */
Kojto 112:6f327212ef96 155 #define ADC_EXTERNALTRIGINJECCONV_T1_CC4 ((uint32_t)0x00000000)
Kojto 112:6f327212ef96 156 #define ADC_EXTERNALTRIGINJECCONV_T1_TRGO ((uint32_t)ADC_CR2_JEXTSEL_0)
Kojto 112:6f327212ef96 157 #define ADC_EXTERNALTRIGINJECCONV_T2_CC1 ((uint32_t)ADC_CR2_JEXTSEL_1)
Kojto 112:6f327212ef96 158 #define ADC_EXTERNALTRIGINJECCONV_T2_TRGO ((uint32_t)(ADC_CR2_JEXTSEL_1 | ADC_CR2_JEXTSEL_0))
Kojto 112:6f327212ef96 159 #define ADC_EXTERNALTRIGINJECCONV_T3_CC2 ((uint32_t)ADC_CR2_JEXTSEL_2)
Kojto 112:6f327212ef96 160 #define ADC_EXTERNALTRIGINJECCONV_T3_CC4 ((uint32_t)(ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_0))
Kojto 112:6f327212ef96 161 #define ADC_EXTERNALTRIGINJECCONV_T4_CC1 ((uint32_t)(ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_1))
Kojto 112:6f327212ef96 162 #define ADC_EXTERNALTRIGINJECCONV_T4_CC2 ((uint32_t)(ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_1 | ADC_CR2_JEXTSEL_0))
Kojto 112:6f327212ef96 163 #define ADC_EXTERNALTRIGINJECCONV_T4_CC3 ((uint32_t)ADC_CR2_JEXTSEL_3)
Kojto 112:6f327212ef96 164 #define ADC_EXTERNALTRIGINJECCONV_T4_TRGO ((uint32_t)(ADC_CR2_JEXTSEL_3 | ADC_CR2_JEXTSEL_0))
Kojto 112:6f327212ef96 165 #define ADC_EXTERNALTRIGINJECCONV_T5_CC4 ((uint32_t)(ADC_CR2_JEXTSEL_3 | ADC_CR2_JEXTSEL_1))
Kojto 112:6f327212ef96 166 #define ADC_EXTERNALTRIGINJECCONV_T5_TRGO ((uint32_t)(ADC_CR2_JEXTSEL_3 | ADC_CR2_JEXTSEL_1 | ADC_CR2_JEXTSEL_0))
Kojto 112:6f327212ef96 167 #define ADC_EXTERNALTRIGINJECCONV_T8_CC2 ((uint32_t)(ADC_CR2_JEXTSEL_3 | ADC_CR2_JEXTSEL_2))
Kojto 112:6f327212ef96 168 #define ADC_EXTERNALTRIGINJECCONV_T8_CC3 ((uint32_t)(ADC_CR2_JEXTSEL_3 | ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_0))
Kojto 112:6f327212ef96 169 #define ADC_EXTERNALTRIGINJECCONV_T8_CC4 ((uint32_t)(ADC_CR2_JEXTSEL_3 | ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_1))
Kojto 112:6f327212ef96 170 #define ADC_EXTERNALTRIGINJECCONV_EXT_IT15 ((uint32_t)ADC_CR2_JEXTSEL)
Kojto 112:6f327212ef96 171 #define ADC_INJECTED_SOFTWARE_START ((uint32_t)ADC_CR2_JEXTSEL + 1)
Kojto 112:6f327212ef96 172 /**
Kojto 112:6f327212ef96 173 * @}
Kojto 112:6f327212ef96 174 */
Kojto 112:6f327212ef96 175
Kojto 112:6f327212ef96 176 /** @defgroup ADCEx_injected_channel_selection ADC Injected Channel Selection
Kojto 112:6f327212ef96 177 * @{
Kojto 112:6f327212ef96 178 */
Kojto 112:6f327212ef96 179 #define ADC_INJECTED_RANK_1 ((uint32_t)0x00000001)
Kojto 112:6f327212ef96 180 #define ADC_INJECTED_RANK_2 ((uint32_t)0x00000002)
Kojto 112:6f327212ef96 181 #define ADC_INJECTED_RANK_3 ((uint32_t)0x00000003)
Kojto 112:6f327212ef96 182 #define ADC_INJECTED_RANK_4 ((uint32_t)0x00000004)
Kojto 112:6f327212ef96 183 /**
Kojto 112:6f327212ef96 184 * @}
Kojto 112:6f327212ef96 185 */
Kojto 112:6f327212ef96 186
Kojto 112:6f327212ef96 187 /** @defgroup ADCEx_channels ADC Specific Channels
Kojto 112:6f327212ef96 188 * @{
Kojto 112:6f327212ef96 189 */
Kojto 112:6f327212ef96 190 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || \
Kojto 112:6f327212ef96 191 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F410Tx) || defined(STM32F410Cx) || \
Kojto 112:6f327212ef96 192 defined(STM32F410Rx) || defined(STM32F412xG)
Kojto 112:6f327212ef96 193 #define ADC_CHANNEL_TEMPSENSOR ((uint32_t)ADC_CHANNEL_16)
Kojto 112:6f327212ef96 194 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F401xC || STM32F401xE || STM32F410xx || STM32F412xG */
Kojto 112:6f327212ef96 195
Kojto 112:6f327212ef96 196 #if defined(STM32F411xE) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || \
Kojto 112:6f327212ef96 197 defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx)
Kojto 112:6f327212ef96 198 #define ADC_CHANNEL_DIFFERENCIATION_TEMPSENSOR_VBAT ((uint32_t)0x10000000) /* Dummy bit for driver internal usage, not used in ADC channel setting registers CR1 or SQRx */
Kojto 112:6f327212ef96 199 #define ADC_CHANNEL_TEMPSENSOR ((uint32_t)ADC_CHANNEL_18 | ADC_CHANNEL_DIFFERENCIATION_TEMPSENSOR_VBAT)
Kojto 112:6f327212ef96 200 #endif /* STM32F411xE || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 201 /**
Kojto 112:6f327212ef96 202 * @}
Kojto 112:6f327212ef96 203 */
Kojto 112:6f327212ef96 204
Kojto 112:6f327212ef96 205
Kojto 112:6f327212ef96 206 /**
Kojto 112:6f327212ef96 207 * @}
Kojto 112:6f327212ef96 208 */
Kojto 112:6f327212ef96 209
Kojto 112:6f327212ef96 210 /* Exported macro ------------------------------------------------------------*/
Kojto 112:6f327212ef96 211 /** @defgroup ADC_Exported_Macros ADC Exported Macros
Kojto 112:6f327212ef96 212 * @{
Kojto 112:6f327212ef96 213 */
Kojto 112:6f327212ef96 214
Kojto 112:6f327212ef96 215 /**
Kojto 112:6f327212ef96 216 * @}
Kojto 112:6f327212ef96 217 */
Kojto 112:6f327212ef96 218
Kojto 112:6f327212ef96 219 /* Exported functions --------------------------------------------------------*/
Kojto 112:6f327212ef96 220 /** @addtogroup ADCEx_Exported_Functions
Kojto 112:6f327212ef96 221 * @{
Kojto 112:6f327212ef96 222 */
Kojto 112:6f327212ef96 223
Kojto 112:6f327212ef96 224 /** @addtogroup ADCEx_Exported_Functions_Group1
Kojto 112:6f327212ef96 225 * @{
Kojto 112:6f327212ef96 226 */
Kojto 112:6f327212ef96 227
Kojto 112:6f327212ef96 228 /* I/O operation functions ******************************************************/
Kojto 112:6f327212ef96 229 HAL_StatusTypeDef HAL_ADCEx_InjectedStart(ADC_HandleTypeDef* hadc);
Kojto 112:6f327212ef96 230 HAL_StatusTypeDef HAL_ADCEx_InjectedStop(ADC_HandleTypeDef* hadc);
Kojto 112:6f327212ef96 231 HAL_StatusTypeDef HAL_ADCEx_InjectedPollForConversion(ADC_HandleTypeDef* hadc, uint32_t Timeout);
Kojto 112:6f327212ef96 232 HAL_StatusTypeDef HAL_ADCEx_InjectedStart_IT(ADC_HandleTypeDef* hadc);
Kojto 112:6f327212ef96 233 HAL_StatusTypeDef HAL_ADCEx_InjectedStop_IT(ADC_HandleTypeDef* hadc);
Kojto 112:6f327212ef96 234 uint32_t HAL_ADCEx_InjectedGetValue(ADC_HandleTypeDef* hadc, uint32_t InjectedRank);
Kojto 112:6f327212ef96 235 HAL_StatusTypeDef HAL_ADCEx_MultiModeStart_DMA(ADC_HandleTypeDef* hadc, uint32_t* pData, uint32_t Length);
Kojto 112:6f327212ef96 236 HAL_StatusTypeDef HAL_ADCEx_MultiModeStop_DMA(ADC_HandleTypeDef* hadc);
Kojto 112:6f327212ef96 237 uint32_t HAL_ADCEx_MultiModeGetValue(ADC_HandleTypeDef* hadc);
Kojto 112:6f327212ef96 238 void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef* hadc);
Kojto 112:6f327212ef96 239
Kojto 112:6f327212ef96 240 /* Peripheral Control functions *************************************************/
Kojto 112:6f327212ef96 241 HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc,ADC_InjectionConfTypeDef* sConfigInjected);
Kojto 112:6f327212ef96 242 HAL_StatusTypeDef HAL_ADCEx_MultiModeConfigChannel(ADC_HandleTypeDef* hadc, ADC_MultiModeTypeDef* multimode);
Kojto 112:6f327212ef96 243
Kojto 112:6f327212ef96 244 /**
Kojto 112:6f327212ef96 245 * @}
Kojto 112:6f327212ef96 246 */
Kojto 112:6f327212ef96 247
Kojto 112:6f327212ef96 248 /**
Kojto 112:6f327212ef96 249 * @}
Kojto 112:6f327212ef96 250 */
Kojto 112:6f327212ef96 251 /* Private types -------------------------------------------------------------*/
Kojto 112:6f327212ef96 252 /* Private variables ---------------------------------------------------------*/
Kojto 112:6f327212ef96 253 /* Private constants ---------------------------------------------------------*/
Kojto 112:6f327212ef96 254 /** @defgroup ADCEx_Private_Constants ADC Private Constants
Kojto 112:6f327212ef96 255 * @{
Kojto 112:6f327212ef96 256 */
Kojto 112:6f327212ef96 257
Kojto 112:6f327212ef96 258 /**
Kojto 112:6f327212ef96 259 * @}
Kojto 112:6f327212ef96 260 */
Kojto 112:6f327212ef96 261
Kojto 112:6f327212ef96 262 /* Private macros ------------------------------------------------------------*/
Kojto 112:6f327212ef96 263 /** @defgroup ADCEx_Private_Macros ADC Private Macros
Kojto 112:6f327212ef96 264 * @{
Kojto 112:6f327212ef96 265 */
Kojto 112:6f327212ef96 266 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || \
Kojto 112:6f327212ef96 267 defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F410Tx) || defined(STM32F410Cx) || \
Kojto 112:6f327212ef96 268 defined(STM32F410Rx) || defined(STM32F411xE) || defined(STM32F412xG)
Kojto 112:6f327212ef96 269 #define IS_ADC_CHANNEL(CHANNEL) ((CHANNEL) <= ADC_CHANNEL_18)
Kojto 112:6f327212ef96 270 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F401xC || STM32F401xE || STM32F410xx || STM32F411xE || STM32F412xG */
Kojto 112:6f327212ef96 271
Kojto 112:6f327212ef96 272 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || \
Kojto 112:6f327212ef96 273 defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx)
Kojto 112:6f327212ef96 274 #define IS_ADC_CHANNEL(CHANNEL) (((CHANNEL) <= ADC_CHANNEL_18) || \
Kojto 112:6f327212ef96 275 ((CHANNEL) == ADC_CHANNEL_TEMPSENSOR))
Kojto 112:6f327212ef96 276 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || STM32F479xx */
Kojto 112:6f327212ef96 277
Kojto 112:6f327212ef96 278 #define IS_ADC_MODE(MODE) (((MODE) == ADC_MODE_INDEPENDENT) || \
Kojto 112:6f327212ef96 279 ((MODE) == ADC_DUALMODE_REGSIMULT_INJECSIMULT) || \
Kojto 112:6f327212ef96 280 ((MODE) == ADC_DUALMODE_REGSIMULT_ALTERTRIG) || \
Kojto 112:6f327212ef96 281 ((MODE) == ADC_DUALMODE_INJECSIMULT) || \
Kojto 112:6f327212ef96 282 ((MODE) == ADC_DUALMODE_REGSIMULT) || \
Kojto 112:6f327212ef96 283 ((MODE) == ADC_DUALMODE_INTERL) || \
Kojto 112:6f327212ef96 284 ((MODE) == ADC_DUALMODE_ALTERTRIG) || \
Kojto 112:6f327212ef96 285 ((MODE) == ADC_TRIPLEMODE_REGSIMULT_INJECSIMULT) || \
Kojto 112:6f327212ef96 286 ((MODE) == ADC_TRIPLEMODE_REGSIMULT_AlterTrig) || \
Kojto 112:6f327212ef96 287 ((MODE) == ADC_TRIPLEMODE_INJECSIMULT) || \
Kojto 112:6f327212ef96 288 ((MODE) == ADC_TRIPLEMODE_REGSIMULT) || \
Kojto 112:6f327212ef96 289 ((MODE) == ADC_TRIPLEMODE_INTERL) || \
Kojto 112:6f327212ef96 290 ((MODE) == ADC_TRIPLEMODE_ALTERTRIG))
Kojto 112:6f327212ef96 291 #define IS_ADC_DMA_ACCESS_MODE(MODE) (((MODE) == ADC_DMAACCESSMODE_DISABLED) || \
Kojto 112:6f327212ef96 292 ((MODE) == ADC_DMAACCESSMODE_1) || \
Kojto 112:6f327212ef96 293 ((MODE) == ADC_DMAACCESSMODE_2) || \
Kojto 112:6f327212ef96 294 ((MODE) == ADC_DMAACCESSMODE_3))
Kojto 112:6f327212ef96 295 #define IS_ADC_EXT_INJEC_TRIG_EDGE(EDGE) (((EDGE) == ADC_EXTERNALTRIGINJECCONVEDGE_NONE) || \
Kojto 112:6f327212ef96 296 ((EDGE) == ADC_EXTERNALTRIGINJECCONVEDGE_RISING) || \
Kojto 112:6f327212ef96 297 ((EDGE) == ADC_EXTERNALTRIGINJECCONVEDGE_FALLING) || \
Kojto 112:6f327212ef96 298 ((EDGE) == ADC_EXTERNALTRIGINJECCONVEDGE_RISINGFALLING))
Kojto 112:6f327212ef96 299 #define IS_ADC_EXT_INJEC_TRIG(INJTRIG) (((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_CC4) || \
Kojto 112:6f327212ef96 300 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_TRGO) || \
Kojto 112:6f327212ef96 301 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_CC1) || \
Kojto 112:6f327212ef96 302 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_TRGO) || \
Kojto 112:6f327212ef96 303 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC2) || \
Kojto 112:6f327212ef96 304 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC4) || \
Kojto 112:6f327212ef96 305 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC1) || \
Kojto 112:6f327212ef96 306 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC2) || \
Kojto 112:6f327212ef96 307 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC3) || \
Kojto 112:6f327212ef96 308 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_TRGO) || \
Kojto 112:6f327212ef96 309 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T5_CC4) || \
Kojto 112:6f327212ef96 310 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T5_TRGO) || \
Kojto 112:6f327212ef96 311 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_CC2) || \
Kojto 112:6f327212ef96 312 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_CC3) || \
Kojto 112:6f327212ef96 313 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_CC4) || \
Kojto 112:6f327212ef96 314 ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_EXT_IT15)|| \
Kojto 112:6f327212ef96 315 ((INJTRIG) == ADC_INJECTED_SOFTWARE_START))
Kojto 112:6f327212ef96 316 #define IS_ADC_INJECTED_LENGTH(LENGTH) (((LENGTH) >= ((uint32_t)1)) && ((LENGTH) <= ((uint32_t)4)))
Kojto 112:6f327212ef96 317 #define IS_ADC_INJECTED_RANK(RANK) (((RANK) >= ((uint32_t)1)) && ((RANK) <= ((uint32_t)4)))
Kojto 112:6f327212ef96 318
Kojto 112:6f327212ef96 319 /**
Kojto 112:6f327212ef96 320 * @brief Set the selected injected Channel rank.
Kojto 112:6f327212ef96 321 * @param _CHANNELNB_: Channel number.
Kojto 112:6f327212ef96 322 * @param _RANKNB_: Rank number.
Kojto 112:6f327212ef96 323 * @param _JSQR_JL_: Sequence length.
Kojto 112:6f327212ef96 324 * @retval None
Kojto 112:6f327212ef96 325 */
Kojto 112:6f327212ef96 326 #define ADC_JSQR(_CHANNELNB_, _RANKNB_, _JSQR_JL_) (((uint32_t)((uint16_t)(_CHANNELNB_))) << (5 * (uint8_t)(((_RANKNB_) + 3) - (_JSQR_JL_))))
Kojto 112:6f327212ef96 327
Kojto 112:6f327212ef96 328 /**
Kojto 112:6f327212ef96 329 * @}
Kojto 112:6f327212ef96 330 */
Kojto 112:6f327212ef96 331
Kojto 112:6f327212ef96 332 /* Private functions ---------------------------------------------------------*/
Kojto 112:6f327212ef96 333 /** @defgroup ADCEx_Private_Functions ADC Private Functions
Kojto 112:6f327212ef96 334 * @{
Kojto 112:6f327212ef96 335 */
Kojto 112:6f327212ef96 336
Kojto 112:6f327212ef96 337 /**
Kojto 112:6f327212ef96 338 * @}
Kojto 112:6f327212ef96 339 */
Kojto 112:6f327212ef96 340
Kojto 112:6f327212ef96 341 /**
Kojto 112:6f327212ef96 342 * @}
Kojto 112:6f327212ef96 343 */
Kojto 112:6f327212ef96 344
Kojto 112:6f327212ef96 345 /**
Kojto 112:6f327212ef96 346 * @}
Kojto 112:6f327212ef96 347 */
Kojto 112:6f327212ef96 348
Kojto 112:6f327212ef96 349 #ifdef __cplusplus
Kojto 112:6f327212ef96 350 }
Kojto 112:6f327212ef96 351 #endif
Kojto 112:6f327212ef96 352
Kojto 112:6f327212ef96 353 #endif /*__STM32F4xx_ADC_EX_H */
Kojto 112:6f327212ef96 354
Kojto 112:6f327212ef96 355
Kojto 112:6f327212ef96 356 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/