mbed library sources
Fork of mbed-src by
targets/cmsis/TARGET_STM/TARGET_NUCLEO_F103RB/stm32f10x_dac.h@52:a51c77007319, 2013-12-02 (annotated)
- Committer:
- mbed_official
- Date:
- Mon Dec 02 11:30:05 2013 +0000
- Revision:
- 52:a51c77007319
- Child:
- 70:c1fbde68b492
Synchronized with git revision 49df530ae72ce97ccc773d1f2c13b38e868e6abd
Full URL: https://github.com/mbedmicro/mbed/commit/49df530ae72ce97ccc773d1f2c13b38e868e6abd/
Add STMicroelectronics NUCLEO_F103RB target
Who changed what in which revision?
User | Revision | Line number | New 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 | 52:a51c77007319 | 9 | ****************************************************************************** |
mbed_official | 52:a51c77007319 | 10 | * @attention |
mbed_official | 52:a51c77007319 | 11 | * |
mbed_official | 52:a51c77007319 | 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS |
mbed_official | 52:a51c77007319 | 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE |
mbed_official | 52:a51c77007319 | 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY |
mbed_official | 52:a51c77007319 | 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING |
mbed_official | 52:a51c77007319 | 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE |
mbed_official | 52:a51c77007319 | 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. |
mbed_official | 52:a51c77007319 | 18 | * |
mbed_official | 52:a51c77007319 | 19 | * <h2><center>© COPYRIGHT 2011 STMicroelectronics</center></h2> |
mbed_official | 52:a51c77007319 | 20 | ****************************************************************************** |
mbed_official | 52:a51c77007319 | 21 | */ |
mbed_official | 52:a51c77007319 | 22 | |
mbed_official | 52:a51c77007319 | 23 | /* Define to prevent recursive inclusion -------------------------------------*/ |
mbed_official | 52:a51c77007319 | 24 | #ifndef __STM32F10x_DAC_H |
mbed_official | 52:a51c77007319 | 25 | #define __STM32F10x_DAC_H |
mbed_official | 52:a51c77007319 | 26 | |
mbed_official | 52:a51c77007319 | 27 | #ifdef __cplusplus |
mbed_official | 52:a51c77007319 | 28 | extern "C" { |
mbed_official | 52:a51c77007319 | 29 | #endif |
mbed_official | 52:a51c77007319 | 30 | |
mbed_official | 52:a51c77007319 | 31 | /* Includes ------------------------------------------------------------------*/ |
mbed_official | 52:a51c77007319 | 32 | #include "stm32f10x.h" |
mbed_official | 52:a51c77007319 | 33 | |
mbed_official | 52:a51c77007319 | 34 | /** @addtogroup STM32F10x_StdPeriph_Driver |
mbed_official | 52:a51c77007319 | 35 | * @{ |
mbed_official | 52:a51c77007319 | 36 | */ |
mbed_official | 52:a51c77007319 | 37 | |
mbed_official | 52:a51c77007319 | 38 | /** @addtogroup DAC |
mbed_official | 52:a51c77007319 | 39 | * @{ |
mbed_official | 52:a51c77007319 | 40 | */ |
mbed_official | 52:a51c77007319 | 41 | |
mbed_official | 52:a51c77007319 | 42 | /** @defgroup DAC_Exported_Types |
mbed_official | 52:a51c77007319 | 43 | * @{ |
mbed_official | 52:a51c77007319 | 44 | */ |
mbed_official | 52:a51c77007319 | 45 | |
mbed_official | 52:a51c77007319 | 46 | /** |
mbed_official | 52:a51c77007319 | 47 | * @brief DAC Init structure definition |
mbed_official | 52:a51c77007319 | 48 | */ |
mbed_official | 52:a51c77007319 | 49 | |
mbed_official | 52:a51c77007319 | 50 | typedef struct |
mbed_official | 52:a51c77007319 | 51 | { |
mbed_official | 52:a51c77007319 | 52 | uint32_t DAC_Trigger; /*!< Specifies the external trigger for the selected DAC channel. |
mbed_official | 52:a51c77007319 | 53 | This parameter can be a value of @ref DAC_trigger_selection */ |
mbed_official | 52:a51c77007319 | 54 | |
mbed_official | 52:a51c77007319 | 55 | uint32_t DAC_WaveGeneration; /*!< Specifies whether DAC channel noise waves or triangle waves |
mbed_official | 52:a51c77007319 | 56 | are generated, or whether no wave is generated. |
mbed_official | 52:a51c77007319 | 57 | This parameter can be a value of @ref DAC_wave_generation */ |
mbed_official | 52:a51c77007319 | 58 | |
mbed_official | 52:a51c77007319 | 59 | uint32_t DAC_LFSRUnmask_TriangleAmplitude; /*!< Specifies the LFSR mask for noise wave generation or |
mbed_official | 52:a51c77007319 | 60 | the maximum amplitude triangle generation for the DAC channel. |
mbed_official | 52:a51c77007319 | 61 | This parameter can be a value of @ref DAC_lfsrunmask_triangleamplitude */ |
mbed_official | 52:a51c77007319 | 62 | |
mbed_official | 52:a51c77007319 | 63 | uint32_t DAC_OutputBuffer; /*!< Specifies whether the DAC channel output buffer is enabled or disabled. |
mbed_official | 52:a51c77007319 | 64 | This parameter can be a value of @ref DAC_output_buffer */ |
mbed_official | 52:a51c77007319 | 65 | }DAC_InitTypeDef; |
mbed_official | 52:a51c77007319 | 66 | |
mbed_official | 52:a51c77007319 | 67 | /** |
mbed_official | 52:a51c77007319 | 68 | * @} |
mbed_official | 52:a51c77007319 | 69 | */ |
mbed_official | 52:a51c77007319 | 70 | |
mbed_official | 52:a51c77007319 | 71 | /** @defgroup DAC_Exported_Constants |
mbed_official | 52:a51c77007319 | 72 | * @{ |
mbed_official | 52:a51c77007319 | 73 | */ |
mbed_official | 52:a51c77007319 | 74 | |
mbed_official | 52:a51c77007319 | 75 | /** @defgroup DAC_trigger_selection |
mbed_official | 52:a51c77007319 | 76 | * @{ |
mbed_official | 52:a51c77007319 | 77 | */ |
mbed_official | 52:a51c77007319 | 78 | |
mbed_official | 52:a51c77007319 | 79 | #define DAC_Trigger_None ((uint32_t)0x00000000) /*!< Conversion is automatic once the DAC1_DHRxxxx register |
mbed_official | 52:a51c77007319 | 80 | has been loaded, and not by external trigger */ |
mbed_official | 52:a51c77007319 | 81 | #define DAC_Trigger_T6_TRGO ((uint32_t)0x00000004) /*!< TIM6 TRGO selected as external conversion trigger for DAC channel */ |
mbed_official | 52:a51c77007319 | 82 | #define DAC_Trigger_T8_TRGO ((uint32_t)0x0000000C) /*!< TIM8 TRGO selected as external conversion trigger for DAC channel |
mbed_official | 52:a51c77007319 | 83 | only in High-density devices*/ |
mbed_official | 52:a51c77007319 | 84 | #define DAC_Trigger_T3_TRGO ((uint32_t)0x0000000C) /*!< TIM8 TRGO selected as external conversion trigger for DAC channel |
mbed_official | 52:a51c77007319 | 85 | only in Connectivity line, Medium-density and Low-density Value Line devices */ |
mbed_official | 52:a51c77007319 | 86 | #define DAC_Trigger_T7_TRGO ((uint32_t)0x00000014) /*!< TIM7 TRGO selected as external conversion trigger for DAC channel */ |
mbed_official | 52:a51c77007319 | 87 | #define DAC_Trigger_T5_TRGO ((uint32_t)0x0000001C) /*!< TIM5 TRGO selected as external conversion trigger for DAC channel */ |
mbed_official | 52:a51c77007319 | 88 | #define DAC_Trigger_T15_TRGO ((uint32_t)0x0000001C) /*!< TIM15 TRGO selected as external conversion trigger for DAC channel |
mbed_official | 52:a51c77007319 | 89 | only in Medium-density and Low-density Value Line devices*/ |
mbed_official | 52:a51c77007319 | 90 | #define DAC_Trigger_T2_TRGO ((uint32_t)0x00000024) /*!< TIM2 TRGO selected as external conversion trigger for DAC channel */ |
mbed_official | 52:a51c77007319 | 91 | #define DAC_Trigger_T4_TRGO ((uint32_t)0x0000002C) /*!< TIM4 TRGO selected as external conversion trigger for DAC channel */ |
mbed_official | 52:a51c77007319 | 92 | #define DAC_Trigger_Ext_IT9 ((uint32_t)0x00000034) /*!< EXTI Line9 event selected as external conversion trigger for DAC channel */ |
mbed_official | 52:a51c77007319 | 93 | #define DAC_Trigger_Software ((uint32_t)0x0000003C) /*!< Conversion started by software trigger for DAC channel */ |
mbed_official | 52:a51c77007319 | 94 | |
mbed_official | 52:a51c77007319 | 95 | #define IS_DAC_TRIGGER(TRIGGER) (((TRIGGER) == DAC_Trigger_None) || \ |
mbed_official | 52:a51c77007319 | 96 | ((TRIGGER) == DAC_Trigger_T6_TRGO) || \ |
mbed_official | 52:a51c77007319 | 97 | ((TRIGGER) == DAC_Trigger_T8_TRGO) || \ |
mbed_official | 52:a51c77007319 | 98 | ((TRIGGER) == DAC_Trigger_T7_TRGO) || \ |
mbed_official | 52:a51c77007319 | 99 | ((TRIGGER) == DAC_Trigger_T5_TRGO) || \ |
mbed_official | 52:a51c77007319 | 100 | ((TRIGGER) == DAC_Trigger_T2_TRGO) || \ |
mbed_official | 52:a51c77007319 | 101 | ((TRIGGER) == DAC_Trigger_T4_TRGO) || \ |
mbed_official | 52:a51c77007319 | 102 | ((TRIGGER) == DAC_Trigger_Ext_IT9) || \ |
mbed_official | 52:a51c77007319 | 103 | ((TRIGGER) == DAC_Trigger_Software)) |
mbed_official | 52:a51c77007319 | 104 | |
mbed_official | 52:a51c77007319 | 105 | /** |
mbed_official | 52:a51c77007319 | 106 | * @} |
mbed_official | 52:a51c77007319 | 107 | */ |
mbed_official | 52:a51c77007319 | 108 | |
mbed_official | 52:a51c77007319 | 109 | /** @defgroup DAC_wave_generation |
mbed_official | 52:a51c77007319 | 110 | * @{ |
mbed_official | 52:a51c77007319 | 111 | */ |
mbed_official | 52:a51c77007319 | 112 | |
mbed_official | 52:a51c77007319 | 113 | #define DAC_WaveGeneration_None ((uint32_t)0x00000000) |
mbed_official | 52:a51c77007319 | 114 | #define DAC_WaveGeneration_Noise ((uint32_t)0x00000040) |
mbed_official | 52:a51c77007319 | 115 | #define DAC_WaveGeneration_Triangle ((uint32_t)0x00000080) |
mbed_official | 52:a51c77007319 | 116 | #define IS_DAC_GENERATE_WAVE(WAVE) (((WAVE) == DAC_WaveGeneration_None) || \ |
mbed_official | 52:a51c77007319 | 117 | ((WAVE) == DAC_WaveGeneration_Noise) || \ |
mbed_official | 52:a51c77007319 | 118 | ((WAVE) == DAC_WaveGeneration_Triangle)) |
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 | /** @defgroup DAC_lfsrunmask_triangleamplitude |
mbed_official | 52:a51c77007319 | 124 | * @{ |
mbed_official | 52:a51c77007319 | 125 | */ |
mbed_official | 52:a51c77007319 | 126 | |
mbed_official | 52:a51c77007319 | 127 | #define DAC_LFSRUnmask_Bit0 ((uint32_t)0x00000000) /*!< Unmask DAC channel LFSR bit0 for noise wave generation */ |
mbed_official | 52:a51c77007319 | 128 | #define DAC_LFSRUnmask_Bits1_0 ((uint32_t)0x00000100) /*!< Unmask DAC channel LFSR bit[1:0] for noise wave generation */ |
mbed_official | 52:a51c77007319 | 129 | #define DAC_LFSRUnmask_Bits2_0 ((uint32_t)0x00000200) /*!< Unmask DAC channel LFSR bit[2:0] for noise wave generation */ |
mbed_official | 52:a51c77007319 | 130 | #define DAC_LFSRUnmask_Bits3_0 ((uint32_t)0x00000300) /*!< Unmask DAC channel LFSR bit[3:0] for noise wave generation */ |
mbed_official | 52:a51c77007319 | 131 | #define DAC_LFSRUnmask_Bits4_0 ((uint32_t)0x00000400) /*!< Unmask DAC channel LFSR bit[4:0] for noise wave generation */ |
mbed_official | 52:a51c77007319 | 132 | #define DAC_LFSRUnmask_Bits5_0 ((uint32_t)0x00000500) /*!< Unmask DAC channel LFSR bit[5:0] for noise wave generation */ |
mbed_official | 52:a51c77007319 | 133 | #define DAC_LFSRUnmask_Bits6_0 ((uint32_t)0x00000600) /*!< Unmask DAC channel LFSR bit[6:0] for noise wave generation */ |
mbed_official | 52:a51c77007319 | 134 | #define DAC_LFSRUnmask_Bits7_0 ((uint32_t)0x00000700) /*!< Unmask DAC channel LFSR bit[7:0] for noise wave generation */ |
mbed_official | 52:a51c77007319 | 135 | #define DAC_LFSRUnmask_Bits8_0 ((uint32_t)0x00000800) /*!< Unmask DAC channel LFSR bit[8:0] for noise wave generation */ |
mbed_official | 52:a51c77007319 | 136 | #define DAC_LFSRUnmask_Bits9_0 ((uint32_t)0x00000900) /*!< Unmask DAC channel LFSR bit[9:0] for noise wave generation */ |
mbed_official | 52:a51c77007319 | 137 | #define DAC_LFSRUnmask_Bits10_0 ((uint32_t)0x00000A00) /*!< Unmask DAC channel LFSR bit[10:0] for noise wave generation */ |
mbed_official | 52:a51c77007319 | 138 | #define DAC_LFSRUnmask_Bits11_0 ((uint32_t)0x00000B00) /*!< Unmask DAC channel LFSR bit[11:0] for noise wave generation */ |
mbed_official | 52:a51c77007319 | 139 | #define DAC_TriangleAmplitude_1 ((uint32_t)0x00000000) /*!< Select max triangle amplitude of 1 */ |
mbed_official | 52:a51c77007319 | 140 | #define DAC_TriangleAmplitude_3 ((uint32_t)0x00000100) /*!< Select max triangle amplitude of 3 */ |
mbed_official | 52:a51c77007319 | 141 | #define DAC_TriangleAmplitude_7 ((uint32_t)0x00000200) /*!< Select max triangle amplitude of 7 */ |
mbed_official | 52:a51c77007319 | 142 | #define DAC_TriangleAmplitude_15 ((uint32_t)0x00000300) /*!< Select max triangle amplitude of 15 */ |
mbed_official | 52:a51c77007319 | 143 | #define DAC_TriangleAmplitude_31 ((uint32_t)0x00000400) /*!< Select max triangle amplitude of 31 */ |
mbed_official | 52:a51c77007319 | 144 | #define DAC_TriangleAmplitude_63 ((uint32_t)0x00000500) /*!< Select max triangle amplitude of 63 */ |
mbed_official | 52:a51c77007319 | 145 | #define DAC_TriangleAmplitude_127 ((uint32_t)0x00000600) /*!< Select max triangle amplitude of 127 */ |
mbed_official | 52:a51c77007319 | 146 | #define DAC_TriangleAmplitude_255 ((uint32_t)0x00000700) /*!< Select max triangle amplitude of 255 */ |
mbed_official | 52:a51c77007319 | 147 | #define DAC_TriangleAmplitude_511 ((uint32_t)0x00000800) /*!< Select max triangle amplitude of 511 */ |
mbed_official | 52:a51c77007319 | 148 | #define DAC_TriangleAmplitude_1023 ((uint32_t)0x00000900) /*!< Select max triangle amplitude of 1023 */ |
mbed_official | 52:a51c77007319 | 149 | #define DAC_TriangleAmplitude_2047 ((uint32_t)0x00000A00) /*!< Select max triangle amplitude of 2047 */ |
mbed_official | 52:a51c77007319 | 150 | #define DAC_TriangleAmplitude_4095 ((uint32_t)0x00000B00) /*!< Select max triangle amplitude of 4095 */ |
mbed_official | 52:a51c77007319 | 151 | |
mbed_official | 52:a51c77007319 | 152 | #define IS_DAC_LFSR_UNMASK_TRIANGLE_AMPLITUDE(VALUE) (((VALUE) == DAC_LFSRUnmask_Bit0) || \ |
mbed_official | 52:a51c77007319 | 153 | ((VALUE) == DAC_LFSRUnmask_Bits1_0) || \ |
mbed_official | 52:a51c77007319 | 154 | ((VALUE) == DAC_LFSRUnmask_Bits2_0) || \ |
mbed_official | 52:a51c77007319 | 155 | ((VALUE) == DAC_LFSRUnmask_Bits3_0) || \ |
mbed_official | 52:a51c77007319 | 156 | ((VALUE) == DAC_LFSRUnmask_Bits4_0) || \ |
mbed_official | 52:a51c77007319 | 157 | ((VALUE) == DAC_LFSRUnmask_Bits5_0) || \ |
mbed_official | 52:a51c77007319 | 158 | ((VALUE) == DAC_LFSRUnmask_Bits6_0) || \ |
mbed_official | 52:a51c77007319 | 159 | ((VALUE) == DAC_LFSRUnmask_Bits7_0) || \ |
mbed_official | 52:a51c77007319 | 160 | ((VALUE) == DAC_LFSRUnmask_Bits8_0) || \ |
mbed_official | 52:a51c77007319 | 161 | ((VALUE) == DAC_LFSRUnmask_Bits9_0) || \ |
mbed_official | 52:a51c77007319 | 162 | ((VALUE) == DAC_LFSRUnmask_Bits10_0) || \ |
mbed_official | 52:a51c77007319 | 163 | ((VALUE) == DAC_LFSRUnmask_Bits11_0) || \ |
mbed_official | 52:a51c77007319 | 164 | ((VALUE) == DAC_TriangleAmplitude_1) || \ |
mbed_official | 52:a51c77007319 | 165 | ((VALUE) == DAC_TriangleAmplitude_3) || \ |
mbed_official | 52:a51c77007319 | 166 | ((VALUE) == DAC_TriangleAmplitude_7) || \ |
mbed_official | 52:a51c77007319 | 167 | ((VALUE) == DAC_TriangleAmplitude_15) || \ |
mbed_official | 52:a51c77007319 | 168 | ((VALUE) == DAC_TriangleAmplitude_31) || \ |
mbed_official | 52:a51c77007319 | 169 | ((VALUE) == DAC_TriangleAmplitude_63) || \ |
mbed_official | 52:a51c77007319 | 170 | ((VALUE) == DAC_TriangleAmplitude_127) || \ |
mbed_official | 52:a51c77007319 | 171 | ((VALUE) == DAC_TriangleAmplitude_255) || \ |
mbed_official | 52:a51c77007319 | 172 | ((VALUE) == DAC_TriangleAmplitude_511) || \ |
mbed_official | 52:a51c77007319 | 173 | ((VALUE) == DAC_TriangleAmplitude_1023) || \ |
mbed_official | 52:a51c77007319 | 174 | ((VALUE) == DAC_TriangleAmplitude_2047) || \ |
mbed_official | 52:a51c77007319 | 175 | ((VALUE) == DAC_TriangleAmplitude_4095)) |
mbed_official | 52:a51c77007319 | 176 | /** |
mbed_official | 52:a51c77007319 | 177 | * @} |
mbed_official | 52:a51c77007319 | 178 | */ |
mbed_official | 52:a51c77007319 | 179 | |
mbed_official | 52:a51c77007319 | 180 | /** @defgroup DAC_output_buffer |
mbed_official | 52:a51c77007319 | 181 | * @{ |
mbed_official | 52:a51c77007319 | 182 | */ |
mbed_official | 52:a51c77007319 | 183 | |
mbed_official | 52:a51c77007319 | 184 | #define DAC_OutputBuffer_Enable ((uint32_t)0x00000000) |
mbed_official | 52:a51c77007319 | 185 | #define DAC_OutputBuffer_Disable ((uint32_t)0x00000002) |
mbed_official | 52:a51c77007319 | 186 | #define IS_DAC_OUTPUT_BUFFER_STATE(STATE) (((STATE) == DAC_OutputBuffer_Enable) || \ |
mbed_official | 52:a51c77007319 | 187 | ((STATE) == DAC_OutputBuffer_Disable)) |
mbed_official | 52:a51c77007319 | 188 | /** |
mbed_official | 52:a51c77007319 | 189 | * @} |
mbed_official | 52:a51c77007319 | 190 | */ |
mbed_official | 52:a51c77007319 | 191 | |
mbed_official | 52:a51c77007319 | 192 | /** @defgroup DAC_Channel_selection |
mbed_official | 52:a51c77007319 | 193 | * @{ |
mbed_official | 52:a51c77007319 | 194 | */ |
mbed_official | 52:a51c77007319 | 195 | |
mbed_official | 52:a51c77007319 | 196 | #define DAC_Channel_1 ((uint32_t)0x00000000) |
mbed_official | 52:a51c77007319 | 197 | #define DAC_Channel_2 ((uint32_t)0x00000010) |
mbed_official | 52:a51c77007319 | 198 | #define IS_DAC_CHANNEL(CHANNEL) (((CHANNEL) == DAC_Channel_1) || \ |
mbed_official | 52:a51c77007319 | 199 | ((CHANNEL) == DAC_Channel_2)) |
mbed_official | 52:a51c77007319 | 200 | /** |
mbed_official | 52:a51c77007319 | 201 | * @} |
mbed_official | 52:a51c77007319 | 202 | */ |
mbed_official | 52:a51c77007319 | 203 | |
mbed_official | 52:a51c77007319 | 204 | /** @defgroup DAC_data_alignment |
mbed_official | 52:a51c77007319 | 205 | * @{ |
mbed_official | 52:a51c77007319 | 206 | */ |
mbed_official | 52:a51c77007319 | 207 | |
mbed_official | 52:a51c77007319 | 208 | #define DAC_Align_12b_R ((uint32_t)0x00000000) |
mbed_official | 52:a51c77007319 | 209 | #define DAC_Align_12b_L ((uint32_t)0x00000004) |
mbed_official | 52:a51c77007319 | 210 | #define DAC_Align_8b_R ((uint32_t)0x00000008) |
mbed_official | 52:a51c77007319 | 211 | #define IS_DAC_ALIGN(ALIGN) (((ALIGN) == DAC_Align_12b_R) || \ |
mbed_official | 52:a51c77007319 | 212 | ((ALIGN) == DAC_Align_12b_L) || \ |
mbed_official | 52:a51c77007319 | 213 | ((ALIGN) == DAC_Align_8b_R)) |
mbed_official | 52:a51c77007319 | 214 | /** |
mbed_official | 52:a51c77007319 | 215 | * @} |
mbed_official | 52:a51c77007319 | 216 | */ |
mbed_official | 52:a51c77007319 | 217 | |
mbed_official | 52:a51c77007319 | 218 | /** @defgroup DAC_wave_generation |
mbed_official | 52:a51c77007319 | 219 | * @{ |
mbed_official | 52:a51c77007319 | 220 | */ |
mbed_official | 52:a51c77007319 | 221 | |
mbed_official | 52:a51c77007319 | 222 | #define DAC_Wave_Noise ((uint32_t)0x00000040) |
mbed_official | 52:a51c77007319 | 223 | #define DAC_Wave_Triangle ((uint32_t)0x00000080) |
mbed_official | 52:a51c77007319 | 224 | #define IS_DAC_WAVE(WAVE) (((WAVE) == DAC_Wave_Noise) || \ |
mbed_official | 52:a51c77007319 | 225 | ((WAVE) == DAC_Wave_Triangle)) |
mbed_official | 52:a51c77007319 | 226 | /** |
mbed_official | 52:a51c77007319 | 227 | * @} |
mbed_official | 52:a51c77007319 | 228 | */ |
mbed_official | 52:a51c77007319 | 229 | |
mbed_official | 52:a51c77007319 | 230 | /** @defgroup DAC_data |
mbed_official | 52:a51c77007319 | 231 | * @{ |
mbed_official | 52:a51c77007319 | 232 | */ |
mbed_official | 52:a51c77007319 | 233 | |
mbed_official | 52:a51c77007319 | 234 | #define IS_DAC_DATA(DATA) ((DATA) <= 0xFFF0) |
mbed_official | 52:a51c77007319 | 235 | /** |
mbed_official | 52:a51c77007319 | 236 | * @} |
mbed_official | 52:a51c77007319 | 237 | */ |
mbed_official | 52:a51c77007319 | 238 | #if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) |
mbed_official | 52:a51c77007319 | 239 | /** @defgroup DAC_interrupts_definition |
mbed_official | 52:a51c77007319 | 240 | * @{ |
mbed_official | 52:a51c77007319 | 241 | */ |
mbed_official | 52:a51c77007319 | 242 | |
mbed_official | 52:a51c77007319 | 243 | #define DAC_IT_DMAUDR ((uint32_t)0x00002000) |
mbed_official | 52:a51c77007319 | 244 | #define IS_DAC_IT(IT) (((IT) == DAC_IT_DMAUDR)) |
mbed_official | 52:a51c77007319 | 245 | |
mbed_official | 52:a51c77007319 | 246 | /** |
mbed_official | 52:a51c77007319 | 247 | * @} |
mbed_official | 52:a51c77007319 | 248 | */ |
mbed_official | 52:a51c77007319 | 249 | |
mbed_official | 52:a51c77007319 | 250 | /** @defgroup DAC_flags_definition |
mbed_official | 52:a51c77007319 | 251 | * @{ |
mbed_official | 52:a51c77007319 | 252 | */ |
mbed_official | 52:a51c77007319 | 253 | |
mbed_official | 52:a51c77007319 | 254 | #define DAC_FLAG_DMAUDR ((uint32_t)0x00002000) |
mbed_official | 52:a51c77007319 | 255 | #define IS_DAC_FLAG(FLAG) (((FLAG) == DAC_FLAG_DMAUDR)) |
mbed_official | 52:a51c77007319 | 256 | |
mbed_official | 52:a51c77007319 | 257 | /** |
mbed_official | 52:a51c77007319 | 258 | * @} |
mbed_official | 52:a51c77007319 | 259 | */ |
mbed_official | 52:a51c77007319 | 260 | #endif |
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 | |
mbed_official | 52:a51c77007319 | 266 | /** @defgroup DAC_Exported_Macros |
mbed_official | 52:a51c77007319 | 267 | * @{ |
mbed_official | 52:a51c77007319 | 268 | */ |
mbed_official | 52:a51c77007319 | 269 | |
mbed_official | 52:a51c77007319 | 270 | /** |
mbed_official | 52:a51c77007319 | 271 | * @} |
mbed_official | 52:a51c77007319 | 272 | */ |
mbed_official | 52:a51c77007319 | 273 | |
mbed_official | 52:a51c77007319 | 274 | /** @defgroup DAC_Exported_Functions |
mbed_official | 52:a51c77007319 | 275 | * @{ |
mbed_official | 52:a51c77007319 | 276 | */ |
mbed_official | 52:a51c77007319 | 277 | |
mbed_official | 52:a51c77007319 | 278 | void DAC_DeInit(void); |
mbed_official | 52:a51c77007319 | 279 | void DAC_Init(uint32_t DAC_Channel, DAC_InitTypeDef* DAC_InitStruct); |
mbed_official | 52:a51c77007319 | 280 | void DAC_StructInit(DAC_InitTypeDef* DAC_InitStruct); |
mbed_official | 52:a51c77007319 | 281 | void DAC_Cmd(uint32_t DAC_Channel, FunctionalState NewState); |
mbed_official | 52:a51c77007319 | 282 | #if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) |
mbed_official | 52:a51c77007319 | 283 | void DAC_ITConfig(uint32_t DAC_Channel, uint32_t DAC_IT, FunctionalState NewState); |
mbed_official | 52:a51c77007319 | 284 | #endif |
mbed_official | 52:a51c77007319 | 285 | void DAC_DMACmd(uint32_t DAC_Channel, FunctionalState NewState); |
mbed_official | 52:a51c77007319 | 286 | void DAC_SoftwareTriggerCmd(uint32_t DAC_Channel, FunctionalState NewState); |
mbed_official | 52:a51c77007319 | 287 | void DAC_DualSoftwareTriggerCmd(FunctionalState NewState); |
mbed_official | 52:a51c77007319 | 288 | void DAC_WaveGenerationCmd(uint32_t DAC_Channel, uint32_t DAC_Wave, FunctionalState NewState); |
mbed_official | 52:a51c77007319 | 289 | void DAC_SetChannel1Data(uint32_t DAC_Align, uint16_t Data); |
mbed_official | 52:a51c77007319 | 290 | void DAC_SetChannel2Data(uint32_t DAC_Align, uint16_t Data); |
mbed_official | 52:a51c77007319 | 291 | void DAC_SetDualChannelData(uint32_t DAC_Align, uint16_t Data2, uint16_t Data1); |
mbed_official | 52:a51c77007319 | 292 | uint16_t DAC_GetDataOutputValue(uint32_t DAC_Channel); |
mbed_official | 52:a51c77007319 | 293 | #if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL) |
mbed_official | 52:a51c77007319 | 294 | FlagStatus DAC_GetFlagStatus(uint32_t DAC_Channel, uint32_t DAC_FLAG); |
mbed_official | 52:a51c77007319 | 295 | void DAC_ClearFlag(uint32_t DAC_Channel, uint32_t DAC_FLAG); |
mbed_official | 52:a51c77007319 | 296 | ITStatus DAC_GetITStatus(uint32_t DAC_Channel, uint32_t DAC_IT); |
mbed_official | 52:a51c77007319 | 297 | void DAC_ClearITPendingBit(uint32_t DAC_Channel, uint32_t DAC_IT); |
mbed_official | 52:a51c77007319 | 298 | #endif |
mbed_official | 52:a51c77007319 | 299 | |
mbed_official | 52:a51c77007319 | 300 | #ifdef __cplusplus |
mbed_official | 52:a51c77007319 | 301 | } |
mbed_official | 52:a51c77007319 | 302 | #endif |
mbed_official | 52:a51c77007319 | 303 | |
mbed_official | 52:a51c77007319 | 304 | #endif /*__STM32F10x_DAC_H */ |
mbed_official | 52:a51c77007319 | 305 | /** |
mbed_official | 52:a51c77007319 | 306 | * @} |
mbed_official | 52:a51c77007319 | 307 | */ |
mbed_official | 52:a51c77007319 | 308 | |
mbed_official | 52:a51c77007319 | 309 | /** |
mbed_official | 52:a51c77007319 | 310 | * @} |
mbed_official | 52:a51c77007319 | 311 | */ |
mbed_official | 52:a51c77007319 | 312 | |
mbed_official | 52:a51c77007319 | 313 | /** |
mbed_official | 52:a51c77007319 | 314 | * @} |
mbed_official | 52:a51c77007319 | 315 | */ |
mbed_official | 52:a51c77007319 | 316 | |
mbed_official | 52:a51c77007319 | 317 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ |