meh

Fork of mbed by mbed official

Committer:
Kojto
Date:
Tue Feb 03 15:31:20 2015 +0000
Revision:
93:e188a91d3eaa
Parent:
90:cb3d968589d8
Child:
108:34e6b704fe68
Release 93 of the mbed library

Main changes:

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

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 90:cb3d968589d8 1 /**
Kojto 90:cb3d968589d8 2 ******************************************************************************
Kojto 90:cb3d968589d8 3 * @file stm32f0xx_hal_dac_ex.h
Kojto 90:cb3d968589d8 4 * @author MCD Application Team
Kojto 93:e188a91d3eaa 5 * @version V1.2.0
Kojto 93:e188a91d3eaa 6 * @date 11-December-2014
Kojto 90:cb3d968589d8 7 * @brief Header file of DAC HAL Extension 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 __STM32F0xx_HAL_DAC_EX_H
Kojto 90:cb3d968589d8 40 #define __STM32F0xx_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 #if defined(STM32F051x8) || defined(STM32F058xx) || \
Kojto 90:cb3d968589d8 47 defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || \
Kojto 90:cb3d968589d8 48 defined(STM32F091xC) || defined(STM32F098xx)
Kojto 90:cb3d968589d8 49
Kojto 90:cb3d968589d8 50 /* Includes ------------------------------------------------------------------*/
Kojto 90:cb3d968589d8 51 #include "stm32f0xx_hal_def.h"
Kojto 90:cb3d968589d8 52
Kojto 90:cb3d968589d8 53 /** @addtogroup STM32F0xx_HAL_Driver
Kojto 90:cb3d968589d8 54 * @{
Kojto 90:cb3d968589d8 55 */
Kojto 90:cb3d968589d8 56
Kojto 90:cb3d968589d8 57 /** @addtogroup DACEx
Kojto 90:cb3d968589d8 58 * @{
Kojto 90:cb3d968589d8 59 */
Kojto 90:cb3d968589d8 60
Kojto 90:cb3d968589d8 61 /* Exported types ------------------------------------------------------------*/
Kojto 90:cb3d968589d8 62
Kojto 90:cb3d968589d8 63 /**
Kojto 90:cb3d968589d8 64 * @brief HAL State structures definition
Kojto 90:cb3d968589d8 65 */
Kojto 90:cb3d968589d8 66
Kojto 90:cb3d968589d8 67 /* Exported constants --------------------------------------------------------*/
Kojto 90:cb3d968589d8 68 /** @defgroup DACEx_Exported_Constants DACEx Exported Constants
Kojto 90:cb3d968589d8 69 * @{
Kojto 90:cb3d968589d8 70 */
Kojto 90:cb3d968589d8 71 /** @defgroup DACEx_wave_generation DACEx wave generation
Kojto 90:cb3d968589d8 72 * @{
Kojto 90:cb3d968589d8 73 */
Kojto 90:cb3d968589d8 74 #define DAC_WAVEGENERATION_NONE ((uint32_t)0x00000000)
Kojto 90:cb3d968589d8 75 #define DAC_WAVEGENERATION_NOISE ((uint32_t)DAC_CR_WAVE1_0)
Kojto 90:cb3d968589d8 76 #define DAC_WAVEGENERATION_TRIANGLE ((uint32_t)DAC_CR_WAVE1_1)
Kojto 90:cb3d968589d8 77
Kojto 90:cb3d968589d8 78 #define IS_DAC_GENERATE_WAVE(WAVE) (((WAVE) == DAC_WAVEGENERATION_NONE) || \
Kojto 90:cb3d968589d8 79 ((WAVE) == DAC_WAVEGENERATION_NOISE) || \
Kojto 90:cb3d968589d8 80 ((WAVE) == DAC_WAVEGENERATION_TRIANGLE))
Kojto 90:cb3d968589d8 81 /**
Kojto 90:cb3d968589d8 82 * @}
Kojto 90:cb3d968589d8 83 */
Kojto 90:cb3d968589d8 84
Kojto 90:cb3d968589d8 85 /** @defgroup DACEx_lfsrunmask_triangleamplitude DACEx lfsrunmask triangleamplitude
Kojto 90:cb3d968589d8 86 * @{
Kojto 90:cb3d968589d8 87 */
Kojto 90:cb3d968589d8 88 #define DAC_LFSRUNMASK_BIT0 ((uint32_t)0x00000000) /*!< Unmask DAC channel LFSR bit0 for noise wave generation */
Kojto 90:cb3d968589d8 89 #define DAC_LFSRUNMASK_BITS1_0 ((uint32_t)DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[1:0] for noise wave generation */
Kojto 90:cb3d968589d8 90 #define DAC_LFSRUNMASK_BITS2_0 ((uint32_t)DAC_CR_MAMP1_1) /*!< Unmask DAC channel LFSR bit[2:0] for noise wave generation */
Kojto 90:cb3d968589d8 91 #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 */
Kojto 90:cb3d968589d8 92 #define DAC_LFSRUNMASK_BITS4_0 ((uint32_t)DAC_CR_MAMP1_2) /*!< Unmask DAC channel LFSR bit[4:0] for noise wave generation */
Kojto 90:cb3d968589d8 93 #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 */
Kojto 90:cb3d968589d8 94 #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 */
Kojto 90:cb3d968589d8 95 #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 */
Kojto 90:cb3d968589d8 96 #define DAC_LFSRUNMASK_BITS8_0 ((uint32_t)DAC_CR_MAMP1_3) /*!< Unmask DAC channel LFSR bit[8:0] for noise wave generation */
Kojto 90:cb3d968589d8 97 #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 */
Kojto 90:cb3d968589d8 98 #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 */
Kojto 90:cb3d968589d8 99 #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 */
Kojto 90:cb3d968589d8 100 #define DAC_TRIANGLEAMPLITUDE_1 ((uint32_t)0x00000000) /*!< Select max triangle amplitude of 1 */
Kojto 90:cb3d968589d8 101 #define DAC_TRIANGLEAMPLITUDE_3 ((uint32_t)DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 3 */
Kojto 90:cb3d968589d8 102 #define DAC_TRIANGLEAMPLITUDE_7 ((uint32_t)DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 7 */
Kojto 90:cb3d968589d8 103 #define DAC_TRIANGLEAMPLITUDE_15 ((uint32_t)DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 15 */
Kojto 90:cb3d968589d8 104 #define DAC_TRIANGLEAMPLITUDE_31 ((uint32_t)DAC_CR_MAMP1_2) /*!< Select max triangle amplitude of 31 */
Kojto 90:cb3d968589d8 105 #define DAC_TRIANGLEAMPLITUDE_63 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 63 */
Kojto 90:cb3d968589d8 106 #define DAC_TRIANGLEAMPLITUDE_127 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 127 */
Kojto 90:cb3d968589d8 107 #define DAC_TRIANGLEAMPLITUDE_255 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 255 */
Kojto 90:cb3d968589d8 108 #define DAC_TRIANGLEAMPLITUDE_511 ((uint32_t)DAC_CR_MAMP1_3) /*!< Select max triangle amplitude of 511 */
Kojto 90:cb3d968589d8 109 #define DAC_TRIANGLEAMPLITUDE_1023 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 1023 */
Kojto 90:cb3d968589d8 110 #define DAC_TRIANGLEAMPLITUDE_2047 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 2047 */
Kojto 90:cb3d968589d8 111 #define DAC_TRIANGLEAMPLITUDE_4095 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 4095 */
Kojto 90:cb3d968589d8 112
Kojto 90:cb3d968589d8 113 #define IS_DAC_LFSR_UNMASK_TRIANGLE_AMPLITUDE(VALUE) (((VALUE) == DAC_LFSRUNMASK_BIT0) || \
Kojto 90:cb3d968589d8 114 ((VALUE) == DAC_LFSRUNMASK_BITS1_0) || \
Kojto 90:cb3d968589d8 115 ((VALUE) == DAC_LFSRUNMASK_BITS2_0) || \
Kojto 90:cb3d968589d8 116 ((VALUE) == DAC_LFSRUNMASK_BITS3_0) || \
Kojto 90:cb3d968589d8 117 ((VALUE) == DAC_LFSRUNMASK_BITS4_0) || \
Kojto 90:cb3d968589d8 118 ((VALUE) == DAC_LFSRUNMASK_BITS5_0) || \
Kojto 90:cb3d968589d8 119 ((VALUE) == DAC_LFSRUNMASK_BITS6_0) || \
Kojto 90:cb3d968589d8 120 ((VALUE) == DAC_LFSRUNMASK_BITS7_0) || \
Kojto 90:cb3d968589d8 121 ((VALUE) == DAC_LFSRUNMASK_BITS8_0) || \
Kojto 90:cb3d968589d8 122 ((VALUE) == DAC_LFSRUNMASK_BITS9_0) || \
Kojto 90:cb3d968589d8 123 ((VALUE) == DAC_LFSRUNMASK_BITS10_0) || \
Kojto 90:cb3d968589d8 124 ((VALUE) == DAC_LFSRUNMASK_BITS11_0) || \
Kojto 90:cb3d968589d8 125 ((VALUE) == DAC_TRIANGLEAMPLITUDE_1) || \
Kojto 90:cb3d968589d8 126 ((VALUE) == DAC_TRIANGLEAMPLITUDE_3) || \
Kojto 90:cb3d968589d8 127 ((VALUE) == DAC_TRIANGLEAMPLITUDE_7) || \
Kojto 90:cb3d968589d8 128 ((VALUE) == DAC_TRIANGLEAMPLITUDE_15) || \
Kojto 90:cb3d968589d8 129 ((VALUE) == DAC_TRIANGLEAMPLITUDE_31) || \
Kojto 90:cb3d968589d8 130 ((VALUE) == DAC_TRIANGLEAMPLITUDE_63) || \
Kojto 90:cb3d968589d8 131 ((VALUE) == DAC_TRIANGLEAMPLITUDE_127) || \
Kojto 90:cb3d968589d8 132 ((VALUE) == DAC_TRIANGLEAMPLITUDE_255) || \
Kojto 90:cb3d968589d8 133 ((VALUE) == DAC_TRIANGLEAMPLITUDE_511) || \
Kojto 90:cb3d968589d8 134 ((VALUE) == DAC_TRIANGLEAMPLITUDE_1023) || \
Kojto 90:cb3d968589d8 135 ((VALUE) == DAC_TRIANGLEAMPLITUDE_2047) || \
Kojto 90:cb3d968589d8 136 ((VALUE) == DAC_TRIANGLEAMPLITUDE_4095))
Kojto 90:cb3d968589d8 137 /**
Kojto 90:cb3d968589d8 138 * @}
Kojto 90:cb3d968589d8 139 */
Kojto 90:cb3d968589d8 140
Kojto 90:cb3d968589d8 141 /** @defgroup DACEx_wave_generationbis DACEx wave generation bis
Kojto 90:cb3d968589d8 142 * @{
Kojto 90:cb3d968589d8 143 */
Kojto 90:cb3d968589d8 144 #define DAC_WAVE_NOISE ((uint32_t)DAC_CR_WAVE1_0)
Kojto 90:cb3d968589d8 145 #define DAC_WAVE_TRIANGLE ((uint32_t)DAC_CR_WAVE1_1)
Kojto 90:cb3d968589d8 146
Kojto 90:cb3d968589d8 147 #define IS_DAC_WAVE(WAVE) (((WAVE) == DAC_WAVE_NOISE) || \
Kojto 90:cb3d968589d8 148 ((WAVE) == DAC_WAVE_TRIANGLE))
Kojto 90:cb3d968589d8 149
Kojto 90:cb3d968589d8 150 /**
Kojto 90:cb3d968589d8 151 * @}
Kojto 90:cb3d968589d8 152 */
Kojto 90:cb3d968589d8 153
Kojto 90:cb3d968589d8 154 /**
Kojto 90:cb3d968589d8 155 * @}
Kojto 90:cb3d968589d8 156 */
Kojto 90:cb3d968589d8 157
Kojto 90:cb3d968589d8 158 /* Exported macro ------------------------------------------------------------*/
Kojto 90:cb3d968589d8 159
Kojto 90:cb3d968589d8 160 /** @defgroup DACEx_Exported_Macros DACEx Exported Macros
Kojto 90:cb3d968589d8 161 * @{
Kojto 90:cb3d968589d8 162 */
Kojto 90:cb3d968589d8 163
Kojto 90:cb3d968589d8 164 /** @defgroup DAC_trigger_selection DAC trigger selection
Kojto 90:cb3d968589d8 165 * @{
Kojto 90:cb3d968589d8 166 */
Kojto 90:cb3d968589d8 167 #if defined(STM32F051x8) || defined(STM32F058xx)
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 #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 172 #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 173 #define DAC_TRIGGER_T6_TRGO ((uint32_t)DAC_CR_TEN1) /*!< TIM6 TRGO selected as external conversion trigger for DAC channel */
Kojto 90:cb3d968589d8 174 #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 175 #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 176 #define DAC_TRIGGER_SOFTWARE ((uint32_t)(DAC_CR_TSEL1 | DAC_CR_TEN1)) /*!< Conversion started by software trigger for DAC channel */
Kojto 90:cb3d968589d8 177
Kojto 90:cb3d968589d8 178 #define IS_DAC_TRIGGER(TRIGGER) (((TRIGGER) == DAC_TRIGGER_NONE) || \
Kojto 90:cb3d968589d8 179 ((TRIGGER) == DAC_TRIGGER_T2_TRGO) || \
Kojto 90:cb3d968589d8 180 ((TRIGGER) == DAC_TRIGGER_T3_TRGO) || \
Kojto 90:cb3d968589d8 181 ((TRIGGER) == DAC_TRIGGER_T6_TRGO) || \
Kojto 90:cb3d968589d8 182 ((TRIGGER) == DAC_TRIGGER_T15_TRGO) || \
Kojto 90:cb3d968589d8 183 ((TRIGGER) == DAC_TRIGGER_EXT_IT9) || \
Kojto 90:cb3d968589d8 184 ((TRIGGER) == DAC_TRIGGER_SOFTWARE))
Kojto 90:cb3d968589d8 185
Kojto 90:cb3d968589d8 186 #endif /* STM32F051x8 || STM32F058xx */
Kojto 90:cb3d968589d8 187
Kojto 90:cb3d968589d8 188 #if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || \
Kojto 90:cb3d968589d8 189 defined(STM32F091xC) || defined(STM32F098xx)
Kojto 90:cb3d968589d8 190
Kojto 90:cb3d968589d8 191 #define DAC_TRIGGER_NONE ((uint32_t)0x00000000) /*!< Conversion is automatic once the DAC1_DHRxxxx register
Kojto 90:cb3d968589d8 192 has been loaded, and not by external trigger */
Kojto 90:cb3d968589d8 193 #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 194 #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 195 #define DAC_TRIGGER_T6_TRGO ((uint32_t)DAC_CR_TEN1) /*!< TIM6 TRGO selected as external conversion trigger for DAC channel */
Kojto 90:cb3d968589d8 196 #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 197 #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 198 #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 199 #define DAC_TRIGGER_SOFTWARE ((uint32_t)(DAC_CR_TSEL1 | DAC_CR_TEN1)) /*!< Conversion started by software trigger for DAC channel */
Kojto 90:cb3d968589d8 200
Kojto 90:cb3d968589d8 201 #define IS_DAC_TRIGGER(TRIGGER) (((TRIGGER) == DAC_TRIGGER_NONE) || \
Kojto 90:cb3d968589d8 202 ((TRIGGER) == DAC_TRIGGER_T2_TRGO) || \
Kojto 90:cb3d968589d8 203 ((TRIGGER) == DAC_TRIGGER_T3_TRGO) || \
Kojto 90:cb3d968589d8 204 ((TRIGGER) == DAC_TRIGGER_T6_TRGO) || \
Kojto 90:cb3d968589d8 205 ((TRIGGER) == DAC_TRIGGER_T7_TRGO) || \
Kojto 90:cb3d968589d8 206 ((TRIGGER) == DAC_TRIGGER_T15_TRGO) || \
Kojto 90:cb3d968589d8 207 ((TRIGGER) == DAC_TRIGGER_EXT_IT9) || \
Kojto 90:cb3d968589d8 208 ((TRIGGER) == DAC_TRIGGER_SOFTWARE))
Kojto 90:cb3d968589d8 209
Kojto 90:cb3d968589d8 210 #endif /* STM32F071xB || STM32F072xB || STM32F078xx || */
Kojto 90:cb3d968589d8 211 /* STM32F091xC || STM32F098xx */
Kojto 90:cb3d968589d8 212 /**
Kojto 90:cb3d968589d8 213 * @}
Kojto 90:cb3d968589d8 214 */
Kojto 90:cb3d968589d8 215
Kojto 90:cb3d968589d8 216 /** @defgroup DAC_Channel_selection DAC Channel selection
Kojto 90:cb3d968589d8 217 * @{
Kojto 90:cb3d968589d8 218 */
Kojto 90:cb3d968589d8 219
Kojto 90:cb3d968589d8 220 #if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || \
Kojto 90:cb3d968589d8 221 defined(STM32F091xC) || defined(STM32F098xx)
Kojto 90:cb3d968589d8 222
Kojto 90:cb3d968589d8 223 #define DAC_CHANNEL_1 ((uint32_t)0x00000000)
Kojto 90:cb3d968589d8 224 #define DAC_CHANNEL_2 ((uint32_t)0x00000010)
Kojto 90:cb3d968589d8 225
Kojto 90:cb3d968589d8 226 #define IS_DAC_CHANNEL(CHANNEL) (((CHANNEL) == DAC_CHANNEL_1) || \
Kojto 90:cb3d968589d8 227 ((CHANNEL) == DAC_CHANNEL_2))
Kojto 90:cb3d968589d8 228
Kojto 90:cb3d968589d8 229 #endif /* STM32F071xB || STM32F072xB || STM32F078xx || */
Kojto 90:cb3d968589d8 230 /* STM32F091xC || STM32F098xx */
Kojto 90:cb3d968589d8 231
Kojto 90:cb3d968589d8 232 #if defined(STM32F051x8) || defined(STM32F058xx)
Kojto 90:cb3d968589d8 233
Kojto 90:cb3d968589d8 234 #define DAC_CHANNEL_1 ((uint32_t)0x00000000)
Kojto 90:cb3d968589d8 235 #define IS_DAC_CHANNEL(CHANNEL) (((CHANNEL) == DAC_CHANNEL_1))
Kojto 90:cb3d968589d8 236
Kojto 90:cb3d968589d8 237 #endif /* STM32F051x8 || STM32F058xx */
Kojto 90:cb3d968589d8 238
Kojto 90:cb3d968589d8 239 /**
Kojto 90:cb3d968589d8 240 * @}
Kojto 90:cb3d968589d8 241 */
Kojto 90:cb3d968589d8 242
Kojto 90:cb3d968589d8 243 /**
Kojto 90:cb3d968589d8 244 * @}
Kojto 90:cb3d968589d8 245 */
Kojto 90:cb3d968589d8 246
Kojto 90:cb3d968589d8 247 /* Exported functions --------------------------------------------------------*/
Kojto 90:cb3d968589d8 248 /* Extension features functions ***********************************************/
Kojto 90:cb3d968589d8 249
Kojto 90:cb3d968589d8 250 /** @addtogroup DACEx_Exported_Functions
Kojto 90:cb3d968589d8 251 * @{
Kojto 90:cb3d968589d8 252 */
Kojto 90:cb3d968589d8 253
Kojto 90:cb3d968589d8 254 /** @addtogroup DACEx_Exported_Functions_Group1 Extended features functions
Kojto 90:cb3d968589d8 255 * @brief Extended features functions
Kojto 90:cb3d968589d8 256 * @{
Kojto 90:cb3d968589d8 257 */
Kojto 90:cb3d968589d8 258
Kojto 90:cb3d968589d8 259 uint32_t HAL_DACEx_DualGetValue(DAC_HandleTypeDef* hdac);
Kojto 90:cb3d968589d8 260 HAL_StatusTypeDef HAL_DACEx_TriangleWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude);
Kojto 90:cb3d968589d8 261 HAL_StatusTypeDef HAL_DACEx_NoiseWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude);
Kojto 90:cb3d968589d8 262 HAL_StatusTypeDef HAL_DACEx_DualSetValue(DAC_HandleTypeDef* hdac, uint32_t Alignment, uint32_t Data1, uint32_t Data2);
Kojto 90:cb3d968589d8 263
Kojto 90:cb3d968589d8 264 void HAL_DACEx_ConvCpltCallbackCh2(DAC_HandleTypeDef* hdac);
Kojto 90:cb3d968589d8 265 void HAL_DACEx_ConvHalfCpltCallbackCh2(DAC_HandleTypeDef* hdac);
Kojto 90:cb3d968589d8 266 void HAL_DACEx_ErrorCallbackCh2(DAC_HandleTypeDef* hdac);
Kojto 90:cb3d968589d8 267 void HAL_DACEx_DMAUnderrunCallbackCh2(DAC_HandleTypeDef* hdac);
Kojto 90:cb3d968589d8 268
Kojto 90:cb3d968589d8 269 void DAC_DMAConvCpltCh2(DMA_HandleTypeDef *hdma);
Kojto 90:cb3d968589d8 270 void DAC_DMAErrorCh2(DMA_HandleTypeDef *hdma);
Kojto 90:cb3d968589d8 271 void DAC_DMAHalfConvCpltCh2(DMA_HandleTypeDef *hdma);
Kojto 90:cb3d968589d8 272 /**
Kojto 90:cb3d968589d8 273 * @}
Kojto 90:cb3d968589d8 274 */
Kojto 90:cb3d968589d8 275
Kojto 90:cb3d968589d8 276 /**
Kojto 90:cb3d968589d8 277 * @}
Kojto 90:cb3d968589d8 278 */
Kojto 90:cb3d968589d8 279 #endif /* */
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 */
Kojto 90:cb3d968589d8 288
Kojto 90:cb3d968589d8 289 #ifdef __cplusplus
Kojto 90:cb3d968589d8 290 }
Kojto 90:cb3d968589d8 291 #endif /* STM32F051x8 || STM32F058xx || */
Kojto 90:cb3d968589d8 292 /* STM32F071xB || STM32F072xB || STM32F078xx || */
Kojto 90:cb3d968589d8 293 /* STM32F091xC || STM32F098xx */
Kojto 90:cb3d968589d8 294
Kojto 90:cb3d968589d8 295 #endif /*__STM32F0xx_HAL_DAC_EX_H */
Kojto 90:cb3d968589d8 296
Kojto 90:cb3d968589d8 297 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/