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