Ricardo Benitez / mbed

Fork of mbed by mbed official

Committer:
Kojto
Date:
Wed Sep 16 15:32:31 2015 +0100
Revision:
107:4f6c30876dfa
Child:
116:c0f6e94411f5
Release 107  of the mbed library

Changes:
- new platforms - DISCO_F746NG, DISCO_L476VG, NUCLEO_L476RG
- KL43Z - bugfix RTC init function
- K20 - SPI mode fix

Who changed what in which revision?

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