Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
108:34e6b704fe68
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 85:024bf7f99721 1 /**
bogdanm 85:024bf7f99721 2 ******************************************************************************
bogdanm 92:4fc01daae5a5 3 * @file stm32f0xx_hal_dac_ex.h
bogdanm 85:024bf7f99721 4 * @author MCD Application Team
Kojto 108:34e6b704fe68 5 * @version V1.3.0
Kojto 108:34e6b704fe68 6 * @date 26-June-2015
bogdanm 85:024bf7f99721 7 * @brief Header file of DAC HAL Extension module.
bogdanm 85:024bf7f99721 8 ******************************************************************************
bogdanm 85:024bf7f99721 9 * @attention
bogdanm 85:024bf7f99721 10 *
Kojto 108:34e6b704fe68 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
bogdanm 85:024bf7f99721 12 *
bogdanm 85:024bf7f99721 13 * Redistribution and use in source and binary forms, with or without modification,
bogdanm 85:024bf7f99721 14 * are permitted provided that the following conditions are met:
bogdanm 85:024bf7f99721 15 * 1. Redistributions of source code must retain the above copyright notice,
bogdanm 85:024bf7f99721 16 * this list of conditions and the following disclaimer.
bogdanm 85:024bf7f99721 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
bogdanm 85:024bf7f99721 18 * this list of conditions and the following disclaimer in the documentation
bogdanm 85:024bf7f99721 19 * and/or other materials provided with the distribution.
bogdanm 85:024bf7f99721 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bogdanm 85:024bf7f99721 21 * may be used to endorse or promote products derived from this software
bogdanm 85:024bf7f99721 22 * without specific prior written permission.
bogdanm 85:024bf7f99721 23 *
bogdanm 85:024bf7f99721 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bogdanm 85:024bf7f99721 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bogdanm 85:024bf7f99721 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bogdanm 85:024bf7f99721 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bogdanm 85:024bf7f99721 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bogdanm 85:024bf7f99721 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bogdanm 85:024bf7f99721 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bogdanm 85:024bf7f99721 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bogdanm 85:024bf7f99721 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bogdanm 85:024bf7f99721 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bogdanm 85:024bf7f99721 34 *
bogdanm 85:024bf7f99721 35 ******************************************************************************
bogdanm 85:024bf7f99721 36 */
bogdanm 85:024bf7f99721 37
bogdanm 85:024bf7f99721 38 /* Define to prevent recursive inclusion -------------------------------------*/
bogdanm 85:024bf7f99721 39 #ifndef __STM32F0xx_HAL_DAC_EX_H
bogdanm 85:024bf7f99721 40 #define __STM32F0xx_HAL_DAC_EX_H
bogdanm 85:024bf7f99721 41
bogdanm 85:024bf7f99721 42 #ifdef __cplusplus
bogdanm 85:024bf7f99721 43 extern "C" {
bogdanm 85:024bf7f99721 44 #endif
bogdanm 85:024bf7f99721 45
Kojto 108:34e6b704fe68 46 /** @addtogroup STM32F0xx_HAL_Driver
Kojto 108:34e6b704fe68 47 * @{
Kojto 108:34e6b704fe68 48 */
Kojto 108:34e6b704fe68 49
bogdanm 85:024bf7f99721 50 #if defined(STM32F051x8) || defined(STM32F058xx) || \
bogdanm 92:4fc01daae5a5 51 defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || \
bogdanm 92:4fc01daae5a5 52 defined(STM32F091xC) || defined(STM32F098xx)
bogdanm 85:024bf7f99721 53
bogdanm 85:024bf7f99721 54 /* Includes ------------------------------------------------------------------*/
bogdanm 85:024bf7f99721 55 #include "stm32f0xx_hal_def.h"
bogdanm 85:024bf7f99721 56
bogdanm 85:024bf7f99721 57 /** @addtogroup DACEx
bogdanm 85:024bf7f99721 58 * @{
bogdanm 85:024bf7f99721 59 */
bogdanm 85:024bf7f99721 60
bogdanm 85:024bf7f99721 61 /* Exported types ------------------------------------------------------------*/
bogdanm 85:024bf7f99721 62
Kojto 108:34e6b704fe68 63 /* Exported constants --------------------------------------------------------*/
bogdanm 85:024bf7f99721 64
bogdanm 92:4fc01daae5a5 65 /** @defgroup DACEx_Exported_Constants DACEx Exported Constants
bogdanm 92:4fc01daae5a5 66 * @{
bogdanm 92:4fc01daae5a5 67 */
bogdanm 85:024bf7f99721 68
bogdanm 92:4fc01daae5a5 69 /** @defgroup DACEx_lfsrunmask_triangleamplitude DACEx lfsrunmask triangleamplitude
bogdanm 85:024bf7f99721 70 * @{
bogdanm 85:024bf7f99721 71 */
bogdanm 85:024bf7f99721 72 #define DAC_LFSRUNMASK_BIT0 ((uint32_t)0x00000000) /*!< Unmask DAC channel LFSR bit0 for noise wave generation */
bogdanm 85:024bf7f99721 73 #define DAC_LFSRUNMASK_BITS1_0 ((uint32_t)DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[1:0] for noise wave generation */
bogdanm 85:024bf7f99721 74 #define DAC_LFSRUNMASK_BITS2_0 ((uint32_t)DAC_CR_MAMP1_1) /*!< Unmask DAC channel LFSR bit[2:0] for noise wave generation */
bogdanm 85:024bf7f99721 75 #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 */
bogdanm 85:024bf7f99721 76 #define DAC_LFSRUNMASK_BITS4_0 ((uint32_t)DAC_CR_MAMP1_2) /*!< Unmask DAC channel LFSR bit[4:0] for noise wave generation */
bogdanm 85:024bf7f99721 77 #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 */
bogdanm 85:024bf7f99721 78 #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 */
bogdanm 85:024bf7f99721 79 #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 */
bogdanm 85:024bf7f99721 80 #define DAC_LFSRUNMASK_BITS8_0 ((uint32_t)DAC_CR_MAMP1_3) /*!< Unmask DAC channel LFSR bit[8:0] for noise wave generation */
bogdanm 85:024bf7f99721 81 #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 */
bogdanm 85:024bf7f99721 82 #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 */
bogdanm 85:024bf7f99721 83 #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 */
bogdanm 85:024bf7f99721 84 #define DAC_TRIANGLEAMPLITUDE_1 ((uint32_t)0x00000000) /*!< Select max triangle amplitude of 1 */
bogdanm 85:024bf7f99721 85 #define DAC_TRIANGLEAMPLITUDE_3 ((uint32_t)DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 3 */
bogdanm 85:024bf7f99721 86 #define DAC_TRIANGLEAMPLITUDE_7 ((uint32_t)DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 7 */
bogdanm 85:024bf7f99721 87 #define DAC_TRIANGLEAMPLITUDE_15 ((uint32_t)DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 15 */
bogdanm 85:024bf7f99721 88 #define DAC_TRIANGLEAMPLITUDE_31 ((uint32_t)DAC_CR_MAMP1_2) /*!< Select max triangle amplitude of 31 */
bogdanm 85:024bf7f99721 89 #define DAC_TRIANGLEAMPLITUDE_63 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 63 */
bogdanm 85:024bf7f99721 90 #define DAC_TRIANGLEAMPLITUDE_127 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 127 */
bogdanm 85:024bf7f99721 91 #define DAC_TRIANGLEAMPLITUDE_255 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 255 */
bogdanm 85:024bf7f99721 92 #define DAC_TRIANGLEAMPLITUDE_511 ((uint32_t)DAC_CR_MAMP1_3) /*!< Select max triangle amplitude of 511 */
bogdanm 85:024bf7f99721 93 #define DAC_TRIANGLEAMPLITUDE_1023 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 1023 */
bogdanm 85:024bf7f99721 94 #define DAC_TRIANGLEAMPLITUDE_2047 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 2047 */
bogdanm 85:024bf7f99721 95 #define DAC_TRIANGLEAMPLITUDE_4095 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 4095 */
bogdanm 85:024bf7f99721 96
Kojto 108:34e6b704fe68 97
Kojto 108:34e6b704fe68 98 /**
Kojto 108:34e6b704fe68 99 * @}
Kojto 108:34e6b704fe68 100 */
Kojto 108:34e6b704fe68 101
Kojto 108:34e6b704fe68 102 /**
Kojto 108:34e6b704fe68 103 * @}
Kojto 108:34e6b704fe68 104 */
Kojto 108:34e6b704fe68 105
Kojto 108:34e6b704fe68 106 /* Exported macro ------------------------------------------------------------*/
Kojto 108:34e6b704fe68 107
Kojto 108:34e6b704fe68 108
Kojto 108:34e6b704fe68 109 /** @defgroup DACEx_Exported_Macros DACEx Exported Macros
Kojto 108:34e6b704fe68 110 * @{
Kojto 108:34e6b704fe68 111 */
Kojto 108:34e6b704fe68 112
Kojto 108:34e6b704fe68 113 /** @defgroup DAC_trigger_selection DAC trigger selection
Kojto 108:34e6b704fe68 114 * @{
Kojto 108:34e6b704fe68 115 */
Kojto 108:34e6b704fe68 116 #if defined(STM32F051x8) || defined(STM32F058xx)
Kojto 108:34e6b704fe68 117
Kojto 108:34e6b704fe68 118 #define DAC_TRIGGER_NONE ((uint32_t)0x00000000) /*!< Conversion is automatic once the DAC1_DHRxxxx register
Kojto 108:34e6b704fe68 119 has been loaded, and not by external trigger */
Kojto 108:34e6b704fe68 120 #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 108:34e6b704fe68 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 108:34e6b704fe68 122 #define DAC_TRIGGER_T6_TRGO ((uint32_t)DAC_CR_TEN1) /*!< TIM6 TRGO selected as external conversion trigger for DAC channel */
Kojto 108:34e6b704fe68 123 #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 108:34e6b704fe68 124 #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 108:34e6b704fe68 125 #define DAC_TRIGGER_SOFTWARE ((uint32_t)(DAC_CR_TSEL1 | DAC_CR_TEN1)) /*!< Conversion started by software trigger for DAC channel */
Kojto 108:34e6b704fe68 126
Kojto 108:34e6b704fe68 127 #endif /* STM32F051x8 || STM32F058xx */
Kojto 108:34e6b704fe68 128
Kojto 108:34e6b704fe68 129 #if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || \
Kojto 108:34e6b704fe68 130 defined(STM32F091xC) || defined(STM32F098xx)
Kojto 108:34e6b704fe68 131
Kojto 108:34e6b704fe68 132 #define DAC_TRIGGER_NONE ((uint32_t)0x00000000) /*!< Conversion is automatic once the DAC1_DHRxxxx register
Kojto 108:34e6b704fe68 133 has been loaded, and not by external trigger */
Kojto 108:34e6b704fe68 134 #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 108:34e6b704fe68 135 #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 108:34e6b704fe68 136 #define DAC_TRIGGER_T6_TRGO ((uint32_t)DAC_CR_TEN1) /*!< TIM6 TRGO selected as external conversion trigger for DAC channel */
Kojto 108:34e6b704fe68 137 #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 108:34e6b704fe68 138 #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 108:34e6b704fe68 139 #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 108:34e6b704fe68 140 #define DAC_TRIGGER_SOFTWARE ((uint32_t)(DAC_CR_TSEL1 | DAC_CR_TEN1)) /*!< Conversion started by software trigger for DAC channel */
Kojto 108:34e6b704fe68 141
Kojto 108:34e6b704fe68 142 #endif /* STM32F071xB || STM32F072xB || STM32F078xx || */
Kojto 108:34e6b704fe68 143 /* STM32F091xC || STM32F098xx */
Kojto 108:34e6b704fe68 144
Kojto 108:34e6b704fe68 145 /**
Kojto 108:34e6b704fe68 146 * @}
Kojto 108:34e6b704fe68 147 */
Kojto 108:34e6b704fe68 148
Kojto 108:34e6b704fe68 149 /** @defgroup DAC_Channel_selection DAC Channel selection
Kojto 108:34e6b704fe68 150 * @{
Kojto 108:34e6b704fe68 151 */
Kojto 108:34e6b704fe68 152
Kojto 108:34e6b704fe68 153 #if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || \
Kojto 108:34e6b704fe68 154 defined(STM32F091xC) || defined(STM32F098xx)
Kojto 108:34e6b704fe68 155
Kojto 108:34e6b704fe68 156 #define DAC_CHANNEL_1 ((uint32_t)0x00000000)
Kojto 108:34e6b704fe68 157 #define DAC_CHANNEL_2 ((uint32_t)0x00000010)
Kojto 108:34e6b704fe68 158
Kojto 108:34e6b704fe68 159 #endif /* STM32F071xB || STM32F072xB || STM32F078xx || */
Kojto 108:34e6b704fe68 160 /* STM32F091xC || STM32F098xx */
Kojto 108:34e6b704fe68 161
Kojto 108:34e6b704fe68 162 #if defined(STM32F051x8) || defined(STM32F058xx)
Kojto 108:34e6b704fe68 163
Kojto 108:34e6b704fe68 164 #define DAC_CHANNEL_1 ((uint32_t)0x00000000)
Kojto 108:34e6b704fe68 165
Kojto 108:34e6b704fe68 166 #endif /* STM32F051x8 || STM32F058xx */
Kojto 108:34e6b704fe68 167
Kojto 108:34e6b704fe68 168 /**
Kojto 108:34e6b704fe68 169 * @}
Kojto 108:34e6b704fe68 170 */
Kojto 108:34e6b704fe68 171
Kojto 108:34e6b704fe68 172 /**
Kojto 108:34e6b704fe68 173 * @}
Kojto 108:34e6b704fe68 174 */
Kojto 108:34e6b704fe68 175
Kojto 108:34e6b704fe68 176 /* Private macro -------------------------------------------------------------*/
Kojto 108:34e6b704fe68 177
Kojto 108:34e6b704fe68 178 /** @addtogroup DACEx_Private_Macros
Kojto 108:34e6b704fe68 179 * @{
Kojto 108:34e6b704fe68 180 */
Kojto 108:34e6b704fe68 181
Kojto 108:34e6b704fe68 182 #if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || \
Kojto 108:34e6b704fe68 183 defined(STM32F091xC) || defined(STM32F098xx)
Kojto 108:34e6b704fe68 184
Kojto 108:34e6b704fe68 185 #define IS_DAC_TRIGGER(TRIGGER) (((TRIGGER) == DAC_TRIGGER_NONE) || \
Kojto 108:34e6b704fe68 186 ((TRIGGER) == DAC_TRIGGER_T2_TRGO) || \
Kojto 108:34e6b704fe68 187 ((TRIGGER) == DAC_TRIGGER_T3_TRGO) || \
Kojto 108:34e6b704fe68 188 ((TRIGGER) == DAC_TRIGGER_T6_TRGO) || \
Kojto 108:34e6b704fe68 189 ((TRIGGER) == DAC_TRIGGER_T7_TRGO) || \
Kojto 108:34e6b704fe68 190 ((TRIGGER) == DAC_TRIGGER_T15_TRGO) || \
Kojto 108:34e6b704fe68 191 ((TRIGGER) == DAC_TRIGGER_EXT_IT9) || \
Kojto 108:34e6b704fe68 192 ((TRIGGER) == DAC_TRIGGER_SOFTWARE))
Kojto 108:34e6b704fe68 193
Kojto 108:34e6b704fe68 194 #endif /* STM32F071xB || STM32F072xB || STM32F078xx || */
Kojto 108:34e6b704fe68 195 /* STM32F091xC || STM32F098xx */
Kojto 108:34e6b704fe68 196
Kojto 108:34e6b704fe68 197 #if defined(STM32F051x8) || defined(STM32F058xx)
Kojto 108:34e6b704fe68 198
Kojto 108:34e6b704fe68 199 #define IS_DAC_TRIGGER(TRIGGER) (((TRIGGER) == DAC_TRIGGER_NONE) || \
Kojto 108:34e6b704fe68 200 ((TRIGGER) == DAC_TRIGGER_T2_TRGO) || \
Kojto 108:34e6b704fe68 201 ((TRIGGER) == DAC_TRIGGER_T3_TRGO) || \
Kojto 108:34e6b704fe68 202 ((TRIGGER) == DAC_TRIGGER_T6_TRGO) || \
Kojto 108:34e6b704fe68 203 ((TRIGGER) == DAC_TRIGGER_T15_TRGO) || \
Kojto 108:34e6b704fe68 204 ((TRIGGER) == DAC_TRIGGER_EXT_IT9) || \
Kojto 108:34e6b704fe68 205 ((TRIGGER) == DAC_TRIGGER_SOFTWARE))
Kojto 108:34e6b704fe68 206
Kojto 108:34e6b704fe68 207 #endif /* STM32F051x8 || STM32F058xx */
Kojto 108:34e6b704fe68 208
Kojto 108:34e6b704fe68 209 #if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || \
Kojto 108:34e6b704fe68 210 defined(STM32F091xC) || defined(STM32F098xx)
Kojto 108:34e6b704fe68 211
Kojto 108:34e6b704fe68 212 #define IS_DAC_TRIGGER(TRIGGER) (((TRIGGER) == DAC_TRIGGER_NONE) || \
Kojto 108:34e6b704fe68 213 ((TRIGGER) == DAC_TRIGGER_T2_TRGO) || \
Kojto 108:34e6b704fe68 214 ((TRIGGER) == DAC_TRIGGER_T3_TRGO) || \
Kojto 108:34e6b704fe68 215 ((TRIGGER) == DAC_TRIGGER_T6_TRGO) || \
Kojto 108:34e6b704fe68 216 ((TRIGGER) == DAC_TRIGGER_T7_TRGO) || \
Kojto 108:34e6b704fe68 217 ((TRIGGER) == DAC_TRIGGER_T15_TRGO) || \
Kojto 108:34e6b704fe68 218 ((TRIGGER) == DAC_TRIGGER_EXT_IT9) || \
Kojto 108:34e6b704fe68 219 ((TRIGGER) == DAC_TRIGGER_SOFTWARE))
Kojto 108:34e6b704fe68 220
Kojto 108:34e6b704fe68 221 #endif /* STM32F071xB || STM32F072xB || STM32F078xx || */
Kojto 108:34e6b704fe68 222 /* STM32F091xC || STM32F098xx */
Kojto 108:34e6b704fe68 223
bogdanm 85:024bf7f99721 224 #define IS_DAC_LFSR_UNMASK_TRIANGLE_AMPLITUDE(VALUE) (((VALUE) == DAC_LFSRUNMASK_BIT0) || \
bogdanm 85:024bf7f99721 225 ((VALUE) == DAC_LFSRUNMASK_BITS1_0) || \
bogdanm 85:024bf7f99721 226 ((VALUE) == DAC_LFSRUNMASK_BITS2_0) || \
bogdanm 85:024bf7f99721 227 ((VALUE) == DAC_LFSRUNMASK_BITS3_0) || \
bogdanm 85:024bf7f99721 228 ((VALUE) == DAC_LFSRUNMASK_BITS4_0) || \
bogdanm 85:024bf7f99721 229 ((VALUE) == DAC_LFSRUNMASK_BITS5_0) || \
bogdanm 85:024bf7f99721 230 ((VALUE) == DAC_LFSRUNMASK_BITS6_0) || \
bogdanm 85:024bf7f99721 231 ((VALUE) == DAC_LFSRUNMASK_BITS7_0) || \
bogdanm 85:024bf7f99721 232 ((VALUE) == DAC_LFSRUNMASK_BITS8_0) || \
bogdanm 85:024bf7f99721 233 ((VALUE) == DAC_LFSRUNMASK_BITS9_0) || \
bogdanm 85:024bf7f99721 234 ((VALUE) == DAC_LFSRUNMASK_BITS10_0) || \
bogdanm 85:024bf7f99721 235 ((VALUE) == DAC_LFSRUNMASK_BITS11_0) || \
bogdanm 85:024bf7f99721 236 ((VALUE) == DAC_TRIANGLEAMPLITUDE_1) || \
bogdanm 85:024bf7f99721 237 ((VALUE) == DAC_TRIANGLEAMPLITUDE_3) || \
bogdanm 85:024bf7f99721 238 ((VALUE) == DAC_TRIANGLEAMPLITUDE_7) || \
bogdanm 85:024bf7f99721 239 ((VALUE) == DAC_TRIANGLEAMPLITUDE_15) || \
bogdanm 85:024bf7f99721 240 ((VALUE) == DAC_TRIANGLEAMPLITUDE_31) || \
bogdanm 85:024bf7f99721 241 ((VALUE) == DAC_TRIANGLEAMPLITUDE_63) || \
bogdanm 85:024bf7f99721 242 ((VALUE) == DAC_TRIANGLEAMPLITUDE_127) || \
bogdanm 85:024bf7f99721 243 ((VALUE) == DAC_TRIANGLEAMPLITUDE_255) || \
bogdanm 85:024bf7f99721 244 ((VALUE) == DAC_TRIANGLEAMPLITUDE_511) || \
bogdanm 85:024bf7f99721 245 ((VALUE) == DAC_TRIANGLEAMPLITUDE_1023) || \
bogdanm 85:024bf7f99721 246 ((VALUE) == DAC_TRIANGLEAMPLITUDE_2047) || \
bogdanm 85:024bf7f99721 247 ((VALUE) == DAC_TRIANGLEAMPLITUDE_4095))
Kojto 108:34e6b704fe68 248
bogdanm 85:024bf7f99721 249 /**
bogdanm 85:024bf7f99721 250 * @}
bogdanm 85:024bf7f99721 251 */
bogdanm 85:024bf7f99721 252
Kojto 108:34e6b704fe68 253 /* Exported functions --------------------------------------------------------*/
Kojto 108:34e6b704fe68 254
Kojto 108:34e6b704fe68 255 /** @addtogroup DACEx_Exported_Functions
bogdanm 85:024bf7f99721 256 * @{
bogdanm 85:024bf7f99721 257 */
Kojto 108:34e6b704fe68 258
Kojto 108:34e6b704fe68 259 /** @addtogroup DACEx_Exported_Functions_Group1
Kojto 108:34e6b704fe68 260 * @{
Kojto 108:34e6b704fe68 261 */
Kojto 108:34e6b704fe68 262 /* IO operation functions *****************************************************/
Kojto 108:34e6b704fe68 263
Kojto 108:34e6b704fe68 264 HAL_StatusTypeDef HAL_DACEx_TriangleWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude);
Kojto 108:34e6b704fe68 265 HAL_StatusTypeDef HAL_DACEx_NoiseWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude);
Kojto 108:34e6b704fe68 266 HAL_StatusTypeDef HAL_DACEx_DualSetValue(DAC_HandleTypeDef* hdac, uint32_t Alignment, uint32_t Data1, uint32_t Data2);
bogdanm 85:024bf7f99721 267
Kojto 108:34e6b704fe68 268 void HAL_DACEx_ConvCpltCallbackCh2(DAC_HandleTypeDef* hdac);
Kojto 108:34e6b704fe68 269 void HAL_DACEx_ConvHalfCpltCallbackCh2(DAC_HandleTypeDef* hdac);
Kojto 108:34e6b704fe68 270 void HAL_DACEx_ErrorCallbackCh2(DAC_HandleTypeDef* hdac);
Kojto 108:34e6b704fe68 271 void HAL_DACEx_DMAUnderrunCallbackCh2(DAC_HandleTypeDef* hdac);
Kojto 108:34e6b704fe68 272
Kojto 108:34e6b704fe68 273 /**
Kojto 108:34e6b704fe68 274 * @}
Kojto 108:34e6b704fe68 275 */
Kojto 108:34e6b704fe68 276
Kojto 108:34e6b704fe68 277 /** @addtogroup DACEx_Exported_Functions_Group3
Kojto 108:34e6b704fe68 278 * @{
Kojto 108:34e6b704fe68 279 */
Kojto 108:34e6b704fe68 280 /* Peripheral Control functions ***********************************************/
Kojto 108:34e6b704fe68 281
Kojto 108:34e6b704fe68 282 uint32_t HAL_DACEx_DualGetValue(DAC_HandleTypeDef* hdac);
Kojto 108:34e6b704fe68 283
bogdanm 92:4fc01daae5a5 284 /**
bogdanm 92:4fc01daae5a5 285 * @}
bogdanm 92:4fc01daae5a5 286 */
bogdanm 85:024bf7f99721 287
bogdanm 85:024bf7f99721 288 /**
bogdanm 85:024bf7f99721 289 * @}
bogdanm 85:024bf7f99721 290 */
bogdanm 85:024bf7f99721 291
bogdanm 92:4fc01daae5a5 292 /**
bogdanm 92:4fc01daae5a5 293 * @}
bogdanm 92:4fc01daae5a5 294 */
bogdanm 85:024bf7f99721 295
Kojto 108:34e6b704fe68 296 #endif /* STM32F051x8 || STM32F058xx || */
Kojto 108:34e6b704fe68 297 /* STM32F071xB || STM32F072xB || STM32F078xx || */
Kojto 108:34e6b704fe68 298 /* STM32F091xC || STM32F098xx */
bogdanm 85:024bf7f99721 299
bogdanm 85:024bf7f99721 300 /**
bogdanm 85:024bf7f99721 301 * @}
bogdanm 85:024bf7f99721 302 */
bogdanm 85:024bf7f99721 303
bogdanm 85:024bf7f99721 304 #ifdef __cplusplus
bogdanm 85:024bf7f99721 305 }
Kojto 108:34e6b704fe68 306 #endif
Kojto 108:34e6b704fe68 307
bogdanm 85:024bf7f99721 308 #endif /*__STM32F0xx_HAL_DAC_EX_H */
bogdanm 85:024bf7f99721 309
bogdanm 85:024bf7f99721 310 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/