Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.
Dependents: 1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB
Fork of mbed by
TARGET_ARCH_MAX/stm32f4xx_hal_dac_ex.h@106:ba1f97679dad, 2015-09-02 (annotated)
- Committer:
- Kojto
- Date:
- Wed Sep 02 14:17:43 2015 +0100
- Revision:
- 106:ba1f97679dad
- Parent:
- 99:dbbf35b96557
- Child:
- 110:165afa46840b
Release 106 of the mbed library
Changes:
- new platform - Nucleo F446RE
- STM32F4 Cube driver update v2.3.2
- ST cmsis driver v2.3.2
- nordic bugfix gcc linker start address
- lpc11u68 - bugfix for serial ports
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bogdanm | 89:552587b429a1 | 1 | /** |
bogdanm | 89:552587b429a1 | 2 | ****************************************************************************** |
bogdanm | 89:552587b429a1 | 3 | * @file stm32f4xx_hal_dac.h |
bogdanm | 89:552587b429a1 | 4 | * @author MCD Application Team |
Kojto | 106:ba1f97679dad | 5 | * @version V1.3.2 |
Kojto | 106:ba1f97679dad | 6 | * @date 26-June-2015 |
bogdanm | 89:552587b429a1 | 7 | * @brief Header file of DAC HAL Extension module. |
bogdanm | 89:552587b429a1 | 8 | ****************************************************************************** |
bogdanm | 89:552587b429a1 | 9 | * @attention |
bogdanm | 89:552587b429a1 | 10 | * |
Kojto | 99:dbbf35b96557 | 11 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
bogdanm | 89:552587b429a1 | 12 | * |
bogdanm | 89:552587b429a1 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
bogdanm | 89:552587b429a1 | 14 | * are permitted provided that the following conditions are met: |
bogdanm | 89:552587b429a1 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
bogdanm | 89:552587b429a1 | 16 | * this list of conditions and the following disclaimer. |
bogdanm | 89:552587b429a1 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
bogdanm | 89:552587b429a1 | 18 | * this list of conditions and the following disclaimer in the documentation |
bogdanm | 89:552587b429a1 | 19 | * and/or other materials provided with the distribution. |
bogdanm | 89:552587b429a1 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
bogdanm | 89:552587b429a1 | 21 | * may be used to endorse or promote products derived from this software |
bogdanm | 89:552587b429a1 | 22 | * without specific prior written permission. |
bogdanm | 89:552587b429a1 | 23 | * |
bogdanm | 89:552587b429a1 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
bogdanm | 89:552587b429a1 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
bogdanm | 89:552587b429a1 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
bogdanm | 89:552587b429a1 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
bogdanm | 89:552587b429a1 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
bogdanm | 89:552587b429a1 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
bogdanm | 89:552587b429a1 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
bogdanm | 89:552587b429a1 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
bogdanm | 89:552587b429a1 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
bogdanm | 89:552587b429a1 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
bogdanm | 89:552587b429a1 | 34 | * |
bogdanm | 89:552587b429a1 | 35 | ****************************************************************************** |
bogdanm | 89:552587b429a1 | 36 | */ |
bogdanm | 89:552587b429a1 | 37 | |
bogdanm | 89:552587b429a1 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
bogdanm | 89:552587b429a1 | 39 | #ifndef __STM32F4xx_HAL_DAC_EX_H |
bogdanm | 89:552587b429a1 | 40 | #define __STM32F4xx_HAL_DAC_EX_H |
bogdanm | 89:552587b429a1 | 41 | |
bogdanm | 89:552587b429a1 | 42 | #ifdef __cplusplus |
bogdanm | 89:552587b429a1 | 43 | extern "C" { |
bogdanm | 89:552587b429a1 | 44 | #endif |
bogdanm | 89:552587b429a1 | 45 | |
Kojto | 99:dbbf35b96557 | 46 | #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ |
Kojto | 99:dbbf35b96557 | 47 | defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ |
Kojto | 99:dbbf35b96557 | 48 | defined(STM32F446xx) |
bogdanm | 89:552587b429a1 | 49 | |
bogdanm | 89:552587b429a1 | 50 | /* Includes ------------------------------------------------------------------*/ |
bogdanm | 89:552587b429a1 | 51 | #include "stm32f4xx_hal_def.h" |
bogdanm | 89:552587b429a1 | 52 | |
bogdanm | 89:552587b429a1 | 53 | /** @addtogroup STM32F4xx_HAL_Driver |
bogdanm | 89:552587b429a1 | 54 | * @{ |
bogdanm | 89:552587b429a1 | 55 | */ |
bogdanm | 89:552587b429a1 | 56 | |
bogdanm | 89:552587b429a1 | 57 | /** @addtogroup DACEx |
bogdanm | 89:552587b429a1 | 58 | * @{ |
bogdanm | 89:552587b429a1 | 59 | */ |
bogdanm | 89:552587b429a1 | 60 | |
bogdanm | 89:552587b429a1 | 61 | /* Exported types ------------------------------------------------------------*/ |
bogdanm | 89:552587b429a1 | 62 | /* Exported constants --------------------------------------------------------*/ |
Kojto | 99:dbbf35b96557 | 63 | /** @defgroup DACEx_Exported_Constants DAC Exported Constants |
bogdanm | 89:552587b429a1 | 64 | * @{ |
bogdanm | 89:552587b429a1 | 65 | */ |
bogdanm | 89:552587b429a1 | 66 | |
Kojto | 99:dbbf35b96557 | 67 | /** @defgroup DACEx_lfsrunmask_triangleamplitude DAC LFS Run Mask Triangle Amplitude |
bogdanm | 89:552587b429a1 | 68 | * @{ |
bogdanm | 89:552587b429a1 | 69 | */ |
bogdanm | 89:552587b429a1 | 70 | #define DAC_LFSRUNMASK_BIT0 ((uint32_t)0x00000000) /*!< Unmask DAC channel LFSR bit0 for noise wave generation */ |
bogdanm | 89:552587b429a1 | 71 | #define DAC_LFSRUNMASK_BITS1_0 ((uint32_t)DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[1:0] for noise wave generation */ |
bogdanm | 89:552587b429a1 | 72 | #define DAC_LFSRUNMASK_BITS2_0 ((uint32_t)DAC_CR_MAMP1_1) /*!< Unmask DAC channel LFSR bit[2:0] for noise wave generation */ |
bogdanm | 89:552587b429a1 | 73 | #define DAC_LFSRUNMASK_BITS3_0 ((uint32_t)DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0)/*!< Unmask DAC channel LFSR bit[3:0] for noise wave generation */ |
bogdanm | 89:552587b429a1 | 74 | #define DAC_LFSRUNMASK_BITS4_0 ((uint32_t)DAC_CR_MAMP1_2) /*!< Unmask DAC channel LFSR bit[4:0] for noise wave generation */ |
bogdanm | 89:552587b429a1 | 75 | #define DAC_LFSRUNMASK_BITS5_0 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[5:0] for noise wave generation */ |
bogdanm | 89:552587b429a1 | 76 | #define DAC_LFSRUNMASK_BITS6_0 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_1) /*!< Unmask DAC channel LFSR bit[6:0] for noise wave generation */ |
bogdanm | 89:552587b429a1 | 77 | #define DAC_LFSRUNMASK_BITS7_0 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[7:0] for noise wave generation */ |
bogdanm | 89:552587b429a1 | 78 | #define DAC_LFSRUNMASK_BITS8_0 ((uint32_t)DAC_CR_MAMP1_3) /*!< Unmask DAC channel LFSR bit[8:0] for noise wave generation */ |
bogdanm | 89:552587b429a1 | 79 | #define DAC_LFSRUNMASK_BITS9_0 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[9:0] for noise wave generation */ |
bogdanm | 89:552587b429a1 | 80 | #define DAC_LFSRUNMASK_BITS10_0 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1) /*!< Unmask DAC channel LFSR bit[10:0] for noise wave generation */ |
bogdanm | 89:552587b429a1 | 81 | #define DAC_LFSRUNMASK_BITS11_0 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[11:0] for noise wave generation */ |
bogdanm | 89:552587b429a1 | 82 | #define DAC_TRIANGLEAMPLITUDE_1 ((uint32_t)0x00000000) /*!< Select max triangle amplitude of 1 */ |
bogdanm | 89:552587b429a1 | 83 | #define DAC_TRIANGLEAMPLITUDE_3 ((uint32_t)DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 3 */ |
bogdanm | 89:552587b429a1 | 84 | #define DAC_TRIANGLEAMPLITUDE_7 ((uint32_t)DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 7 */ |
bogdanm | 89:552587b429a1 | 85 | #define DAC_TRIANGLEAMPLITUDE_15 ((uint32_t)DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 15 */ |
bogdanm | 89:552587b429a1 | 86 | #define DAC_TRIANGLEAMPLITUDE_31 ((uint32_t)DAC_CR_MAMP1_2) /*!< Select max triangle amplitude of 31 */ |
bogdanm | 89:552587b429a1 | 87 | #define DAC_TRIANGLEAMPLITUDE_63 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 63 */ |
bogdanm | 89:552587b429a1 | 88 | #define DAC_TRIANGLEAMPLITUDE_127 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 127 */ |
bogdanm | 89:552587b429a1 | 89 | #define DAC_TRIANGLEAMPLITUDE_255 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 255 */ |
bogdanm | 89:552587b429a1 | 90 | #define DAC_TRIANGLEAMPLITUDE_511 ((uint32_t)DAC_CR_MAMP1_3) /*!< Select max triangle amplitude of 511 */ |
bogdanm | 89:552587b429a1 | 91 | #define DAC_TRIANGLEAMPLITUDE_1023 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 1023 */ |
bogdanm | 89:552587b429a1 | 92 | #define DAC_TRIANGLEAMPLITUDE_2047 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 2047 */ |
bogdanm | 89:552587b429a1 | 93 | #define DAC_TRIANGLEAMPLITUDE_4095 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 4095 */ |
Kojto | 99:dbbf35b96557 | 94 | /** |
Kojto | 99:dbbf35b96557 | 95 | * @} |
Kojto | 99:dbbf35b96557 | 96 | */ |
bogdanm | 89:552587b429a1 | 97 | |
Kojto | 99:dbbf35b96557 | 98 | /** |
Kojto | 99:dbbf35b96557 | 99 | * @} |
Kojto | 99:dbbf35b96557 | 100 | */ |
Kojto | 99:dbbf35b96557 | 101 | |
Kojto | 99:dbbf35b96557 | 102 | /* Exported macro ------------------------------------------------------------*/ |
Kojto | 99:dbbf35b96557 | 103 | /* Exported functions --------------------------------------------------------*/ |
Kojto | 99:dbbf35b96557 | 104 | /** @addtogroup DACEx_Exported_Functions |
Kojto | 99:dbbf35b96557 | 105 | * @{ |
Kojto | 99:dbbf35b96557 | 106 | */ |
Kojto | 99:dbbf35b96557 | 107 | |
Kojto | 99:dbbf35b96557 | 108 | /** @addtogroup DACEx_Exported_Functions_Group1 |
Kojto | 99:dbbf35b96557 | 109 | * @{ |
Kojto | 99:dbbf35b96557 | 110 | */ |
Kojto | 99:dbbf35b96557 | 111 | /* Extension features functions ***********************************************/ |
Kojto | 99:dbbf35b96557 | 112 | uint32_t HAL_DACEx_DualGetValue(DAC_HandleTypeDef* hdac); |
Kojto | 99:dbbf35b96557 | 113 | HAL_StatusTypeDef HAL_DACEx_TriangleWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude); |
Kojto | 99:dbbf35b96557 | 114 | HAL_StatusTypeDef HAL_DACEx_NoiseWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude); |
Kojto | 99:dbbf35b96557 | 115 | HAL_StatusTypeDef HAL_DACEx_DualSetValue(DAC_HandleTypeDef* hdac, uint32_t Alignment, uint32_t Data1, uint32_t Data2); |
Kojto | 99:dbbf35b96557 | 116 | |
Kojto | 99:dbbf35b96557 | 117 | void HAL_DACEx_ConvCpltCallbackCh2(DAC_HandleTypeDef* hdac); |
Kojto | 99:dbbf35b96557 | 118 | void HAL_DACEx_ConvHalfCpltCallbackCh2(DAC_HandleTypeDef* hdac); |
Kojto | 99:dbbf35b96557 | 119 | void HAL_DACEx_ErrorCallbackCh2(DAC_HandleTypeDef* hdac); |
Kojto | 99:dbbf35b96557 | 120 | void HAL_DACEx_DMAUnderrunCallbackCh2(DAC_HandleTypeDef* hdac); |
Kojto | 99:dbbf35b96557 | 121 | /** |
Kojto | 99:dbbf35b96557 | 122 | * @} |
Kojto | 99:dbbf35b96557 | 123 | */ |
Kojto | 99:dbbf35b96557 | 124 | |
Kojto | 99:dbbf35b96557 | 125 | /** |
Kojto | 99:dbbf35b96557 | 126 | * @} |
Kojto | 99:dbbf35b96557 | 127 | */ |
Kojto | 99:dbbf35b96557 | 128 | /* Private types -------------------------------------------------------------*/ |
Kojto | 99:dbbf35b96557 | 129 | /* Private variables ---------------------------------------------------------*/ |
Kojto | 99:dbbf35b96557 | 130 | /* Private constants ---------------------------------------------------------*/ |
Kojto | 99:dbbf35b96557 | 131 | /** @defgroup DACEx_Private_Constants DAC Private Constants |
Kojto | 99:dbbf35b96557 | 132 | * @{ |
Kojto | 99:dbbf35b96557 | 133 | */ |
Kojto | 99:dbbf35b96557 | 134 | |
Kojto | 99:dbbf35b96557 | 135 | /** |
Kojto | 99:dbbf35b96557 | 136 | * @} |
Kojto | 99:dbbf35b96557 | 137 | */ |
Kojto | 99:dbbf35b96557 | 138 | |
Kojto | 99:dbbf35b96557 | 139 | /* Private macros ------------------------------------------------------------*/ |
Kojto | 99:dbbf35b96557 | 140 | /** @defgroup DACEx_Private_Macros DAC Private Macros |
Kojto | 99:dbbf35b96557 | 141 | * @{ |
Kojto | 99:dbbf35b96557 | 142 | */ |
bogdanm | 89:552587b429a1 | 143 | #define IS_DAC_LFSR_UNMASK_TRIANGLE_AMPLITUDE(VALUE) (((VALUE) == DAC_LFSRUNMASK_BIT0) || \ |
bogdanm | 89:552587b429a1 | 144 | ((VALUE) == DAC_LFSRUNMASK_BITS1_0) || \ |
bogdanm | 89:552587b429a1 | 145 | ((VALUE) == DAC_LFSRUNMASK_BITS2_0) || \ |
bogdanm | 89:552587b429a1 | 146 | ((VALUE) == DAC_LFSRUNMASK_BITS3_0) || \ |
bogdanm | 89:552587b429a1 | 147 | ((VALUE) == DAC_LFSRUNMASK_BITS4_0) || \ |
bogdanm | 89:552587b429a1 | 148 | ((VALUE) == DAC_LFSRUNMASK_BITS5_0) || \ |
bogdanm | 89:552587b429a1 | 149 | ((VALUE) == DAC_LFSRUNMASK_BITS6_0) || \ |
bogdanm | 89:552587b429a1 | 150 | ((VALUE) == DAC_LFSRUNMASK_BITS7_0) || \ |
bogdanm | 89:552587b429a1 | 151 | ((VALUE) == DAC_LFSRUNMASK_BITS8_0) || \ |
bogdanm | 89:552587b429a1 | 152 | ((VALUE) == DAC_LFSRUNMASK_BITS9_0) || \ |
bogdanm | 89:552587b429a1 | 153 | ((VALUE) == DAC_LFSRUNMASK_BITS10_0) || \ |
bogdanm | 89:552587b429a1 | 154 | ((VALUE) == DAC_LFSRUNMASK_BITS11_0) || \ |
bogdanm | 89:552587b429a1 | 155 | ((VALUE) == DAC_TRIANGLEAMPLITUDE_1) || \ |
bogdanm | 89:552587b429a1 | 156 | ((VALUE) == DAC_TRIANGLEAMPLITUDE_3) || \ |
bogdanm | 89:552587b429a1 | 157 | ((VALUE) == DAC_TRIANGLEAMPLITUDE_7) || \ |
bogdanm | 89:552587b429a1 | 158 | ((VALUE) == DAC_TRIANGLEAMPLITUDE_15) || \ |
bogdanm | 89:552587b429a1 | 159 | ((VALUE) == DAC_TRIANGLEAMPLITUDE_31) || \ |
bogdanm | 89:552587b429a1 | 160 | ((VALUE) == DAC_TRIANGLEAMPLITUDE_63) || \ |
bogdanm | 89:552587b429a1 | 161 | ((VALUE) == DAC_TRIANGLEAMPLITUDE_127) || \ |
bogdanm | 89:552587b429a1 | 162 | ((VALUE) == DAC_TRIANGLEAMPLITUDE_255) || \ |
bogdanm | 89:552587b429a1 | 163 | ((VALUE) == DAC_TRIANGLEAMPLITUDE_511) || \ |
bogdanm | 89:552587b429a1 | 164 | ((VALUE) == DAC_TRIANGLEAMPLITUDE_1023) || \ |
bogdanm | 89:552587b429a1 | 165 | ((VALUE) == DAC_TRIANGLEAMPLITUDE_2047) || \ |
bogdanm | 89:552587b429a1 | 166 | ((VALUE) == DAC_TRIANGLEAMPLITUDE_4095)) |
bogdanm | 89:552587b429a1 | 167 | /** |
bogdanm | 89:552587b429a1 | 168 | * @} |
bogdanm | 89:552587b429a1 | 169 | */ |
bogdanm | 89:552587b429a1 | 170 | |
Kojto | 99:dbbf35b96557 | 171 | /* Private functions ---------------------------------------------------------*/ |
Kojto | 99:dbbf35b96557 | 172 | /** @defgroup DACEx_Private_Functions DAC Private Functions |
bogdanm | 89:552587b429a1 | 173 | * @{ |
bogdanm | 89:552587b429a1 | 174 | */ |
Kojto | 99:dbbf35b96557 | 175 | void DAC_DMAConvCpltCh2(DMA_HandleTypeDef *hdma); |
Kojto | 99:dbbf35b96557 | 176 | void DAC_DMAErrorCh2(DMA_HandleTypeDef *hdma); |
Kojto | 99:dbbf35b96557 | 177 | void DAC_DMAHalfConvCpltCh2(DMA_HandleTypeDef *hdma); |
bogdanm | 89:552587b429a1 | 178 | /** |
bogdanm | 89:552587b429a1 | 179 | * @} |
bogdanm | 89:552587b429a1 | 180 | */ |
Kojto | 99:dbbf35b96557 | 181 | #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx ||\ |
Kojto | 99:dbbf35b96557 | 182 | STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx ||\ |
Kojto | 99:dbbf35b96557 | 183 | STM32F446xx */ |
bogdanm | 89:552587b429a1 | 184 | |
bogdanm | 89:552587b429a1 | 185 | /** |
bogdanm | 89:552587b429a1 | 186 | * @} |
bogdanm | 89:552587b429a1 | 187 | */ |
bogdanm | 89:552587b429a1 | 188 | |
bogdanm | 89:552587b429a1 | 189 | /** |
bogdanm | 89:552587b429a1 | 190 | * @} |
bogdanm | 89:552587b429a1 | 191 | */ |
bogdanm | 89:552587b429a1 | 192 | |
bogdanm | 89:552587b429a1 | 193 | #ifdef __cplusplus |
bogdanm | 89:552587b429a1 | 194 | } |
bogdanm | 89:552587b429a1 | 195 | #endif |
bogdanm | 89:552587b429a1 | 196 | |
bogdanm | 89:552587b429a1 | 197 | #endif /*__STM32F4xx_HAL_DAC_EX_H */ |
bogdanm | 89:552587b429a1 | 198 | |
bogdanm | 89:552587b429a1 | 199 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |