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