Go to most recent revision | Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 2 | mjames | 1 | /** |
| 2 | ****************************************************************************** |
||
| 3 | * @file stm32f1xx_hal_dac_ex.h |
||
| 4 | * @author MCD Application Team |
||
| 5 | * @version V1.0.1 |
||
| 6 | * @date 31-July-2015 |
||
| 7 | * @brief Header file of DAC HAL Extension module. |
||
| 8 | ****************************************************************************** |
||
| 9 | * @attention |
||
| 10 | * |
||
| 11 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
||
| 12 | * |
||
| 13 | * Redistribution and use in source and binary forms, with or without modification, |
||
| 14 | * are permitted provided that the following conditions are met: |
||
| 15 | * 1. Redistributions of source code must retain the above copyright notice, |
||
| 16 | * this list of conditions and the following disclaimer. |
||
| 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
||
| 18 | * this list of conditions and the following disclaimer in the documentation |
||
| 19 | * and/or other materials provided with the distribution. |
||
| 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
||
| 21 | * may be used to endorse or promote products derived from this software |
||
| 22 | * without specific prior written permission. |
||
| 23 | * |
||
| 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
||
| 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
||
| 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
||
| 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
||
| 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
||
| 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
||
| 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
||
| 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
||
| 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||
| 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||
| 34 | * |
||
| 35 | ****************************************************************************** |
||
| 36 | */ |
||
| 37 | |||
| 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
||
| 39 | #ifndef __STM32F1xx_HAL_DAC_EX_H |
||
| 40 | #define __STM32F1xx_HAL_DAC_EX_H |
||
| 41 | |||
| 42 | #ifdef __cplusplus |
||
| 43 | extern "C" { |
||
| 44 | #endif |
||
| 45 | |||
| 46 | #if defined (STM32F100xB) || defined (STM32F100xE) || defined (STM32F101xE) || defined (STM32F101xG) || defined (STM32F103xE) || defined (STM32F103xG) || defined (STM32F105xC) || defined (STM32F107xC) |
||
| 47 | |||
| 48 | /* Includes ------------------------------------------------------------------*/ |
||
| 49 | #include "stm32f1xx_hal_def.h" |
||
| 50 | |||
| 51 | /** @addtogroup STM32F1xx_HAL_Driver |
||
| 52 | * @{ |
||
| 53 | */ |
||
| 54 | |||
| 55 | /** @addtogroup DACEx |
||
| 56 | * @{ |
||
| 57 | */ |
||
| 58 | |||
| 59 | /* Exported types ------------------------------------------------------------*/ |
||
| 60 | |||
| 61 | /* Exported constants --------------------------------------------------------*/ |
||
| 62 | |||
| 63 | /** @defgroup DACEx_Exported_Constants DACEx Exported Constants |
||
| 64 | * @{ |
||
| 65 | */ |
||
| 66 | |||
| 67 | /** @defgroup DACEx_lfsrunmask_triangleamplitude DACEx lfsrunmask triangleamplitude |
||
| 68 | * @{ |
||
| 69 | */ |
||
| 70 | #define DAC_LFSRUNMASK_BIT0 ((uint32_t)0x00000000) /*!< Unmask DAC channel LFSR bit0 for noise wave generation */ |
||
| 71 | #define DAC_LFSRUNMASK_BITS1_0 ((uint32_t)DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[1:0] for noise wave generation */ |
||
| 72 | #define DAC_LFSRUNMASK_BITS2_0 ((uint32_t)DAC_CR_MAMP1_1) /*!< Unmask DAC channel LFSR bit[2:0] for noise wave generation */ |
||
| 73 | #define DAC_LFSRUNMASK_BITS3_0 ((uint32_t)DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0)/*!< Unmask DAC channel LFSR bit[3:0] for noise wave generation */ |
||
| 74 | #define DAC_LFSRUNMASK_BITS4_0 ((uint32_t)DAC_CR_MAMP1_2) /*!< Unmask DAC channel LFSR bit[4:0] for noise wave generation */ |
||
| 75 | #define DAC_LFSRUNMASK_BITS5_0 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[5:0] for noise wave generation */ |
||
| 76 | #define DAC_LFSRUNMASK_BITS6_0 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_1) /*!< Unmask DAC channel LFSR bit[6:0] for noise wave generation */ |
||
| 77 | #define DAC_LFSRUNMASK_BITS7_0 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[7:0] for noise wave generation */ |
||
| 78 | #define DAC_LFSRUNMASK_BITS8_0 ((uint32_t)DAC_CR_MAMP1_3) /*!< Unmask DAC channel LFSR bit[8:0] for noise wave generation */ |
||
| 79 | #define DAC_LFSRUNMASK_BITS9_0 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[9:0] for noise wave generation */ |
||
| 80 | #define DAC_LFSRUNMASK_BITS10_0 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1) /*!< Unmask DAC channel LFSR bit[10:0] for noise wave generation */ |
||
| 81 | #define DAC_LFSRUNMASK_BITS11_0 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[11:0] for noise wave generation */ |
||
| 82 | #define DAC_TRIANGLEAMPLITUDE_1 ((uint32_t)0x00000000) /*!< Select max triangle amplitude of 1 */ |
||
| 83 | #define DAC_TRIANGLEAMPLITUDE_3 ((uint32_t)DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 3 */ |
||
| 84 | #define DAC_TRIANGLEAMPLITUDE_7 ((uint32_t)DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 7 */ |
||
| 85 | #define DAC_TRIANGLEAMPLITUDE_15 ((uint32_t)DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 15 */ |
||
| 86 | #define DAC_TRIANGLEAMPLITUDE_31 ((uint32_t)DAC_CR_MAMP1_2) /*!< Select max triangle amplitude of 31 */ |
||
| 87 | #define DAC_TRIANGLEAMPLITUDE_63 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 63 */ |
||
| 88 | #define DAC_TRIANGLEAMPLITUDE_127 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 127 */ |
||
| 89 | #define DAC_TRIANGLEAMPLITUDE_255 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 255 */ |
||
| 90 | #define DAC_TRIANGLEAMPLITUDE_511 ((uint32_t)DAC_CR_MAMP1_3) /*!< Select max triangle amplitude of 511 */ |
||
| 91 | #define DAC_TRIANGLEAMPLITUDE_1023 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 1023 */ |
||
| 92 | #define DAC_TRIANGLEAMPLITUDE_2047 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 2047 */ |
||
| 93 | #define DAC_TRIANGLEAMPLITUDE_4095 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 4095 */ |
||
| 94 | |||
| 95 | /** |
||
| 96 | * @} |
||
| 97 | */ |
||
| 98 | |||
| 99 | /** @defgroup DACEx_wave_generation DACEx wave generation |
||
| 100 | * @{ |
||
| 101 | */ |
||
| 102 | #define DAC_WAVE_NOISE ((uint32_t)DAC_CR_WAVE1_0) |
||
| 103 | #define DAC_WAVE_TRIANGLE ((uint32_t)DAC_CR_WAVE1_1) |
||
| 104 | |||
| 105 | /** |
||
| 106 | * @} |
||
| 107 | */ |
||
| 108 | |||
| 109 | /** @defgroup DACEx_trigger_selection DAC trigger selection |
||
| 110 | * @{ |
||
| 111 | */ |
||
| 112 | #define DAC_TRIGGER_NONE ((uint32_t)0x00000000) /*!< Conversion is automatic once the DAC1_DHRxxxx register |
||
| 113 | has been loaded, and not by external trigger */ |
||
| 114 | #define DAC_TRIGGER_T6_TRGO ((uint32_t) DAC_CR_TEN1) /*!< TIM6 TRGO selected as external conversion trigger for DAC channel */ |
||
| 115 | #define DAC_TRIGGER_T7_TRGO ((uint32_t)( DAC_CR_TSEL1_1 | DAC_CR_TEN1)) /*!< TIM7 TRGO selected as external conversion trigger for DAC channel */ |
||
| 116 | #define DAC_TRIGGER_T2_TRGO ((uint32_t)(DAC_CR_TSEL1_2 | DAC_CR_TEN1)) /*!< TIM2 TRGO selected as external conversion trigger for DAC channel */ |
||
| 117 | #define DAC_TRIGGER_T4_TRGO ((uint32_t)(DAC_CR_TSEL1_2 | DAC_CR_TSEL1_0 | DAC_CR_TEN1)) /*!< TIM4 TRGO selected as external conversion trigger for DAC channel */ |
||
| 118 | #define DAC_TRIGGER_EXT_IT9 ((uint32_t)(DAC_CR_TSEL1_2 | DAC_CR_TSEL1_1 | DAC_CR_TEN1)) /*!< EXTI Line9 event selected as external conversion trigger for DAC channel */ |
||
| 119 | #define DAC_TRIGGER_SOFTWARE ((uint32_t)(DAC_CR_TSEL1 | DAC_CR_TEN1)) /*!< Conversion started by software trigger for DAC channel */ |
||
| 120 | |||
| 121 | #if defined (STM32F101xE) || defined (STM32F101xG) || defined (STM32F103xE) || defined (STM32F103xG) |
||
| 122 | /* For STM32F10x high-density and XL-density devices: TIM8 */ |
||
| 123 | #define DAC_TRIGGER_T8_TRGO ((uint32_t) DAC_CR_TSEL1_0 | DAC_CR_TEN1) /*!< TIM8 TRGO selected as external conversion trigger for DAC channel */ |
||
| 124 | #endif /* STM32F101xE || STM32F101xG || STM32F103xE || STM32F103xG */ |
||
| 125 | |||
| 126 | #if defined (STM32F100xB) || defined (STM32F100xE) || defined (STM32F105xC) || defined (STM32F107xC) |
||
| 127 | /* For STM32F10x connectivity line devices and STM32F100x devices: TIM3 */ |
||
| 128 | #define DAC_TRIGGER_T3_TRGO ((uint32_t) DAC_CR_TSEL1_0 | DAC_CR_TEN1) /*!< TIM3 TRGO selected as external conversion trigger for DAC channel */ |
||
| 129 | #endif /* STM32F100xB || STM32F100xE || STM32F105xC || STM32F107xC */ |
||
| 130 | |||
| 131 | /* Availability of trigger from TIM5 and TIM15: */ |
||
| 132 | /* - For STM32F10x value line devices STM32F100xB: */ |
||
| 133 | /* trigger from TIM15 is available, TIM5 not available. */ |
||
| 134 | /* - For STM32F10x value line devices STM32F100xE: */ |
||
| 135 | /* trigger from TIM15 and TIM5 are both available, */ |
||
| 136 | /* selection depends on remap (with TIM5 as default configuration). */ |
||
| 137 | /* - Other STM32F1 devices: */ |
||
| 138 | /* trigger from TIM5 is available, TIM15 not available. */ |
||
| 139 | #if defined (STM32F100xB) |
||
| 140 | #define DAC_TRIGGER_T15_TRGO ((uint32_t)( DAC_CR_TSEL1_1 | DAC_CR_TSEL1_0 | DAC_CR_TEN1)) /*!< TIM15 TRGO selected as external conversion trigger for DAC channel */ |
||
| 141 | #else |
||
| 142 | |||
| 143 | #define DAC_TRIGGER_T5_TRGO ((uint32_t)( DAC_CR_TSEL1_1 | DAC_CR_TSEL1_0 | DAC_CR_TEN1)) /*!< TIM5 TRGO selected as external conversion trigger for DAC channel */ |
||
| 144 | |||
| 145 | #if defined (STM32F100xE) |
||
| 146 | /*!< DAC trigger availability depending on STM32F1 devices: |
||
| 147 | For STM32F100x high-density value line devices, the TIM15 TRGO event can be selected |
||
| 148 | as replacement of TIM5 TRGO if the MISC_REMAP bit in the AFIO_MAPR2 register is set. |
||
| 149 | Refer to macro "__HAL_AFIO_REMAP_MISC_ENABLE()/__HAL_AFIO_REMAP_MISC_DISABLE()". |
||
| 150 | Otherwise, TIM5 TRGO is used and TIM15 TRGO is not used (default case). |
||
| 151 | For more details please refer to the AFIO section. */ |
||
| 152 | #define DAC_TRIGGER_T15_TRGO DAC_TRIGGER_T5_TRGO |
||
| 153 | #endif /* STM32F100xE */ |
||
| 154 | |||
| 155 | #endif /* STM32F100xB */ |
||
| 156 | /** |
||
| 157 | * @} |
||
| 158 | */ |
||
| 159 | |||
| 160 | #if defined (STM32F100xB) || defined (STM32F100xE) |
||
| 161 | /** @defgroup DAC_flags_definition DAC flags definition |
||
| 162 | * @{ |
||
| 163 | */ |
||
| 164 | #define DAC_FLAG_DMAUDR1 ((uint32_t)DAC_SR_DMAUDR1) |
||
| 165 | #define DAC_FLAG_DMAUDR2 ((uint32_t)DAC_SR_DMAUDR2) |
||
| 166 | |||
| 167 | /** |
||
| 168 | * @} |
||
| 169 | */ |
||
| 170 | |||
| 171 | /** @defgroup DAC_IT_definition DAC IT definition |
||
| 172 | * @{ |
||
| 173 | */ |
||
| 174 | #define DAC_IT_DMAUDR1 ((uint32_t)DAC_SR_DMAUDR1) |
||
| 175 | #define DAC_IT_DMAUDR2 ((uint32_t)DAC_SR_DMAUDR2) |
||
| 176 | |||
| 177 | /** |
||
| 178 | * @} |
||
| 179 | */ |
||
| 180 | #endif /* STM32F100xB || STM32F100xE */ |
||
| 181 | |||
| 182 | /** |
||
| 183 | * @} |
||
| 184 | */ |
||
| 185 | |||
| 186 | /* Exported macro ------------------------------------------------------------*/ |
||
| 187 | |||
| 188 | #if defined (STM32F100xB) || defined (STM32F100xE) |
||
| 189 | /** @defgroup DACEx_Exported_Macros DACEx Exported Macros |
||
| 190 | * @{ |
||
| 191 | */ |
||
| 192 | |||
| 193 | /** @brief Enable the DAC interrupt |
||
| 194 | * @param __HANDLE__: specifies the DAC handle |
||
| 195 | * @param __INTERRUPT__: specifies the DAC interrupt. |
||
| 196 | * This parameter can be any combination of the following values: |
||
| 197 | * @arg DAC_IT_DMAUDR1: DAC channel 1 DMA underrun interrupt |
||
| 198 | * @arg DAC_IT_DMAUDR2: DAC channel 2 DMA underrun interrupt |
||
| 199 | * @retval None |
||
| 200 | */ |
||
| 201 | #define __HAL_DAC_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CR) |= (__INTERRUPT__)) |
||
| 202 | |||
| 203 | /** @brief Disable the DAC interrupt |
||
| 204 | * @param __HANDLE__: specifies the DAC handle |
||
| 205 | * @param __INTERRUPT__: specifies the DAC interrupt. |
||
| 206 | * This parameter can be any combination of the following values: |
||
| 207 | * @arg DAC_IT_DMAUDR1: DAC channel 1 DMA underrun interrupt |
||
| 208 | * @arg DAC_IT_DMAUDR2: DAC channel 2 DMA underrun interrupt |
||
| 209 | * @retval None |
||
| 210 | */ |
||
| 211 | #define __HAL_DAC_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CR) &= ~(__INTERRUPT__)) |
||
| 212 | |||
| 213 | /** @brief Checks if the specified DAC interrupt source is enabled or disabled. |
||
| 214 | * @param __HANDLE__: DAC handle |
||
| 215 | * @param __INTERRUPT__: DAC interrupt source to check |
||
| 216 | * This parameter can be any combination of the following values: |
||
| 217 | * @arg DAC_IT_DMAUDR1: DAC channel 1 DMA underrun interrupt |
||
| 218 | * @arg DAC_IT_DMAUDR2: DAC channel 2 DMA underrun interrupt |
||
| 219 | * @retval State of interruption (SET or RESET) |
||
| 220 | */ |
||
| 221 | #define __HAL_DAC_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CR & (__INTERRUPT__)) == (__INTERRUPT__)) |
||
| 222 | |||
| 223 | /** @brief Get the selected DAC's flag status. |
||
| 224 | * @param __HANDLE__: specifies the DAC handle. |
||
| 225 | * @param __FLAG__: specifies the DAC flag to get. |
||
| 226 | * This parameter can be any combination of the following values: |
||
| 227 | * @arg DAC_FLAG_DMAUDR1: DAC channel 1 DMA underrun flag |
||
| 228 | * @arg DAC_FLAG_DMAUDR2: DAC channel 2 DMA underrun flag |
||
| 229 | * @retval None |
||
| 230 | */ |
||
| 231 | #define __HAL_DAC_GET_FLAG(__HANDLE__, __FLAG__) ((((__HANDLE__)->Instance->SR) & (__FLAG__)) == (__FLAG__)) |
||
| 232 | |||
| 233 | /** @brief Clear the DAC's flag. |
||
| 234 | * @param __HANDLE__: specifies the DAC handle. |
||
| 235 | * @param __FLAG__: specifies the DAC flag to clear. |
||
| 236 | * This parameter can be any combination of the following values: |
||
| 237 | * @arg DAC_FLAG_DMAUDR1: DAC channel 1 DMA underrun flag |
||
| 238 | * @arg DAC_FLAG_DMAUDR2: DAC channel 2 DMA underrun flag |
||
| 239 | * @retval None |
||
| 240 | */ |
||
| 241 | #define __HAL_DAC_CLEAR_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR) = (__FLAG__)) |
||
| 242 | |||
| 243 | |||
| 244 | /** |
||
| 245 | * @} |
||
| 246 | */ |
||
| 247 | #endif /* STM32F100xB || STM32F100xE */ |
||
| 248 | |||
| 249 | /* Private macro -------------------------------------------------------------*/ |
||
| 250 | |||
| 251 | /** @defgroup DACEx_Private_Macros DACEx Private Macros |
||
| 252 | * @{ |
||
| 253 | */ |
||
| 254 | #if defined (STM32F101xE) || defined (STM32F101xG) || defined (STM32F103xE) || defined (STM32F103xG) |
||
| 255 | #define IS_DAC_TRIGGER(TRIGGER) (((TRIGGER) == DAC_TRIGGER_NONE) || \ |
||
| 256 | ((TRIGGER) == DAC_TRIGGER_T6_TRGO) || \ |
||
| 257 | ((TRIGGER) == DAC_TRIGGER_T8_TRGO) || \ |
||
| 258 | ((TRIGGER) == DAC_TRIGGER_T7_TRGO) || \ |
||
| 259 | ((TRIGGER) == DAC_TRIGGER_T5_TRGO) || \ |
||
| 260 | ((TRIGGER) == DAC_TRIGGER_T2_TRGO) || \ |
||
| 261 | ((TRIGGER) == DAC_TRIGGER_T4_TRGO) || \ |
||
| 262 | ((TRIGGER) == DAC_TRIGGER_EXT_IT9) || \ |
||
| 263 | ((TRIGGER) == DAC_TRIGGER_SOFTWARE)) |
||
| 264 | #endif /* STM32F101xE || STM32F101xG || STM32F103xE || STM32F103xG */ |
||
| 265 | #if defined (STM32F100xE) || defined (STM32F105xC) || defined (STM32F107xC) |
||
| 266 | #define IS_DAC_TRIGGER(TRIGGER) (((TRIGGER) == DAC_TRIGGER_NONE) || \ |
||
| 267 | ((TRIGGER) == DAC_TRIGGER_T6_TRGO) || \ |
||
| 268 | ((TRIGGER) == DAC_TRIGGER_T3_TRGO) || \ |
||
| 269 | ((TRIGGER) == DAC_TRIGGER_T7_TRGO) || \ |
||
| 270 | ((TRIGGER) == DAC_TRIGGER_T5_TRGO) || \ |
||
| 271 | ((TRIGGER) == DAC_TRIGGER_T2_TRGO) || \ |
||
| 272 | ((TRIGGER) == DAC_TRIGGER_T4_TRGO) || \ |
||
| 273 | ((TRIGGER) == DAC_TRIGGER_EXT_IT9) || \ |
||
| 274 | ((TRIGGER) == DAC_TRIGGER_SOFTWARE)) |
||
| 275 | #endif /* STM32F100xE || STM32F105xC || STM32F107xC */ |
||
| 276 | #if defined (STM32F100xB) |
||
| 277 | #define IS_DAC_TRIGGER(TRIGGER) (((TRIGGER) == DAC_TRIGGER_NONE) || \ |
||
| 278 | ((TRIGGER) == DAC_TRIGGER_T6_TRGO) || \ |
||
| 279 | ((TRIGGER) == DAC_TRIGGER_T3_TRGO) || \ |
||
| 280 | ((TRIGGER) == DAC_TRIGGER_T7_TRGO) || \ |
||
| 281 | ((TRIGGER) == DAC_TRIGGER_T15_TRGO) || \ |
||
| 282 | ((TRIGGER) == DAC_TRIGGER_T2_TRGO) || \ |
||
| 283 | ((TRIGGER) == DAC_TRIGGER_T4_TRGO) || \ |
||
| 284 | ((TRIGGER) == DAC_TRIGGER_EXT_IT9) || \ |
||
| 285 | ((TRIGGER) == DAC_TRIGGER_SOFTWARE)) |
||
| 286 | #endif /* STM32F100xB */ |
||
| 287 | |||
| 288 | #define IS_DAC_LFSR_UNMASK_TRIANGLE_AMPLITUDE(VALUE) (((VALUE) == DAC_LFSRUNMASK_BIT0) || \ |
||
| 289 | ((VALUE) == DAC_LFSRUNMASK_BITS1_0) || \ |
||
| 290 | ((VALUE) == DAC_LFSRUNMASK_BITS2_0) || \ |
||
| 291 | ((VALUE) == DAC_LFSRUNMASK_BITS3_0) || \ |
||
| 292 | ((VALUE) == DAC_LFSRUNMASK_BITS4_0) || \ |
||
| 293 | ((VALUE) == DAC_LFSRUNMASK_BITS5_0) || \ |
||
| 294 | ((VALUE) == DAC_LFSRUNMASK_BITS6_0) || \ |
||
| 295 | ((VALUE) == DAC_LFSRUNMASK_BITS7_0) || \ |
||
| 296 | ((VALUE) == DAC_LFSRUNMASK_BITS8_0) || \ |
||
| 297 | ((VALUE) == DAC_LFSRUNMASK_BITS9_0) || \ |
||
| 298 | ((VALUE) == DAC_LFSRUNMASK_BITS10_0) || \ |
||
| 299 | ((VALUE) == DAC_LFSRUNMASK_BITS11_0) || \ |
||
| 300 | ((VALUE) == DAC_TRIANGLEAMPLITUDE_1) || \ |
||
| 301 | ((VALUE) == DAC_TRIANGLEAMPLITUDE_3) || \ |
||
| 302 | ((VALUE) == DAC_TRIANGLEAMPLITUDE_7) || \ |
||
| 303 | ((VALUE) == DAC_TRIANGLEAMPLITUDE_15) || \ |
||
| 304 | ((VALUE) == DAC_TRIANGLEAMPLITUDE_31) || \ |
||
| 305 | ((VALUE) == DAC_TRIANGLEAMPLITUDE_63) || \ |
||
| 306 | ((VALUE) == DAC_TRIANGLEAMPLITUDE_127) || \ |
||
| 307 | ((VALUE) == DAC_TRIANGLEAMPLITUDE_255) || \ |
||
| 308 | ((VALUE) == DAC_TRIANGLEAMPLITUDE_511) || \ |
||
| 309 | ((VALUE) == DAC_TRIANGLEAMPLITUDE_1023) || \ |
||
| 310 | ((VALUE) == DAC_TRIANGLEAMPLITUDE_2047) || \ |
||
| 311 | ((VALUE) == DAC_TRIANGLEAMPLITUDE_4095)) |
||
| 312 | |||
| 313 | /** |
||
| 314 | * @} |
||
| 315 | */ |
||
| 316 | |||
| 317 | |||
| 318 | /* Exported functions --------------------------------------------------------*/ |
||
| 319 | |||
| 320 | /** @addtogroup DACEx_Exported_Functions |
||
| 321 | * @{ |
||
| 322 | */ |
||
| 323 | |||
| 324 | /** @addtogroup DACEx_Exported_Functions_Group1 |
||
| 325 | * @{ |
||
| 326 | */ |
||
| 327 | /* Extension features functions ***********************************************/ |
||
| 328 | |||
| 329 | uint32_t HAL_DACEx_DualGetValue(DAC_HandleTypeDef* hdac); |
||
| 330 | HAL_StatusTypeDef HAL_DACEx_TriangleWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude); |
||
| 331 | HAL_StatusTypeDef HAL_DACEx_NoiseWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude); |
||
| 332 | HAL_StatusTypeDef HAL_DACEx_DualSetValue(DAC_HandleTypeDef* hdac, uint32_t Alignment, uint32_t Data1, uint32_t Data2); |
||
| 333 | |||
| 334 | void HAL_DACEx_ConvCpltCallbackCh2(DAC_HandleTypeDef* hdac); |
||
| 335 | void HAL_DACEx_ConvHalfCpltCallbackCh2(DAC_HandleTypeDef* hdac); |
||
| 336 | void HAL_DACEx_ErrorCallbackCh2(DAC_HandleTypeDef* hdac); |
||
| 337 | |||
| 338 | #if defined (STM32F100xB) || defined (STM32F100xE) |
||
| 339 | void HAL_DAC_IRQHandler(DAC_HandleTypeDef* hdac); |
||
| 340 | void HAL_DAC_DMAUnderrunCallbackCh1(DAC_HandleTypeDef *hdac); |
||
| 341 | void HAL_DACEx_DMAUnderrunCallbackCh2(DAC_HandleTypeDef* hdac); |
||
| 342 | #endif /* STM32F100xB) || defined (STM32F100xE) */ |
||
| 343 | |||
| 344 | /** |
||
| 345 | * @} |
||
| 346 | */ |
||
| 347 | |||
| 348 | |||
| 349 | |||
| 350 | |||
| 351 | /** |
||
| 352 | * @} |
||
| 353 | */ |
||
| 354 | |||
| 355 | /** @addtogroup DACEx_Private_Functions |
||
| 356 | * @{ |
||
| 357 | */ |
||
| 358 | void DAC_DMAConvCpltCh2(DMA_HandleTypeDef *hdma); |
||
| 359 | void DAC_DMAHalfConvCpltCh2(DMA_HandleTypeDef *hdma); |
||
| 360 | void DAC_DMAErrorCh2(DMA_HandleTypeDef *hdma); |
||
| 361 | |||
| 362 | /** |
||
| 363 | * @} |
||
| 364 | */ |
||
| 365 | |||
| 366 | /** |
||
| 367 | * @} |
||
| 368 | */ |
||
| 369 | |||
| 370 | /** |
||
| 371 | * @} |
||
| 372 | */ |
||
| 373 | |||
| 374 | #endif /* STM32F100xB || STM32F100xE || STM32F101xE || STM32F101xG || STM32F103xE || STM32F103xG || STM32F105xC || STM32F107xC */ |
||
| 375 | |||
| 376 | #ifdef __cplusplus |
||
| 377 | } |
||
| 378 | #endif |
||
| 379 | |||
| 380 | #endif /*__STM32F1xx_HAL_DAC_EX_H */ |
||
| 381 | |||
| 382 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |