meh

Fork of mbed by mbed official

Committer:
ricardobtez
Date:
Tue Apr 05 23:51:21 2016 +0000
Revision:
118:16969dd821af
Parent:
90:cb3d968589d8
dgdgr

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 90:cb3d968589d8 1 /**
Kojto 90:cb3d968589d8 2 ******************************************************************************
Kojto 90:cb3d968589d8 3 * @file stm32f3xx_hal_dac_ex.h
Kojto 90:cb3d968589d8 4 * @author MCD Application Team
Kojto 90:cb3d968589d8 5 * @version V1.1.0
Kojto 90:cb3d968589d8 6 * @date 12-Sept-2014
Kojto 90:cb3d968589d8 7 * @brief Header file of DAC HAL Extended module.
Kojto 90:cb3d968589d8 8 ******************************************************************************
Kojto 90:cb3d968589d8 9 * @attention
Kojto 90:cb3d968589d8 10 *
Kojto 90:cb3d968589d8 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
Kojto 90:cb3d968589d8 12 *
Kojto 90:cb3d968589d8 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 90:cb3d968589d8 14 * are permitted provided that the following conditions are met:
Kojto 90:cb3d968589d8 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 90:cb3d968589d8 16 * this list of conditions and the following disclaimer.
Kojto 90:cb3d968589d8 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 90:cb3d968589d8 18 * this list of conditions and the following disclaimer in the documentation
Kojto 90:cb3d968589d8 19 * and/or other materials provided with the distribution.
Kojto 90:cb3d968589d8 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 90:cb3d968589d8 21 * may be used to endorse or promote products derived from this software
Kojto 90:cb3d968589d8 22 * without specific prior written permission.
Kojto 90:cb3d968589d8 23 *
Kojto 90:cb3d968589d8 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 90:cb3d968589d8 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 90:cb3d968589d8 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 90:cb3d968589d8 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 90:cb3d968589d8 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 90:cb3d968589d8 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 90:cb3d968589d8 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 90:cb3d968589d8 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 90:cb3d968589d8 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 90:cb3d968589d8 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 90:cb3d968589d8 34 *
Kojto 90:cb3d968589d8 35 ******************************************************************************
Kojto 90:cb3d968589d8 36 */
Kojto 90:cb3d968589d8 37
Kojto 90:cb3d968589d8 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 90:cb3d968589d8 39 #ifndef __STM32F3xx_HAL_DAC_EX_H
Kojto 90:cb3d968589d8 40 #define __STM32F3xx_HAL_DAC_EX_H
Kojto 90:cb3d968589d8 41
Kojto 90:cb3d968589d8 42 #ifdef __cplusplus
Kojto 90:cb3d968589d8 43 extern "C" {
Kojto 90:cb3d968589d8 44 #endif
Kojto 90:cb3d968589d8 45
Kojto 90:cb3d968589d8 46 /* Includes ------------------------------------------------------------------*/
Kojto 90:cb3d968589d8 47 #include "stm32f3xx_hal_def.h"
Kojto 90:cb3d968589d8 48
Kojto 90:cb3d968589d8 49 /** @addtogroup STM32F3xx_HAL_Driver
Kojto 90:cb3d968589d8 50 * @{
Kojto 90:cb3d968589d8 51 */
Kojto 90:cb3d968589d8 52
Kojto 90:cb3d968589d8 53 /** @addtogroup DACEx DAC Extended HAL module driver
Kojto 90:cb3d968589d8 54 * @{
Kojto 90:cb3d968589d8 55 */
Kojto 90:cb3d968589d8 56
Kojto 90:cb3d968589d8 57 /* Exported types ------------------------------------------------------------*/
Kojto 90:cb3d968589d8 58 /* Exported constants --------------------------------------------------------*/
Kojto 90:cb3d968589d8 59 /** @defgroup DACEx_Exported_Constants DAC Extended Exported Constants
Kojto 90:cb3d968589d8 60 * @{
Kojto 90:cb3d968589d8 61 */
Kojto 90:cb3d968589d8 62
Kojto 90:cb3d968589d8 63 /** @defgroup DACEx_trigger_selection DAC Extended trigger selection
Kojto 90:cb3d968589d8 64 * @{
Kojto 90:cb3d968589d8 65 */
Kojto 90:cb3d968589d8 66
Kojto 90:cb3d968589d8 67 #if defined(STM32F301x8) || defined(STM32F318xx)
Kojto 90:cb3d968589d8 68 #define DAC_TRIGGER_NONE ((uint32_t)0x00000000) /*!< Conversion is automatic once the DAC1_DHRxxxx register
Kojto 90:cb3d968589d8 69 has been loaded, and not by external trigger */
Kojto 90:cb3d968589d8 70 #define DAC_TRIGGER_T6_TRGO ((uint32_t)DAC_CR_TEN1) /*!< TIM6 TRGO selected as external conversion trigger for DAC channel */
Kojto 90:cb3d968589d8 71 #define DAC_TRIGGER_T2_TRGO ((uint32_t)(DAC_CR_TSEL1_2 | DAC_CR_TEN1)) /*!< TIM2 TRGO selected as external conversion trigger for DAC channel */
Kojto 90:cb3d968589d8 72 #define DAC_TRIGGER_T15_TRGO ((uint32_t)(DAC_CR_TSEL1_1 | DAC_CR_TSEL1_0 | DAC_CR_TEN1)) /*!< TIM5 TRGO selected as external conversion trigger for DAC channel */
Kojto 90:cb3d968589d8 73 #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 */
Kojto 90:cb3d968589d8 74 #define DAC_TRIGGER_SOFTWARE ((uint32_t)(DAC_CR_TSEL1 | DAC_CR_TEN1)) /*!< Conversion started by software trigger for DAC channel */
Kojto 90:cb3d968589d8 75
Kojto 90:cb3d968589d8 76 #define IS_DAC_TRIGGER(TRIGGER) (((TRIGGER) == DAC_TRIGGER_NONE) || \
Kojto 90:cb3d968589d8 77 ((TRIGGER) == DAC_TRIGGER_T2_TRGO) || \
Kojto 90:cb3d968589d8 78 ((TRIGGER) == DAC_TRIGGER_T6_TRGO) || \
Kojto 90:cb3d968589d8 79 ((TRIGGER) == DAC_TRIGGER_T15_TRGO) || \
Kojto 90:cb3d968589d8 80 ((TRIGGER) == DAC_TRIGGER_EXT_IT9) || \
Kojto 90:cb3d968589d8 81 ((TRIGGER) == DAC_TRIGGER_SOFTWARE))
Kojto 90:cb3d968589d8 82 #endif /* STM32F301x8 || STM32F318xx */
Kojto 90:cb3d968589d8 83
Kojto 90:cb3d968589d8 84 #if defined(STM32F302xE) || \
Kojto 90:cb3d968589d8 85 defined(STM32F302xC) || \
Kojto 90:cb3d968589d8 86 defined(STM32F302x8)
Kojto 90:cb3d968589d8 87
Kojto 90:cb3d968589d8 88 #define DAC_TRIGGER_NONE ((uint32_t)0x00000000) /*!< Conversion is automatic once the DAC1_DHRxxxx register
Kojto 90:cb3d968589d8 89 has been loaded, and not by external trigger */
Kojto 90:cb3d968589d8 90 #define DAC_TRIGGER_T6_TRGO ((uint32_t)DAC_CR_TEN1) /*!< TIM6 TRGO selected as external conversion trigger for DAC channel */
Kojto 90:cb3d968589d8 91 #define DAC_TRIGGER_T3_TRGO ((uint32_t)(DAC_CR_TSEL1_0 | DAC_CR_TEN1)) /*!< TIM3 TRGO selected as external conversion trigger for DAC channel */
Kojto 90:cb3d968589d8 92 #define DAC_TRIGGER_T15_TRGO ((uint32_t)(DAC_CR_TSEL1_1 | DAC_CR_TSEL1_0 | DAC_CR_TEN1)) /*!< TIM5 TRGO selected as external conversion trigger for DAC channel */
Kojto 90:cb3d968589d8 93 #define DAC_TRIGGER_T2_TRGO ((uint32_t)(DAC_CR_TSEL1_2 | DAC_CR_TEN1)) /*!< TIM2 TRGO selected as external conversion trigger for DAC channel */
Kojto 90:cb3d968589d8 94 #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 */
Kojto 90:cb3d968589d8 95 #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 */
Kojto 90:cb3d968589d8 96 #define DAC_TRIGGER_SOFTWARE ((uint32_t)(DAC_CR_TSEL1 | DAC_CR_TEN1)) /*!< Conversion started by software trigger for DAC channel */
Kojto 90:cb3d968589d8 97
Kojto 90:cb3d968589d8 98 #define IS_DAC_TRIGGER(TRIGGER) (((TRIGGER) == DAC_TRIGGER_NONE) || \
Kojto 90:cb3d968589d8 99 ((TRIGGER) == DAC_TRIGGER_T2_TRGO) || \
Kojto 90:cb3d968589d8 100 ((TRIGGER) == DAC_TRIGGER_T3_TRGO) || \
Kojto 90:cb3d968589d8 101 ((TRIGGER) == DAC_TRIGGER_T4_TRGO) || \
Kojto 90:cb3d968589d8 102 ((TRIGGER) == DAC_TRIGGER_T15_TRGO) || \
Kojto 90:cb3d968589d8 103 ((TRIGGER) == DAC_TRIGGER_T6_TRGO) || \
Kojto 90:cb3d968589d8 104 ((TRIGGER) == DAC_TRIGGER_EXT_IT9) || \
Kojto 90:cb3d968589d8 105 ((TRIGGER) == DAC_TRIGGER_SOFTWARE))
Kojto 90:cb3d968589d8 106
Kojto 90:cb3d968589d8 107 #endif /* STM32F302xE || */
Kojto 90:cb3d968589d8 108 /* STM32F302xC || */
Kojto 90:cb3d968589d8 109 /* STM32F302x8 */
Kojto 90:cb3d968589d8 110
Kojto 90:cb3d968589d8 111 #if defined(STM32F303xE) || defined(STM32F398xx) || \
Kojto 90:cb3d968589d8 112 defined(STM32F303xC) || defined(STM32F358xx)
Kojto 90:cb3d968589d8 113
Kojto 90:cb3d968589d8 114 #define DAC_TRIGGER_NONE ((uint32_t)0x00000000) /*!< Conversion is automatic once the DAC1_DHRxxxx register
Kojto 90:cb3d968589d8 115 has been loaded, and not by external trigger */
Kojto 90:cb3d968589d8 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 */
Kojto 90:cb3d968589d8 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 */
Kojto 90:cb3d968589d8 118 #define DAC_TRIGGER_T15_TRGO ((uint32_t)(DAC_CR_TSEL1_1 | DAC_CR_TSEL1_0 | DAC_CR_TEN1)) /*!< TIM5 TRGO selected as external conversion trigger for DAC channel */
Kojto 90:cb3d968589d8 119 #define DAC_TRIGGER_T6_TRGO ((uint32_t)DAC_CR_TEN1) /*!< TIM6 TRGO selected as external conversion trigger for DAC channel */
Kojto 90:cb3d968589d8 120 #define DAC_TRIGGER_T7_TRGO ((uint32_t)(DAC_CR_TSEL1_1 | DAC_CR_TEN1)) /*!< TIM7 TRGO selected as external conversion trigger for DAC channel */
Kojto 90:cb3d968589d8 121 #define DAC_TRIGGER_T3_TRGO ((uint32_t)(DAC_CR_TSEL1_0 | DAC_CR_TEN1)) /*!< TIM3 TRGO selected as external conversion trigger for DAC channel
Kojto 90:cb3d968589d8 122 Use __HAL_REMAPTRIGGER_ENABLE(HAL_REMAPTRIGGER_DAC1_TRIG) for TIM3 selection */
Kojto 90:cb3d968589d8 123 #define DAC_TRIGGER_T8_TRGO DAC_TRIGGER_T3_TRGO /*!< TIM8 TRGO selected as external conversion trigger for DAC channel
Kojto 90:cb3d968589d8 124 Use __HAL_REMAPTRIGGER_DISABLE(HAL_REMAPTRIGGER_DAC1_TRIG) for TIM8 selection */
Kojto 90:cb3d968589d8 125
Kojto 90:cb3d968589d8 126 #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 */
Kojto 90:cb3d968589d8 127 #define DAC_TRIGGER_SOFTWARE ((uint32_t)(DAC_CR_TSEL1 | DAC_CR_TEN1)) /*!< Conversion started by software trigger for DAC channel */
Kojto 90:cb3d968589d8 128
Kojto 90:cb3d968589d8 129 #define IS_DAC_TRIGGER(TRIGGER) (((TRIGGER) == DAC_TRIGGER_NONE) || \
Kojto 90:cb3d968589d8 130 ((TRIGGER) == DAC_TRIGGER_T2_TRGO) || \
Kojto 90:cb3d968589d8 131 ((TRIGGER) == DAC_TRIGGER_T3_TRGO) || \
Kojto 90:cb3d968589d8 132 ((TRIGGER) == DAC_TRIGGER_T4_TRGO) || \
Kojto 90:cb3d968589d8 133 ((TRIGGER) == DAC_TRIGGER_T15_TRGO) || \
Kojto 90:cb3d968589d8 134 ((TRIGGER) == DAC_TRIGGER_T6_TRGO) || \
Kojto 90:cb3d968589d8 135 ((TRIGGER) == DAC_TRIGGER_T7_TRGO) || \
Kojto 90:cb3d968589d8 136 ((TRIGGER) == DAC_TRIGGER_EXT_IT9) || \
Kojto 90:cb3d968589d8 137 ((TRIGGER) == DAC_TRIGGER_SOFTWARE))
Kojto 90:cb3d968589d8 138 #endif /* STM32F303xE || STM32F398xx || */
Kojto 90:cb3d968589d8 139 /* STM32F303xC || STM32F358xx */
Kojto 90:cb3d968589d8 140
Kojto 90:cb3d968589d8 141
Kojto 90:cb3d968589d8 142 #if defined(STM32F303x8) || defined(STM32F328xx)
Kojto 90:cb3d968589d8 143
Kojto 90:cb3d968589d8 144 #define DAC_TRIGGER_NONE ((uint32_t)0x00000000) /*!< Conversion is automatic once the DAC1_DHRxxxx register
Kojto 90:cb3d968589d8 145 has been loaded, and not by external trigger */
Kojto 90:cb3d968589d8 146 #define DAC_TRIGGER_T2_TRGO ((uint32_t)(DAC_CR_TSEL1_2 | DAC_CR_TEN1)) /*!< TIM2 TRGO selected as external conversion trigger for DAC channel */
Kojto 90:cb3d968589d8 147 #define DAC_TRIGGER_T15_TRGO ((uint32_t)(DAC_CR_TSEL1_1 | DAC_CR_TSEL1_0 | DAC_CR_TEN1)) /*!< TIM5 TRGO selected as external conversion trigger for DAC channel */
Kojto 90:cb3d968589d8 148 #define DAC_TRIGGER_T6_TRGO ((uint32_t)DAC_CR_TEN1) /*!< TIM6 TRGO selected as external conversion trigger for DAC channel */
Kojto 90:cb3d968589d8 149 #define DAC_TRIGGER_T7_TRGO ((uint32_t)(DAC_CR_TSEL1_1 | DAC_CR_TEN1)) /*!< TIM7 TRGO selected as external conversion trigger for DAC channel */
Kojto 90:cb3d968589d8 150 #define DAC_TRIGGER_T3_TRGO ((uint32_t)(DAC_CR_TSEL1_0 | DAC_CR_TEN1)) /*!< TIM3 TRGO selected as external conversion trigger for DAC channel */
Kojto 90:cb3d968589d8 151
Kojto 90:cb3d968589d8 152 #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 */
Kojto 90:cb3d968589d8 153 #define DAC_TRIGGER_SOFTWARE ((uint32_t)(DAC_CR_TSEL1 | DAC_CR_TEN1)) /*!< Conversion started by software trigger for DAC channel */
Kojto 90:cb3d968589d8 154
Kojto 90:cb3d968589d8 155 #define IS_DAC_TRIGGER(TRIGGER) (((TRIGGER) == DAC_TRIGGER_NONE) || \
Kojto 90:cb3d968589d8 156 ((TRIGGER) == DAC_TRIGGER_T2_TRGO) || \
Kojto 90:cb3d968589d8 157 ((TRIGGER) == DAC_TRIGGER_T3_TRGO) || \
Kojto 90:cb3d968589d8 158 ((TRIGGER) == DAC_TRIGGER_T15_TRGO) || \
Kojto 90:cb3d968589d8 159 ((TRIGGER) == DAC_TRIGGER_T6_TRGO) || \
Kojto 90:cb3d968589d8 160 ((TRIGGER) == DAC_TRIGGER_T7_TRGO) || \
Kojto 90:cb3d968589d8 161 ((TRIGGER) == DAC_TRIGGER_EXT_IT9) || \
Kojto 90:cb3d968589d8 162 ((TRIGGER) == DAC_TRIGGER_SOFTWARE))
Kojto 90:cb3d968589d8 163
Kojto 90:cb3d968589d8 164 #endif /* STM32F303x8 || STM32F328xx */
Kojto 90:cb3d968589d8 165
Kojto 90:cb3d968589d8 166
Kojto 90:cb3d968589d8 167 #if defined(STM32F373xC) || defined(STM32F378xx)
Kojto 90:cb3d968589d8 168
Kojto 90:cb3d968589d8 169 #define DAC_TRIGGER_NONE ((uint32_t)0x00000000) /*!< Conversion is automatic once the DAC1_DHRxxxx register
Kojto 90:cb3d968589d8 170 has been loaded, and not by external trigger */
Kojto 90:cb3d968589d8 171
Kojto 90:cb3d968589d8 172 #define DAC_TRIGGER_T2_TRGO ((uint32_t)(DAC_CR_TSEL1_2 | DAC_CR_TEN1)) /*!< TIM2 TRGO selected as external conversion trigger for DAC channel */
Kojto 90:cb3d968589d8 173 #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 */
Kojto 90:cb3d968589d8 174 #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 (DAC1) */
Kojto 90:cb3d968589d8 175 #define DAC_TRIGGER_T18_TRGO DAC_TRIGGER_T5_TRGO /*!< TIM18 TRGO selected as external conversion trigger for DAC channel (DAC2) */
Kojto 90:cb3d968589d8 176 #define DAC_TRIGGER_T6_TRGO ((uint32_t)DAC_CR_TEN1) /*!< TIM6 TRGO selected as external conversion trigger for DAC channel */
Kojto 90:cb3d968589d8 177 #define DAC_TRIGGER_T7_TRGO ((uint32_t)(DAC_CR_TSEL1_1 | DAC_CR_TEN1)) /*!< TIM7 TRGO selected as external conversion trigger for DAC channel */
Kojto 90:cb3d968589d8 178 #define DAC_TRIGGER_T3_TRGO ((uint32_t)(DAC_CR_TSEL1_0 | DAC_CR_TEN1)) /*!< TIM3 TRGO selected as external conversion trigger for DAC channel */
Kojto 90:cb3d968589d8 179
Kojto 90:cb3d968589d8 180 #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 */
Kojto 90:cb3d968589d8 181 #define DAC_TRIGGER_SOFTWARE ((uint32_t)(DAC_CR_TSEL1 | DAC_CR_TEN1)) /*!< Conversion started by software trigger for DAC channel */
Kojto 90:cb3d968589d8 182
Kojto 90:cb3d968589d8 183
Kojto 90:cb3d968589d8 184 #define IS_DAC_TRIGGER(TRIGGER) (((TRIGGER) == DAC_TRIGGER_NONE) || \
Kojto 90:cb3d968589d8 185 ((TRIGGER) == DAC_TRIGGER_T2_TRGO) || \
Kojto 90:cb3d968589d8 186 ((TRIGGER) == DAC_TRIGGER_T3_TRGO) || \
Kojto 90:cb3d968589d8 187 ((TRIGGER) == DAC_TRIGGER_T4_TRGO) || \
Kojto 90:cb3d968589d8 188 ((TRIGGER) == DAC_TRIGGER_T5_TRGO) || \
Kojto 90:cb3d968589d8 189 ((TRIGGER) == DAC_TRIGGER_T6_TRGO) || \
Kojto 90:cb3d968589d8 190 ((TRIGGER) == DAC_TRIGGER_T7_TRGO) || \
Kojto 90:cb3d968589d8 191 ((TRIGGER) == DAC_TRIGGER_EXT_IT9) || \
Kojto 90:cb3d968589d8 192 ((TRIGGER) == DAC_TRIGGER_SOFTWARE))
Kojto 90:cb3d968589d8 193 #endif /* STM32F373xC || STM32F378xx */
Kojto 90:cb3d968589d8 194
Kojto 90:cb3d968589d8 195 #if defined(STM32F334x8)
Kojto 90:cb3d968589d8 196
Kojto 90:cb3d968589d8 197 #define DAC_TRIGGER_NONE ((uint32_t)0x00000000) /*!< Conversion is automatic once the DAC1_DHRxxxx register
Kojto 90:cb3d968589d8 198 has been loaded, and not by external trigger */
Kojto 90:cb3d968589d8 199 #define DAC_TRIGGER_T6_TRGO ((uint32_t)DAC_CR_TEN1) /*!< TIM6 TRGO selected as external conversion trigger for DAC channel */
Kojto 90:cb3d968589d8 200 #define DAC_TRIGGER_T3_TRGO ((uint32_t)(DAC_CR_TSEL1_0 | DAC_CR_TEN1)) /*!< TIM3 TRGO selected as external conversion trigger for DAC channel
Kojto 90:cb3d968589d8 201 Use __HAL_REMAPTRIGGER_ENABLE(HAL_REMAPTRIGGER_DAC1_TRIG) for TIM3 remap */
Kojto 90:cb3d968589d8 202
Kojto 90:cb3d968589d8 203 #define DAC_TRIGGER_T7_TRGO ((uint32_t)(DAC_CR_TSEL1_1 | DAC_CR_TEN1)) /*!< TIM7 TRGO selected as external conversion trigger for DAC channel */
Kojto 90:cb3d968589d8 204 #define DAC_TRIGGER_T2_TRGO ((uint32_t)(DAC_CR_TSEL1_2 | DAC_CR_TEN1)) /*!< TIM2 TRGO selected as external conversion trigger for DAC channel */
Kojto 90:cb3d968589d8 205 #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
Kojto 90:cb3d968589d8 206 Use __HAL_REMAPTRIGGER_DISABLE(HAL_REMAPTRIGGER_DAC1_TRIG3) for TIM15 selection */
Kojto 90:cb3d968589d8 207 #define DAC_TRIGGER_HRTIM1_DACTRG1 DAC_TRIGGER_T15_TRGO /*!< HRTIM1 DACTRG1 selected as external conversion trigger for DAC
Kojto 90:cb3d968589d8 208 Use __HAL_REMAPTRIGGER_ENABLE(HAL_REMAPTRIGGER_DAC1_TRIG3) for HRTIM1 DACTRG1 selection */
Kojto 90:cb3d968589d8 209
Kojto 90:cb3d968589d8 210 #define DAC_TRIGGER_HRTIM1_DACTRG2 ((uint32_t)(DAC_CR_TSEL1_2 | DAC_CR_TSEL1_0 | DAC_CR_TEN1)) /*!< HRTIM1 DACTRG2 selected as external conversion trigger for DAC channel (DAC1)
Kojto 90:cb3d968589d8 211 Use __HAL_REMAPTRIGGER_ENABLE(HAL_REMAPTRIGGER_DAC1_TRIG5) for HRTIM1 DACTRG2 remap */
Kojto 90:cb3d968589d8 212 #define DAC_TRIGGER_HRTIM1_DACTRG3 DAC_TRIGGER_HRTIM1_DACTRG2 /*!< HRTIM1 DACTRG3 selected as external conversion trigger for DAC channel (DAC2)*/
Kojto 90:cb3d968589d8 213
Kojto 90:cb3d968589d8 214 #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 */
Kojto 90:cb3d968589d8 215 #define DAC_TRIGGER_SOFTWARE ((uint32_t)(DAC_CR_TSEL1 | DAC_CR_TEN1)) /*!< Conversion started by software trigger for DAC channel */
Kojto 90:cb3d968589d8 216
Kojto 90:cb3d968589d8 217 #define IS_DAC_TRIGGER(TRIGGER) (((TRIGGER) == DAC_TRIGGER_NONE) || \
Kojto 90:cb3d968589d8 218 ((TRIGGER) == DAC_TRIGGER_T6_TRGO) || \
Kojto 90:cb3d968589d8 219 ((TRIGGER) == DAC_TRIGGER_T3_TRGO) || \
Kojto 90:cb3d968589d8 220 ((TRIGGER) == DAC_TRIGGER_T7_TRGO) || \
Kojto 90:cb3d968589d8 221 ((TRIGGER) == DAC_TRIGGER_T15_TRGO) || \
Kojto 90:cb3d968589d8 222 ((TRIGGER) == DAC_TRIGGER_T2_TRGO) || \
Kojto 90:cb3d968589d8 223 ((TRIGGER) == DAC_TRIGGER_HRTIM1_DACTRG2) || \
Kojto 90:cb3d968589d8 224 ((TRIGGER) == DAC_TRIGGER_EXT_IT9) || \
Kojto 90:cb3d968589d8 225 ((TRIGGER) == DAC_TRIGGER_SOFTWARE))
Kojto 90:cb3d968589d8 226
Kojto 90:cb3d968589d8 227 #endif /* STM32F334x8 */
Kojto 90:cb3d968589d8 228
Kojto 90:cb3d968589d8 229 /**
Kojto 90:cb3d968589d8 230 * @}
Kojto 90:cb3d968589d8 231 */
Kojto 90:cb3d968589d8 232
Kojto 90:cb3d968589d8 233 /** @defgroup DACEx_Channel_selection DAC Extended Channel selection
Kojto 90:cb3d968589d8 234 * @{
Kojto 90:cb3d968589d8 235 */
Kojto 90:cb3d968589d8 236
Kojto 90:cb3d968589d8 237 #if defined(STM32F302xE) || \
Kojto 90:cb3d968589d8 238 defined(STM32F302xC) || \
Kojto 90:cb3d968589d8 239 defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx)
Kojto 90:cb3d968589d8 240 #define DAC_CHANNEL_1 ((uint32_t)0x00000000) /*!< DAC Channel 1 */
Kojto 90:cb3d968589d8 241 /* Aliases for compatibility */
Kojto 90:cb3d968589d8 242 #define DAC1_CHANNEL_1 DAC_CHANNEL_1 /*!< DAC1 Channel 1 */
Kojto 90:cb3d968589d8 243
Kojto 90:cb3d968589d8 244 #define IS_DAC_CHANNEL(CHANNEL) ((CHANNEL) == DAC_CHANNEL_1)
Kojto 90:cb3d968589d8 245 #endif /* STM32F302xE || */
Kojto 90:cb3d968589d8 246 /* STM32F302xC || */
Kojto 90:cb3d968589d8 247 /* STM32F301x8 || STM32F302x8 || STM32F318xx */
Kojto 90:cb3d968589d8 248
Kojto 90:cb3d968589d8 249
Kojto 90:cb3d968589d8 250 #if defined(STM32F303xE) || defined(STM32F398xx) || \
Kojto 90:cb3d968589d8 251 defined(STM32F303xC) || defined(STM32F358xx)
Kojto 90:cb3d968589d8 252 #define DAC_CHANNEL_1 ((uint32_t)0x00000000) /*!< DAC Channel 1 */
Kojto 90:cb3d968589d8 253 #define DAC_CHANNEL_2 ((uint32_t)0x00000010) /*!< DAC Channel 2 */
Kojto 90:cb3d968589d8 254 /* Aliases for compatibility */
Kojto 90:cb3d968589d8 255 #define DAC1_CHANNEL_1 DAC_CHANNEL_1 /*!< DAC1 Channel 1 */
Kojto 90:cb3d968589d8 256 #define DAC1_CHANNEL_2 DAC_CHANNEL_2 /*!< DAC1 Channel 2 */
Kojto 90:cb3d968589d8 257
Kojto 90:cb3d968589d8 258 #define IS_DAC_CHANNEL(CHANNEL) (((CHANNEL) == DAC_CHANNEL_1) || \
Kojto 90:cb3d968589d8 259 ((CHANNEL) == DAC_CHANNEL_2))
Kojto 90:cb3d968589d8 260 #endif /* STM32F303xE || STM32F398xx || */
Kojto 90:cb3d968589d8 261 /* STM32F303xC || STM32F358xx */
Kojto 90:cb3d968589d8 262
Kojto 90:cb3d968589d8 263 #if defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \
Kojto 90:cb3d968589d8 264 defined(STM32F373xC) || defined(STM32F378xx)
Kojto 90:cb3d968589d8 265
Kojto 90:cb3d968589d8 266 #define DAC_CHANNEL_1 ((uint32_t)0x00000000) /*!< DAC Channel 1 */
Kojto 90:cb3d968589d8 267 #define DAC_CHANNEL_2 ((uint32_t)0x00000010) /*!< DAC Channel 2 */
Kojto 90:cb3d968589d8 268
Kojto 90:cb3d968589d8 269 /* Aliases for compatibility */
Kojto 90:cb3d968589d8 270 #define DAC1_CHANNEL_1 DAC_CHANNEL_1 /*!< DAC1 Channel 1 */
Kojto 90:cb3d968589d8 271 #define DAC1_CHANNEL_2 DAC_CHANNEL_2 /*!< DAC1 Channel 2 */
Kojto 90:cb3d968589d8 272 #define DAC2_CHANNEL_1 DAC_CHANNEL_1 /*!< DAC2 Channel 1 */
Kojto 90:cb3d968589d8 273
Kojto 90:cb3d968589d8 274 #define IS_DAC_CHANNEL(CHANNEL) (((CHANNEL) == DAC_CHANNEL_1) || \
Kojto 90:cb3d968589d8 275 ((CHANNEL) == DAC_CHANNEL_2))
Kojto 90:cb3d968589d8 276 #endif /* STM32F303x8 || STM32F334x8 || STM32F328xx || */
Kojto 90:cb3d968589d8 277 /* STM32F373xC || STM32F378xx */
Kojto 90:cb3d968589d8 278
Kojto 90:cb3d968589d8 279 /**
Kojto 90:cb3d968589d8 280 * @}
Kojto 90:cb3d968589d8 281 */
Kojto 90:cb3d968589d8 282
Kojto 90:cb3d968589d8 283 /**
Kojto 90:cb3d968589d8 284 * @}
Kojto 90:cb3d968589d8 285 */
Kojto 90:cb3d968589d8 286
Kojto 90:cb3d968589d8 287 /* Exported macro ------------------------------------------------------------*/
Kojto 90:cb3d968589d8 288 /** @addtogroup DACEx_Exported_Functions DAC Extended Exported Functions
Kojto 90:cb3d968589d8 289 * @{
Kojto 90:cb3d968589d8 290 */
Kojto 90:cb3d968589d8 291 /* Extended features functions ***********************************************/
Kojto 90:cb3d968589d8 292 uint32_t HAL_DACEx_DualGetValue(DAC_HandleTypeDef* hdac);
Kojto 90:cb3d968589d8 293 HAL_StatusTypeDef HAL_DACEx_DualSetValue(DAC_HandleTypeDef* hdac, uint32_t alignment, uint32_t data1, uint32_t data2);
Kojto 90:cb3d968589d8 294 HAL_StatusTypeDef HAL_DACEx_TriangleWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t channel, uint32_t Amplitude);
Kojto 90:cb3d968589d8 295 HAL_StatusTypeDef HAL_DACEx_NoiseWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t channel, uint32_t Amplitude);
Kojto 90:cb3d968589d8 296
Kojto 90:cb3d968589d8 297 void HAL_DACEx_ConvCpltCallbackCh2(DAC_HandleTypeDef* hdac);
Kojto 90:cb3d968589d8 298 void HAL_DACEx_ConvHalfCpltCallbackCh2(DAC_HandleTypeDef* hdac);
Kojto 90:cb3d968589d8 299 void HAL_DACEx_ErrorCallbackCh2(DAC_HandleTypeDef *hdac);
Kojto 90:cb3d968589d8 300 void HAL_DACEx_DMAUnderrunCallbackCh2(DAC_HandleTypeDef *hdac);
Kojto 90:cb3d968589d8 301
Kojto 90:cb3d968589d8 302 /**
Kojto 90:cb3d968589d8 303 * @}
Kojto 90:cb3d968589d8 304 */
Kojto 90:cb3d968589d8 305
Kojto 90:cb3d968589d8 306 /**
Kojto 90:cb3d968589d8 307 * @}
Kojto 90:cb3d968589d8 308 */
Kojto 90:cb3d968589d8 309
Kojto 90:cb3d968589d8 310 /**
Kojto 90:cb3d968589d8 311 * @}
Kojto 90:cb3d968589d8 312 */
Kojto 90:cb3d968589d8 313
Kojto 90:cb3d968589d8 314 #ifdef __cplusplus
Kojto 90:cb3d968589d8 315 }
Kojto 90:cb3d968589d8 316 #endif
Kojto 90:cb3d968589d8 317
Kojto 90:cb3d968589d8 318 #endif /* __STM32F3xx_HAL_HAL_EX_H */
Kojto 90:cb3d968589d8 319
Kojto 90:cb3d968589d8 320 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/