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