mbed library sources

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Mon Nov 03 10:30:07 2014 +0000
Revision:
381:5460fc57b6e4
Synchronized with git revision 02478cd1f27fc7b9643486472635eb515b2bca81

Full URL: https://github.com/mbedmicro/mbed/commit/02478cd1f27fc7b9643486472635eb515b2bca81/

Target: LPC1549 - Fix serial interrupt issues (issue report #616)

Who changed what in which revision?

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