mbed library sources
Fork of mbed-src by
targets/cmsis/TARGET_STM/TARGET_STM32F0/stm32f0xx_hal_dac.h@441:d2c15dda23c1, 2015-01-06 (annotated)
- Committer:
- mbed_official
- Date:
- Tue Jan 06 16:15:36 2015 +0000
- Revision:
- 441:d2c15dda23c1
- Parent:
- 392:2b59412bb664
Synchronized with git revision 245a60b29caabb42eabdd19658eeac7c3f68313b
Full URL: https://github.com/mbedmicro/mbed/commit/245a60b29caabb42eabdd19658eeac7c3f68313b/
NUCLEO_F072RB/F091RC - adding target to rtos lib and exporter for coide and gcc_arm
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 340:28d1f895c6fe | 1 | /** |
mbed_official | 340:28d1f895c6fe | 2 | ****************************************************************************** |
mbed_official | 340:28d1f895c6fe | 3 | * @file stm32f0xx_hal_dac.h |
mbed_official | 340:28d1f895c6fe | 4 | * @author MCD Application Team |
mbed_official | 441:d2c15dda23c1 | 5 | * @version V1.2.0 |
mbed_official | 441:d2c15dda23c1 | 6 | * @date 11-December-2014 |
mbed_official | 340:28d1f895c6fe | 7 | * @brief Header file of DAC HAL module. |
mbed_official | 340:28d1f895c6fe | 8 | ****************************************************************************** |
mbed_official | 340:28d1f895c6fe | 9 | * @attention |
mbed_official | 340:28d1f895c6fe | 10 | * |
mbed_official | 340:28d1f895c6fe | 11 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
mbed_official | 340:28d1f895c6fe | 12 | * |
mbed_official | 340:28d1f895c6fe | 13 | * Redistribution and use in source and binary forms, with or without modification, |
mbed_official | 340:28d1f895c6fe | 14 | * are permitted provided that the following conditions are met: |
mbed_official | 340:28d1f895c6fe | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
mbed_official | 340:28d1f895c6fe | 16 | * this list of conditions and the following disclaimer. |
mbed_official | 340:28d1f895c6fe | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mbed_official | 340:28d1f895c6fe | 18 | * this list of conditions and the following disclaimer in the documentation |
mbed_official | 340:28d1f895c6fe | 19 | * and/or other materials provided with the distribution. |
mbed_official | 340:28d1f895c6fe | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
mbed_official | 340:28d1f895c6fe | 21 | * may be used to endorse or promote products derived from this software |
mbed_official | 340:28d1f895c6fe | 22 | * without specific prior written permission. |
mbed_official | 340:28d1f895c6fe | 23 | * |
mbed_official | 340:28d1f895c6fe | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 340:28d1f895c6fe | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 340:28d1f895c6fe | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mbed_official | 340:28d1f895c6fe | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
mbed_official | 340:28d1f895c6fe | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mbed_official | 340:28d1f895c6fe | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
mbed_official | 340:28d1f895c6fe | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
mbed_official | 340:28d1f895c6fe | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
mbed_official | 340:28d1f895c6fe | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
mbed_official | 340:28d1f895c6fe | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 340:28d1f895c6fe | 34 | * |
mbed_official | 340:28d1f895c6fe | 35 | ****************************************************************************** |
mbed_official | 340:28d1f895c6fe | 36 | */ |
mbed_official | 340:28d1f895c6fe | 37 | |
mbed_official | 340:28d1f895c6fe | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
mbed_official | 340:28d1f895c6fe | 39 | #ifndef __STM32F0xx_HAL_DAC_H |
mbed_official | 340:28d1f895c6fe | 40 | #define __STM32F0xx_HAL_DAC_H |
mbed_official | 340:28d1f895c6fe | 41 | |
mbed_official | 340:28d1f895c6fe | 42 | #ifdef __cplusplus |
mbed_official | 340:28d1f895c6fe | 43 | extern "C" { |
mbed_official | 340:28d1f895c6fe | 44 | #endif |
mbed_official | 340:28d1f895c6fe | 45 | |
mbed_official | 340:28d1f895c6fe | 46 | #if defined(STM32F051x8) || defined(STM32F058xx) || \ |
mbed_official | 340:28d1f895c6fe | 47 | defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || \ |
mbed_official | 340:28d1f895c6fe | 48 | defined(STM32F091xC) || defined(STM32F098xx) |
mbed_official | 340:28d1f895c6fe | 49 | |
mbed_official | 340:28d1f895c6fe | 50 | /* Includes ------------------------------------------------------------------*/ |
mbed_official | 340:28d1f895c6fe | 51 | #include "stm32f0xx_hal_def.h" |
mbed_official | 340:28d1f895c6fe | 52 | |
mbed_official | 340:28d1f895c6fe | 53 | /** @addtogroup STM32F0xx_HAL_Driver |
mbed_official | 340:28d1f895c6fe | 54 | * @{ |
mbed_official | 340:28d1f895c6fe | 55 | */ |
mbed_official | 340:28d1f895c6fe | 56 | |
mbed_official | 340:28d1f895c6fe | 57 | /** @addtogroup DAC |
mbed_official | 340:28d1f895c6fe | 58 | * @{ |
mbed_official | 340:28d1f895c6fe | 59 | */ |
mbed_official | 340:28d1f895c6fe | 60 | |
mbed_official | 340:28d1f895c6fe | 61 | /* Exported types ------------------------------------------------------------*/ |
mbed_official | 340:28d1f895c6fe | 62 | |
mbed_official | 340:28d1f895c6fe | 63 | /** @defgroup DAC_Exported_Types DAC Exported Types |
mbed_official | 340:28d1f895c6fe | 64 | * @{ |
mbed_official | 340:28d1f895c6fe | 65 | */ |
mbed_official | 340:28d1f895c6fe | 66 | |
mbed_official | 340:28d1f895c6fe | 67 | /** |
mbed_official | 340:28d1f895c6fe | 68 | * @brief HAL State structures definition |
mbed_official | 340:28d1f895c6fe | 69 | */ |
mbed_official | 340:28d1f895c6fe | 70 | typedef enum |
mbed_official | 340:28d1f895c6fe | 71 | { |
mbed_official | 340:28d1f895c6fe | 72 | HAL_DAC_STATE_RESET = 0x00, /*!< DAC not yet initialized or disabled */ |
mbed_official | 340:28d1f895c6fe | 73 | HAL_DAC_STATE_READY = 0x01, /*!< DAC initialized and ready for use */ |
mbed_official | 340:28d1f895c6fe | 74 | HAL_DAC_STATE_BUSY = 0x02, /*!< DAC internal processing is ongoing */ |
mbed_official | 340:28d1f895c6fe | 75 | HAL_DAC_STATE_TIMEOUT = 0x03, /*!< DAC timeout state */ |
mbed_official | 340:28d1f895c6fe | 76 | HAL_DAC_STATE_ERROR = 0x04 /*!< DAC error state */ |
mbed_official | 340:28d1f895c6fe | 77 | |
mbed_official | 340:28d1f895c6fe | 78 | }HAL_DAC_StateTypeDef; |
mbed_official | 340:28d1f895c6fe | 79 | |
mbed_official | 340:28d1f895c6fe | 80 | /** |
mbed_official | 340:28d1f895c6fe | 81 | * @brief DAC handle Structure definition |
mbed_official | 340:28d1f895c6fe | 82 | */ |
mbed_official | 340:28d1f895c6fe | 83 | typedef struct |
mbed_official | 340:28d1f895c6fe | 84 | { |
mbed_official | 340:28d1f895c6fe | 85 | DAC_TypeDef *Instance; /*!< Register base address */ |
mbed_official | 340:28d1f895c6fe | 86 | |
mbed_official | 340:28d1f895c6fe | 87 | __IO HAL_DAC_StateTypeDef State; /*!< DAC communication state */ |
mbed_official | 340:28d1f895c6fe | 88 | |
mbed_official | 340:28d1f895c6fe | 89 | HAL_LockTypeDef Lock; /*!< DAC locking object */ |
mbed_official | 340:28d1f895c6fe | 90 | |
mbed_official | 340:28d1f895c6fe | 91 | DMA_HandleTypeDef *DMA_Handle1; /*!< Pointer DMA handler for channel 1 */ |
mbed_official | 340:28d1f895c6fe | 92 | |
mbed_official | 340:28d1f895c6fe | 93 | DMA_HandleTypeDef *DMA_Handle2; /*!< Pointer DMA handler for channel 2 */ |
mbed_official | 340:28d1f895c6fe | 94 | |
mbed_official | 340:28d1f895c6fe | 95 | __IO uint32_t ErrorCode; /*!< DAC Error code */ |
mbed_official | 340:28d1f895c6fe | 96 | |
mbed_official | 340:28d1f895c6fe | 97 | }DAC_HandleTypeDef; |
mbed_official | 340:28d1f895c6fe | 98 | |
mbed_official | 340:28d1f895c6fe | 99 | /** |
mbed_official | 340:28d1f895c6fe | 100 | * @brief DAC Configuration regular Channel structure definition |
mbed_official | 340:28d1f895c6fe | 101 | */ |
mbed_official | 340:28d1f895c6fe | 102 | typedef struct |
mbed_official | 340:28d1f895c6fe | 103 | { |
mbed_official | 340:28d1f895c6fe | 104 | uint32_t DAC_Trigger; /*!< Specifies the external trigger for the selected DAC channel. |
mbed_official | 340:28d1f895c6fe | 105 | This parameter can be a value of @ref DAC_trigger_selection */ |
mbed_official | 340:28d1f895c6fe | 106 | |
mbed_official | 340:28d1f895c6fe | 107 | uint32_t DAC_OutputBuffer; /*!< Specifies whether the DAC channel output buffer is enabled or disabled. |
mbed_official | 340:28d1f895c6fe | 108 | This parameter can be a value of @ref DAC_output_buffer */ |
mbed_official | 340:28d1f895c6fe | 109 | |
mbed_official | 340:28d1f895c6fe | 110 | }DAC_ChannelConfTypeDef; |
mbed_official | 340:28d1f895c6fe | 111 | |
mbed_official | 340:28d1f895c6fe | 112 | /** |
mbed_official | 340:28d1f895c6fe | 113 | * @} |
mbed_official | 340:28d1f895c6fe | 114 | */ |
mbed_official | 340:28d1f895c6fe | 115 | |
mbed_official | 340:28d1f895c6fe | 116 | /* Exported constants --------------------------------------------------------*/ |
mbed_official | 340:28d1f895c6fe | 117 | |
mbed_official | 340:28d1f895c6fe | 118 | /** @defgroup DAC_Exported_Constants DAC Exported Constants |
mbed_official | 340:28d1f895c6fe | 119 | * @{ |
mbed_official | 340:28d1f895c6fe | 120 | */ |
mbed_official | 340:28d1f895c6fe | 121 | |
mbed_official | 340:28d1f895c6fe | 122 | /** @defgroup DAC_Error_Code DAC Error Code |
mbed_official | 340:28d1f895c6fe | 123 | * @{ |
mbed_official | 340:28d1f895c6fe | 124 | */ |
mbed_official | 340:28d1f895c6fe | 125 | #define HAL_DAC_ERROR_NONE 0x00 /*!< No error */ |
mbed_official | 340:28d1f895c6fe | 126 | #define HAL_DAC_ERROR_DMAUNDERRUNCH1 0x01 /*!< DAC channel1 DAM underrun error */ |
mbed_official | 340:28d1f895c6fe | 127 | #define HAL_DAC_ERROR_DMAUNDERRUNCH2 0x02 /*!< DAC channel2 DAM underrun error */ |
mbed_official | 340:28d1f895c6fe | 128 | #define HAL_DAC_ERROR_DMA 0x04 /*!< DMA error */ |
mbed_official | 340:28d1f895c6fe | 129 | /** |
mbed_official | 340:28d1f895c6fe | 130 | * @} |
mbed_official | 340:28d1f895c6fe | 131 | */ |
mbed_official | 340:28d1f895c6fe | 132 | |
mbed_official | 340:28d1f895c6fe | 133 | /** @defgroup DAC_output_buffer DAC output buffer |
mbed_official | 340:28d1f895c6fe | 134 | * @{ |
mbed_official | 340:28d1f895c6fe | 135 | */ |
mbed_official | 340:28d1f895c6fe | 136 | #define DAC_OUTPUTBUFFER_ENABLE ((uint32_t)0x00000000) |
mbed_official | 340:28d1f895c6fe | 137 | #define DAC_OUTPUTBUFFER_DISABLE ((uint32_t)DAC_CR_BOFF1) |
mbed_official | 340:28d1f895c6fe | 138 | |
mbed_official | 340:28d1f895c6fe | 139 | #define IS_DAC_OUTPUT_BUFFER_STATE(STATE) (((STATE) == DAC_OUTPUTBUFFER_ENABLE) || \ |
mbed_official | 340:28d1f895c6fe | 140 | ((STATE) == DAC_OUTPUTBUFFER_DISABLE)) |
mbed_official | 340:28d1f895c6fe | 141 | /** |
mbed_official | 340:28d1f895c6fe | 142 | * @} |
mbed_official | 340:28d1f895c6fe | 143 | */ |
mbed_official | 340:28d1f895c6fe | 144 | |
mbed_official | 340:28d1f895c6fe | 145 | /** @defgroup DAC_data_alignement DAC data alignement |
mbed_official | 340:28d1f895c6fe | 146 | * @{ |
mbed_official | 340:28d1f895c6fe | 147 | */ |
mbed_official | 340:28d1f895c6fe | 148 | #define DAC_ALIGN_12B_R ((uint32_t)0x00000000) |
mbed_official | 340:28d1f895c6fe | 149 | #define DAC_ALIGN_12B_L ((uint32_t)0x00000004) |
mbed_official | 340:28d1f895c6fe | 150 | #define DAC_ALIGN_8B_R ((uint32_t)0x00000008) |
mbed_official | 340:28d1f895c6fe | 151 | |
mbed_official | 340:28d1f895c6fe | 152 | #define IS_DAC_ALIGN(ALIGN) (((ALIGN) == DAC_ALIGN_12B_R) || \ |
mbed_official | 340:28d1f895c6fe | 153 | ((ALIGN) == DAC_ALIGN_12B_L) || \ |
mbed_official | 340:28d1f895c6fe | 154 | ((ALIGN) == DAC_ALIGN_8B_R)) |
mbed_official | 340:28d1f895c6fe | 155 | /** |
mbed_official | 340:28d1f895c6fe | 156 | * @} |
mbed_official | 340:28d1f895c6fe | 157 | */ |
mbed_official | 340:28d1f895c6fe | 158 | |
mbed_official | 340:28d1f895c6fe | 159 | /** @defgroup DAC_data DAC data |
mbed_official | 340:28d1f895c6fe | 160 | * @{ |
mbed_official | 340:28d1f895c6fe | 161 | */ |
mbed_official | 340:28d1f895c6fe | 162 | #define IS_DAC_DATA(DATA) ((DATA) <= 0xFFF0) |
mbed_official | 340:28d1f895c6fe | 163 | /** |
mbed_official | 340:28d1f895c6fe | 164 | * @} |
mbed_official | 340:28d1f895c6fe | 165 | */ |
mbed_official | 340:28d1f895c6fe | 166 | |
mbed_official | 340:28d1f895c6fe | 167 | /** @defgroup DAC_flags_definition DAC flags definition |
mbed_official | 340:28d1f895c6fe | 168 | * @{ |
mbed_official | 340:28d1f895c6fe | 169 | */ |
mbed_official | 340:28d1f895c6fe | 170 | #define DAC_FLAG_DMAUDR1 ((uint32_t)DAC_SR_DMAUDR1) |
mbed_official | 340:28d1f895c6fe | 171 | #define DAC_FLAG_DMAUDR2 ((uint32_t)DAC_SR_DMAUDR2) |
mbed_official | 340:28d1f895c6fe | 172 | /** |
mbed_official | 340:28d1f895c6fe | 173 | * @} |
mbed_official | 340:28d1f895c6fe | 174 | */ |
mbed_official | 340:28d1f895c6fe | 175 | |
mbed_official | 340:28d1f895c6fe | 176 | /** @defgroup DAC_IT_definition DAC IT definition |
mbed_official | 340:28d1f895c6fe | 177 | * @{ |
mbed_official | 340:28d1f895c6fe | 178 | */ |
mbed_official | 340:28d1f895c6fe | 179 | #define DAC_IT_DMAUDR1 ((uint32_t)DAC_SR_DMAUDR1) |
mbed_official | 340:28d1f895c6fe | 180 | #define DAC_IT_DMAUDR2 ((uint32_t)DAC_SR_DMAUDR2) |
mbed_official | 340:28d1f895c6fe | 181 | /** |
mbed_official | 340:28d1f895c6fe | 182 | * @} |
mbed_official | 340:28d1f895c6fe | 183 | */ |
mbed_official | 340:28d1f895c6fe | 184 | |
mbed_official | 340:28d1f895c6fe | 185 | /** |
mbed_official | 340:28d1f895c6fe | 186 | * @} |
mbed_official | 340:28d1f895c6fe | 187 | */ |
mbed_official | 340:28d1f895c6fe | 188 | |
mbed_official | 340:28d1f895c6fe | 189 | /* Exported macro ------------------------------------------------------------*/ |
mbed_official | 340:28d1f895c6fe | 190 | |
mbed_official | 340:28d1f895c6fe | 191 | /** @defgroup DAC_Exported_Macros DAC Exported Macros |
mbed_official | 340:28d1f895c6fe | 192 | * @{ |
mbed_official | 340:28d1f895c6fe | 193 | */ |
mbed_official | 340:28d1f895c6fe | 194 | |
mbed_official | 340:28d1f895c6fe | 195 | /** @brief Reset DAC handle state |
mbed_official | 340:28d1f895c6fe | 196 | * @param __HANDLE__: specifies the DAC handle. |
mbed_official | 340:28d1f895c6fe | 197 | * @retval None |
mbed_official | 340:28d1f895c6fe | 198 | */ |
mbed_official | 340:28d1f895c6fe | 199 | #define __HAL_DAC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DAC_STATE_RESET) |
mbed_official | 340:28d1f895c6fe | 200 | |
mbed_official | 340:28d1f895c6fe | 201 | /** @brief Enable the DAC channel |
mbed_official | 340:28d1f895c6fe | 202 | * @param __HANDLE__: specifies the DAC handle. |
mbed_official | 340:28d1f895c6fe | 203 | * @param __DAC_Channel__: specifies the DAC channel |
mbed_official | 340:28d1f895c6fe | 204 | * @retval None |
mbed_official | 340:28d1f895c6fe | 205 | */ |
mbed_official | 340:28d1f895c6fe | 206 | #define __HAL_DAC_ENABLE(__HANDLE__, __DAC_Channel__) \ |
mbed_official | 340:28d1f895c6fe | 207 | ((__HANDLE__)->Instance->CR |= (DAC_CR_EN1 << (__DAC_Channel__))) |
mbed_official | 340:28d1f895c6fe | 208 | |
mbed_official | 340:28d1f895c6fe | 209 | /** @brief Disable the DAC channel |
mbed_official | 340:28d1f895c6fe | 210 | * @param __HANDLE__: specifies the DAC handle |
mbed_official | 340:28d1f895c6fe | 211 | * @param __DAC_Channel__: specifies the DAC channel. |
mbed_official | 340:28d1f895c6fe | 212 | * @retval None |
mbed_official | 340:28d1f895c6fe | 213 | */ |
mbed_official | 340:28d1f895c6fe | 214 | #define __HAL_DAC_DISABLE(__HANDLE__, __DAC_Channel__) \ |
mbed_official | 340:28d1f895c6fe | 215 | ((__HANDLE__)->Instance->CR &= ~(DAC_CR_EN1 << (__DAC_Channel__))) |
mbed_official | 340:28d1f895c6fe | 216 | |
mbed_official | 340:28d1f895c6fe | 217 | /** @brief Set DHR12R1 alignment |
mbed_official | 340:28d1f895c6fe | 218 | * @param __ALIGNEMENT__: specifies the DAC alignement |
mbed_official | 340:28d1f895c6fe | 219 | * @retval None |
mbed_official | 340:28d1f895c6fe | 220 | */ |
mbed_official | 340:28d1f895c6fe | 221 | #define __HAL_DHR12R1_ALIGNEMENT(__ALIGNEMENT__) (((uint32_t)0x00000008) + (__ALIGNEMENT__)) |
mbed_official | 340:28d1f895c6fe | 222 | |
mbed_official | 340:28d1f895c6fe | 223 | /** @brief Set DHR12R2 alignment |
mbed_official | 340:28d1f895c6fe | 224 | * @param __ALIGNEMENT__: specifies the DAC alignement |
mbed_official | 340:28d1f895c6fe | 225 | * @retval None |
mbed_official | 340:28d1f895c6fe | 226 | */ |
mbed_official | 340:28d1f895c6fe | 227 | #define __HAL_DHR12R2_ALIGNEMENT(__ALIGNEMENT__) (((uint32_t)0x00000014) + (__ALIGNEMENT__)) |
mbed_official | 340:28d1f895c6fe | 228 | |
mbed_official | 340:28d1f895c6fe | 229 | /** @brief Set DHR12RD alignment |
mbed_official | 340:28d1f895c6fe | 230 | * @param __ALIGNEMENT__: specifies the DAC alignement |
mbed_official | 340:28d1f895c6fe | 231 | * @retval None |
mbed_official | 340:28d1f895c6fe | 232 | */ |
mbed_official | 340:28d1f895c6fe | 233 | #define __HAL_DHR12RD_ALIGNEMENT(__ALIGNEMENT__) (((uint32_t)0x00000020) + (__ALIGNEMENT__)) |
mbed_official | 340:28d1f895c6fe | 234 | |
mbed_official | 340:28d1f895c6fe | 235 | /** @brief Enable the DAC interrupt |
mbed_official | 340:28d1f895c6fe | 236 | * @param __HANDLE__: specifies the DAC handle |
mbed_official | 340:28d1f895c6fe | 237 | * @param __INTERRUPT__: specifies the DAC interrupt. |
mbed_official | 340:28d1f895c6fe | 238 | * @retval None |
mbed_official | 340:28d1f895c6fe | 239 | */ |
mbed_official | 340:28d1f895c6fe | 240 | #define __HAL_DAC_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CR) |= (__INTERRUPT__)) |
mbed_official | 340:28d1f895c6fe | 241 | |
mbed_official | 340:28d1f895c6fe | 242 | /** @brief Disable the DAC interrupt |
mbed_official | 340:28d1f895c6fe | 243 | * @param __HANDLE__: specifies the DAC handle |
mbed_official | 340:28d1f895c6fe | 244 | * @param __INTERRUPT__: specifies the DAC interrupt. |
mbed_official | 340:28d1f895c6fe | 245 | * @retval None |
mbed_official | 340:28d1f895c6fe | 246 | */ |
mbed_official | 340:28d1f895c6fe | 247 | #define __HAL_DAC_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CR) &= ~(__INTERRUPT__)) |
mbed_official | 340:28d1f895c6fe | 248 | |
mbed_official | 340:28d1f895c6fe | 249 | /** @brief Get the selected DAC's flag status. |
mbed_official | 340:28d1f895c6fe | 250 | * @param __HANDLE__: specifies the DAC handle. |
mbed_official | 340:28d1f895c6fe | 251 | * @param __FLAG__: specifies the FLAG. |
mbed_official | 340:28d1f895c6fe | 252 | * @retval None |
mbed_official | 340:28d1f895c6fe | 253 | */ |
mbed_official | 340:28d1f895c6fe | 254 | #define __HAL_DAC_GET_FLAG(__HANDLE__, __FLAG__) ((((__HANDLE__)->Instance->SR) & (__FLAG__)) == (__FLAG__)) |
mbed_official | 340:28d1f895c6fe | 255 | |
mbed_official | 340:28d1f895c6fe | 256 | /** @brief Clear the DAC's flag. |
mbed_official | 340:28d1f895c6fe | 257 | * @param __HANDLE__: specifies the DAC handle. |
mbed_official | 340:28d1f895c6fe | 258 | * @param __FLAG__: specifies the FLAG. |
mbed_official | 340:28d1f895c6fe | 259 | * @retval None |
mbed_official | 340:28d1f895c6fe | 260 | */ |
mbed_official | 340:28d1f895c6fe | 261 | #define __HAL_DAC_CLEAR_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR) = (__FLAG__)) |
mbed_official | 340:28d1f895c6fe | 262 | |
mbed_official | 340:28d1f895c6fe | 263 | /** |
mbed_official | 340:28d1f895c6fe | 264 | * @} |
mbed_official | 340:28d1f895c6fe | 265 | */ |
mbed_official | 340:28d1f895c6fe | 266 | |
mbed_official | 340:28d1f895c6fe | 267 | |
mbed_official | 340:28d1f895c6fe | 268 | /* Include DAC HAL Extension module */ |
mbed_official | 340:28d1f895c6fe | 269 | #include "stm32f0xx_hal_dac_ex.h" |
mbed_official | 340:28d1f895c6fe | 270 | |
mbed_official | 340:28d1f895c6fe | 271 | /* Exported functions --------------------------------------------------------*/ |
mbed_official | 340:28d1f895c6fe | 272 | |
mbed_official | 340:28d1f895c6fe | 273 | /** @addtogroup DAC_Exported_Functions |
mbed_official | 340:28d1f895c6fe | 274 | * @{ |
mbed_official | 340:28d1f895c6fe | 275 | */ |
mbed_official | 340:28d1f895c6fe | 276 | |
mbed_official | 340:28d1f895c6fe | 277 | /** @addtogroup DAC_Exported_Functions_Group1 |
mbed_official | 340:28d1f895c6fe | 278 | * @{ |
mbed_official | 340:28d1f895c6fe | 279 | */ |
mbed_official | 340:28d1f895c6fe | 280 | /* Initialization and de-initialization functions *****************************/ |
mbed_official | 340:28d1f895c6fe | 281 | HAL_StatusTypeDef HAL_DAC_Init(DAC_HandleTypeDef* hdac); |
mbed_official | 340:28d1f895c6fe | 282 | HAL_StatusTypeDef HAL_DAC_DeInit(DAC_HandleTypeDef* hdac); |
mbed_official | 340:28d1f895c6fe | 283 | void HAL_DAC_MspInit(DAC_HandleTypeDef* hdac); |
mbed_official | 340:28d1f895c6fe | 284 | void HAL_DAC_MspDeInit(DAC_HandleTypeDef* hdac); |
mbed_official | 340:28d1f895c6fe | 285 | |
mbed_official | 340:28d1f895c6fe | 286 | /** |
mbed_official | 340:28d1f895c6fe | 287 | * @} |
mbed_official | 340:28d1f895c6fe | 288 | */ |
mbed_official | 340:28d1f895c6fe | 289 | |
mbed_official | 340:28d1f895c6fe | 290 | /** @addtogroup DAC_Exported_Functions_Group2 |
mbed_official | 340:28d1f895c6fe | 291 | * @{ |
mbed_official | 340:28d1f895c6fe | 292 | */ |
mbed_official | 340:28d1f895c6fe | 293 | /* IO operation functions *****************************************************/ |
mbed_official | 340:28d1f895c6fe | 294 | HAL_StatusTypeDef HAL_DAC_Start(DAC_HandleTypeDef* hdac, uint32_t Channel); |
mbed_official | 340:28d1f895c6fe | 295 | HAL_StatusTypeDef HAL_DAC_Stop(DAC_HandleTypeDef* hdac, uint32_t Channel); |
mbed_official | 340:28d1f895c6fe | 296 | HAL_StatusTypeDef HAL_DAC_Start_DMA(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t* pData, uint32_t Length, uint32_t Alignment); |
mbed_official | 340:28d1f895c6fe | 297 | HAL_StatusTypeDef HAL_DAC_Stop_DMA(DAC_HandleTypeDef* hdac, uint32_t Channel); |
mbed_official | 340:28d1f895c6fe | 298 | |
mbed_official | 340:28d1f895c6fe | 299 | void HAL_DAC_ConvCpltCallbackCh1(DAC_HandleTypeDef* hdac); |
mbed_official | 340:28d1f895c6fe | 300 | void HAL_DAC_ConvHalfCpltCallbackCh1(DAC_HandleTypeDef* hdac); |
mbed_official | 340:28d1f895c6fe | 301 | void HAL_DAC_ErrorCallbackCh1(DAC_HandleTypeDef *hdac); |
mbed_official | 340:28d1f895c6fe | 302 | void HAL_DAC_DMAUnderrunCallbackCh1(DAC_HandleTypeDef *hdac); |
mbed_official | 340:28d1f895c6fe | 303 | /** |
mbed_official | 340:28d1f895c6fe | 304 | * @} |
mbed_official | 340:28d1f895c6fe | 305 | */ |
mbed_official | 340:28d1f895c6fe | 306 | |
mbed_official | 340:28d1f895c6fe | 307 | /** @addtogroup DAC_Exported_Functions_Group3 |
mbed_official | 340:28d1f895c6fe | 308 | * @{ |
mbed_official | 340:28d1f895c6fe | 309 | */ |
mbed_official | 340:28d1f895c6fe | 310 | /* Peripheral Control functions ***********************************************/ |
mbed_official | 340:28d1f895c6fe | 311 | HAL_StatusTypeDef HAL_DAC_ConfigChannel(DAC_HandleTypeDef* hdac, DAC_ChannelConfTypeDef* sConfig, uint32_t Channel); |
mbed_official | 340:28d1f895c6fe | 312 | HAL_StatusTypeDef HAL_DAC_SetValue(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Alignment, uint32_t Data); |
mbed_official | 340:28d1f895c6fe | 313 | uint32_t HAL_DAC_GetValue(DAC_HandleTypeDef* hdac, uint32_t Channel); |
mbed_official | 340:28d1f895c6fe | 314 | /** |
mbed_official | 340:28d1f895c6fe | 315 | * @} |
mbed_official | 340:28d1f895c6fe | 316 | */ |
mbed_official | 340:28d1f895c6fe | 317 | |
mbed_official | 340:28d1f895c6fe | 318 | /** @addtogroup DAC_Exported_Functions_Group4 |
mbed_official | 340:28d1f895c6fe | 319 | * @{ |
mbed_official | 340:28d1f895c6fe | 320 | */ |
mbed_official | 340:28d1f895c6fe | 321 | /* Peripheral State and Error functions ***************************************/ |
mbed_official | 340:28d1f895c6fe | 322 | HAL_DAC_StateTypeDef HAL_DAC_GetState(DAC_HandleTypeDef* hdac); |
mbed_official | 340:28d1f895c6fe | 323 | void HAL_DAC_IRQHandler(DAC_HandleTypeDef* hdac); |
mbed_official | 340:28d1f895c6fe | 324 | uint32_t HAL_DAC_GetError(DAC_HandleTypeDef *hdac); |
mbed_official | 340:28d1f895c6fe | 325 | |
mbed_official | 340:28d1f895c6fe | 326 | /** |
mbed_official | 340:28d1f895c6fe | 327 | * @} |
mbed_official | 340:28d1f895c6fe | 328 | */ |
mbed_official | 340:28d1f895c6fe | 329 | |
mbed_official | 340:28d1f895c6fe | 330 | /** |
mbed_official | 340:28d1f895c6fe | 331 | * @} |
mbed_official | 340:28d1f895c6fe | 332 | */ |
mbed_official | 340:28d1f895c6fe | 333 | |
mbed_official | 340:28d1f895c6fe | 334 | /** |
mbed_official | 340:28d1f895c6fe | 335 | * @} |
mbed_official | 340:28d1f895c6fe | 336 | */ |
mbed_official | 340:28d1f895c6fe | 337 | |
mbed_official | 340:28d1f895c6fe | 338 | /** |
mbed_official | 340:28d1f895c6fe | 339 | * @} |
mbed_official | 340:28d1f895c6fe | 340 | */ |
mbed_official | 340:28d1f895c6fe | 341 | |
mbed_official | 340:28d1f895c6fe | 342 | #endif /* STM32F051x8 || STM32F058xx || */ |
mbed_official | 340:28d1f895c6fe | 343 | /* STM32F071xB || STM32F072xB || STM32F078xx || */ |
mbed_official | 340:28d1f895c6fe | 344 | /* STM32F091xC || STM32F098xx */ |
mbed_official | 340:28d1f895c6fe | 345 | |
mbed_official | 340:28d1f895c6fe | 346 | #ifdef __cplusplus |
mbed_official | 340:28d1f895c6fe | 347 | } |
mbed_official | 340:28d1f895c6fe | 348 | #endif |
mbed_official | 340:28d1f895c6fe | 349 | |
mbed_official | 340:28d1f895c6fe | 350 | |
mbed_official | 340:28d1f895c6fe | 351 | #endif /*__STM32F0xx_HAL_DAC_H */ |
mbed_official | 340:28d1f895c6fe | 352 | |
mbed_official | 340:28d1f895c6fe | 353 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
mbed_official | 340:28d1f895c6fe | 354 |