mbed(SerialHalfDuplex入り)

Fork of mbed by mbed official

Committer:
Kojto
Date:
Tue Feb 03 15:31:20 2015 +0000
Revision:
93:e188a91d3eaa
Release 93 of the mbed library

Main changes:

- Renesas RZ_A1H bugfixes - i2c, ticker
- new targets - Nucleo F303RE, Nucleo F070RB, BLE SMURFS,
Dragonfly 411RE,
- BusXXX - is connected method, plus operators addition
- LPC8xx - I2c fixes
- timestamp_t reverted to uint32_t
- RTX - fixes regarding stack (alignment, magic word)

Who changed what in which revision?

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