mbed library sources

Dependents:   frdm_kl05z_gpio_test

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Wed Feb 26 09:45:12 2014 +0000
Revision:
106:ced8cbb51063
Parent:
80:66393a7b209d
Synchronized with git revision 4222735eff5868389433f0e9271976b39c8115cd

Full URL: https://github.com/mbedmicro/mbed/commit/4222735eff5868389433f0e9271976b39c8115cd/

[NUCLEO_xxx] Update STM32CubeF4 driver V1.0.0 + update license

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 76:aeb1df146756 1 /**
mbed_official 76:aeb1df146756 2 ******************************************************************************
mbed_official 76:aeb1df146756 3 * @file stm32l1xx_dac.h
mbed_official 76:aeb1df146756 4 * @author MCD Application Team
mbed_official 80:66393a7b209d 5 * @version V1.3.0
mbed_official 80:66393a7b209d 6 * @date 31-January-2014
mbed_official 76:aeb1df146756 7 * @brief This file contains all the functions prototypes for the DAC firmware
mbed_official 76:aeb1df146756 8 * library.
mbed_official 76:aeb1df146756 9 ******************************************************************************
mbed_official 76:aeb1df146756 10 * @attention
mbed_official 76:aeb1df146756 11 *
mbed_official 106:ced8cbb51063 12 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 76:aeb1df146756 13 *
mbed_official 106:ced8cbb51063 14 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 106:ced8cbb51063 15 * are permitted provided that the following conditions are met:
mbed_official 106:ced8cbb51063 16 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 106:ced8cbb51063 17 * this list of conditions and the following disclaimer.
mbed_official 106:ced8cbb51063 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 106:ced8cbb51063 19 * this list of conditions and the following disclaimer in the documentation
mbed_official 106:ced8cbb51063 20 * and/or other materials provided with the distribution.
mbed_official 106:ced8cbb51063 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 106:ced8cbb51063 22 * may be used to endorse or promote products derived from this software
mbed_official 106:ced8cbb51063 23 * without specific prior written permission.
mbed_official 76:aeb1df146756 24 *
mbed_official 106:ced8cbb51063 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 106:ced8cbb51063 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 106:ced8cbb51063 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 106:ced8cbb51063 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 106:ced8cbb51063 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 106:ced8cbb51063 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 106:ced8cbb51063 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 106:ced8cbb51063 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 106:ced8cbb51063 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 106:ced8cbb51063 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 76:aeb1df146756 35 *
mbed_official 76:aeb1df146756 36 ******************************************************************************
mbed_official 76:aeb1df146756 37 */
mbed_official 76:aeb1df146756 38
mbed_official 76:aeb1df146756 39 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 76:aeb1df146756 40 #ifndef __STM32L1xx_DAC_H
mbed_official 76:aeb1df146756 41 #define __STM32L1xx_DAC_H
mbed_official 76:aeb1df146756 42
mbed_official 76:aeb1df146756 43 #ifdef __cplusplus
mbed_official 76:aeb1df146756 44 extern "C" {
mbed_official 76:aeb1df146756 45 #endif
mbed_official 76:aeb1df146756 46
mbed_official 76:aeb1df146756 47 /* Includes ------------------------------------------------------------------*/
mbed_official 76:aeb1df146756 48 #include "stm32l1xx.h"
mbed_official 76:aeb1df146756 49
mbed_official 76:aeb1df146756 50 /** @addtogroup STM32L1xx_StdPeriph_Driver
mbed_official 76:aeb1df146756 51 * @{
mbed_official 76:aeb1df146756 52 */
mbed_official 76:aeb1df146756 53
mbed_official 76:aeb1df146756 54 /** @addtogroup DAC
mbed_official 76:aeb1df146756 55 * @{
mbed_official 76:aeb1df146756 56 */
mbed_official 76:aeb1df146756 57
mbed_official 76:aeb1df146756 58 /* Exported types ------------------------------------------------------------*/
mbed_official 76:aeb1df146756 59
mbed_official 76:aeb1df146756 60 /**
mbed_official 76:aeb1df146756 61 * @brief DAC Init structure definition
mbed_official 76:aeb1df146756 62 */
mbed_official 76:aeb1df146756 63
mbed_official 76:aeb1df146756 64 typedef struct
mbed_official 76:aeb1df146756 65 {
mbed_official 76:aeb1df146756 66 uint32_t DAC_Trigger; /*!< Specifies the external trigger for the selected DAC channel.
mbed_official 76:aeb1df146756 67 This parameter can be a value of @ref DAC_trigger_selection */
mbed_official 76:aeb1df146756 68
mbed_official 76:aeb1df146756 69 uint32_t DAC_WaveGeneration; /*!< Specifies whether DAC channel noise waves or triangle waves
mbed_official 76:aeb1df146756 70 are generated, or whether no wave is generated.
mbed_official 76:aeb1df146756 71 This parameter can be a value of @ref DAC_wave_generation */
mbed_official 76:aeb1df146756 72
mbed_official 76:aeb1df146756 73 uint32_t DAC_LFSRUnmask_TriangleAmplitude; /*!< Specifies the LFSR mask for noise wave generation or
mbed_official 76:aeb1df146756 74 the maximum amplitude triangle generation for the DAC channel.
mbed_official 76:aeb1df146756 75 This parameter can be a value of @ref DAC_lfsrunmask_triangleamplitude */
mbed_official 76:aeb1df146756 76
mbed_official 76:aeb1df146756 77 uint32_t DAC_OutputBuffer; /*!< Specifies whether the DAC channel output buffer is enabled or disabled.
mbed_official 76:aeb1df146756 78 This parameter can be a value of @ref DAC_output_buffer */
mbed_official 76:aeb1df146756 79 }DAC_InitTypeDef;
mbed_official 76:aeb1df146756 80
mbed_official 76:aeb1df146756 81 /* Exported constants --------------------------------------------------------*/
mbed_official 76:aeb1df146756 82
mbed_official 76:aeb1df146756 83 /** @defgroup DAC_Exported_Constants
mbed_official 76:aeb1df146756 84 * @{
mbed_official 76:aeb1df146756 85 */
mbed_official 76:aeb1df146756 86
mbed_official 76:aeb1df146756 87 /** @defgroup DAC_trigger_selection
mbed_official 76:aeb1df146756 88 * @{
mbed_official 76:aeb1df146756 89 */
mbed_official 76:aeb1df146756 90
mbed_official 76:aeb1df146756 91 #define DAC_Trigger_None ((uint32_t)0x00000000) /*!< Conversion is automatic once the DAC1_DHRxxxx register
mbed_official 76:aeb1df146756 92 has been loaded, and not by external trigger */
mbed_official 76:aeb1df146756 93 #define DAC_Trigger_T6_TRGO ((uint32_t)0x00000004) /*!< TIM6 TRGO selected as external conversion trigger for DAC channel */
mbed_official 76:aeb1df146756 94 #define DAC_Trigger_T7_TRGO ((uint32_t)0x00000014) /*!< TIM7 TRGO selected as external conversion trigger for DAC channel */
mbed_official 76:aeb1df146756 95 #define DAC_Trigger_T9_TRGO ((uint32_t)0x0000001C) /*!< TIM9 TRGO selected as external conversion trigger for DAC channel */
mbed_official 76:aeb1df146756 96 #define DAC_Trigger_T2_TRGO ((uint32_t)0x00000024) /*!< TIM2 TRGO selected as external conversion trigger for DAC channel */
mbed_official 76:aeb1df146756 97 #define DAC_Trigger_T4_TRGO ((uint32_t)0x0000002C) /*!< TIM4 TRGO selected as external conversion trigger for DAC channel */
mbed_official 76:aeb1df146756 98 #define DAC_Trigger_Ext_IT9 ((uint32_t)0x00000034) /*!< EXTI Line9 event selected as external conversion trigger for DAC channel */
mbed_official 76:aeb1df146756 99 #define DAC_Trigger_Software ((uint32_t)0x0000003C) /*!< Conversion started by software trigger for DAC channel */
mbed_official 76:aeb1df146756 100
mbed_official 76:aeb1df146756 101 #define IS_DAC_TRIGGER(TRIGGER) (((TRIGGER) == DAC_Trigger_None) || \
mbed_official 76:aeb1df146756 102 ((TRIGGER) == DAC_Trigger_T6_TRGO) || \
mbed_official 76:aeb1df146756 103 ((TRIGGER) == DAC_Trigger_T7_TRGO) || \
mbed_official 76:aeb1df146756 104 ((TRIGGER) == DAC_Trigger_T9_TRGO) || \
mbed_official 76:aeb1df146756 105 ((TRIGGER) == DAC_Trigger_T2_TRGO) || \
mbed_official 76:aeb1df146756 106 ((TRIGGER) == DAC_Trigger_T4_TRGO) || \
mbed_official 76:aeb1df146756 107 ((TRIGGER) == DAC_Trigger_Ext_IT9) || \
mbed_official 76:aeb1df146756 108 ((TRIGGER) == DAC_Trigger_Software))
mbed_official 76:aeb1df146756 109
mbed_official 76:aeb1df146756 110 /**
mbed_official 76:aeb1df146756 111 * @}
mbed_official 76:aeb1df146756 112 */
mbed_official 76:aeb1df146756 113
mbed_official 76:aeb1df146756 114 /** @defgroup DAC_wave_generation
mbed_official 76:aeb1df146756 115 * @{
mbed_official 76:aeb1df146756 116 */
mbed_official 76:aeb1df146756 117
mbed_official 76:aeb1df146756 118 #define DAC_WaveGeneration_None ((uint32_t)0x00000000)
mbed_official 76:aeb1df146756 119 #define DAC_WaveGeneration_Noise ((uint32_t)0x00000040)
mbed_official 76:aeb1df146756 120 #define DAC_WaveGeneration_Triangle ((uint32_t)0x00000080)
mbed_official 76:aeb1df146756 121 #define IS_DAC_GENERATE_WAVE(WAVE) (((WAVE) == DAC_WaveGeneration_None) || \
mbed_official 76:aeb1df146756 122 ((WAVE) == DAC_WaveGeneration_Noise) || \
mbed_official 76:aeb1df146756 123 ((WAVE) == DAC_WaveGeneration_Triangle))
mbed_official 76:aeb1df146756 124 /**
mbed_official 76:aeb1df146756 125 * @}
mbed_official 76:aeb1df146756 126 */
mbed_official 76:aeb1df146756 127
mbed_official 76:aeb1df146756 128 /** @defgroup DAC_lfsrunmask_triangleamplitude
mbed_official 76:aeb1df146756 129 * @{
mbed_official 76:aeb1df146756 130 */
mbed_official 76:aeb1df146756 131
mbed_official 76:aeb1df146756 132 #define DAC_LFSRUnmask_Bit0 ((uint32_t)0x00000000) /*!< Unmask DAC channel LFSR bit0 for noise wave generation */
mbed_official 76:aeb1df146756 133 #define DAC_LFSRUnmask_Bits1_0 ((uint32_t)0x00000100) /*!< Unmask DAC channel LFSR bit[1:0] for noise wave generation */
mbed_official 76:aeb1df146756 134 #define DAC_LFSRUnmask_Bits2_0 ((uint32_t)0x00000200) /*!< Unmask DAC channel LFSR bit[2:0] for noise wave generation */
mbed_official 76:aeb1df146756 135 #define DAC_LFSRUnmask_Bits3_0 ((uint32_t)0x00000300) /*!< Unmask DAC channel LFSR bit[3:0] for noise wave generation */
mbed_official 76:aeb1df146756 136 #define DAC_LFSRUnmask_Bits4_0 ((uint32_t)0x00000400) /*!< Unmask DAC channel LFSR bit[4:0] for noise wave generation */
mbed_official 76:aeb1df146756 137 #define DAC_LFSRUnmask_Bits5_0 ((uint32_t)0x00000500) /*!< Unmask DAC channel LFSR bit[5:0] for noise wave generation */
mbed_official 76:aeb1df146756 138 #define DAC_LFSRUnmask_Bits6_0 ((uint32_t)0x00000600) /*!< Unmask DAC channel LFSR bit[6:0] for noise wave generation */
mbed_official 76:aeb1df146756 139 #define DAC_LFSRUnmask_Bits7_0 ((uint32_t)0x00000700) /*!< Unmask DAC channel LFSR bit[7:0] for noise wave generation */
mbed_official 76:aeb1df146756 140 #define DAC_LFSRUnmask_Bits8_0 ((uint32_t)0x00000800) /*!< Unmask DAC channel LFSR bit[8:0] for noise wave generation */
mbed_official 76:aeb1df146756 141 #define DAC_LFSRUnmask_Bits9_0 ((uint32_t)0x00000900) /*!< Unmask DAC channel LFSR bit[9:0] for noise wave generation */
mbed_official 76:aeb1df146756 142 #define DAC_LFSRUnmask_Bits10_0 ((uint32_t)0x00000A00) /*!< Unmask DAC channel LFSR bit[10:0] for noise wave generation */
mbed_official 76:aeb1df146756 143 #define DAC_LFSRUnmask_Bits11_0 ((uint32_t)0x00000B00) /*!< Unmask DAC channel LFSR bit[11:0] for noise wave generation */
mbed_official 76:aeb1df146756 144 #define DAC_TriangleAmplitude_1 ((uint32_t)0x00000000) /*!< Select max triangle amplitude of 1 */
mbed_official 76:aeb1df146756 145 #define DAC_TriangleAmplitude_3 ((uint32_t)0x00000100) /*!< Select max triangle amplitude of 3 */
mbed_official 76:aeb1df146756 146 #define DAC_TriangleAmplitude_7 ((uint32_t)0x00000200) /*!< Select max triangle amplitude of 7 */
mbed_official 76:aeb1df146756 147 #define DAC_TriangleAmplitude_15 ((uint32_t)0x00000300) /*!< Select max triangle amplitude of 15 */
mbed_official 76:aeb1df146756 148 #define DAC_TriangleAmplitude_31 ((uint32_t)0x00000400) /*!< Select max triangle amplitude of 31 */
mbed_official 76:aeb1df146756 149 #define DAC_TriangleAmplitude_63 ((uint32_t)0x00000500) /*!< Select max triangle amplitude of 63 */
mbed_official 76:aeb1df146756 150 #define DAC_TriangleAmplitude_127 ((uint32_t)0x00000600) /*!< Select max triangle amplitude of 127 */
mbed_official 76:aeb1df146756 151 #define DAC_TriangleAmplitude_255 ((uint32_t)0x00000700) /*!< Select max triangle amplitude of 255 */
mbed_official 76:aeb1df146756 152 #define DAC_TriangleAmplitude_511 ((uint32_t)0x00000800) /*!< Select max triangle amplitude of 511 */
mbed_official 76:aeb1df146756 153 #define DAC_TriangleAmplitude_1023 ((uint32_t)0x00000900) /*!< Select max triangle amplitude of 1023 */
mbed_official 76:aeb1df146756 154 #define DAC_TriangleAmplitude_2047 ((uint32_t)0x00000A00) /*!< Select max triangle amplitude of 2047 */
mbed_official 76:aeb1df146756 155 #define DAC_TriangleAmplitude_4095 ((uint32_t)0x00000B00) /*!< Select max triangle amplitude of 4095 */
mbed_official 76:aeb1df146756 156
mbed_official 76:aeb1df146756 157 #define IS_DAC_LFSR_UNMASK_TRIANGLE_AMPLITUDE(VALUE) (((VALUE) == DAC_LFSRUnmask_Bit0) || \
mbed_official 76:aeb1df146756 158 ((VALUE) == DAC_LFSRUnmask_Bits1_0) || \
mbed_official 76:aeb1df146756 159 ((VALUE) == DAC_LFSRUnmask_Bits2_0) || \
mbed_official 76:aeb1df146756 160 ((VALUE) == DAC_LFSRUnmask_Bits3_0) || \
mbed_official 76:aeb1df146756 161 ((VALUE) == DAC_LFSRUnmask_Bits4_0) || \
mbed_official 76:aeb1df146756 162 ((VALUE) == DAC_LFSRUnmask_Bits5_0) || \
mbed_official 76:aeb1df146756 163 ((VALUE) == DAC_LFSRUnmask_Bits6_0) || \
mbed_official 76:aeb1df146756 164 ((VALUE) == DAC_LFSRUnmask_Bits7_0) || \
mbed_official 76:aeb1df146756 165 ((VALUE) == DAC_LFSRUnmask_Bits8_0) || \
mbed_official 76:aeb1df146756 166 ((VALUE) == DAC_LFSRUnmask_Bits9_0) || \
mbed_official 76:aeb1df146756 167 ((VALUE) == DAC_LFSRUnmask_Bits10_0) || \
mbed_official 76:aeb1df146756 168 ((VALUE) == DAC_LFSRUnmask_Bits11_0) || \
mbed_official 76:aeb1df146756 169 ((VALUE) == DAC_TriangleAmplitude_1) || \
mbed_official 76:aeb1df146756 170 ((VALUE) == DAC_TriangleAmplitude_3) || \
mbed_official 76:aeb1df146756 171 ((VALUE) == DAC_TriangleAmplitude_7) || \
mbed_official 76:aeb1df146756 172 ((VALUE) == DAC_TriangleAmplitude_15) || \
mbed_official 76:aeb1df146756 173 ((VALUE) == DAC_TriangleAmplitude_31) || \
mbed_official 76:aeb1df146756 174 ((VALUE) == DAC_TriangleAmplitude_63) || \
mbed_official 76:aeb1df146756 175 ((VALUE) == DAC_TriangleAmplitude_127) || \
mbed_official 76:aeb1df146756 176 ((VALUE) == DAC_TriangleAmplitude_255) || \
mbed_official 76:aeb1df146756 177 ((VALUE) == DAC_TriangleAmplitude_511) || \
mbed_official 76:aeb1df146756 178 ((VALUE) == DAC_TriangleAmplitude_1023) || \
mbed_official 76:aeb1df146756 179 ((VALUE) == DAC_TriangleAmplitude_2047) || \
mbed_official 76:aeb1df146756 180 ((VALUE) == DAC_TriangleAmplitude_4095))
mbed_official 76:aeb1df146756 181 /**
mbed_official 76:aeb1df146756 182 * @}
mbed_official 76:aeb1df146756 183 */
mbed_official 76:aeb1df146756 184
mbed_official 76:aeb1df146756 185 /** @defgroup DAC_output_buffer
mbed_official 76:aeb1df146756 186 * @{
mbed_official 76:aeb1df146756 187 */
mbed_official 76:aeb1df146756 188
mbed_official 76:aeb1df146756 189 #define DAC_OutputBuffer_Enable ((uint32_t)0x00000000)
mbed_official 76:aeb1df146756 190 #define DAC_OutputBuffer_Disable ((uint32_t)0x00000002)
mbed_official 76:aeb1df146756 191 #define IS_DAC_OUTPUT_BUFFER_STATE(STATE) (((STATE) == DAC_OutputBuffer_Enable) || \
mbed_official 76:aeb1df146756 192 ((STATE) == DAC_OutputBuffer_Disable))
mbed_official 76:aeb1df146756 193 /**
mbed_official 76:aeb1df146756 194 * @}
mbed_official 76:aeb1df146756 195 */
mbed_official 76:aeb1df146756 196
mbed_official 76:aeb1df146756 197 /** @defgroup DAC_Channel_selection
mbed_official 76:aeb1df146756 198 * @{
mbed_official 76:aeb1df146756 199 */
mbed_official 76:aeb1df146756 200
mbed_official 76:aeb1df146756 201 #define DAC_Channel_1 ((uint32_t)0x00000000)
mbed_official 76:aeb1df146756 202 #define DAC_Channel_2 ((uint32_t)0x00000010)
mbed_official 76:aeb1df146756 203 #define IS_DAC_CHANNEL(CHANNEL) (((CHANNEL) == DAC_Channel_1) || \
mbed_official 76:aeb1df146756 204 ((CHANNEL) == DAC_Channel_2))
mbed_official 76:aeb1df146756 205 /**
mbed_official 76:aeb1df146756 206 * @}
mbed_official 76:aeb1df146756 207 */
mbed_official 76:aeb1df146756 208
mbed_official 76:aeb1df146756 209 /** @defgroup DAC_data_alignment
mbed_official 76:aeb1df146756 210 * @{
mbed_official 76:aeb1df146756 211 */
mbed_official 76:aeb1df146756 212
mbed_official 76:aeb1df146756 213 #define DAC_Align_12b_R ((uint32_t)0x00000000)
mbed_official 76:aeb1df146756 214 #define DAC_Align_12b_L ((uint32_t)0x00000004)
mbed_official 76:aeb1df146756 215 #define DAC_Align_8b_R ((uint32_t)0x00000008)
mbed_official 76:aeb1df146756 216 #define IS_DAC_ALIGN(ALIGN) (((ALIGN) == DAC_Align_12b_R) || \
mbed_official 76:aeb1df146756 217 ((ALIGN) == DAC_Align_12b_L) || \
mbed_official 76:aeb1df146756 218 ((ALIGN) == DAC_Align_8b_R))
mbed_official 76:aeb1df146756 219 /**
mbed_official 76:aeb1df146756 220 * @}
mbed_official 76:aeb1df146756 221 */
mbed_official 76:aeb1df146756 222
mbed_official 76:aeb1df146756 223 /** @defgroup DAC_wave_generation
mbed_official 76:aeb1df146756 224 * @{
mbed_official 76:aeb1df146756 225 */
mbed_official 76:aeb1df146756 226
mbed_official 76:aeb1df146756 227 #define DAC_Wave_Noise ((uint32_t)0x00000040)
mbed_official 76:aeb1df146756 228 #define DAC_Wave_Triangle ((uint32_t)0x00000080)
mbed_official 76:aeb1df146756 229 #define IS_DAC_WAVE(WAVE) (((WAVE) == DAC_Wave_Noise) || \
mbed_official 76:aeb1df146756 230 ((WAVE) == DAC_Wave_Triangle))
mbed_official 76:aeb1df146756 231 /**
mbed_official 76:aeb1df146756 232 * @}
mbed_official 76:aeb1df146756 233 */
mbed_official 76:aeb1df146756 234
mbed_official 76:aeb1df146756 235 /** @defgroup DAC_data
mbed_official 76:aeb1df146756 236 * @{
mbed_official 76:aeb1df146756 237 */
mbed_official 76:aeb1df146756 238
mbed_official 76:aeb1df146756 239 #define IS_DAC_DATA(DATA) ((DATA) <= 0xFFF0)
mbed_official 76:aeb1df146756 240
mbed_official 76:aeb1df146756 241 /**
mbed_official 76:aeb1df146756 242 * @}
mbed_official 76:aeb1df146756 243 */
mbed_official 76:aeb1df146756 244
mbed_official 76:aeb1df146756 245 /** @defgroup DAC_interrupts_definition
mbed_official 76:aeb1df146756 246 * @{
mbed_official 76:aeb1df146756 247 */
mbed_official 76:aeb1df146756 248
mbed_official 76:aeb1df146756 249 #define DAC_IT_DMAUDR ((uint32_t)0x00002000)
mbed_official 76:aeb1df146756 250 #define IS_DAC_IT(IT) (((IT) == DAC_IT_DMAUDR))
mbed_official 76:aeb1df146756 251
mbed_official 76:aeb1df146756 252 /**
mbed_official 76:aeb1df146756 253 * @}
mbed_official 76:aeb1df146756 254 */
mbed_official 76:aeb1df146756 255
mbed_official 76:aeb1df146756 256
mbed_official 76:aeb1df146756 257 /** @defgroup DAC_flags_definition
mbed_official 76:aeb1df146756 258 * @{
mbed_official 76:aeb1df146756 259 */
mbed_official 76:aeb1df146756 260
mbed_official 76:aeb1df146756 261 #define DAC_FLAG_DMAUDR ((uint32_t)0x00002000)
mbed_official 76:aeb1df146756 262
mbed_official 76:aeb1df146756 263 #define IS_DAC_FLAG(FLAG) (((FLAG) == DAC_FLAG_DMAUDR))
mbed_official 76:aeb1df146756 264
mbed_official 76:aeb1df146756 265 /**
mbed_official 76:aeb1df146756 266 * @}
mbed_official 76:aeb1df146756 267 */
mbed_official 76:aeb1df146756 268
mbed_official 76:aeb1df146756 269 /**
mbed_official 76:aeb1df146756 270 * @}
mbed_official 76:aeb1df146756 271 */
mbed_official 76:aeb1df146756 272
mbed_official 76:aeb1df146756 273 /* Exported macro ------------------------------------------------------------*/
mbed_official 76:aeb1df146756 274 /* Exported functions ------------------------------------------------------- */
mbed_official 76:aeb1df146756 275
mbed_official 76:aeb1df146756 276 /* Function used to set the DAC configuration to the default reset state *****/
mbed_official 76:aeb1df146756 277 void DAC_DeInit(void);
mbed_official 76:aeb1df146756 278
mbed_official 76:aeb1df146756 279 /* DAC channels configuration: trigger, output buffer, data format functions */
mbed_official 76:aeb1df146756 280 void DAC_Init(uint32_t DAC_Channel, DAC_InitTypeDef* DAC_InitStruct);
mbed_official 76:aeb1df146756 281 void DAC_StructInit(DAC_InitTypeDef* DAC_InitStruct);
mbed_official 76:aeb1df146756 282 void DAC_Cmd(uint32_t DAC_Channel, FunctionalState NewState);
mbed_official 76:aeb1df146756 283 void DAC_SoftwareTriggerCmd(uint32_t DAC_Channel, FunctionalState NewState);
mbed_official 76:aeb1df146756 284 void DAC_DualSoftwareTriggerCmd(FunctionalState NewState);
mbed_official 76:aeb1df146756 285 void DAC_WaveGenerationCmd(uint32_t DAC_Channel, uint32_t DAC_Wave, FunctionalState NewState);
mbed_official 76:aeb1df146756 286 void DAC_SetChannel1Data(uint32_t DAC_Align, uint16_t Data);
mbed_official 76:aeb1df146756 287 void DAC_SetChannel2Data(uint32_t DAC_Align, uint16_t Data);
mbed_official 76:aeb1df146756 288 void DAC_SetDualChannelData(uint32_t DAC_Align, uint16_t Data2, uint16_t Data1);
mbed_official 76:aeb1df146756 289 uint16_t DAC_GetDataOutputValue(uint32_t DAC_Channel);
mbed_official 76:aeb1df146756 290
mbed_official 76:aeb1df146756 291 /* DMA management functions ***************************************************/
mbed_official 76:aeb1df146756 292 void DAC_DMACmd(uint32_t DAC_Channel, FunctionalState NewState);
mbed_official 76:aeb1df146756 293
mbed_official 76:aeb1df146756 294 /* Interrupts and flags management functions **********************************/
mbed_official 76:aeb1df146756 295 void DAC_ITConfig(uint32_t DAC_Channel, uint32_t DAC_IT, FunctionalState NewState);
mbed_official 76:aeb1df146756 296 FlagStatus DAC_GetFlagStatus(uint32_t DAC_Channel, uint32_t DAC_FLAG);
mbed_official 76:aeb1df146756 297 void DAC_ClearFlag(uint32_t DAC_Channel, uint32_t DAC_FLAG);
mbed_official 76:aeb1df146756 298 ITStatus DAC_GetITStatus(uint32_t DAC_Channel, uint32_t DAC_IT);
mbed_official 76:aeb1df146756 299 void DAC_ClearITPendingBit(uint32_t DAC_Channel, uint32_t DAC_IT);
mbed_official 76:aeb1df146756 300
mbed_official 76:aeb1df146756 301 #ifdef __cplusplus
mbed_official 76:aeb1df146756 302 }
mbed_official 76:aeb1df146756 303 #endif
mbed_official 76:aeb1df146756 304
mbed_official 76:aeb1df146756 305 #endif /*__STM32L1xx_DAC_H */
mbed_official 76:aeb1df146756 306
mbed_official 76:aeb1df146756 307 /**
mbed_official 76:aeb1df146756 308 * @}
mbed_official 76:aeb1df146756 309 */
mbed_official 76:aeb1df146756 310
mbed_official 76:aeb1df146756 311 /**
mbed_official 76:aeb1df146756 312 * @}
mbed_official 76:aeb1df146756 313 */
mbed_official 76:aeb1df146756 314
mbed_official 76:aeb1df146756 315 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/