mbed library sources
Fork of mbed-src by
targets/cmsis/TARGET_STM/TARGET_NUCLEO_L152RE/stm32l1xx_dac.h@76:aeb1df146756, 2014-01-27 (annotated)
- Committer:
- mbed_official
- Date:
- Mon Jan 27 14:30:07 2014 +0000
- Revision:
- 76:aeb1df146756
- Child:
- 80:66393a7b209d
Synchronized with git revision a31ec9c5f7bcb5c8a1b2eced103f6a1dfa921abd
Full URL: https://github.com/mbedmicro/mbed/commit/a31ec9c5f7bcb5c8a1b2eced103f6a1dfa921abd/
Add NUCLEO_L152RE
Who changed what in which revision?
User | Revision | Line number | New 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 | 76:aeb1df146756 | 5 | * @version V1.2.0 |
mbed_official | 76:aeb1df146756 | 6 | * @date 22-February-2013 |
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 | 76:aeb1df146756 | 12 | * <h2><center>© COPYRIGHT 2013 STMicroelectronics</center></h2> |
mbed_official | 76:aeb1df146756 | 13 | * |
mbed_official | 76:aeb1df146756 | 14 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); |
mbed_official | 76:aeb1df146756 | 15 | * You may not use this file except in compliance with the License. |
mbed_official | 76:aeb1df146756 | 16 | * You may obtain a copy of the License at: |
mbed_official | 76:aeb1df146756 | 17 | * |
mbed_official | 76:aeb1df146756 | 18 | * http://www.st.com/software_license_agreement_liberty_v2 |
mbed_official | 76:aeb1df146756 | 19 | * |
mbed_official | 76:aeb1df146756 | 20 | * Unless required by applicable law or agreed to in writing, software |
mbed_official | 76:aeb1df146756 | 21 | * distributed under the License is distributed on an "AS IS" BASIS, |
mbed_official | 76:aeb1df146756 | 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
mbed_official | 76:aeb1df146756 | 23 | * See the License for the specific language governing permissions and |
mbed_official | 76:aeb1df146756 | 24 | * limitations under the License. |
mbed_official | 76:aeb1df146756 | 25 | * |
mbed_official | 76:aeb1df146756 | 26 | ****************************************************************************** |
mbed_official | 76:aeb1df146756 | 27 | */ |
mbed_official | 76:aeb1df146756 | 28 | |
mbed_official | 76:aeb1df146756 | 29 | /* Define to prevent recursive inclusion -------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 30 | #ifndef __STM32L1xx_DAC_H |
mbed_official | 76:aeb1df146756 | 31 | #define __STM32L1xx_DAC_H |
mbed_official | 76:aeb1df146756 | 32 | |
mbed_official | 76:aeb1df146756 | 33 | #ifdef __cplusplus |
mbed_official | 76:aeb1df146756 | 34 | extern "C" { |
mbed_official | 76:aeb1df146756 | 35 | #endif |
mbed_official | 76:aeb1df146756 | 36 | |
mbed_official | 76:aeb1df146756 | 37 | /* Includes ------------------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 38 | #include "stm32l1xx.h" |
mbed_official | 76:aeb1df146756 | 39 | |
mbed_official | 76:aeb1df146756 | 40 | /** @addtogroup STM32L1xx_StdPeriph_Driver |
mbed_official | 76:aeb1df146756 | 41 | * @{ |
mbed_official | 76:aeb1df146756 | 42 | */ |
mbed_official | 76:aeb1df146756 | 43 | |
mbed_official | 76:aeb1df146756 | 44 | /** @addtogroup DAC |
mbed_official | 76:aeb1df146756 | 45 | * @{ |
mbed_official | 76:aeb1df146756 | 46 | */ |
mbed_official | 76:aeb1df146756 | 47 | |
mbed_official | 76:aeb1df146756 | 48 | /* Exported types ------------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 49 | |
mbed_official | 76:aeb1df146756 | 50 | /** |
mbed_official | 76:aeb1df146756 | 51 | * @brief DAC Init structure definition |
mbed_official | 76:aeb1df146756 | 52 | */ |
mbed_official | 76:aeb1df146756 | 53 | |
mbed_official | 76:aeb1df146756 | 54 | typedef struct |
mbed_official | 76:aeb1df146756 | 55 | { |
mbed_official | 76:aeb1df146756 | 56 | uint32_t DAC_Trigger; /*!< Specifies the external trigger for the selected DAC channel. |
mbed_official | 76:aeb1df146756 | 57 | This parameter can be a value of @ref DAC_trigger_selection */ |
mbed_official | 76:aeb1df146756 | 58 | |
mbed_official | 76:aeb1df146756 | 59 | uint32_t DAC_WaveGeneration; /*!< Specifies whether DAC channel noise waves or triangle waves |
mbed_official | 76:aeb1df146756 | 60 | are generated, or whether no wave is generated. |
mbed_official | 76:aeb1df146756 | 61 | This parameter can be a value of @ref DAC_wave_generation */ |
mbed_official | 76:aeb1df146756 | 62 | |
mbed_official | 76:aeb1df146756 | 63 | uint32_t DAC_LFSRUnmask_TriangleAmplitude; /*!< Specifies the LFSR mask for noise wave generation or |
mbed_official | 76:aeb1df146756 | 64 | the maximum amplitude triangle generation for the DAC channel. |
mbed_official | 76:aeb1df146756 | 65 | This parameter can be a value of @ref DAC_lfsrunmask_triangleamplitude */ |
mbed_official | 76:aeb1df146756 | 66 | |
mbed_official | 76:aeb1df146756 | 67 | uint32_t DAC_OutputBuffer; /*!< Specifies whether the DAC channel output buffer is enabled or disabled. |
mbed_official | 76:aeb1df146756 | 68 | This parameter can be a value of @ref DAC_output_buffer */ |
mbed_official | 76:aeb1df146756 | 69 | }DAC_InitTypeDef; |
mbed_official | 76:aeb1df146756 | 70 | |
mbed_official | 76:aeb1df146756 | 71 | /* Exported constants --------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 72 | |
mbed_official | 76:aeb1df146756 | 73 | /** @defgroup DAC_Exported_Constants |
mbed_official | 76:aeb1df146756 | 74 | * @{ |
mbed_official | 76:aeb1df146756 | 75 | */ |
mbed_official | 76:aeb1df146756 | 76 | |
mbed_official | 76:aeb1df146756 | 77 | /** @defgroup DAC_trigger_selection |
mbed_official | 76:aeb1df146756 | 78 | * @{ |
mbed_official | 76:aeb1df146756 | 79 | */ |
mbed_official | 76:aeb1df146756 | 80 | |
mbed_official | 76:aeb1df146756 | 81 | #define DAC_Trigger_None ((uint32_t)0x00000000) /*!< Conversion is automatic once the DAC1_DHRxxxx register |
mbed_official | 76:aeb1df146756 | 82 | has been loaded, and not by external trigger */ |
mbed_official | 76:aeb1df146756 | 83 | #define DAC_Trigger_T6_TRGO ((uint32_t)0x00000004) /*!< TIM6 TRGO selected as external conversion trigger for DAC channel */ |
mbed_official | 76:aeb1df146756 | 84 | #define DAC_Trigger_T7_TRGO ((uint32_t)0x00000014) /*!< TIM7 TRGO selected as external conversion trigger for DAC channel */ |
mbed_official | 76:aeb1df146756 | 85 | #define DAC_Trigger_T9_TRGO ((uint32_t)0x0000001C) /*!< TIM9 TRGO selected as external conversion trigger for DAC channel */ |
mbed_official | 76:aeb1df146756 | 86 | #define DAC_Trigger_T2_TRGO ((uint32_t)0x00000024) /*!< TIM2 TRGO selected as external conversion trigger for DAC channel */ |
mbed_official | 76:aeb1df146756 | 87 | #define DAC_Trigger_T4_TRGO ((uint32_t)0x0000002C) /*!< TIM4 TRGO selected as external conversion trigger for DAC channel */ |
mbed_official | 76:aeb1df146756 | 88 | #define DAC_Trigger_Ext_IT9 ((uint32_t)0x00000034) /*!< EXTI Line9 event selected as external conversion trigger for DAC channel */ |
mbed_official | 76:aeb1df146756 | 89 | #define DAC_Trigger_Software ((uint32_t)0x0000003C) /*!< Conversion started by software trigger for DAC channel */ |
mbed_official | 76:aeb1df146756 | 90 | |
mbed_official | 76:aeb1df146756 | 91 | #define IS_DAC_TRIGGER(TRIGGER) (((TRIGGER) == DAC_Trigger_None) || \ |
mbed_official | 76:aeb1df146756 | 92 | ((TRIGGER) == DAC_Trigger_T6_TRGO) || \ |
mbed_official | 76:aeb1df146756 | 93 | ((TRIGGER) == DAC_Trigger_T7_TRGO) || \ |
mbed_official | 76:aeb1df146756 | 94 | ((TRIGGER) == DAC_Trigger_T9_TRGO) || \ |
mbed_official | 76:aeb1df146756 | 95 | ((TRIGGER) == DAC_Trigger_T2_TRGO) || \ |
mbed_official | 76:aeb1df146756 | 96 | ((TRIGGER) == DAC_Trigger_T4_TRGO) || \ |
mbed_official | 76:aeb1df146756 | 97 | ((TRIGGER) == DAC_Trigger_Ext_IT9) || \ |
mbed_official | 76:aeb1df146756 | 98 | ((TRIGGER) == DAC_Trigger_Software)) |
mbed_official | 76:aeb1df146756 | 99 | |
mbed_official | 76:aeb1df146756 | 100 | /** |
mbed_official | 76:aeb1df146756 | 101 | * @} |
mbed_official | 76:aeb1df146756 | 102 | */ |
mbed_official | 76:aeb1df146756 | 103 | |
mbed_official | 76:aeb1df146756 | 104 | /** @defgroup DAC_wave_generation |
mbed_official | 76:aeb1df146756 | 105 | * @{ |
mbed_official | 76:aeb1df146756 | 106 | */ |
mbed_official | 76:aeb1df146756 | 107 | |
mbed_official | 76:aeb1df146756 | 108 | #define DAC_WaveGeneration_None ((uint32_t)0x00000000) |
mbed_official | 76:aeb1df146756 | 109 | #define DAC_WaveGeneration_Noise ((uint32_t)0x00000040) |
mbed_official | 76:aeb1df146756 | 110 | #define DAC_WaveGeneration_Triangle ((uint32_t)0x00000080) |
mbed_official | 76:aeb1df146756 | 111 | #define IS_DAC_GENERATE_WAVE(WAVE) (((WAVE) == DAC_WaveGeneration_None) || \ |
mbed_official | 76:aeb1df146756 | 112 | ((WAVE) == DAC_WaveGeneration_Noise) || \ |
mbed_official | 76:aeb1df146756 | 113 | ((WAVE) == DAC_WaveGeneration_Triangle)) |
mbed_official | 76:aeb1df146756 | 114 | /** |
mbed_official | 76:aeb1df146756 | 115 | * @} |
mbed_official | 76:aeb1df146756 | 116 | */ |
mbed_official | 76:aeb1df146756 | 117 | |
mbed_official | 76:aeb1df146756 | 118 | /** @defgroup DAC_lfsrunmask_triangleamplitude |
mbed_official | 76:aeb1df146756 | 119 | * @{ |
mbed_official | 76:aeb1df146756 | 120 | */ |
mbed_official | 76:aeb1df146756 | 121 | |
mbed_official | 76:aeb1df146756 | 122 | #define DAC_LFSRUnmask_Bit0 ((uint32_t)0x00000000) /*!< Unmask DAC channel LFSR bit0 for noise wave generation */ |
mbed_official | 76:aeb1df146756 | 123 | #define DAC_LFSRUnmask_Bits1_0 ((uint32_t)0x00000100) /*!< Unmask DAC channel LFSR bit[1:0] for noise wave generation */ |
mbed_official | 76:aeb1df146756 | 124 | #define DAC_LFSRUnmask_Bits2_0 ((uint32_t)0x00000200) /*!< Unmask DAC channel LFSR bit[2:0] for noise wave generation */ |
mbed_official | 76:aeb1df146756 | 125 | #define DAC_LFSRUnmask_Bits3_0 ((uint32_t)0x00000300) /*!< Unmask DAC channel LFSR bit[3:0] for noise wave generation */ |
mbed_official | 76:aeb1df146756 | 126 | #define DAC_LFSRUnmask_Bits4_0 ((uint32_t)0x00000400) /*!< Unmask DAC channel LFSR bit[4:0] for noise wave generation */ |
mbed_official | 76:aeb1df146756 | 127 | #define DAC_LFSRUnmask_Bits5_0 ((uint32_t)0x00000500) /*!< Unmask DAC channel LFSR bit[5:0] for noise wave generation */ |
mbed_official | 76:aeb1df146756 | 128 | #define DAC_LFSRUnmask_Bits6_0 ((uint32_t)0x00000600) /*!< Unmask DAC channel LFSR bit[6:0] for noise wave generation */ |
mbed_official | 76:aeb1df146756 | 129 | #define DAC_LFSRUnmask_Bits7_0 ((uint32_t)0x00000700) /*!< Unmask DAC channel LFSR bit[7:0] for noise wave generation */ |
mbed_official | 76:aeb1df146756 | 130 | #define DAC_LFSRUnmask_Bits8_0 ((uint32_t)0x00000800) /*!< Unmask DAC channel LFSR bit[8:0] for noise wave generation */ |
mbed_official | 76:aeb1df146756 | 131 | #define DAC_LFSRUnmask_Bits9_0 ((uint32_t)0x00000900) /*!< Unmask DAC channel LFSR bit[9:0] for noise wave generation */ |
mbed_official | 76:aeb1df146756 | 132 | #define DAC_LFSRUnmask_Bits10_0 ((uint32_t)0x00000A00) /*!< Unmask DAC channel LFSR bit[10:0] for noise wave generation */ |
mbed_official | 76:aeb1df146756 | 133 | #define DAC_LFSRUnmask_Bits11_0 ((uint32_t)0x00000B00) /*!< Unmask DAC channel LFSR bit[11:0] for noise wave generation */ |
mbed_official | 76:aeb1df146756 | 134 | #define DAC_TriangleAmplitude_1 ((uint32_t)0x00000000) /*!< Select max triangle amplitude of 1 */ |
mbed_official | 76:aeb1df146756 | 135 | #define DAC_TriangleAmplitude_3 ((uint32_t)0x00000100) /*!< Select max triangle amplitude of 3 */ |
mbed_official | 76:aeb1df146756 | 136 | #define DAC_TriangleAmplitude_7 ((uint32_t)0x00000200) /*!< Select max triangle amplitude of 7 */ |
mbed_official | 76:aeb1df146756 | 137 | #define DAC_TriangleAmplitude_15 ((uint32_t)0x00000300) /*!< Select max triangle amplitude of 15 */ |
mbed_official | 76:aeb1df146756 | 138 | #define DAC_TriangleAmplitude_31 ((uint32_t)0x00000400) /*!< Select max triangle amplitude of 31 */ |
mbed_official | 76:aeb1df146756 | 139 | #define DAC_TriangleAmplitude_63 ((uint32_t)0x00000500) /*!< Select max triangle amplitude of 63 */ |
mbed_official | 76:aeb1df146756 | 140 | #define DAC_TriangleAmplitude_127 ((uint32_t)0x00000600) /*!< Select max triangle amplitude of 127 */ |
mbed_official | 76:aeb1df146756 | 141 | #define DAC_TriangleAmplitude_255 ((uint32_t)0x00000700) /*!< Select max triangle amplitude of 255 */ |
mbed_official | 76:aeb1df146756 | 142 | #define DAC_TriangleAmplitude_511 ((uint32_t)0x00000800) /*!< Select max triangle amplitude of 511 */ |
mbed_official | 76:aeb1df146756 | 143 | #define DAC_TriangleAmplitude_1023 ((uint32_t)0x00000900) /*!< Select max triangle amplitude of 1023 */ |
mbed_official | 76:aeb1df146756 | 144 | #define DAC_TriangleAmplitude_2047 ((uint32_t)0x00000A00) /*!< Select max triangle amplitude of 2047 */ |
mbed_official | 76:aeb1df146756 | 145 | #define DAC_TriangleAmplitude_4095 ((uint32_t)0x00000B00) /*!< Select max triangle amplitude of 4095 */ |
mbed_official | 76:aeb1df146756 | 146 | |
mbed_official | 76:aeb1df146756 | 147 | #define IS_DAC_LFSR_UNMASK_TRIANGLE_AMPLITUDE(VALUE) (((VALUE) == DAC_LFSRUnmask_Bit0) || \ |
mbed_official | 76:aeb1df146756 | 148 | ((VALUE) == DAC_LFSRUnmask_Bits1_0) || \ |
mbed_official | 76:aeb1df146756 | 149 | ((VALUE) == DAC_LFSRUnmask_Bits2_0) || \ |
mbed_official | 76:aeb1df146756 | 150 | ((VALUE) == DAC_LFSRUnmask_Bits3_0) || \ |
mbed_official | 76:aeb1df146756 | 151 | ((VALUE) == DAC_LFSRUnmask_Bits4_0) || \ |
mbed_official | 76:aeb1df146756 | 152 | ((VALUE) == DAC_LFSRUnmask_Bits5_0) || \ |
mbed_official | 76:aeb1df146756 | 153 | ((VALUE) == DAC_LFSRUnmask_Bits6_0) || \ |
mbed_official | 76:aeb1df146756 | 154 | ((VALUE) == DAC_LFSRUnmask_Bits7_0) || \ |
mbed_official | 76:aeb1df146756 | 155 | ((VALUE) == DAC_LFSRUnmask_Bits8_0) || \ |
mbed_official | 76:aeb1df146756 | 156 | ((VALUE) == DAC_LFSRUnmask_Bits9_0) || \ |
mbed_official | 76:aeb1df146756 | 157 | ((VALUE) == DAC_LFSRUnmask_Bits10_0) || \ |
mbed_official | 76:aeb1df146756 | 158 | ((VALUE) == DAC_LFSRUnmask_Bits11_0) || \ |
mbed_official | 76:aeb1df146756 | 159 | ((VALUE) == DAC_TriangleAmplitude_1) || \ |
mbed_official | 76:aeb1df146756 | 160 | ((VALUE) == DAC_TriangleAmplitude_3) || \ |
mbed_official | 76:aeb1df146756 | 161 | ((VALUE) == DAC_TriangleAmplitude_7) || \ |
mbed_official | 76:aeb1df146756 | 162 | ((VALUE) == DAC_TriangleAmplitude_15) || \ |
mbed_official | 76:aeb1df146756 | 163 | ((VALUE) == DAC_TriangleAmplitude_31) || \ |
mbed_official | 76:aeb1df146756 | 164 | ((VALUE) == DAC_TriangleAmplitude_63) || \ |
mbed_official | 76:aeb1df146756 | 165 | ((VALUE) == DAC_TriangleAmplitude_127) || \ |
mbed_official | 76:aeb1df146756 | 166 | ((VALUE) == DAC_TriangleAmplitude_255) || \ |
mbed_official | 76:aeb1df146756 | 167 | ((VALUE) == DAC_TriangleAmplitude_511) || \ |
mbed_official | 76:aeb1df146756 | 168 | ((VALUE) == DAC_TriangleAmplitude_1023) || \ |
mbed_official | 76:aeb1df146756 | 169 | ((VALUE) == DAC_TriangleAmplitude_2047) || \ |
mbed_official | 76:aeb1df146756 | 170 | ((VALUE) == DAC_TriangleAmplitude_4095)) |
mbed_official | 76:aeb1df146756 | 171 | /** |
mbed_official | 76:aeb1df146756 | 172 | * @} |
mbed_official | 76:aeb1df146756 | 173 | */ |
mbed_official | 76:aeb1df146756 | 174 | |
mbed_official | 76:aeb1df146756 | 175 | /** @defgroup DAC_output_buffer |
mbed_official | 76:aeb1df146756 | 176 | * @{ |
mbed_official | 76:aeb1df146756 | 177 | */ |
mbed_official | 76:aeb1df146756 | 178 | |
mbed_official | 76:aeb1df146756 | 179 | #define DAC_OutputBuffer_Enable ((uint32_t)0x00000000) |
mbed_official | 76:aeb1df146756 | 180 | #define DAC_OutputBuffer_Disable ((uint32_t)0x00000002) |
mbed_official | 76:aeb1df146756 | 181 | #define IS_DAC_OUTPUT_BUFFER_STATE(STATE) (((STATE) == DAC_OutputBuffer_Enable) || \ |
mbed_official | 76:aeb1df146756 | 182 | ((STATE) == DAC_OutputBuffer_Disable)) |
mbed_official | 76:aeb1df146756 | 183 | /** |
mbed_official | 76:aeb1df146756 | 184 | * @} |
mbed_official | 76:aeb1df146756 | 185 | */ |
mbed_official | 76:aeb1df146756 | 186 | |
mbed_official | 76:aeb1df146756 | 187 | /** @defgroup DAC_Channel_selection |
mbed_official | 76:aeb1df146756 | 188 | * @{ |
mbed_official | 76:aeb1df146756 | 189 | */ |
mbed_official | 76:aeb1df146756 | 190 | |
mbed_official | 76:aeb1df146756 | 191 | #define DAC_Channel_1 ((uint32_t)0x00000000) |
mbed_official | 76:aeb1df146756 | 192 | #define DAC_Channel_2 ((uint32_t)0x00000010) |
mbed_official | 76:aeb1df146756 | 193 | #define IS_DAC_CHANNEL(CHANNEL) (((CHANNEL) == DAC_Channel_1) || \ |
mbed_official | 76:aeb1df146756 | 194 | ((CHANNEL) == DAC_Channel_2)) |
mbed_official | 76:aeb1df146756 | 195 | /** |
mbed_official | 76:aeb1df146756 | 196 | * @} |
mbed_official | 76:aeb1df146756 | 197 | */ |
mbed_official | 76:aeb1df146756 | 198 | |
mbed_official | 76:aeb1df146756 | 199 | /** @defgroup DAC_data_alignment |
mbed_official | 76:aeb1df146756 | 200 | * @{ |
mbed_official | 76:aeb1df146756 | 201 | */ |
mbed_official | 76:aeb1df146756 | 202 | |
mbed_official | 76:aeb1df146756 | 203 | #define DAC_Align_12b_R ((uint32_t)0x00000000) |
mbed_official | 76:aeb1df146756 | 204 | #define DAC_Align_12b_L ((uint32_t)0x00000004) |
mbed_official | 76:aeb1df146756 | 205 | #define DAC_Align_8b_R ((uint32_t)0x00000008) |
mbed_official | 76:aeb1df146756 | 206 | #define IS_DAC_ALIGN(ALIGN) (((ALIGN) == DAC_Align_12b_R) || \ |
mbed_official | 76:aeb1df146756 | 207 | ((ALIGN) == DAC_Align_12b_L) || \ |
mbed_official | 76:aeb1df146756 | 208 | ((ALIGN) == DAC_Align_8b_R)) |
mbed_official | 76:aeb1df146756 | 209 | /** |
mbed_official | 76:aeb1df146756 | 210 | * @} |
mbed_official | 76:aeb1df146756 | 211 | */ |
mbed_official | 76:aeb1df146756 | 212 | |
mbed_official | 76:aeb1df146756 | 213 | /** @defgroup DAC_wave_generation |
mbed_official | 76:aeb1df146756 | 214 | * @{ |
mbed_official | 76:aeb1df146756 | 215 | */ |
mbed_official | 76:aeb1df146756 | 216 | |
mbed_official | 76:aeb1df146756 | 217 | #define DAC_Wave_Noise ((uint32_t)0x00000040) |
mbed_official | 76:aeb1df146756 | 218 | #define DAC_Wave_Triangle ((uint32_t)0x00000080) |
mbed_official | 76:aeb1df146756 | 219 | #define IS_DAC_WAVE(WAVE) (((WAVE) == DAC_Wave_Noise) || \ |
mbed_official | 76:aeb1df146756 | 220 | ((WAVE) == DAC_Wave_Triangle)) |
mbed_official | 76:aeb1df146756 | 221 | /** |
mbed_official | 76:aeb1df146756 | 222 | * @} |
mbed_official | 76:aeb1df146756 | 223 | */ |
mbed_official | 76:aeb1df146756 | 224 | |
mbed_official | 76:aeb1df146756 | 225 | /** @defgroup DAC_data |
mbed_official | 76:aeb1df146756 | 226 | * @{ |
mbed_official | 76:aeb1df146756 | 227 | */ |
mbed_official | 76:aeb1df146756 | 228 | |
mbed_official | 76:aeb1df146756 | 229 | #define IS_DAC_DATA(DATA) ((DATA) <= 0xFFF0) |
mbed_official | 76:aeb1df146756 | 230 | |
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_interrupts_definition |
mbed_official | 76:aeb1df146756 | 236 | * @{ |
mbed_official | 76:aeb1df146756 | 237 | */ |
mbed_official | 76:aeb1df146756 | 238 | |
mbed_official | 76:aeb1df146756 | 239 | #define DAC_IT_DMAUDR ((uint32_t)0x00002000) |
mbed_official | 76:aeb1df146756 | 240 | #define IS_DAC_IT(IT) (((IT) == DAC_IT_DMAUDR)) |
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 | |
mbed_official | 76:aeb1df146756 | 246 | |
mbed_official | 76:aeb1df146756 | 247 | /** @defgroup DAC_flags_definition |
mbed_official | 76:aeb1df146756 | 248 | * @{ |
mbed_official | 76:aeb1df146756 | 249 | */ |
mbed_official | 76:aeb1df146756 | 250 | |
mbed_official | 76:aeb1df146756 | 251 | #define DAC_FLAG_DMAUDR ((uint32_t)0x00002000) |
mbed_official | 76:aeb1df146756 | 252 | |
mbed_official | 76:aeb1df146756 | 253 | #define IS_DAC_FLAG(FLAG) (((FLAG) == DAC_FLAG_DMAUDR)) |
mbed_official | 76:aeb1df146756 | 254 | |
mbed_official | 76:aeb1df146756 | 255 | /** |
mbed_official | 76:aeb1df146756 | 256 | * @} |
mbed_official | 76:aeb1df146756 | 257 | */ |
mbed_official | 76:aeb1df146756 | 258 | |
mbed_official | 76:aeb1df146756 | 259 | /** |
mbed_official | 76:aeb1df146756 | 260 | * @} |
mbed_official | 76:aeb1df146756 | 261 | */ |
mbed_official | 76:aeb1df146756 | 262 | |
mbed_official | 76:aeb1df146756 | 263 | /* Exported macro ------------------------------------------------------------*/ |
mbed_official | 76:aeb1df146756 | 264 | /* Exported functions ------------------------------------------------------- */ |
mbed_official | 76:aeb1df146756 | 265 | |
mbed_official | 76:aeb1df146756 | 266 | /* Function used to set the DAC configuration to the default reset state *****/ |
mbed_official | 76:aeb1df146756 | 267 | void DAC_DeInit(void); |
mbed_official | 76:aeb1df146756 | 268 | |
mbed_official | 76:aeb1df146756 | 269 | /* DAC channels configuration: trigger, output buffer, data format functions */ |
mbed_official | 76:aeb1df146756 | 270 | void DAC_Init(uint32_t DAC_Channel, DAC_InitTypeDef* DAC_InitStruct); |
mbed_official | 76:aeb1df146756 | 271 | void DAC_StructInit(DAC_InitTypeDef* DAC_InitStruct); |
mbed_official | 76:aeb1df146756 | 272 | void DAC_Cmd(uint32_t DAC_Channel, FunctionalState NewState); |
mbed_official | 76:aeb1df146756 | 273 | void DAC_SoftwareTriggerCmd(uint32_t DAC_Channel, FunctionalState NewState); |
mbed_official | 76:aeb1df146756 | 274 | void DAC_DualSoftwareTriggerCmd(FunctionalState NewState); |
mbed_official | 76:aeb1df146756 | 275 | void DAC_WaveGenerationCmd(uint32_t DAC_Channel, uint32_t DAC_Wave, FunctionalState NewState); |
mbed_official | 76:aeb1df146756 | 276 | void DAC_SetChannel1Data(uint32_t DAC_Align, uint16_t Data); |
mbed_official | 76:aeb1df146756 | 277 | void DAC_SetChannel2Data(uint32_t DAC_Align, uint16_t Data); |
mbed_official | 76:aeb1df146756 | 278 | void DAC_SetDualChannelData(uint32_t DAC_Align, uint16_t Data2, uint16_t Data1); |
mbed_official | 76:aeb1df146756 | 279 | uint16_t DAC_GetDataOutputValue(uint32_t DAC_Channel); |
mbed_official | 76:aeb1df146756 | 280 | |
mbed_official | 76:aeb1df146756 | 281 | /* DMA management functions ***************************************************/ |
mbed_official | 76:aeb1df146756 | 282 | void DAC_DMACmd(uint32_t DAC_Channel, FunctionalState NewState); |
mbed_official | 76:aeb1df146756 | 283 | |
mbed_official | 76:aeb1df146756 | 284 | /* Interrupts and flags management functions **********************************/ |
mbed_official | 76:aeb1df146756 | 285 | void DAC_ITConfig(uint32_t DAC_Channel, uint32_t DAC_IT, FunctionalState NewState); |
mbed_official | 76:aeb1df146756 | 286 | FlagStatus DAC_GetFlagStatus(uint32_t DAC_Channel, uint32_t DAC_FLAG); |
mbed_official | 76:aeb1df146756 | 287 | void DAC_ClearFlag(uint32_t DAC_Channel, uint32_t DAC_FLAG); |
mbed_official | 76:aeb1df146756 | 288 | ITStatus DAC_GetITStatus(uint32_t DAC_Channel, uint32_t DAC_IT); |
mbed_official | 76:aeb1df146756 | 289 | void DAC_ClearITPendingBit(uint32_t DAC_Channel, uint32_t DAC_IT); |
mbed_official | 76:aeb1df146756 | 290 | |
mbed_official | 76:aeb1df146756 | 291 | #ifdef __cplusplus |
mbed_official | 76:aeb1df146756 | 292 | } |
mbed_official | 76:aeb1df146756 | 293 | #endif |
mbed_official | 76:aeb1df146756 | 294 | |
mbed_official | 76:aeb1df146756 | 295 | #endif /*__STM32L1xx_DAC_H */ |
mbed_official | 76:aeb1df146756 | 296 | |
mbed_official | 76:aeb1df146756 | 297 | /** |
mbed_official | 76:aeb1df146756 | 298 | * @} |
mbed_official | 76:aeb1df146756 | 299 | */ |
mbed_official | 76:aeb1df146756 | 300 | |
mbed_official | 76:aeb1df146756 | 301 | /** |
mbed_official | 76:aeb1df146756 | 302 | * @} |
mbed_official | 76:aeb1df146756 | 303 | */ |
mbed_official | 76:aeb1df146756 | 304 | |
mbed_official | 76:aeb1df146756 | 305 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |