Ricardo Benitez / mbed

Fork of mbed by mbed official

Committer:
Kojto
Date:
Wed Mar 02 09:58:28 2016 +0100
Revision:
115:87f2f5183dfb
Child:
116:c0f6e94411f5
Release 115 of the mbed library

Changes:
- new targets - NUCLEO_F746ZG
- Bugfix - STM32F7 + STM32L4 - RTC init fix
- Bugfix - STM32L4 Set NVIC_RAM_VECTOR_ADDRESS to 0x10000000
- B96B_F446VE - CAN addition
- Changed target name from NZ32SC151 to NZ32_SC151

Who changed what in which revision?

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