|
2 | 2 | ****************************************************************************** |
3 | 3 | * @file stm32f4xx_hal_dac.h |
4 | 4 | * @author MCD Application Team |
5 | | - * @version V1.1.0 |
6 | | - * @date 19-June-2014 |
| 5 | + * @version V1.5.1 |
| 6 | + * @date 01-July-2016 |
7 | 7 | * @brief Header file of DAC HAL Extension module. |
8 | 8 | ****************************************************************************** |
9 | 9 | * @attention |
10 | 10 | * |
11 | | - * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
| 11 | + * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
12 | 12 | * |
13 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
14 | 14 | * are permitted provided that the following conditions are met: |
|
43 | 43 | extern "C" { |
44 | 44 | #endif |
45 | 45 |
|
46 | | -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) |
| 46 | +#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) ||\ |
| 47 | + defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) ||\ |
| 48 | + defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx) || defined(STM32F446xx) ||\ |
| 49 | + defined(STM32F469xx) || defined(STM32F479xx) |
47 | 50 |
|
48 | 51 | /* Includes ------------------------------------------------------------------*/ |
49 | 52 | #include "stm32f4xx_hal_def.h" |
|
57 | 60 | */ |
58 | 61 |
|
59 | 62 | /* Exported types ------------------------------------------------------------*/ |
60 | | - |
61 | | -/** |
62 | | - * @brief HAL State structures definition |
63 | | - */ |
64 | | - |
65 | 63 | /* Exported constants --------------------------------------------------------*/ |
66 | | - |
67 | | -/** @defgroup DACEx_wave_generation |
| 64 | +/** @defgroup DACEx_Exported_Constants DAC Exported Constants |
68 | 65 | * @{ |
69 | 66 | */ |
70 | | -#define DAC_WAVEGENERATION_NONE ((uint32_t)0x00000000) |
71 | | -#define DAC_WAVEGENERATION_NOISE ((uint32_t)DAC_CR_WAVE1_0) |
72 | | -#define DAC_WAVEGENERATION_TRIANGLE ((uint32_t)DAC_CR_WAVE1_1) |
73 | 67 |
|
74 | | -#define IS_DAC_GENERATE_WAVE(WAVE) (((WAVE) == DAC_WAVEGENERATION_NONE) || \ |
75 | | - ((WAVE) == DAC_WAVEGENERATION_NOISE) || \ |
76 | | - ((WAVE) == DAC_WAVEGENERATION_TRIANGLE)) |
77 | | -/** |
78 | | - * @} |
79 | | - */ |
80 | | - |
81 | | -/** @defgroup DACEx_lfsrunmask_triangleamplitude |
| 68 | +/** @defgroup DACEx_lfsrunmask_triangleamplitude DAC LFS Run Mask Triangle Amplitude |
82 | 69 | * @{ |
83 | 70 | */ |
84 | | -#define DAC_LFSRUNMASK_BIT0 ((uint32_t)0x00000000) /*!< Unmask DAC channel LFSR bit0 for noise wave generation */ |
| 71 | +#define DAC_LFSRUNMASK_BIT0 ((uint32_t)0x00000000U) /*!< Unmask DAC channel LFSR bit0 for noise wave generation */ |
85 | 72 | #define DAC_LFSRUNMASK_BITS1_0 ((uint32_t)DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[1:0] for noise wave generation */ |
86 | 73 | #define DAC_LFSRUNMASK_BITS2_0 ((uint32_t)DAC_CR_MAMP1_1) /*!< Unmask DAC channel LFSR bit[2:0] for noise wave generation */ |
87 | 74 | #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 */ |
|
93 | 80 | #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 */ |
94 | 81 | #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 */ |
95 | 82 | #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 */ |
96 | | -#define DAC_TRIANGLEAMPLITUDE_1 ((uint32_t)0x00000000) /*!< Select max triangle amplitude of 1 */ |
| 83 | +#define DAC_TRIANGLEAMPLITUDE_1 ((uint32_t)0x00000000U) /*!< Select max triangle amplitude of 1 */ |
97 | 84 | #define DAC_TRIANGLEAMPLITUDE_3 ((uint32_t)DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 3 */ |
98 | 85 | #define DAC_TRIANGLEAMPLITUDE_7 ((uint32_t)DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 7 */ |
99 | 86 | #define DAC_TRIANGLEAMPLITUDE_15 ((uint32_t)DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 15 */ |
|
105 | 92 | #define DAC_TRIANGLEAMPLITUDE_1023 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 1023 */ |
106 | 93 | #define DAC_TRIANGLEAMPLITUDE_2047 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 2047 */ |
107 | 94 | #define DAC_TRIANGLEAMPLITUDE_4095 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 4095 */ |
| 95 | +/** |
| 96 | + * @} |
| 97 | + */ |
| 98 | + |
| 99 | +/** |
| 100 | + * @} |
| 101 | + */ |
| 102 | + |
| 103 | +/* Exported macro ------------------------------------------------------------*/ |
| 104 | +/* Exported functions --------------------------------------------------------*/ |
| 105 | +/** @addtogroup DACEx_Exported_Functions |
| 106 | + * @{ |
| 107 | + */ |
108 | 108 |
|
| 109 | +/** @addtogroup DACEx_Exported_Functions_Group1 |
| 110 | + * @{ |
| 111 | + */ |
| 112 | +/* Extension features functions ***********************************************/ |
| 113 | +uint32_t HAL_DACEx_DualGetValue(DAC_HandleTypeDef* hdac); |
| 114 | +HAL_StatusTypeDef HAL_DACEx_TriangleWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude); |
| 115 | +HAL_StatusTypeDef HAL_DACEx_NoiseWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude); |
| 116 | +HAL_StatusTypeDef HAL_DACEx_DualSetValue(DAC_HandleTypeDef* hdac, uint32_t Alignment, uint32_t Data1, uint32_t Data2); |
| 117 | + |
| 118 | +void HAL_DACEx_ConvCpltCallbackCh2(DAC_HandleTypeDef* hdac); |
| 119 | +void HAL_DACEx_ConvHalfCpltCallbackCh2(DAC_HandleTypeDef* hdac); |
| 120 | +void HAL_DACEx_ErrorCallbackCh2(DAC_HandleTypeDef* hdac); |
| 121 | +void HAL_DACEx_DMAUnderrunCallbackCh2(DAC_HandleTypeDef* hdac); |
| 122 | +/** |
| 123 | + * @} |
| 124 | + */ |
| 125 | + |
| 126 | +/** |
| 127 | + * @} |
| 128 | + */ |
| 129 | +/* Private types -------------------------------------------------------------*/ |
| 130 | +/* Private variables ---------------------------------------------------------*/ |
| 131 | +/* Private constants ---------------------------------------------------------*/ |
| 132 | +/** @defgroup DACEx_Private_Constants DAC Private Constants |
| 133 | + * @{ |
| 134 | + */ |
| 135 | + |
| 136 | +/** |
| 137 | + * @} |
| 138 | + */ |
| 139 | + |
| 140 | +/* Private macros ------------------------------------------------------------*/ |
| 141 | +/** @defgroup DACEx_Private_Macros DAC Private Macros |
| 142 | + * @{ |
| 143 | + */ |
109 | 144 | #define IS_DAC_LFSR_UNMASK_TRIANGLE_AMPLITUDE(VALUE) (((VALUE) == DAC_LFSRUNMASK_BIT0) || \ |
110 | 145 | ((VALUE) == DAC_LFSRUNMASK_BITS1_0) || \ |
111 | 146 | ((VALUE) == DAC_LFSRUNMASK_BITS2_0) || \ |
|
134 | 169 | * @} |
135 | 170 | */ |
136 | 171 |
|
137 | | -/** @defgroup DACEx_wave_generation |
| 172 | +/* Private functions ---------------------------------------------------------*/ |
| 173 | +/** @defgroup DACEx_Private_Functions DAC Private Functions |
138 | 174 | * @{ |
139 | 175 | */ |
140 | | -#define DAC_WAVE_NOISE ((uint32_t)DAC_CR_WAVE1_0) |
141 | | -#define DAC_WAVE_TRIANGLE ((uint32_t)DAC_CR_WAVE1_1) |
142 | | - |
143 | | -#define IS_DAC_WAVE(WAVE) (((WAVE) == DAC_WAVE_NOISE) || \ |
144 | | - ((WAVE) == DAC_WAVE_TRIANGLE)) |
145 | | -/** |
146 | | - * @} |
147 | | - */ |
148 | | - |
149 | | -/* Exported macro ------------------------------------------------------------*/ |
150 | | -/* Exported functions --------------------------------------------------------*/ |
151 | | - |
152 | | -/* Extension features functions ***********************************************/ |
153 | | -uint32_t HAL_DACEx_DualGetValue(DAC_HandleTypeDef* hdac); |
154 | | -HAL_StatusTypeDef HAL_DACEx_TriangleWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude); |
155 | | -HAL_StatusTypeDef HAL_DACEx_NoiseWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude); |
156 | | -HAL_StatusTypeDef HAL_DACEx_DualSetValue(DAC_HandleTypeDef* hdac, uint32_t Alignment, uint32_t Data1, uint32_t Data2); |
157 | | - |
158 | | -void HAL_DACEx_ConvCpltCallbackCh2(DAC_HandleTypeDef* hdac); |
159 | | -void HAL_DACEx_ConvHalfCpltCallbackCh2(DAC_HandleTypeDef* hdac); |
160 | | -void HAL_DACEx_ErrorCallbackCh2(DAC_HandleTypeDef* hdac); |
161 | | -void HAL_DACEx_DMAUnderrunCallbackCh2(DAC_HandleTypeDef* hdac); |
162 | | - |
163 | 176 | void DAC_DMAConvCpltCh2(DMA_HandleTypeDef *hdma); |
164 | 177 | void DAC_DMAErrorCh2(DMA_HandleTypeDef *hdma); |
165 | 178 | void DAC_DMAHalfConvCpltCh2(DMA_HandleTypeDef *hdma); |
166 | | - |
167 | | -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ |
| 179 | +/** |
| 180 | + * @} |
| 181 | + */ |
| 182 | +#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx ||\ |
| 183 | + STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx ||\ |
| 184 | + STM32F410xx || STM32F446xx || STM32F469xx || STM32F479xx */ |
168 | 185 |
|
169 | 186 | /** |
170 | 187 | * @} |
|
0 commit comments