mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Committer:
AnnaBridge
Date:
Wed Feb 20 22:31:08 2019 +0000
Revision:
189:f392fc9709a3
Parent:
186:707f6e361f3e
mbed library release version 165

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 158:b23ee177fd68 1 /**
Kojto 158:b23ee177fd68 2 ******************************************************************************
Kojto 158:b23ee177fd68 3 * @file stm32l0xx_ll_dac.c
Kojto 158:b23ee177fd68 4 * @author MCD Application Team
Kojto 158:b23ee177fd68 5 * @brief DAC LL module driver
Kojto 158:b23ee177fd68 6 ******************************************************************************
Kojto 158:b23ee177fd68 7 * @attention
Kojto 158:b23ee177fd68 8 *
Kojto 158:b23ee177fd68 9 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
Kojto 158:b23ee177fd68 10 *
Kojto 158:b23ee177fd68 11 * Redistribution and use in source and binary forms, with or without modification,
Kojto 158:b23ee177fd68 12 * are permitted provided that the following conditions are met:
Kojto 158:b23ee177fd68 13 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 158:b23ee177fd68 14 * this list of conditions and the following disclaimer.
Kojto 158:b23ee177fd68 15 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 158:b23ee177fd68 16 * this list of conditions and the following disclaimer in the documentation
Kojto 158:b23ee177fd68 17 * and/or other materials provided with the distribution.
Kojto 158:b23ee177fd68 18 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 158:b23ee177fd68 19 * may be used to endorse or promote products derived from this software
Kojto 158:b23ee177fd68 20 * without specific prior written permission.
Kojto 158:b23ee177fd68 21 *
Kojto 158:b23ee177fd68 22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 158:b23ee177fd68 23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 158:b23ee177fd68 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 158:b23ee177fd68 25 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 158:b23ee177fd68 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 158:b23ee177fd68 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 158:b23ee177fd68 28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 158:b23ee177fd68 29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 158:b23ee177fd68 30 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 158:b23ee177fd68 31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 158:b23ee177fd68 32 *
Kojto 158:b23ee177fd68 33 ******************************************************************************
Kojto 158:b23ee177fd68 34 */
Kojto 158:b23ee177fd68 35 #if defined(USE_FULL_LL_DRIVER)
Kojto 158:b23ee177fd68 36
Kojto 158:b23ee177fd68 37 /* Includes ------------------------------------------------------------------*/
Kojto 158:b23ee177fd68 38 #include "stm32l0xx_ll_dac.h"
Kojto 158:b23ee177fd68 39 #include "stm32l0xx_ll_bus.h"
Kojto 158:b23ee177fd68 40
Anna Bridge 186:707f6e361f3e 41 #ifdef USE_FULL_ASSERT
Kojto 158:b23ee177fd68 42 #include "stm32_assert.h"
Kojto 158:b23ee177fd68 43 #else
Kojto 158:b23ee177fd68 44 #define assert_param(expr) ((void)0U)
Kojto 158:b23ee177fd68 45 #endif
Kojto 158:b23ee177fd68 46
Kojto 158:b23ee177fd68 47 /** @addtogroup STM32L0xx_LL_Driver
Kojto 158:b23ee177fd68 48 * @{
Kojto 158:b23ee177fd68 49 */
Kojto 158:b23ee177fd68 50
Kojto 158:b23ee177fd68 51 #if defined (DAC1)
Kojto 158:b23ee177fd68 52
Kojto 158:b23ee177fd68 53 /** @addtogroup DAC_LL DAC
Kojto 158:b23ee177fd68 54 * @{
Kojto 158:b23ee177fd68 55 */
Kojto 158:b23ee177fd68 56
Kojto 158:b23ee177fd68 57 /* Private types -------------------------------------------------------------*/
Kojto 158:b23ee177fd68 58 /* Private variables ---------------------------------------------------------*/
Kojto 158:b23ee177fd68 59 /* Private constants ---------------------------------------------------------*/
Kojto 158:b23ee177fd68 60 /* Private macros ------------------------------------------------------------*/
Kojto 158:b23ee177fd68 61
Kojto 158:b23ee177fd68 62 /** @addtogroup DAC_LL_Private_Macros
Kojto 158:b23ee177fd68 63 * @{
Kojto 158:b23ee177fd68 64 */
Kojto 158:b23ee177fd68 65
Kojto 158:b23ee177fd68 66 #if defined(DAC_CHANNEL2_SUPPORT)
Kojto 158:b23ee177fd68 67 #define IS_LL_DAC_CHANNEL(__DACX__, __DAC_CHANNEL__) \
Kojto 158:b23ee177fd68 68 ( \
Kojto 158:b23ee177fd68 69 ((__DAC_CHANNEL__) == LL_DAC_CHANNEL_1) \
Kojto 158:b23ee177fd68 70 || ((__DAC_CHANNEL__) == LL_DAC_CHANNEL_2) \
Kojto 158:b23ee177fd68 71 )
Kojto 158:b23ee177fd68 72 #else
Kojto 158:b23ee177fd68 73 #define IS_LL_DAC_CHANNEL(__DACX__, __DAC_CHANNEL__) \
Kojto 158:b23ee177fd68 74 ( \
Kojto 158:b23ee177fd68 75 ((__DAC_CHANNEL__) == LL_DAC_CHANNEL_1) \
Kojto 158:b23ee177fd68 76 )
Kojto 158:b23ee177fd68 77 #endif /* DAC_CHANNEL2_SUPPORT */
Kojto 158:b23ee177fd68 78
Kojto 158:b23ee177fd68 79 #define IS_LL_DAC_TRIGGER_SOURCE(__TRIGGER_SOURCE__) \
Kojto 158:b23ee177fd68 80 ( ((__TRIGGER_SOURCE__) == LL_DAC_TRIG_SOFTWARE) \
Kojto 158:b23ee177fd68 81 || ((__TRIGGER_SOURCE__) == LL_DAC_TRIG_EXT_TIM2_TRGO) \
Kojto 158:b23ee177fd68 82 || ((__TRIGGER_SOURCE__) == LL_DAC_TRIG_EXT_TIM3_TRGO) \
Kojto 158:b23ee177fd68 83 || ((__TRIGGER_SOURCE__) == LL_DAC_TRIG_EXT_TIM3_CH3) \
Kojto 158:b23ee177fd68 84 || ((__TRIGGER_SOURCE__) == LL_DAC_TRIG_EXT_TIM6_TRGO) \
Kojto 158:b23ee177fd68 85 || ((__TRIGGER_SOURCE__) == LL_DAC_TRIG_EXT_TIM7_TRGO) \
Kojto 158:b23ee177fd68 86 || ((__TRIGGER_SOURCE__) == LL_DAC_TRIG_EXT_TIM21_TRGO) \
Kojto 158:b23ee177fd68 87 || ((__TRIGGER_SOURCE__) == LL_DAC_TRIG_EXT_EXTI_LINE9) \
Kojto 158:b23ee177fd68 88 )
Kojto 158:b23ee177fd68 89
Kojto 158:b23ee177fd68 90 #define IS_LL_DAC_WAVE_AUTO_GENER_MODE(__WAVE_AUTO_GENERATION_MODE__) \
Kojto 158:b23ee177fd68 91 ( ((__WAVE_AUTO_GENERATION_MODE__) == LL_DAC_WAVE_AUTO_GENERATION_NONE) \
Kojto 158:b23ee177fd68 92 || ((__WAVE_AUTO_GENERATION_MODE__) == LL_DAC_WAVE_AUTO_GENERATION_NOISE) \
Kojto 158:b23ee177fd68 93 || ((__WAVE_AUTO_GENERATION_MODE__) == LL_DAC_WAVE_AUTO_GENERATION_TRIANGLE) \
Kojto 158:b23ee177fd68 94 )
Kojto 158:b23ee177fd68 95
Kojto 158:b23ee177fd68 96 #define IS_LL_DAC_WAVE_AUTO_GENER_CONFIG(__WAVE_AUTO_GENERATION_CONFIG__) \
Kojto 158:b23ee177fd68 97 ( ((__WAVE_AUTO_GENERATION_CONFIG__) == LL_DAC_NOISE_LFSR_UNMASK_BIT0) \
Kojto 158:b23ee177fd68 98 || ((__WAVE_AUTO_GENERATION_CONFIG__) == LL_DAC_NOISE_LFSR_UNMASK_BITS1_0) \
Kojto 158:b23ee177fd68 99 || ((__WAVE_AUTO_GENERATION_CONFIG__) == LL_DAC_NOISE_LFSR_UNMASK_BITS2_0) \
Kojto 158:b23ee177fd68 100 || ((__WAVE_AUTO_GENERATION_CONFIG__) == LL_DAC_NOISE_LFSR_UNMASK_BITS3_0) \
Kojto 158:b23ee177fd68 101 || ((__WAVE_AUTO_GENERATION_CONFIG__) == LL_DAC_NOISE_LFSR_UNMASK_BITS4_0) \
Kojto 158:b23ee177fd68 102 || ((__WAVE_AUTO_GENERATION_CONFIG__) == LL_DAC_NOISE_LFSR_UNMASK_BITS5_0) \
Kojto 158:b23ee177fd68 103 || ((__WAVE_AUTO_GENERATION_CONFIG__) == LL_DAC_NOISE_LFSR_UNMASK_BITS6_0) \
Kojto 158:b23ee177fd68 104 || ((__WAVE_AUTO_GENERATION_CONFIG__) == LL_DAC_NOISE_LFSR_UNMASK_BITS7_0) \
Kojto 158:b23ee177fd68 105 || ((__WAVE_AUTO_GENERATION_CONFIG__) == LL_DAC_NOISE_LFSR_UNMASK_BITS8_0) \
Kojto 158:b23ee177fd68 106 || ((__WAVE_AUTO_GENERATION_CONFIG__) == LL_DAC_NOISE_LFSR_UNMASK_BITS9_0) \
Kojto 158:b23ee177fd68 107 || ((__WAVE_AUTO_GENERATION_CONFIG__) == LL_DAC_NOISE_LFSR_UNMASK_BITS10_0) \
Kojto 158:b23ee177fd68 108 || ((__WAVE_AUTO_GENERATION_CONFIG__) == LL_DAC_NOISE_LFSR_UNMASK_BITS11_0) \
Kojto 158:b23ee177fd68 109 || ((__WAVE_AUTO_GENERATION_CONFIG__) == LL_DAC_TRIANGLE_AMPLITUDE_1) \
Kojto 158:b23ee177fd68 110 || ((__WAVE_AUTO_GENERATION_CONFIG__) == LL_DAC_TRIANGLE_AMPLITUDE_3) \
Kojto 158:b23ee177fd68 111 || ((__WAVE_AUTO_GENERATION_CONFIG__) == LL_DAC_TRIANGLE_AMPLITUDE_7) \
Kojto 158:b23ee177fd68 112 || ((__WAVE_AUTO_GENERATION_CONFIG__) == LL_DAC_TRIANGLE_AMPLITUDE_15) \
Kojto 158:b23ee177fd68 113 || ((__WAVE_AUTO_GENERATION_CONFIG__) == LL_DAC_TRIANGLE_AMPLITUDE_31) \
Kojto 158:b23ee177fd68 114 || ((__WAVE_AUTO_GENERATION_CONFIG__) == LL_DAC_TRIANGLE_AMPLITUDE_63) \
Kojto 158:b23ee177fd68 115 || ((__WAVE_AUTO_GENERATION_CONFIG__) == LL_DAC_TRIANGLE_AMPLITUDE_127) \
Kojto 158:b23ee177fd68 116 || ((__WAVE_AUTO_GENERATION_CONFIG__) == LL_DAC_TRIANGLE_AMPLITUDE_255) \
Kojto 158:b23ee177fd68 117 || ((__WAVE_AUTO_GENERATION_CONFIG__) == LL_DAC_TRIANGLE_AMPLITUDE_511) \
Kojto 158:b23ee177fd68 118 || ((__WAVE_AUTO_GENERATION_CONFIG__) == LL_DAC_TRIANGLE_AMPLITUDE_1023) \
Kojto 158:b23ee177fd68 119 || ((__WAVE_AUTO_GENERATION_CONFIG__) == LL_DAC_TRIANGLE_AMPLITUDE_2047) \
Kojto 158:b23ee177fd68 120 || ((__WAVE_AUTO_GENERATION_CONFIG__) == LL_DAC_TRIANGLE_AMPLITUDE_4095) \
Kojto 158:b23ee177fd68 121 )
Kojto 158:b23ee177fd68 122
Kojto 158:b23ee177fd68 123 #define IS_LL_DAC_OUTPUT_BUFFER(__OUTPUT_BUFFER__) \
Kojto 158:b23ee177fd68 124 ( ((__OUTPUT_BUFFER__) == LL_DAC_OUTPUT_BUFFER_ENABLE) \
Kojto 158:b23ee177fd68 125 || ((__OUTPUT_BUFFER__) == LL_DAC_OUTPUT_BUFFER_DISABLE) \
Kojto 158:b23ee177fd68 126 )
Kojto 158:b23ee177fd68 127
Kojto 158:b23ee177fd68 128 /**
Kojto 158:b23ee177fd68 129 * @}
Kojto 158:b23ee177fd68 130 */
Kojto 158:b23ee177fd68 131
Kojto 158:b23ee177fd68 132
Kojto 158:b23ee177fd68 133 /* Private function prototypes -----------------------------------------------*/
Kojto 158:b23ee177fd68 134
Kojto 158:b23ee177fd68 135 /* Exported functions --------------------------------------------------------*/
Kojto 158:b23ee177fd68 136 /** @addtogroup DAC_LL_Exported_Functions
Kojto 158:b23ee177fd68 137 * @{
Kojto 158:b23ee177fd68 138 */
Kojto 158:b23ee177fd68 139
Kojto 158:b23ee177fd68 140 /** @addtogroup DAC_LL_EF_Init
Kojto 158:b23ee177fd68 141 * @{
Kojto 158:b23ee177fd68 142 */
Kojto 158:b23ee177fd68 143
Kojto 158:b23ee177fd68 144 /**
Kojto 158:b23ee177fd68 145 * @brief De-initialize registers of the selected DAC instance
Kojto 158:b23ee177fd68 146 * to their default reset values.
Kojto 158:b23ee177fd68 147 * @param DACx DAC instance
Kojto 158:b23ee177fd68 148 * @retval An ErrorStatus enumeration value:
Kojto 158:b23ee177fd68 149 * - SUCCESS: DAC registers are de-initialized
Kojto 158:b23ee177fd68 150 * - ERROR: not applicable
Kojto 158:b23ee177fd68 151 */
Kojto 158:b23ee177fd68 152 ErrorStatus LL_DAC_DeInit(DAC_TypeDef *DACx)
Kojto 158:b23ee177fd68 153 {
Kojto 158:b23ee177fd68 154 /* Check the parameters */
Kojto 158:b23ee177fd68 155 assert_param(IS_DAC_ALL_INSTANCE(DACx));
Kojto 158:b23ee177fd68 156
Kojto 158:b23ee177fd68 157 /* Force reset of DAC clock */
Kojto 158:b23ee177fd68 158 LL_APB1_GRP1_ForceReset(LL_APB1_GRP1_PERIPH_DAC1);
Kojto 158:b23ee177fd68 159
Kojto 158:b23ee177fd68 160 /* Release reset of DAC clock */
Kojto 158:b23ee177fd68 161 LL_APB1_GRP1_ReleaseReset(LL_APB1_GRP1_PERIPH_DAC1);
Kojto 158:b23ee177fd68 162
Kojto 158:b23ee177fd68 163 return SUCCESS;
Kojto 158:b23ee177fd68 164 }
Kojto 158:b23ee177fd68 165
Kojto 158:b23ee177fd68 166 /**
Kojto 158:b23ee177fd68 167 * @brief Initialize some features of DAC instance.
Kojto 158:b23ee177fd68 168 * @note The setting of these parameters by function @ref LL_DAC_Init()
Kojto 158:b23ee177fd68 169 * is conditioned to DAC state:
Kojto 158:b23ee177fd68 170 * DAC instance must be disabled.
Kojto 158:b23ee177fd68 171 * @param DACx DAC instance
Kojto 158:b23ee177fd68 172 * @param DAC_Channel This parameter can be one of the following values:
Kojto 158:b23ee177fd68 173 * @arg @ref LL_DAC_CHANNEL_1
Kojto 158:b23ee177fd68 174 * @arg @ref LL_DAC_CHANNEL_2 (1)
Kojto 158:b23ee177fd68 175 *
Anna Bridge 186:707f6e361f3e 176 * (1) On this STM32 serie, parameter not available on all devices.
Kojto 158:b23ee177fd68 177 * Refer to device datasheet for channels availability.
Kojto 158:b23ee177fd68 178 * @param DAC_InitStruct Pointer to a @ref LL_DAC_InitTypeDef structure
Kojto 158:b23ee177fd68 179 * @retval An ErrorStatus enumeration value:
Kojto 158:b23ee177fd68 180 * - SUCCESS: DAC registers are initialized
Kojto 158:b23ee177fd68 181 * - ERROR: DAC registers are not initialized
Kojto 158:b23ee177fd68 182 */
Kojto 158:b23ee177fd68 183 ErrorStatus LL_DAC_Init(DAC_TypeDef *DACx, uint32_t DAC_Channel, LL_DAC_InitTypeDef *DAC_InitStruct)
Kojto 158:b23ee177fd68 184 {
Kojto 158:b23ee177fd68 185 ErrorStatus status = SUCCESS;
Kojto 158:b23ee177fd68 186
Kojto 158:b23ee177fd68 187 /* Check the parameters */
Kojto 158:b23ee177fd68 188 assert_param(IS_DAC_ALL_INSTANCE(DACx));
Kojto 158:b23ee177fd68 189 assert_param(IS_LL_DAC_CHANNEL(DACx, DAC_Channel));
Kojto 158:b23ee177fd68 190 assert_param(IS_LL_DAC_TRIGGER_SOURCE(DAC_InitStruct->TriggerSource));
Kojto 158:b23ee177fd68 191 assert_param(IS_LL_DAC_OUTPUT_BUFFER(DAC_InitStruct->OutputBuffer));
Kojto 158:b23ee177fd68 192 assert_param(IS_LL_DAC_WAVE_AUTO_GENER_MODE(DAC_InitStruct->WaveAutoGeneration));
Kojto 158:b23ee177fd68 193 if (DAC_InitStruct->WaveAutoGeneration != LL_DAC_WAVE_AUTO_GENERATION_NONE)
Kojto 158:b23ee177fd68 194 {
Kojto 158:b23ee177fd68 195 assert_param(IS_LL_DAC_WAVE_AUTO_GENER_CONFIG(DAC_InitStruct->WaveAutoGenerationConfig));
Kojto 158:b23ee177fd68 196 }
Kojto 158:b23ee177fd68 197
Kojto 158:b23ee177fd68 198 /* Note: Hardware constraint (refer to description of this function) */
Kojto 158:b23ee177fd68 199 /* DAC instance must be disabled. */
Kojto 158:b23ee177fd68 200 if(LL_DAC_IsEnabled(DACx, DAC_Channel) == 0U)
Kojto 158:b23ee177fd68 201 {
Kojto 158:b23ee177fd68 202 /* Configuration of DAC channel: */
Kojto 158:b23ee177fd68 203 /* - TriggerSource */
Kojto 158:b23ee177fd68 204 /* - WaveAutoGeneration */
Kojto 158:b23ee177fd68 205 /* - OutputBuffer */
Kojto 158:b23ee177fd68 206 if (DAC_InitStruct->WaveAutoGeneration != LL_DAC_WAVE_AUTO_GENERATION_NONE)
Kojto 158:b23ee177fd68 207 {
Kojto 158:b23ee177fd68 208 MODIFY_REG(DACx->CR,
Kojto 158:b23ee177fd68 209 ( DAC_CR_TSEL1
Kojto 158:b23ee177fd68 210 | DAC_CR_WAVE1
Kojto 158:b23ee177fd68 211 | DAC_CR_MAMP1
Kojto 158:b23ee177fd68 212 | DAC_CR_BOFF1
Kojto 158:b23ee177fd68 213 ) << (DAC_Channel & DAC_CR_CHX_BITOFFSET_MASK)
Kojto 158:b23ee177fd68 214 ,
Kojto 158:b23ee177fd68 215 ( DAC_InitStruct->TriggerSource
Kojto 158:b23ee177fd68 216 | DAC_InitStruct->WaveAutoGeneration
Kojto 158:b23ee177fd68 217 | DAC_InitStruct->WaveAutoGenerationConfig
Kojto 158:b23ee177fd68 218 | DAC_InitStruct->OutputBuffer
Kojto 158:b23ee177fd68 219 ) << (DAC_Channel & DAC_CR_CHX_BITOFFSET_MASK)
Kojto 158:b23ee177fd68 220 );
Kojto 158:b23ee177fd68 221 }
Kojto 158:b23ee177fd68 222 else
Kojto 158:b23ee177fd68 223 {
Kojto 158:b23ee177fd68 224 MODIFY_REG(DACx->CR,
Kojto 158:b23ee177fd68 225 ( DAC_CR_TSEL1
Kojto 158:b23ee177fd68 226 | DAC_CR_WAVE1
Kojto 158:b23ee177fd68 227 | DAC_CR_BOFF1
Kojto 158:b23ee177fd68 228 ) << (DAC_Channel & DAC_CR_CHX_BITOFFSET_MASK)
Kojto 158:b23ee177fd68 229 ,
Kojto 158:b23ee177fd68 230 ( DAC_InitStruct->TriggerSource
Kojto 158:b23ee177fd68 231 | LL_DAC_WAVE_AUTO_GENERATION_NONE
Kojto 158:b23ee177fd68 232 | DAC_InitStruct->OutputBuffer
Kojto 158:b23ee177fd68 233 ) << (DAC_Channel & DAC_CR_CHX_BITOFFSET_MASK)
Kojto 158:b23ee177fd68 234 );
Kojto 158:b23ee177fd68 235 }
Kojto 158:b23ee177fd68 236 }
Kojto 158:b23ee177fd68 237 else
Kojto 158:b23ee177fd68 238 {
Kojto 158:b23ee177fd68 239 /* Initialization error: DAC instance is not disabled. */
Kojto 158:b23ee177fd68 240 status = ERROR;
Kojto 158:b23ee177fd68 241 }
Kojto 158:b23ee177fd68 242 return status;
Kojto 158:b23ee177fd68 243 }
Kojto 158:b23ee177fd68 244
Kojto 158:b23ee177fd68 245 /**
Kojto 158:b23ee177fd68 246 * @brief Set each @ref LL_DAC_InitTypeDef field to default value.
Kojto 158:b23ee177fd68 247 * @param DAC_InitStruct pointer to a @ref LL_DAC_InitTypeDef structure
Kojto 158:b23ee177fd68 248 * whose fields will be set to default values.
Kojto 158:b23ee177fd68 249 * @retval None
Kojto 158:b23ee177fd68 250 */
Kojto 158:b23ee177fd68 251 void LL_DAC_StructInit(LL_DAC_InitTypeDef *DAC_InitStruct)
Kojto 158:b23ee177fd68 252 {
Kojto 158:b23ee177fd68 253 /* Set DAC_InitStruct fields to default values */
Kojto 158:b23ee177fd68 254 DAC_InitStruct->TriggerSource = LL_DAC_TRIG_SOFTWARE;
Kojto 158:b23ee177fd68 255 DAC_InitStruct->WaveAutoGeneration = LL_DAC_WAVE_AUTO_GENERATION_NONE;
Kojto 158:b23ee177fd68 256 /* Note: Parameter discarded if wave auto generation is disabled, */
Kojto 158:b23ee177fd68 257 /* set anyway to its default value. */
Kojto 158:b23ee177fd68 258 DAC_InitStruct->WaveAutoGenerationConfig = LL_DAC_NOISE_LFSR_UNMASK_BIT0;
Kojto 158:b23ee177fd68 259 DAC_InitStruct->OutputBuffer = LL_DAC_OUTPUT_BUFFER_ENABLE;
Kojto 158:b23ee177fd68 260 }
Kojto 158:b23ee177fd68 261
Kojto 158:b23ee177fd68 262 /**
Kojto 158:b23ee177fd68 263 * @}
Kojto 158:b23ee177fd68 264 */
Kojto 158:b23ee177fd68 265
Kojto 158:b23ee177fd68 266 /**
Kojto 158:b23ee177fd68 267 * @}
Kojto 158:b23ee177fd68 268 */
Kojto 158:b23ee177fd68 269
Kojto 158:b23ee177fd68 270 /**
Kojto 158:b23ee177fd68 271 * @}
Kojto 158:b23ee177fd68 272 */
Kojto 158:b23ee177fd68 273
Kojto 158:b23ee177fd68 274 #endif /* DAC1 */
Kojto 158:b23ee177fd68 275
Kojto 158:b23ee177fd68 276 /**
Kojto 158:b23ee177fd68 277 * @}
Kojto 158:b23ee177fd68 278 */
Kojto 158:b23ee177fd68 279
Kojto 158:b23ee177fd68 280 #endif /* USE_FULL_LL_DRIVER */
Kojto 158:b23ee177fd68 281
Kojto 158:b23ee177fd68 282 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/