Modified version of the mbed library for use with the Nucleo boards.

Dependents:   EEPROMWrite Full-Project

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Thu Aug 20 10:45:13 2015 +0100
Revision:
613:bc40b8d2aec4
Parent:
532:fe11edbda85c
Synchronized with git revision 92ca8c7b60a283b6bb60eb65b183dac1599f0ade

Full URL: https://github.com/mbedmicro/mbed/commit/92ca8c7b60a283b6bb60eb65b183dac1599f0ade/

Nordic: update application start address in GCC linker script

Who changed what in which revision?

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