mbed official / mbed

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Committer:
Kojto
Date:
Thu Oct 29 08:40:18 2015 +0000
Revision:
109:9296ab0bfc11
Child:
122:f9eeca106725
Release 109  of the mbed library

Changes:
- new platforms - NUCLEO_F042K6, WIZNWIKI_W7500ECO
- MTS targets - bootloaders update to 0.1.1
- STM F7 - RTC enable fixes
- STM F4 - i2c pending stop before start fix
- STM all targets - analogout normalization fix

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 109:9296ab0bfc11 1 /**
Kojto 109:9296ab0bfc11 2 ******************************************************************************
Kojto 109:9296ab0bfc11 3 * @file stm32f3xx_hal_sdadc.h
Kojto 109:9296ab0bfc11 4 * @author MCD Application Team
Kojto 109:9296ab0bfc11 5 * @version V1.1.0
Kojto 109:9296ab0bfc11 6 * @date 12-Sept-2014
Kojto 109:9296ab0bfc11 7 * @brief This file contains all the functions prototypes for the SDADC
Kojto 109:9296ab0bfc11 8 * firmware library.
Kojto 109:9296ab0bfc11 9 ******************************************************************************
Kojto 109:9296ab0bfc11 10 * @attention
Kojto 109:9296ab0bfc11 11 *
Kojto 109:9296ab0bfc11 12 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
Kojto 109:9296ab0bfc11 13 *
Kojto 109:9296ab0bfc11 14 * Redistribution and use in source and binary forms, with or without modification,
Kojto 109:9296ab0bfc11 15 * are permitted provided that the following conditions are met:
Kojto 109:9296ab0bfc11 16 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 109:9296ab0bfc11 17 * this list of conditions and the following disclaimer.
Kojto 109:9296ab0bfc11 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 109:9296ab0bfc11 19 * this list of conditions and the following disclaimer in the documentation
Kojto 109:9296ab0bfc11 20 * and/or other materials provided with the distribution.
Kojto 109:9296ab0bfc11 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 109:9296ab0bfc11 22 * may be used to endorse or promote products derived from this software
Kojto 109:9296ab0bfc11 23 * without specific prior written permission.
Kojto 109:9296ab0bfc11 24 *
Kojto 109:9296ab0bfc11 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 109:9296ab0bfc11 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 109:9296ab0bfc11 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 109:9296ab0bfc11 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 109:9296ab0bfc11 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 109:9296ab0bfc11 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 109:9296ab0bfc11 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 109:9296ab0bfc11 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 109:9296ab0bfc11 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 109:9296ab0bfc11 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 109:9296ab0bfc11 35 *
Kojto 109:9296ab0bfc11 36 ******************************************************************************
Kojto 109:9296ab0bfc11 37 */
Kojto 109:9296ab0bfc11 38
Kojto 109:9296ab0bfc11 39 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 109:9296ab0bfc11 40 #ifndef __STM32F3xx_SDADC_H
Kojto 109:9296ab0bfc11 41 #define __STM32F3xx_SDADC_H
Kojto 109:9296ab0bfc11 42
Kojto 109:9296ab0bfc11 43 #ifdef __cplusplus
Kojto 109:9296ab0bfc11 44 extern "C" {
Kojto 109:9296ab0bfc11 45 #endif
Kojto 109:9296ab0bfc11 46
Kojto 109:9296ab0bfc11 47 #if defined(STM32F373xC) || defined(STM32F378xx)
Kojto 109:9296ab0bfc11 48
Kojto 109:9296ab0bfc11 49 /* Includes ------------------------------------------------------------------*/
Kojto 109:9296ab0bfc11 50 #include "stm32f3xx_hal_def.h"
Kojto 109:9296ab0bfc11 51
Kojto 109:9296ab0bfc11 52 /** @addtogroup STM32F3xx_HAL_Driver
Kojto 109:9296ab0bfc11 53 * @{
Kojto 109:9296ab0bfc11 54 */
Kojto 109:9296ab0bfc11 55
Kojto 109:9296ab0bfc11 56 /** @addtogroup SDADC
Kojto 109:9296ab0bfc11 57 * @{
Kojto 109:9296ab0bfc11 58 */
Kojto 109:9296ab0bfc11 59
Kojto 109:9296ab0bfc11 60 /* Exported types ------------------------------------------------------------*/
Kojto 109:9296ab0bfc11 61 /** @defgroup SDADC_Exported_Types SDADC Exported Types
Kojto 109:9296ab0bfc11 62 * @{
Kojto 109:9296ab0bfc11 63 */
Kojto 109:9296ab0bfc11 64
Kojto 109:9296ab0bfc11 65
Kojto 109:9296ab0bfc11 66 /**
Kojto 109:9296ab0bfc11 67 * @brief HAL SDADC States definition
Kojto 109:9296ab0bfc11 68 */
Kojto 109:9296ab0bfc11 69 typedef enum
Kojto 109:9296ab0bfc11 70 {
Kojto 109:9296ab0bfc11 71 HAL_SDADC_STATE_RESET = 0x00, /*!< SDADC not initialized */
Kojto 109:9296ab0bfc11 72 HAL_SDADC_STATE_READY = 0x01, /*!< SDADC initialized and ready for use */
Kojto 109:9296ab0bfc11 73 HAL_SDADC_STATE_CALIB = 0x02, /*!< SDADC calibration in progress */
Kojto 109:9296ab0bfc11 74 HAL_SDADC_STATE_REG = 0x03, /*!< SDADC regular conversion in progress */
Kojto 109:9296ab0bfc11 75 HAL_SDADC_STATE_INJ = 0x04, /*!< SDADC injected conversion in progress */
Kojto 109:9296ab0bfc11 76 HAL_SDADC_STATE_REG_INJ = 0x05, /*!< SDADC regular and injected conversions in progress */
Kojto 109:9296ab0bfc11 77 HAL_SDADC_STATE_ERROR = 0xFF, /*!< SDADC state error */
Kojto 109:9296ab0bfc11 78 }HAL_SDADC_StateTypeDef;
Kojto 109:9296ab0bfc11 79
Kojto 109:9296ab0bfc11 80 /**
Kojto 109:9296ab0bfc11 81 * @brief SDADC Init Structure definition
Kojto 109:9296ab0bfc11 82 */
Kojto 109:9296ab0bfc11 83 typedef struct
Kojto 109:9296ab0bfc11 84 {
Kojto 109:9296ab0bfc11 85 uint32_t IdleLowPowerMode; /*!< Specifies if SDADC can enter in power down or standby when idle.
Kojto 109:9296ab0bfc11 86 This parameter can be a value of @ref SDADC_Idle_Low_Power_Mode */
Kojto 109:9296ab0bfc11 87 uint32_t FastConversionMode; /*!< Specifies if Fast conversion mode is enabled or not.
Kojto 109:9296ab0bfc11 88 This parameter can be a value of @ref SDADC_Fast_Conv_Mode */
Kojto 109:9296ab0bfc11 89 uint32_t SlowClockMode; /*!< Specifies if slow clock mode is enabled or not.
Kojto 109:9296ab0bfc11 90 This parameter can be a value of @ref SDADC_Slow_Clock_Mode */
Kojto 109:9296ab0bfc11 91 uint32_t ReferenceVoltage; /*!< Specifies the reference voltage.
Kojto 109:9296ab0bfc11 92 This parameter can be a value of @ref SDADC_Reference_Voltage */
Kojto 109:9296ab0bfc11 93 }SDADC_InitTypeDef;
Kojto 109:9296ab0bfc11 94
Kojto 109:9296ab0bfc11 95 /**
Kojto 109:9296ab0bfc11 96 * @brief SDADC handle Structure definition
Kojto 109:9296ab0bfc11 97 */
Kojto 109:9296ab0bfc11 98 typedef struct
Kojto 109:9296ab0bfc11 99 {
Kojto 109:9296ab0bfc11 100 SDADC_TypeDef *Instance; /*!< SDADC registers base address */
Kojto 109:9296ab0bfc11 101 SDADC_InitTypeDef Init; /*!< SDADC init parameters */
Kojto 109:9296ab0bfc11 102 DMA_HandleTypeDef *hdma; /*!< SDADC DMA Handle parameters */
Kojto 109:9296ab0bfc11 103 uint32_t RegularContMode; /*!< Regular conversion continuous mode */
Kojto 109:9296ab0bfc11 104 uint32_t InjectedContMode; /*!< Injected conversion continuous mode */
Kojto 109:9296ab0bfc11 105 uint32_t InjectedChannelsNbr; /*!< Number of channels in injected sequence */
Kojto 109:9296ab0bfc11 106 uint32_t InjConvRemaining; /*!< Injected conversion remaining */
Kojto 109:9296ab0bfc11 107 uint32_t RegularTrigger; /*!< Current trigger used for regular conversion */
Kojto 109:9296ab0bfc11 108 uint32_t InjectedTrigger; /*!< Current trigger used for injected conversion */
Kojto 109:9296ab0bfc11 109 uint32_t ExtTriggerEdge; /*!< Rising, falling or both edges selected */
Kojto 109:9296ab0bfc11 110 uint32_t RegularMultimode; /*!< current type of regular multimode */
Kojto 109:9296ab0bfc11 111 uint32_t InjectedMultimode; /*!< Current type of injected multimode */
Kojto 109:9296ab0bfc11 112 HAL_SDADC_StateTypeDef State; /*!< SDADC state */
Kojto 109:9296ab0bfc11 113 uint32_t ErrorCode; /*!< SDADC Error code */
Kojto 109:9296ab0bfc11 114 }SDADC_HandleTypeDef;
Kojto 109:9296ab0bfc11 115
Kojto 109:9296ab0bfc11 116 /**
Kojto 109:9296ab0bfc11 117 * @brief SDADC Configuration Register Parameter Structure
Kojto 109:9296ab0bfc11 118 */
Kojto 109:9296ab0bfc11 119 typedef struct
Kojto 109:9296ab0bfc11 120 {
Kojto 109:9296ab0bfc11 121 uint32_t InputMode; /*!< Specifies the input mode (single ended, differential...)
Kojto 109:9296ab0bfc11 122 This parameter can be any value of @ref SDADC_InputMode */
Kojto 109:9296ab0bfc11 123 uint32_t Gain; /*!< Specifies the gain setting.
Kojto 109:9296ab0bfc11 124 This parameter can be any value of @ref SDADC_Gain */
Kojto 109:9296ab0bfc11 125 uint32_t CommonMode; /*!< Specifies the common mode setting (VSSA, VDDA, VDDA/2).
Kojto 109:9296ab0bfc11 126 This parameter can be any value of @ref SDADC_CommonMode */
Kojto 109:9296ab0bfc11 127 uint32_t Offset; /*!< Specifies the 12-bit offset value.
Kojto 109:9296ab0bfc11 128 This parameter can be any value lower or equal to 0x00000FFF */
Kojto 109:9296ab0bfc11 129 }SDADC_ConfParamTypeDef;
Kojto 109:9296ab0bfc11 130
Kojto 109:9296ab0bfc11 131 /**
Kojto 109:9296ab0bfc11 132 * @}
Kojto 109:9296ab0bfc11 133 */
Kojto 109:9296ab0bfc11 134
Kojto 109:9296ab0bfc11 135 /* Exported constants --------------------------------------------------------*/
Kojto 109:9296ab0bfc11 136
Kojto 109:9296ab0bfc11 137 /** @defgroup SDADC_Exported_Constants SDADC Exported Constants
Kojto 109:9296ab0bfc11 138 * @{
Kojto 109:9296ab0bfc11 139 */
Kojto 109:9296ab0bfc11 140
Kojto 109:9296ab0bfc11 141 /** @defgroup SDADC_Idle_Low_Power_Mode SDADC Idle Low Power Mode
Kojto 109:9296ab0bfc11 142 * @{
Kojto 109:9296ab0bfc11 143 */
Kojto 109:9296ab0bfc11 144 #define SDADC_LOWPOWER_NONE ((uint32_t)0x00000000)
Kojto 109:9296ab0bfc11 145 #define SDADC_LOWPOWER_POWERDOWN SDADC_CR1_PDI
Kojto 109:9296ab0bfc11 146 #define SDADC_LOWPOWER_STANDBY SDADC_CR1_SBI
Kojto 109:9296ab0bfc11 147 #define IS_SDADC_LOWPOWER_MODE(LOWPOWER) (((LOWPOWER) == SDADC_LOWPOWER_NONE) || \
Kojto 109:9296ab0bfc11 148 ((LOWPOWER) == SDADC_LOWPOWER_POWERDOWN) || \
Kojto 109:9296ab0bfc11 149 ((LOWPOWER) == SDADC_LOWPOWER_STANDBY))
Kojto 109:9296ab0bfc11 150 /**
Kojto 109:9296ab0bfc11 151 * @}
Kojto 109:9296ab0bfc11 152 */
Kojto 109:9296ab0bfc11 153
Kojto 109:9296ab0bfc11 154 /** @defgroup SDADC_Fast_Conv_Mode SDADC Fast Conversion Mode
Kojto 109:9296ab0bfc11 155 * @{
Kojto 109:9296ab0bfc11 156 */
Kojto 109:9296ab0bfc11 157 #define SDADC_FAST_CONV_DISABLE ((uint32_t)0x00000000)
Kojto 109:9296ab0bfc11 158 #define SDADC_FAST_CONV_ENABLE SDADC_CR2_FAST
Kojto 109:9296ab0bfc11 159 #define IS_SDADC_FAST_CONV_MODE(FAST) (((FAST) == SDADC_FAST_CONV_DISABLE) || \
Kojto 109:9296ab0bfc11 160 ((FAST) == SDADC_FAST_CONV_ENABLE))
Kojto 109:9296ab0bfc11 161 /**
Kojto 109:9296ab0bfc11 162 * @}
Kojto 109:9296ab0bfc11 163 */
Kojto 109:9296ab0bfc11 164
Kojto 109:9296ab0bfc11 165 /** @defgroup SDADC_Slow_Clock_Mode SDADC Slow Clock Mode
Kojto 109:9296ab0bfc11 166 * @{
Kojto 109:9296ab0bfc11 167 */
Kojto 109:9296ab0bfc11 168 #define SDADC_SLOW_CLOCK_DISABLE ((uint32_t)0x00000000)
Kojto 109:9296ab0bfc11 169 #define SDADC_SLOW_CLOCK_ENABLE SDADC_CR1_SLOWCK
Kojto 109:9296ab0bfc11 170 #define IS_SDADC_SLOW_CLOCK_MODE(MODE) (((MODE) == SDADC_SLOW_CLOCK_DISABLE) || \
Kojto 109:9296ab0bfc11 171 ((MODE) == SDADC_SLOW_CLOCK_ENABLE))
Kojto 109:9296ab0bfc11 172 /**
Kojto 109:9296ab0bfc11 173 * @}
Kojto 109:9296ab0bfc11 174 */
Kojto 109:9296ab0bfc11 175
Kojto 109:9296ab0bfc11 176 /** @defgroup SDADC_Reference_Voltage SDADC Reference Voltage
Kojto 109:9296ab0bfc11 177 * @{
Kojto 109:9296ab0bfc11 178 */
Kojto 109:9296ab0bfc11 179 #define SDADC_VREF_EXT ((uint32_t)0x00000000) /*!< The reference voltage is forced externally using VREF pin */
Kojto 109:9296ab0bfc11 180 #define SDADC_VREF_VREFINT1 SDADC_CR1_REFV_0 /*!< The reference voltage is forced internally to 1.22V VREFINT */
Kojto 109:9296ab0bfc11 181 #define SDADC_VREF_VREFINT2 SDADC_CR1_REFV_1 /*!< The reference voltage is forced internally to 1.8V VREFINT */
Kojto 109:9296ab0bfc11 182 #define SDADC_VREF_VDDA SDADC_CR1_REFV /*!< The reference voltage is forced internally to VDDA */
Kojto 109:9296ab0bfc11 183 #define IS_SDADC_VREF(VREF) (((VREF) == SDADC_VREF_EXT) || \
Kojto 109:9296ab0bfc11 184 ((VREF) == SDADC_VREF_VREFINT1) || \
Kojto 109:9296ab0bfc11 185 ((VREF) == SDADC_VREF_VREFINT2) || \
Kojto 109:9296ab0bfc11 186 ((VREF) == SDADC_VREF_VDDA))
Kojto 109:9296ab0bfc11 187 /**
Kojto 109:9296ab0bfc11 188 * @}
Kojto 109:9296ab0bfc11 189 */
Kojto 109:9296ab0bfc11 190
Kojto 109:9296ab0bfc11 191 /** @defgroup SDADC_ConfIndex SDADC Configuration Index
Kojto 109:9296ab0bfc11 192 * @{
Kojto 109:9296ab0bfc11 193 */
Kojto 109:9296ab0bfc11 194
Kojto 109:9296ab0bfc11 195 #define SDADC_CONF_INDEX_0 ((uint32_t)0x00000000) /*!< Configuration 0 Register selected */
Kojto 109:9296ab0bfc11 196 #define SDADC_CONF_INDEX_1 ((uint32_t)0x00000001) /*!< Configuration 1 Register selected */
Kojto 109:9296ab0bfc11 197 #define SDADC_CONF_INDEX_2 ((uint32_t)0x00000002) /*!< Configuration 2 Register selected */
Kojto 109:9296ab0bfc11 198
Kojto 109:9296ab0bfc11 199 #define IS_SDADC_CONF_INDEX(CONF) (((CONF) == SDADC_CONF_INDEX_0) || \
Kojto 109:9296ab0bfc11 200 ((CONF) == SDADC_CONF_INDEX_1) || \
Kojto 109:9296ab0bfc11 201 ((CONF) == SDADC_CONF_INDEX_2))
Kojto 109:9296ab0bfc11 202 /**
Kojto 109:9296ab0bfc11 203 * @}
Kojto 109:9296ab0bfc11 204 */
Kojto 109:9296ab0bfc11 205
Kojto 109:9296ab0bfc11 206 /** @defgroup SDADC_InputMode SDADC Input Mode
Kojto 109:9296ab0bfc11 207 * @{
Kojto 109:9296ab0bfc11 208 */
Kojto 109:9296ab0bfc11 209 #define SDADC_INPUT_MODE_DIFF ((uint32_t)0x00000000) /*!< Conversions are executed in differential mode */
Kojto 109:9296ab0bfc11 210 #define SDADC_INPUT_MODE_SE_OFFSET SDADC_CONF0R_SE0_0 /*!< Conversions are executed in single ended offset mode */
Kojto 109:9296ab0bfc11 211 #define SDADC_INPUT_MODE_SE_ZERO_REFERENCE SDADC_CONF0R_SE0 /*!< Conversions are executed in single ended zero-volt reference mode */
Kojto 109:9296ab0bfc11 212
Kojto 109:9296ab0bfc11 213 #define IS_SDADC_INPUT_MODE(MODE) (((MODE) == SDADC_INPUT_MODE_DIFF) || \
Kojto 109:9296ab0bfc11 214 ((MODE) == SDADC_INPUT_MODE_SE_OFFSET) || \
Kojto 109:9296ab0bfc11 215 ((MODE) == SDADC_INPUT_MODE_SE_ZERO_REFERENCE))
Kojto 109:9296ab0bfc11 216 /**
Kojto 109:9296ab0bfc11 217 * @}
Kojto 109:9296ab0bfc11 218 */
Kojto 109:9296ab0bfc11 219
Kojto 109:9296ab0bfc11 220 /** @defgroup SDADC_Gain SDADC Gain
Kojto 109:9296ab0bfc11 221 * @{
Kojto 109:9296ab0bfc11 222 */
Kojto 109:9296ab0bfc11 223 #define SDADC_GAIN_1 ((uint32_t)0x00000000) /*!< Gain equal to 1 */
Kojto 109:9296ab0bfc11 224 #define SDADC_GAIN_2 SDADC_CONF0R_GAIN0_0 /*!< Gain equal to 2 */
Kojto 109:9296ab0bfc11 225 #define SDADC_GAIN_4 SDADC_CONF0R_GAIN0_1 /*!< Gain equal to 4 */
Kojto 109:9296ab0bfc11 226 #define SDADC_GAIN_8 ((uint32_t)0x00300000) /*!< Gain equal to 8 */
Kojto 109:9296ab0bfc11 227 #define SDADC_GAIN_16 SDADC_CONF0R_GAIN0_2 /*!< Gain equal to 16 */
Kojto 109:9296ab0bfc11 228 #define SDADC_GAIN_32 ((uint32_t)0x00500000) /*!< Gain equal to 32 */
Kojto 109:9296ab0bfc11 229 #define SDADC_GAIN_1_2 SDADC_CONF0R_GAIN0 /*!< Gain equal to 1/2 */
Kojto 109:9296ab0bfc11 230 #define IS_SDADC_GAIN(GAIN) (((GAIN) == SDADC_GAIN_1) || \
Kojto 109:9296ab0bfc11 231 ((GAIN) == SDADC_GAIN_2) || \
Kojto 109:9296ab0bfc11 232 ((GAIN) == SDADC_GAIN_4) || \
Kojto 109:9296ab0bfc11 233 ((GAIN) == SDADC_GAIN_8) || \
Kojto 109:9296ab0bfc11 234 ((GAIN) == SDADC_GAIN_16) || \
Kojto 109:9296ab0bfc11 235 ((GAIN) == SDADC_GAIN_32) || \
Kojto 109:9296ab0bfc11 236 ((GAIN) == SDADC_GAIN_1_2))
Kojto 109:9296ab0bfc11 237 /**
Kojto 109:9296ab0bfc11 238 * @}
Kojto 109:9296ab0bfc11 239 */
Kojto 109:9296ab0bfc11 240
Kojto 109:9296ab0bfc11 241 /** @defgroup SDADC_CommonMode SDADC Common Mode
Kojto 109:9296ab0bfc11 242 * @{
Kojto 109:9296ab0bfc11 243 */
Kojto 109:9296ab0bfc11 244 #define SDADC_COMMON_MODE_VSSA ((uint32_t)0x00000000) /*!< Select SDADC VSSA as common mode */
Kojto 109:9296ab0bfc11 245 #define SDADC_COMMON_MODE_VDDA_2 SDADC_CONF0R_COMMON0_0 /*!< Select SDADC VDDA/2 as common mode */
Kojto 109:9296ab0bfc11 246 #define SDADC_COMMON_MODE_VDDA SDADC_CONF0R_COMMON0_1 /*!< Select SDADC VDDA as common mode */
Kojto 109:9296ab0bfc11 247 #define IS_SDADC_COMMON_MODE(MODE) (((MODE) == SDADC_COMMON_MODE_VSSA) || \
Kojto 109:9296ab0bfc11 248 ((MODE) == SDADC_COMMON_MODE_VDDA_2) || \
Kojto 109:9296ab0bfc11 249 ((MODE) == SDADC_COMMON_MODE_VDDA))
Kojto 109:9296ab0bfc11 250 /**
Kojto 109:9296ab0bfc11 251 * @}
Kojto 109:9296ab0bfc11 252 */
Kojto 109:9296ab0bfc11 253
Kojto 109:9296ab0bfc11 254 /** @defgroup SDADC_Offset SDADC Offset
Kojto 109:9296ab0bfc11 255 * @{
Kojto 109:9296ab0bfc11 256 */
Kojto 109:9296ab0bfc11 257 #define IS_SDADC_OFFSET_VALUE(VALUE) ((VALUE) <= 0x00000FFF)
Kojto 109:9296ab0bfc11 258 /**
Kojto 109:9296ab0bfc11 259 * @}
Kojto 109:9296ab0bfc11 260 */
Kojto 109:9296ab0bfc11 261
Kojto 109:9296ab0bfc11 262 /** @defgroup SDADC_Channel_Selection SDADC Channel Selection
Kojto 109:9296ab0bfc11 263 * @{
Kojto 109:9296ab0bfc11 264 */
Kojto 109:9296ab0bfc11 265
Kojto 109:9296ab0bfc11 266 /* SDADC Channels ------------------------------------------------------------*/
Kojto 109:9296ab0bfc11 267 /* The SDADC channels are defined as follows:
Kojto 109:9296ab0bfc11 268 - in 16-bit LSB the channel mask is set
Kojto 109:9296ab0bfc11 269 - in 16-bit MSB the channel number is set
Kojto 109:9296ab0bfc11 270 e.g. for channel 5 definition:
Kojto 109:9296ab0bfc11 271 - the channel mask is 0x00000020 (bit 5 is set)
Kojto 109:9296ab0bfc11 272 - the channel number 5 is 0x00050000
Kojto 109:9296ab0bfc11 273 --> Consequently, channel 5 definition is 0x00000020 | 0x00050000 = 0x00050020 */
Kojto 109:9296ab0bfc11 274 #define SDADC_CHANNEL_0 ((uint32_t)0x00000001)
Kojto 109:9296ab0bfc11 275 #define SDADC_CHANNEL_1 ((uint32_t)0x00010002)
Kojto 109:9296ab0bfc11 276 #define SDADC_CHANNEL_2 ((uint32_t)0x00020004)
Kojto 109:9296ab0bfc11 277 #define SDADC_CHANNEL_3 ((uint32_t)0x00030008)
Kojto 109:9296ab0bfc11 278 #define SDADC_CHANNEL_4 ((uint32_t)0x00040010)
Kojto 109:9296ab0bfc11 279 #define SDADC_CHANNEL_5 ((uint32_t)0x00050020)
Kojto 109:9296ab0bfc11 280 #define SDADC_CHANNEL_6 ((uint32_t)0x00060040)
Kojto 109:9296ab0bfc11 281 #define SDADC_CHANNEL_7 ((uint32_t)0x00070080)
Kojto 109:9296ab0bfc11 282 #define SDADC_CHANNEL_8 ((uint32_t)0x00080100)
Kojto 109:9296ab0bfc11 283
Kojto 109:9296ab0bfc11 284 /* Just one channel of the 9 channels can be selected for regular conversion */
Kojto 109:9296ab0bfc11 285 #define IS_SDADC_REGULAR_CHANNEL(CHANNEL) (((CHANNEL) == SDADC_CHANNEL_0) || \
Kojto 109:9296ab0bfc11 286 ((CHANNEL) == SDADC_CHANNEL_1) || \
Kojto 109:9296ab0bfc11 287 ((CHANNEL) == SDADC_CHANNEL_2) || \
Kojto 109:9296ab0bfc11 288 ((CHANNEL) == SDADC_CHANNEL_3) || \
Kojto 109:9296ab0bfc11 289 ((CHANNEL) == SDADC_CHANNEL_4) || \
Kojto 109:9296ab0bfc11 290 ((CHANNEL) == SDADC_CHANNEL_5) || \
Kojto 109:9296ab0bfc11 291 ((CHANNEL) == SDADC_CHANNEL_6) || \
Kojto 109:9296ab0bfc11 292 ((CHANNEL) == SDADC_CHANNEL_7) || \
Kojto 109:9296ab0bfc11 293 ((CHANNEL) == SDADC_CHANNEL_8))
Kojto 109:9296ab0bfc11 294
Kojto 109:9296ab0bfc11 295 /* Any or all of the 9 channels can be selected for injected conversion */
Kojto 109:9296ab0bfc11 296 #define IS_SDADC_INJECTED_CHANNEL(CHANNEL) (((CHANNEL) != 0) && ((CHANNEL) <= 0x000F01FF))
Kojto 109:9296ab0bfc11 297
Kojto 109:9296ab0bfc11 298 /**
Kojto 109:9296ab0bfc11 299 * @}
Kojto 109:9296ab0bfc11 300 */
Kojto 109:9296ab0bfc11 301
Kojto 109:9296ab0bfc11 302 /** @defgroup SDADC_CalibrationSequence SDADC Calibration Sequence
Kojto 109:9296ab0bfc11 303 * @{
Kojto 109:9296ab0bfc11 304 */
Kojto 109:9296ab0bfc11 305 #define SDADC_CALIBRATION_SEQ_1 ((uint32_t)0x00000000) /*!< One calibration sequence to calculate offset of conf0 (OFFSET0[11:0]) */
Kojto 109:9296ab0bfc11 306 #define SDADC_CALIBRATION_SEQ_2 SDADC_CR2_CALIBCNT_0 /*!< Two calibration sequences to calculate offset of conf0 and conf1 (OFFSET0[11:0] and OFFSET1[11:0]) */
Kojto 109:9296ab0bfc11 307 #define SDADC_CALIBRATION_SEQ_3 SDADC_CR2_CALIBCNT_1 /*!< Three calibration sequences to calculate offset of conf0, conf1 and conf2 (OFFSET0[11:0], OFFSET1[11:0], and OFFSET2[11:0]) */
Kojto 109:9296ab0bfc11 308
Kojto 109:9296ab0bfc11 309 #define IS_SDADC_CALIB_SEQUENCE(SEQUENCE) (((SEQUENCE) == SDADC_CALIBRATION_SEQ_1) || \
Kojto 109:9296ab0bfc11 310 ((SEQUENCE) == SDADC_CALIBRATION_SEQ_2) || \
Kojto 109:9296ab0bfc11 311 ((SEQUENCE) == SDADC_CALIBRATION_SEQ_3))
Kojto 109:9296ab0bfc11 312 /**
Kojto 109:9296ab0bfc11 313 * @}
Kojto 109:9296ab0bfc11 314 */
Kojto 109:9296ab0bfc11 315
Kojto 109:9296ab0bfc11 316 /** @defgroup SDADC_ContinuousMode SDADC Continuous Mode
Kojto 109:9296ab0bfc11 317 * @{
Kojto 109:9296ab0bfc11 318 */
Kojto 109:9296ab0bfc11 319 #define SDADC_CONTINUOUS_CONV_OFF ((uint32_t)0x00000000) /*!< Conversion are not continuous */
Kojto 109:9296ab0bfc11 320 #define SDADC_CONTINUOUS_CONV_ON ((uint32_t)0x00000001) /*!< Conversion are continuous */
Kojto 109:9296ab0bfc11 321
Kojto 109:9296ab0bfc11 322 #define IS_SDADC_CONTINUOUS_MODE(MODE) (((MODE) == SDADC_CONTINUOUS_CONV_OFF) || \
Kojto 109:9296ab0bfc11 323 ((MODE) == SDADC_CONTINUOUS_CONV_ON))
Kojto 109:9296ab0bfc11 324 /**
Kojto 109:9296ab0bfc11 325 * @}
Kojto 109:9296ab0bfc11 326 */
Kojto 109:9296ab0bfc11 327
Kojto 109:9296ab0bfc11 328 /** @defgroup SDADC_Trigger SDADC Trigger
Kojto 109:9296ab0bfc11 329 * @{
Kojto 109:9296ab0bfc11 330 */
Kojto 109:9296ab0bfc11 331 #define SDADC_SOFTWARE_TRIGGER ((uint32_t)0x00000000) /*!< Software trigger */
Kojto 109:9296ab0bfc11 332 #define SDADC_SYNCHRONOUS_TRIGGER ((uint32_t)0x00000001) /*!< Synchronous with SDADC1 (only for SDADC2 and SDADC3) */
Kojto 109:9296ab0bfc11 333 #define SDADC_EXTERNAL_TRIGGER ((uint32_t)0x00000002) /*!< External trigger */
Kojto 109:9296ab0bfc11 334
Kojto 109:9296ab0bfc11 335 #define IS_SDADC_REGULAR_TRIGGER(TRIGGER) (((TRIGGER) == SDADC_SOFTWARE_TRIGGER) || \
Kojto 109:9296ab0bfc11 336 ((TRIGGER) == SDADC_SYNCHRONOUS_TRIGGER))
Kojto 109:9296ab0bfc11 337
Kojto 109:9296ab0bfc11 338 #define IS_SDADC_INJECTED_TRIGGER(TRIGGER) (((TRIGGER) == SDADC_SOFTWARE_TRIGGER) || \
Kojto 109:9296ab0bfc11 339 ((TRIGGER) == SDADC_SYNCHRONOUS_TRIGGER) || \
Kojto 109:9296ab0bfc11 340 ((TRIGGER) == SDADC_EXTERNAL_TRIGGER))
Kojto 109:9296ab0bfc11 341 /**
Kojto 109:9296ab0bfc11 342 * @}
Kojto 109:9296ab0bfc11 343 */
Kojto 109:9296ab0bfc11 344
Kojto 109:9296ab0bfc11 345 /** @defgroup SDADC_InjectedExtTrigger SDADC Injected External Trigger
Kojto 109:9296ab0bfc11 346 * @{
Kojto 109:9296ab0bfc11 347 */
Kojto 109:9296ab0bfc11 348 #define SDADC_EXT_TRIG_TIM13_CC1 ((uint32_t)0x00000000) /*!< Trigger source for SDADC1 */
Kojto 109:9296ab0bfc11 349 #define SDADC_EXT_TRIG_TIM14_CC1 ((uint32_t)0x00000100) /*!< Trigger source for SDADC1 */
Kojto 109:9296ab0bfc11 350 #define SDADC_EXT_TRIG_TIM16_CC1 ((uint32_t)0x00000000) /*!< Trigger source for SDADC3 */
Kojto 109:9296ab0bfc11 351 #define SDADC_EXT_TRIG_TIM17_CC1 ((uint32_t)0x00000000) /*!< Trigger source for SDADC2 */
Kojto 109:9296ab0bfc11 352 #define SDADC_EXT_TRIG_TIM12_CC1 ((uint32_t)0x00000100) /*!< Trigger source for SDADC2 */
Kojto 109:9296ab0bfc11 353 #define SDADC_EXT_TRIG_TIM12_CC2 ((uint32_t)0x00000100) /*!< Trigger source for SDADC3 */
Kojto 109:9296ab0bfc11 354 #define SDADC_EXT_TRIG_TIM15_CC2 ((uint32_t)0x00000200) /*!< Trigger source for SDADC1 */
Kojto 109:9296ab0bfc11 355 #define SDADC_EXT_TRIG_TIM2_CC3 ((uint32_t)0x00000200) /*!< Trigger source for SDADC2 */
Kojto 109:9296ab0bfc11 356 #define SDADC_EXT_TRIG_TIM2_CC4 ((uint32_t)0x00000200) /*!< Trigger source for SDADC3 */
Kojto 109:9296ab0bfc11 357 #define SDADC_EXT_TRIG_TIM3_CC1 ((uint32_t)0x00000300) /*!< Trigger source for SDADC1 */
Kojto 109:9296ab0bfc11 358 #define SDADC_EXT_TRIG_TIM3_CC2 ((uint32_t)0x00000300) /*!< Trigger source for SDADC2 */
Kojto 109:9296ab0bfc11 359 #define SDADC_EXT_TRIG_TIM3_CC3 ((uint32_t)0x00000300) /*!< Trigger source for SDADC3 */
Kojto 109:9296ab0bfc11 360 #define SDADC_EXT_TRIG_TIM4_CC1 ((uint32_t)0x00000400) /*!< Trigger source for SDADC1 */
Kojto 109:9296ab0bfc11 361 #define SDADC_EXT_TRIG_TIM4_CC2 ((uint32_t)0x00000400) /*!< Trigger source for SDADC2 */
Kojto 109:9296ab0bfc11 362 #define SDADC_EXT_TRIG_TIM4_CC3 ((uint32_t)0x00000400) /*!< Trigger source for SDADC3 */
Kojto 109:9296ab0bfc11 363 #define SDADC_EXT_TRIG_TIM19_CC2 ((uint32_t)0x00000500) /*!< Trigger source for SDADC1 */
Kojto 109:9296ab0bfc11 364 #define SDADC_EXT_TRIG_TIM19_CC3 ((uint32_t)0x00000500) /*!< Trigger source for SDADC2 */
Kojto 109:9296ab0bfc11 365 #define SDADC_EXT_TRIG_TIM19_CC4 ((uint32_t)0x00000500) /*!< Trigger source for SDADC3 */
Kojto 109:9296ab0bfc11 366 #define SDADC_EXT_TRIG_EXTI11 ((uint32_t)0x00000700) /*!< Trigger source for SDADC1, SDADC2 and SDADC3 */
Kojto 109:9296ab0bfc11 367 #define SDADC_EXT_TRIG_EXTI15 ((uint32_t)0x00000600) /*!< Trigger source for SDADC1, SDADC2 and SDADC3 */
Kojto 109:9296ab0bfc11 368
Kojto 109:9296ab0bfc11 369 #define IS_SDADC_EXT_INJEC_TRIG(INJTRIG) (((INJTRIG) == SDADC_EXT_TRIG_TIM13_CC1) || \
Kojto 109:9296ab0bfc11 370 ((INJTRIG) == SDADC_EXT_TRIG_TIM14_CC1) || \
Kojto 109:9296ab0bfc11 371 ((INJTRIG) == SDADC_EXT_TRIG_TIM16_CC1) || \
Kojto 109:9296ab0bfc11 372 ((INJTRIG) == SDADC_EXT_TRIG_TIM17_CC1) || \
Kojto 109:9296ab0bfc11 373 ((INJTRIG) == SDADC_EXT_TRIG_TIM12_CC1) || \
Kojto 109:9296ab0bfc11 374 ((INJTRIG) == SDADC_EXT_TRIG_TIM12_CC2) || \
Kojto 109:9296ab0bfc11 375 ((INJTRIG) == SDADC_EXT_TRIG_TIM15_CC2) || \
Kojto 109:9296ab0bfc11 376 ((INJTRIG) == SDADC_EXT_TRIG_TIM2_CC3) || \
Kojto 109:9296ab0bfc11 377 ((INJTRIG) == SDADC_EXT_TRIG_TIM2_CC4) || \
Kojto 109:9296ab0bfc11 378 ((INJTRIG) == SDADC_EXT_TRIG_TIM3_CC1) || \
Kojto 109:9296ab0bfc11 379 ((INJTRIG) == SDADC_EXT_TRIG_TIM3_CC2) || \
Kojto 109:9296ab0bfc11 380 ((INJTRIG) == SDADC_EXT_TRIG_TIM3_CC3) || \
Kojto 109:9296ab0bfc11 381 ((INJTRIG) == SDADC_EXT_TRIG_TIM4_CC1) || \
Kojto 109:9296ab0bfc11 382 ((INJTRIG) == SDADC_EXT_TRIG_TIM4_CC2) || \
Kojto 109:9296ab0bfc11 383 ((INJTRIG) == SDADC_EXT_TRIG_TIM4_CC3) || \
Kojto 109:9296ab0bfc11 384 ((INJTRIG) == SDADC_EXT_TRIG_TIM19_CC2) || \
Kojto 109:9296ab0bfc11 385 ((INJTRIG) == SDADC_EXT_TRIG_TIM19_CC3) || \
Kojto 109:9296ab0bfc11 386 ((INJTRIG) == SDADC_EXT_TRIG_TIM19_CC4) || \
Kojto 109:9296ab0bfc11 387 ((INJTRIG) == SDADC_EXT_TRIG_EXTI11) || \
Kojto 109:9296ab0bfc11 388 ((INJTRIG) == SDADC_EXT_TRIG_EXTI15))
Kojto 109:9296ab0bfc11 389 /**
Kojto 109:9296ab0bfc11 390 * @}
Kojto 109:9296ab0bfc11 391 */
Kojto 109:9296ab0bfc11 392
Kojto 109:9296ab0bfc11 393 /** @defgroup SDADC_ExtTriggerEdge SDADC External Trigger Edge
Kojto 109:9296ab0bfc11 394 * @{
Kojto 109:9296ab0bfc11 395 */
Kojto 109:9296ab0bfc11 396 #define SDADC_EXT_TRIG_RISING_EDGE SDADC_CR2_JEXTEN_0 /*!< External rising edge */
Kojto 109:9296ab0bfc11 397 #define SDADC_EXT_TRIG_FALLING_EDGE SDADC_CR2_JEXTEN_1 /*!< External falling edge */
Kojto 109:9296ab0bfc11 398 #define SDADC_EXT_TRIG_BOTH_EDGES SDADC_CR2_JEXTEN /*!< External rising and falling edges */
Kojto 109:9296ab0bfc11 399
Kojto 109:9296ab0bfc11 400 #define IS_SDADC_EXT_TRIG_EDGE(TRIGGER) (((TRIGGER) == SDADC_EXT_TRIG_RISING_EDGE) || \
Kojto 109:9296ab0bfc11 401 ((TRIGGER) == SDADC_EXT_TRIG_FALLING_EDGE) || \
Kojto 109:9296ab0bfc11 402 ((TRIGGER) == SDADC_EXT_TRIG_BOTH_EDGES))
Kojto 109:9296ab0bfc11 403 /**
Kojto 109:9296ab0bfc11 404 * @}
Kojto 109:9296ab0bfc11 405 */
Kojto 109:9296ab0bfc11 406
Kojto 109:9296ab0bfc11 407 /** @defgroup SDADC_InjectedDelay SDADC Injected Conversion Delay
Kojto 109:9296ab0bfc11 408 * @{
Kojto 109:9296ab0bfc11 409 */
Kojto 109:9296ab0bfc11 410 #define SDADC_INJECTED_DELAY_NONE ((uint32_t)0x00000000) /*!< No delay on injected conversion */
Kojto 109:9296ab0bfc11 411 #define SDADC_INJECTED_DELAY SDADC_CR2_JDS /*!< Delay on injected conversion */
Kojto 109:9296ab0bfc11 412
Kojto 109:9296ab0bfc11 413 #define IS_SDADC_INJECTED_DELAY(DELAY) (((DELAY) == SDADC_INJECTED_DELAY_NONE) || \
Kojto 109:9296ab0bfc11 414 ((DELAY) == SDADC_INJECTED_DELAY))
Kojto 109:9296ab0bfc11 415 /**
Kojto 109:9296ab0bfc11 416 * @}
Kojto 109:9296ab0bfc11 417 */
Kojto 109:9296ab0bfc11 418
Kojto 109:9296ab0bfc11 419 /** @defgroup SDADC_MultimodeType SDADC Multimode Type
Kojto 109:9296ab0bfc11 420 * @{
Kojto 109:9296ab0bfc11 421 */
Kojto 109:9296ab0bfc11 422 #define SDADC_MULTIMODE_SDADC1_SDADC2 ((uint32_t)0x00000000) /*!< Get conversion values for SDADC1 and SDADC2 */
Kojto 109:9296ab0bfc11 423 #define SDADC_MULTIMODE_SDADC1_SDADC3 ((uint32_t)0x00000001) /*!< Get conversion values for SDADC1 and SDADC3 */
Kojto 109:9296ab0bfc11 424
Kojto 109:9296ab0bfc11 425 #define IS_SDADC_MULTIMODE_TYPE(TYPE) (((TYPE) == SDADC_MULTIMODE_SDADC1_SDADC2) || \
Kojto 109:9296ab0bfc11 426 ((TYPE) == SDADC_MULTIMODE_SDADC1_SDADC3))
Kojto 109:9296ab0bfc11 427 /**
Kojto 109:9296ab0bfc11 428 * @}
Kojto 109:9296ab0bfc11 429 */
Kojto 109:9296ab0bfc11 430
Kojto 109:9296ab0bfc11 431 /** @defgroup SDADC_ErrorCode SDADC Error Code
Kojto 109:9296ab0bfc11 432 * @{
Kojto 109:9296ab0bfc11 433 */
Kojto 109:9296ab0bfc11 434 #define SDADC_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */
Kojto 109:9296ab0bfc11 435 #define SDADC_ERROR_REGULAR_OVERRUN ((uint32_t)0x00000001) /*!< Overrun occurs during regular conversion */
Kojto 109:9296ab0bfc11 436 #define SDADC_ERROR_INJECTED_OVERRUN ((uint32_t)0x00000002) /*!< Overrun occurs during injected conversion */
Kojto 109:9296ab0bfc11 437 #define SDADC_ERROR_DMA ((uint32_t)0x00000003) /*!< DMA error occurs */
Kojto 109:9296ab0bfc11 438 /**
Kojto 109:9296ab0bfc11 439 * @}
Kojto 109:9296ab0bfc11 440 */
Kojto 109:9296ab0bfc11 441
Kojto 109:9296ab0bfc11 442 /**
Kojto 109:9296ab0bfc11 443 * @}
Kojto 109:9296ab0bfc11 444 */
Kojto 109:9296ab0bfc11 445
Kojto 109:9296ab0bfc11 446 /* Exported macros -----------------------------------------------------------*/
Kojto 109:9296ab0bfc11 447 /** @defgroup SDADC_Exported_Macros SDADC Exported Macros
Kojto 109:9296ab0bfc11 448 * @{
Kojto 109:9296ab0bfc11 449 */
Kojto 109:9296ab0bfc11 450
Kojto 109:9296ab0bfc11 451 /** @brief Reset SDADC handle state
Kojto 109:9296ab0bfc11 452 * @param __HANDLE__: SDADC handle.
Kojto 109:9296ab0bfc11 453 * @retval None
Kojto 109:9296ab0bfc11 454 */
Kojto 109:9296ab0bfc11 455 #define __HAL_SDADC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_SDADC_STATE_RESET)
Kojto 109:9296ab0bfc11 456
Kojto 109:9296ab0bfc11 457 /**
Kojto 109:9296ab0bfc11 458 * @}
Kojto 109:9296ab0bfc11 459 */
Kojto 109:9296ab0bfc11 460
Kojto 109:9296ab0bfc11 461
Kojto 109:9296ab0bfc11 462 /* Exported functions --------------------------------------------------------*/
Kojto 109:9296ab0bfc11 463 /** @addtogroup SDADC_Exported_Functions SDADC Exported Functions
Kojto 109:9296ab0bfc11 464 * @{
Kojto 109:9296ab0bfc11 465 */
Kojto 109:9296ab0bfc11 466
Kojto 109:9296ab0bfc11 467 /** @addtogroup SDADC_Exported_Functions_Group1 Initialization and de-initialization functions
Kojto 109:9296ab0bfc11 468 * @{
Kojto 109:9296ab0bfc11 469 */
Kojto 109:9296ab0bfc11 470
Kojto 109:9296ab0bfc11 471 /* Initialization and de-initialization functions *****************************/
Kojto 109:9296ab0bfc11 472 HAL_StatusTypeDef HAL_SDADC_Init(SDADC_HandleTypeDef *hsdadc);
Kojto 109:9296ab0bfc11 473 HAL_StatusTypeDef HAL_SDADC_DeInit(SDADC_HandleTypeDef *hsdadc);
Kojto 109:9296ab0bfc11 474 void HAL_SDADC_MspInit(SDADC_HandleTypeDef* hsdadc);
Kojto 109:9296ab0bfc11 475 void HAL_SDADC_MspDeInit(SDADC_HandleTypeDef* hsdadc);
Kojto 109:9296ab0bfc11 476
Kojto 109:9296ab0bfc11 477 /**
Kojto 109:9296ab0bfc11 478 * @}
Kojto 109:9296ab0bfc11 479 */
Kojto 109:9296ab0bfc11 480
Kojto 109:9296ab0bfc11 481 /** @addtogroup SDADC_Exported_Functions_Group2 peripheral control functions
Kojto 109:9296ab0bfc11 482 * @{
Kojto 109:9296ab0bfc11 483 */
Kojto 109:9296ab0bfc11 484
Kojto 109:9296ab0bfc11 485 /* Peripheral Control functions ***********************************************/
Kojto 109:9296ab0bfc11 486 HAL_StatusTypeDef HAL_SDADC_PrepareChannelConfig(SDADC_HandleTypeDef *hsdadc,
Kojto 109:9296ab0bfc11 487 uint32_t ConfIndex,
Kojto 109:9296ab0bfc11 488 SDADC_ConfParamTypeDef* ConfParamStruct);
Kojto 109:9296ab0bfc11 489 HAL_StatusTypeDef HAL_SDADC_AssociateChannelConfig(SDADC_HandleTypeDef *hsdadc,
Kojto 109:9296ab0bfc11 490 uint32_t Channel,
Kojto 109:9296ab0bfc11 491 uint32_t ConfIndex);
Kojto 109:9296ab0bfc11 492 HAL_StatusTypeDef HAL_SDADC_ConfigChannel(SDADC_HandleTypeDef *hsdadc,
Kojto 109:9296ab0bfc11 493 uint32_t Channel,
Kojto 109:9296ab0bfc11 494 uint32_t ContinuousMode);
Kojto 109:9296ab0bfc11 495 HAL_StatusTypeDef HAL_SDADC_InjectedConfigChannel(SDADC_HandleTypeDef *hsdadc,
Kojto 109:9296ab0bfc11 496 uint32_t Channel,
Kojto 109:9296ab0bfc11 497 uint32_t ContinuousMode);
Kojto 109:9296ab0bfc11 498 HAL_StatusTypeDef HAL_SDADC_SelectInjectedExtTrigger(SDADC_HandleTypeDef *hsdadc,
Kojto 109:9296ab0bfc11 499 uint32_t InjectedExtTrigger,
Kojto 109:9296ab0bfc11 500 uint32_t ExtTriggerEdge);
Kojto 109:9296ab0bfc11 501 HAL_StatusTypeDef HAL_SDADC_SelectInjectedDelay(SDADC_HandleTypeDef *hsdadc,
Kojto 109:9296ab0bfc11 502 uint32_t InjectedDelay);
Kojto 109:9296ab0bfc11 503 HAL_StatusTypeDef HAL_SDADC_SelectRegularTrigger(SDADC_HandleTypeDef *hsdadc, uint32_t Trigger);
Kojto 109:9296ab0bfc11 504 HAL_StatusTypeDef HAL_SDADC_SelectInjectedTrigger(SDADC_HandleTypeDef *hsdadc, uint32_t Trigger);
Kojto 109:9296ab0bfc11 505 HAL_StatusTypeDef HAL_SDADC_MultiModeConfigChannel(SDADC_HandleTypeDef* hsdadc, uint32_t MultimodeType);
Kojto 109:9296ab0bfc11 506 HAL_StatusTypeDef HAL_SDADC_InjectedMultiModeConfigChannel(SDADC_HandleTypeDef* hsdadc, uint32_t MultimodeType);
Kojto 109:9296ab0bfc11 507
Kojto 109:9296ab0bfc11 508 /**
Kojto 109:9296ab0bfc11 509 * @}
Kojto 109:9296ab0bfc11 510 */
Kojto 109:9296ab0bfc11 511
Kojto 109:9296ab0bfc11 512 /** @addtogroup SDADC_Exported_Functions_Group3 Input and Output operation functions
Kojto 109:9296ab0bfc11 513 * @{
Kojto 109:9296ab0bfc11 514 */
Kojto 109:9296ab0bfc11 515
Kojto 109:9296ab0bfc11 516 /* IO operation functions *****************************************************/
Kojto 109:9296ab0bfc11 517 HAL_StatusTypeDef HAL_SDADC_CalibrationStart(SDADC_HandleTypeDef *hsdadc, uint32_t CalibrationSequence);
Kojto 109:9296ab0bfc11 518 HAL_StatusTypeDef HAL_SDADC_CalibrationStart_IT(SDADC_HandleTypeDef *hsdadc, uint32_t CalibrationSequence);
Kojto 109:9296ab0bfc11 519
Kojto 109:9296ab0bfc11 520 HAL_StatusTypeDef HAL_SDADC_Start(SDADC_HandleTypeDef *hsdadc);
Kojto 109:9296ab0bfc11 521 HAL_StatusTypeDef HAL_SDADC_Start_IT(SDADC_HandleTypeDef *hsdadc);
Kojto 109:9296ab0bfc11 522 HAL_StatusTypeDef HAL_SDADC_Start_DMA(SDADC_HandleTypeDef *hsdadc, uint32_t *pData, uint32_t Length);
Kojto 109:9296ab0bfc11 523 HAL_StatusTypeDef HAL_SDADC_Stop(SDADC_HandleTypeDef *hsdadc);
Kojto 109:9296ab0bfc11 524 HAL_StatusTypeDef HAL_SDADC_Stop_IT(SDADC_HandleTypeDef *hsdadc);
Kojto 109:9296ab0bfc11 525 HAL_StatusTypeDef HAL_SDADC_Stop_DMA(SDADC_HandleTypeDef *hsdadc);
Kojto 109:9296ab0bfc11 526
Kojto 109:9296ab0bfc11 527 HAL_StatusTypeDef HAL_SDADC_InjectedStart(SDADC_HandleTypeDef *hsdadc);
Kojto 109:9296ab0bfc11 528 HAL_StatusTypeDef HAL_SDADC_InjectedStart_IT(SDADC_HandleTypeDef *hsdadc);
Kojto 109:9296ab0bfc11 529 HAL_StatusTypeDef HAL_SDADC_InjectedStart_DMA(SDADC_HandleTypeDef *hsdadc, uint32_t *pData, uint32_t Length);
Kojto 109:9296ab0bfc11 530 HAL_StatusTypeDef HAL_SDADC_InjectedStop(SDADC_HandleTypeDef *hsdadc);
Kojto 109:9296ab0bfc11 531 HAL_StatusTypeDef HAL_SDADC_InjectedStop_IT(SDADC_HandleTypeDef *hsdadc);
Kojto 109:9296ab0bfc11 532 HAL_StatusTypeDef HAL_SDADC_InjectedStop_DMA(SDADC_HandleTypeDef *hsdadc);
Kojto 109:9296ab0bfc11 533
Kojto 109:9296ab0bfc11 534 HAL_StatusTypeDef HAL_SDADC_MultiModeStart_DMA(SDADC_HandleTypeDef* hsdadc, uint32_t* pData, uint32_t Length);
Kojto 109:9296ab0bfc11 535 HAL_StatusTypeDef HAL_SDADC_MultiModeStop_DMA(SDADC_HandleTypeDef* hsdadc);
Kojto 109:9296ab0bfc11 536 HAL_StatusTypeDef HAL_SDADC_InjectedMultiModeStart_DMA(SDADC_HandleTypeDef* hsdadc, uint32_t* pData, uint32_t Length);
Kojto 109:9296ab0bfc11 537 HAL_StatusTypeDef HAL_SDADC_InjectedMultiModeStop_DMA(SDADC_HandleTypeDef* hsdadc);
Kojto 109:9296ab0bfc11 538
Kojto 109:9296ab0bfc11 539 uint32_t HAL_SDADC_GetValue(SDADC_HandleTypeDef *hsdadc);
Kojto 109:9296ab0bfc11 540 uint32_t HAL_SDADC_InjectedGetValue(SDADC_HandleTypeDef *hsdadc, uint32_t* Channel);
Kojto 109:9296ab0bfc11 541 uint32_t HAL_SDADC_MultiModeGetValue(SDADC_HandleTypeDef* hsdadc);
Kojto 109:9296ab0bfc11 542 uint32_t HAL_SDADC_InjectedMultiModeGetValue(SDADC_HandleTypeDef* hsdadc);
Kojto 109:9296ab0bfc11 543
Kojto 109:9296ab0bfc11 544 void HAL_SDADC_IRQHandler(SDADC_HandleTypeDef* hsdadc);
Kojto 109:9296ab0bfc11 545
Kojto 109:9296ab0bfc11 546 HAL_StatusTypeDef HAL_SDADC_PollForCalibEvent(SDADC_HandleTypeDef* hsdadc, uint32_t Timeout);
Kojto 109:9296ab0bfc11 547 HAL_StatusTypeDef HAL_SDADC_PollForConversion(SDADC_HandleTypeDef* hsdadc, uint32_t Timeout);
Kojto 109:9296ab0bfc11 548 HAL_StatusTypeDef HAL_SDADC_PollForInjectedConversion(SDADC_HandleTypeDef* hsdadc, uint32_t Timeout);
Kojto 109:9296ab0bfc11 549
Kojto 109:9296ab0bfc11 550 void HAL_SDADC_CalibrationCpltCallback(SDADC_HandleTypeDef* hsdadc);
Kojto 109:9296ab0bfc11 551 void HAL_SDADC_ConvHalfCpltCallback(SDADC_HandleTypeDef* hsdadc);
Kojto 109:9296ab0bfc11 552 void HAL_SDADC_ConvCpltCallback(SDADC_HandleTypeDef* hsdadc);
Kojto 109:9296ab0bfc11 553 void HAL_SDADC_InjectedConvHalfCpltCallback(SDADC_HandleTypeDef* hsdadc);
Kojto 109:9296ab0bfc11 554 void HAL_SDADC_InjectedConvCpltCallback(SDADC_HandleTypeDef* hsdadc);
Kojto 109:9296ab0bfc11 555 void HAL_SDADC_ErrorCallback(SDADC_HandleTypeDef* hsdadc);
Kojto 109:9296ab0bfc11 556
Kojto 109:9296ab0bfc11 557 /**
Kojto 109:9296ab0bfc11 558 * @}
Kojto 109:9296ab0bfc11 559 */
Kojto 109:9296ab0bfc11 560
Kojto 109:9296ab0bfc11 561 /** @defgroup SDADC_Exported_Functions_Group4 Peripheral State functions
Kojto 109:9296ab0bfc11 562 * @{
Kojto 109:9296ab0bfc11 563 */
Kojto 109:9296ab0bfc11 564
Kojto 109:9296ab0bfc11 565 /* Peripheral State and Error functions ***************************************/
Kojto 109:9296ab0bfc11 566 HAL_SDADC_StateTypeDef HAL_SDADC_GetState(SDADC_HandleTypeDef* hsdadc);
Kojto 109:9296ab0bfc11 567 uint32_t HAL_SDADC_GetError(SDADC_HandleTypeDef* hsdadc);
Kojto 109:9296ab0bfc11 568
Kojto 109:9296ab0bfc11 569 /* Private functions ---------------------------------------------------------*/
Kojto 109:9296ab0bfc11 570
Kojto 109:9296ab0bfc11 571 /**
Kojto 109:9296ab0bfc11 572 * @}
Kojto 109:9296ab0bfc11 573 */
Kojto 109:9296ab0bfc11 574
Kojto 109:9296ab0bfc11 575 /**
Kojto 109:9296ab0bfc11 576 * @}
Kojto 109:9296ab0bfc11 577 */
Kojto 109:9296ab0bfc11 578
Kojto 109:9296ab0bfc11 579 /**
Kojto 109:9296ab0bfc11 580 * @}
Kojto 109:9296ab0bfc11 581 */
Kojto 109:9296ab0bfc11 582
Kojto 109:9296ab0bfc11 583 /**
Kojto 109:9296ab0bfc11 584 * @}
Kojto 109:9296ab0bfc11 585 */
Kojto 109:9296ab0bfc11 586
Kojto 109:9296ab0bfc11 587 #endif /* defined(STM32F373xC) || defined(STM32F378xx) */
Kojto 109:9296ab0bfc11 588
Kojto 109:9296ab0bfc11 589 #ifdef __cplusplus
Kojto 109:9296ab0bfc11 590 }
Kojto 109:9296ab0bfc11 591 #endif
Kojto 109:9296ab0bfc11 592
Kojto 109:9296ab0bfc11 593 #endif /*__STM32F3xx_SDADC_H */
Kojto 109:9296ab0bfc11 594
Kojto 109:9296ab0bfc11 595
Kojto 109:9296ab0bfc11 596 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/