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:
110:165afa46840b
.

Who changed what in which revision?

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