mbed library with additional peripherals for ST F401 board

Fork of mbed-src by mbed official

This mbed LIB has additional peripherals for ST F401 board

  • UART2 : PA_3 rx, PA_2 tx
  • UART3 : PC_7 rx, PC_6 tx
  • I2C2 : PB_3 SDA, PB_10 SCL
  • I2C3 : PB_4 SDA, PA_8 SCL
Committer:
mbed_official
Date:
Tue Jan 07 11:00:05 2014 +0000
Revision:
70:c1fbde68b492
Parent:
52:a51c77007319
Child:
84:f54042cbc282
Synchronized with git revision 3f438a307904431f2782db3c8fa49946b9fc1d85

Full URL: https://github.com/mbedmicro/mbed/commit/3f438a307904431f2782db3c8fa49946b9fc1d85/

[NUCLEO_F103RB] license text changed + sleep hal updated

Who changed what in which revision?

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