mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Tue Jan 06 16:15:36 2015 +0000
Revision:
441:d2c15dda23c1
Parent:
392:2b59412bb664
Child:
630:825f75ca301e
Synchronized with git revision 245a60b29caabb42eabdd19658eeac7c3f68313b

Full URL: https://github.com/mbedmicro/mbed/commit/245a60b29caabb42eabdd19658eeac7c3f68313b/

NUCLEO_F072RB/F091RC - adding target to rtos lib and exporter for coide and gcc_arm

Who changed what in which revision?

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