stm32f3xx_hal_dac.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. /**
  2. ******************************************************************************
  3. * @file stm32f3xx_hal_dac.h
  4. * @author MCD Application Team
  5. * @brief Header file of DAC HAL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
  10. *
  11. * Redistribution and use in source and binary forms, with or without modification,
  12. * are permitted provided that the following conditions are met:
  13. * 1. Redistributions of source code must retain the above copyright notice,
  14. * this list of conditions and the following disclaimer.
  15. * 2. Redistributions in binary form must reproduce the above copyright notice,
  16. * this list of conditions and the following disclaimer in the documentation
  17. * and/or other materials provided with the distribution.
  18. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  19. * may be used to endorse or promote products derived from this software
  20. * without specific prior written permission.
  21. *
  22. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  23. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  24. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  25. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  26. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  27. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  28. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  29. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  30. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  31. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. *
  33. ******************************************************************************
  34. */
  35. /* Define to prevent recursive inclusion -------------------------------------*/
  36. #ifndef __STM32F3xx_HAL_DAC_H
  37. #define __STM32F3xx_HAL_DAC_H
  38. #ifdef __cplusplus
  39. extern "C" {
  40. #endif
  41. /* Includes ------------------------------------------------------------------*/
  42. #include "stm32f3xx_hal_def.h"
  43. /** @addtogroup STM32F3xx_HAL_Driver
  44. * @{
  45. */
  46. /** @addtogroup DAC
  47. * @{
  48. */
  49. /* Exported types ------------------------------------------------------------*/
  50. /** @defgroup DAC_Exported_Types DAC Exported Types
  51. * @{
  52. */
  53. /**
  54. * @brief HAL State structures definition
  55. */
  56. typedef enum
  57. {
  58. HAL_DAC_STATE_RESET = 0x00U, /*!< DAC not yet initialized or disabled */
  59. HAL_DAC_STATE_READY = 0x01U, /*!< DAC initialized and ready for use */
  60. HAL_DAC_STATE_BUSY = 0x02U, /*!< DAC internal processing is ongoing */
  61. HAL_DAC_STATE_TIMEOUT = 0x03U, /*!< DAC timeout state */
  62. HAL_DAC_STATE_ERROR = 0x04 /*!< DAC error state */
  63. }HAL_DAC_StateTypeDef;
  64. /**
  65. * @brief DAC Configuration regular Channel structure definition
  66. */
  67. typedef struct
  68. {
  69. uint32_t DAC_Trigger; /*!< Specifies the external trigger for the selected DAC channel.
  70. This parameter can be a value of @ref DACEx_trigger_selection */
  71. uint32_t DAC_OutputBuffer; /*!< Specifies whether the DAC channel output buffer is enabled or disabled.
  72. This parameter can be a value of @ref DAC_output_buffer
  73. For a given DAC channel, is this paramater applies then DAC_OutputSwitch
  74. does not apply */
  75. uint32_t DAC_OutputSwitch; /*!< Specifies whether the DAC channel output switch is enabled or disabled.
  76. This parameter can be a value of @ref DAC_OutputSwitch
  77. For a given DAC channel, is this paramater applies then DAC_OutputBuffer
  78. does not apply */
  79. }DAC_ChannelConfTypeDef;
  80. /**
  81. * @brief DAC handle Structure definition
  82. */
  83. typedef struct __DAC_HandleTypeDef
  84. {
  85. DAC_TypeDef *Instance; /*!< Register base address */
  86. __IO HAL_DAC_StateTypeDef State; /*!< DAC communication state */
  87. HAL_LockTypeDef Lock; /*!< DAC locking object */
  88. DMA_HandleTypeDef *DMA_Handle1; /*!< Pointer DMA handler for channel 1U */
  89. DMA_HandleTypeDef *DMA_Handle2; /*!< Pointer DMA handler for channel 2U */
  90. __IO uint32_t ErrorCode; /*!< DAC Error code */
  91. }DAC_HandleTypeDef;
  92. /**
  93. * @}
  94. */
  95. /* Exported constants --------------------------------------------------------*/
  96. /** @defgroup DAC_Exported_Constants DAC Exported Constants
  97. * @{
  98. */
  99. /** @defgroup DAC_Error_Code DAC Error Code
  100. * @{
  101. */
  102. #define HAL_DAC_ERROR_NONE 0x00 /*!< No error */
  103. #define HAL_DAC_ERROR_DMAUNDERRUNCH1 0x01 /*!< DAC channel1 DMA underrun error */
  104. #define HAL_DAC_ERROR_DMAUNDERRUNCH2 0x02 /*!< DAC channel2 DMA underrun error */
  105. #define HAL_DAC_ERROR_DMA 0x04 /*!< DMA error */
  106. /**
  107. * @}
  108. */
  109. /** @defgroup DAC_lfsrunmask_triangleamplitude DAC lfsrunmask triangleamplitude
  110. * @{
  111. */
  112. #define DAC_LFSRUNMASK_BIT0 (0x00000000U) /*!< Unmask DAC channel LFSR bit0 for noise wave generation */
  113. #define DAC_LFSRUNMASK_BITS1_0 ((uint32_t)DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[1:0] for noise wave generation */
  114. #define DAC_LFSRUNMASK_BITS2_0 ((uint32_t)DAC_CR_MAMP1_1) /*!< Unmask DAC channel LFSR bit[2:0] for noise wave generation */
  115. #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 */
  116. #define DAC_LFSRUNMASK_BITS4_0 ((uint32_t)DAC_CR_MAMP1_2) /*!< Unmask DAC channel LFSR bit[4:0] for noise wave generation */
  117. #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 */
  118. #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 */
  119. #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 */
  120. #define DAC_LFSRUNMASK_BITS8_0 ((uint32_t)DAC_CR_MAMP1_3) /*!< Unmask DAC channel LFSR bit[8:0] for noise wave generation */
  121. #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 */
  122. #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 */
  123. #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 */
  124. #define DAC_TRIANGLEAMPLITUDE_1 (0x00000000U) /*!< Select max triangle amplitude of 1U */
  125. #define DAC_TRIANGLEAMPLITUDE_3 ((uint32_t)DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 3U */
  126. #define DAC_TRIANGLEAMPLITUDE_7 ((uint32_t)DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 7U */
  127. #define DAC_TRIANGLEAMPLITUDE_15 ((uint32_t)DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 15U */
  128. #define DAC_TRIANGLEAMPLITUDE_31 ((uint32_t)DAC_CR_MAMP1_2) /*!< Select max triangle amplitude of 31U */
  129. #define DAC_TRIANGLEAMPLITUDE_63 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 63U */
  130. #define DAC_TRIANGLEAMPLITUDE_127 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 127U */
  131. #define DAC_TRIANGLEAMPLITUDE_255 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 255U */
  132. #define DAC_TRIANGLEAMPLITUDE_511 ((uint32_t)DAC_CR_MAMP1_3) /*!< Select max triangle amplitude of 511U */
  133. #define DAC_TRIANGLEAMPLITUDE_1023 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 1023U */
  134. #define DAC_TRIANGLEAMPLITUDE_2047 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 2047U */
  135. #define DAC_TRIANGLEAMPLITUDE_4095 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 4095U */
  136. /**
  137. * @}
  138. */
  139. /** @defgroup DAC_output_buffer DAC output buffer
  140. * @{
  141. */
  142. #define DAC_OUTPUTBUFFER_ENABLE (0x00000000U)
  143. #define DAC_OUTPUTBUFFER_DISABLE ((uint32_t)DAC_CR_BOFF1)
  144. /**
  145. * @}
  146. */
  147. #if defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
  148. /** @defgroup DAC_output_switch DAC output switch
  149. * @{
  150. */
  151. #define DAC_OUTPUTSWITCH_DISABLE (0x00000000U)
  152. #define DAC_OUTPUTSWITCH_ENABLE ((uint32_t)DAC_CR_OUTEN1)
  153. /**
  154. * @}
  155. */
  156. #endif /* STM32F303x8 || STM32F334x8 || STM32F328xx || */
  157. /** @defgroup DAC_data_alignement DAC data alignement
  158. * @{
  159. */
  160. #define DAC_ALIGN_12B_R (0x00000000U)
  161. #define DAC_ALIGN_12B_L (0x00000004U)
  162. #define DAC_ALIGN_8B_R (0x00000008U)
  163. /**
  164. * @}
  165. */
  166. /** @defgroup DAC_flags_definition DAC flags definition
  167. * @{
  168. */
  169. #define DAC_FLAG_DMAUDR1 ((uint32_t)DAC_SR_DMAUDR1)
  170. #define DAC_FLAG_DMAUDR2 ((uint32_t)DAC_SR_DMAUDR2)
  171. /**
  172. * @}
  173. */
  174. /** @defgroup DAC_interrupts_definition DAC interrupts definition
  175. * @{
  176. */
  177. #define DAC_IT_DMAUDR1 ((uint32_t)DAC_CR_DMAUDRIE1)
  178. #define DAC_IT_DMAUDR2 ((uint32_t)DAC_CR_DMAUDRIE2)
  179. /**
  180. * @}
  181. */
  182. /**
  183. * @}
  184. */
  185. /* Exported macro ------------------------------------------------------------*/
  186. /** @defgroup DAC_Exported_Macros DAC Exported Macros
  187. * @{
  188. */
  189. /** @brief Reset DAC handle state
  190. * @param __HANDLE__ specifies the DAC handle.
  191. * @retval None
  192. */
  193. #define __HAL_DAC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DAC_STATE_RESET)
  194. /** @brief Enable the DAC channel
  195. * @param __HANDLE__ specifies the DAC handle.
  196. * @param __DAC_Channel__ specifies the DAC channel
  197. * @retval None
  198. */
  199. #define __HAL_DAC_ENABLE(__HANDLE__, __DAC_Channel__) \
  200. ((__HANDLE__)->Instance->CR |= (DAC_CR_EN1 << (__DAC_Channel__)))
  201. /** @brief Disable the DAC channel
  202. * @param __HANDLE__ specifies the DAC handle
  203. * @param __DAC_Channel__ specifies the DAC channel.
  204. * @retval None
  205. */
  206. #define __HAL_DAC_DISABLE(__HANDLE__, __DAC_Channel__) \
  207. ((__HANDLE__)->Instance->CR &= ~(DAC_CR_EN1 << (__DAC_Channel__)))
  208. /** @brief Set DHR12R1 alignment
  209. * @param __ALIGNMENT__ specifies the DAC alignment
  210. * @retval None
  211. */
  212. #define DAC_DHR12R1_ALIGNMENT(__ALIGNMENT__) ((0x00000008U) + (__ALIGNMENT__))
  213. /** @brief Set DHR12R2 alignment
  214. * @param __ALIGNMENT__ specifies the DAC alignment
  215. * @retval None
  216. */
  217. #define DAC_DHR12R2_ALIGNMENT(__ALIGNMENT__) ((0x00000014U) + (__ALIGNMENT__))
  218. /** @brief Set DHR12RD alignment
  219. * @param __ALIGNMENT__ specifies the DAC alignment
  220. * @retval None
  221. */
  222. #define DAC_DHR12RD_ALIGNMENT(__ALIGNMENT__) ((0x00000020U) + (__ALIGNMENT__))
  223. /** @brief Enable the DAC interrupt
  224. * @param __HANDLE__ specifies the DAC handle
  225. * @param __INTERRUPT__ specifies the DAC interrupt.
  226. * This parameter can be any combination of the following values:
  227. * @arg DAC_IT_DMAUDR1: DAC channel 1 DMA underrun interrupt
  228. * @arg DAC_IT_DMAUDR2: DAC channel 2 DMA underrun interrupt
  229. * @retval None
  230. */
  231. #define __HAL_DAC_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CR) |= (__INTERRUPT__))
  232. /** @brief Disable the DAC interrupt
  233. * @param __HANDLE__ specifies the DAC handle
  234. * @param __INTERRUPT__ specifies the DAC interrupt.
  235. * This parameter can be any combination of the following values:
  236. * @arg DAC_IT_DMAUDR1: DAC channel 1 DMA underrun interrupt
  237. * @arg DAC_IT_DMAUDR2: DAC channel 2 DMA underrun interrupt
  238. * @retval None
  239. */
  240. #define __HAL_DAC_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CR) &= ~(__INTERRUPT__))
  241. /** @brief Check whether the specified DAC interrupt source is enabled or not
  242. * @param __HANDLE__ DAC handle
  243. * @param __INTERRUPT__ DAC interrupt source to check
  244. * This parameter can be any combination of the following values:
  245. * @arg DAC_IT_DMAUDR1: DAC channel 1 DMA underrun interrupt
  246. * @arg DAC_IT_DMAUDR2: DAC channel 2 DMA underrun interrupt
  247. * @retval State of interruption (SET or RESET)
  248. */
  249. #define __HAL_DAC_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CR & (__INTERRUPT__)) == (__INTERRUPT__))
  250. /** @brief Get the selected DAC's flag status
  251. * @param __HANDLE__ specifies the DAC handle.
  252. * @param __FLAG__ specifies the DAC flag to get.
  253. * This parameter can be any combination of the following values:
  254. * @arg DAC_FLAG_DMAUDR1: DAC channel 1 DMA underrun flag
  255. * @arg DAC_FLAG_DMAUDR2: DAC channel 2 DMA underrun flag
  256. * @retval None
  257. */
  258. #define __HAL_DAC_GET_FLAG(__HANDLE__, __FLAG__) ((((__HANDLE__)->Instance->SR) & (__FLAG__)) == (__FLAG__))
  259. /** @brief Clear the DAC's flag
  260. * @param __HANDLE__ specifies the DAC handle.
  261. * @param __FLAG__ specifies the DAC flag to clear.
  262. * This parameter can be any combination of the following values:
  263. * @arg DAC_FLAG_DMAUDR1: DAC channel 1 DMA underrun flag
  264. * @arg DAC_FLAG_DMAUDR2: DAC channel 2 DMA underrun flag
  265. * @retval None
  266. */
  267. #define __HAL_DAC_CLEAR_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR) = (__FLAG__))
  268. /**
  269. * @}
  270. */
  271. /* Private macro -------------------------------------------------------------*/
  272. /** @addtogroup DAC_Private_Macros
  273. * @{
  274. */
  275. #define IS_DAC_LFSR_UNMASK_TRIANGLE_AMPLITUDE(VALUE) (((VALUE) == DAC_LFSRUNMASK_BIT0) || \
  276. ((VALUE) == DAC_LFSRUNMASK_BITS1_0) || \
  277. ((VALUE) == DAC_LFSRUNMASK_BITS2_0) || \
  278. ((VALUE) == DAC_LFSRUNMASK_BITS3_0) || \
  279. ((VALUE) == DAC_LFSRUNMASK_BITS4_0) || \
  280. ((VALUE) == DAC_LFSRUNMASK_BITS5_0) || \
  281. ((VALUE) == DAC_LFSRUNMASK_BITS6_0) || \
  282. ((VALUE) == DAC_LFSRUNMASK_BITS7_0) || \
  283. ((VALUE) == DAC_LFSRUNMASK_BITS8_0) || \
  284. ((VALUE) == DAC_LFSRUNMASK_BITS9_0) || \
  285. ((VALUE) == DAC_LFSRUNMASK_BITS10_0) || \
  286. ((VALUE) == DAC_LFSRUNMASK_BITS11_0) || \
  287. ((VALUE) == DAC_TRIANGLEAMPLITUDE_1) || \
  288. ((VALUE) == DAC_TRIANGLEAMPLITUDE_3) || \
  289. ((VALUE) == DAC_TRIANGLEAMPLITUDE_7) || \
  290. ((VALUE) == DAC_TRIANGLEAMPLITUDE_15) || \
  291. ((VALUE) == DAC_TRIANGLEAMPLITUDE_31) || \
  292. ((VALUE) == DAC_TRIANGLEAMPLITUDE_63) || \
  293. ((VALUE) == DAC_TRIANGLEAMPLITUDE_127) || \
  294. ((VALUE) == DAC_TRIANGLEAMPLITUDE_255) || \
  295. ((VALUE) == DAC_TRIANGLEAMPLITUDE_511) || \
  296. ((VALUE) == DAC_TRIANGLEAMPLITUDE_1023) || \
  297. ((VALUE) == DAC_TRIANGLEAMPLITUDE_2047) || \
  298. ((VALUE) == DAC_TRIANGLEAMPLITUDE_4095))
  299. #define IS_DAC_OUTPUT_BUFFER_STATE(STATE) (((STATE) == DAC_OUTPUTBUFFER_ENABLE) || \
  300. ((STATE) == DAC_OUTPUTBUFFER_DISABLE))
  301. #if defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
  302. #define IS_DAC_OUTPUT_SWITCH_STATE(STATE) (((STATE) == DAC_OUTPUTSWITCH_DISABLE) || \
  303. ((STATE) == DAC_OUTPUTSWITCH_ENABLE))
  304. #endif /* STM32F303x8 || STM32F334x8 || STM32F328xx || */
  305. #define IS_DAC_ALIGN(ALIGN) (((ALIGN) == DAC_ALIGN_12B_R) || \
  306. ((ALIGN) == DAC_ALIGN_12B_L) || \
  307. ((ALIGN) == DAC_ALIGN_8B_R))
  308. #define IS_DAC_DATA(DATA) ((DATA) <= 0xFFF0U)
  309. /**
  310. * @}
  311. */
  312. /* Include DAC HAL Extended module */
  313. #include "stm32f3xx_hal_dac_ex.h"
  314. /* Exported functions --------------------------------------------------------*/
  315. /** @addtogroup DAC_Exported_Functions
  316. * @{
  317. */
  318. /** @addtogroup DAC_Exported_Functions_Group1
  319. * @{
  320. */
  321. /* Initialization and de-initialization functions *****************************/
  322. HAL_StatusTypeDef HAL_DAC_Init(DAC_HandleTypeDef* hdac);
  323. HAL_StatusTypeDef HAL_DAC_DeInit(DAC_HandleTypeDef* hdac);
  324. void HAL_DAC_MspInit(DAC_HandleTypeDef* hdac);
  325. void HAL_DAC_MspDeInit(DAC_HandleTypeDef* hdac);
  326. /**
  327. * @}
  328. */
  329. /** @addtogroup DAC_Exported_Functions_Group2
  330. * @{
  331. */
  332. /* IO operation functions *****************************************************/
  333. HAL_StatusTypeDef HAL_DAC_Start(DAC_HandleTypeDef* hdac, uint32_t Channel);
  334. HAL_StatusTypeDef HAL_DAC_Stop(DAC_HandleTypeDef* hdac, uint32_t Channel);
  335. HAL_StatusTypeDef HAL_DAC_Start_DMA(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t* pData, uint32_t Length, uint32_t Alignment);
  336. HAL_StatusTypeDef HAL_DAC_Stop_DMA(DAC_HandleTypeDef* hdac, uint32_t Channel);
  337. uint32_t HAL_DAC_GetValue(DAC_HandleTypeDef* hdac, uint32_t Channel);
  338. HAL_StatusTypeDef HAL_DAC_ConfigChannel(DAC_HandleTypeDef* hdac, DAC_ChannelConfTypeDef* sConfig, uint32_t Channel);
  339. void HAL_DAC_IRQHandler(DAC_HandleTypeDef* hdac);
  340. void HAL_DAC_ConvCpltCallbackCh1(DAC_HandleTypeDef* hdac);
  341. void HAL_DAC_ConvHalfCpltCallbackCh1(DAC_HandleTypeDef* hdac);
  342. void HAL_DAC_ErrorCallbackCh1(DAC_HandleTypeDef *hdac);
  343. void HAL_DAC_DMAUnderrunCallbackCh1(DAC_HandleTypeDef *hdac);
  344. /**
  345. * @}
  346. */
  347. /** @addtogroup DAC_Exported_Functions_Group3
  348. * @{
  349. */
  350. /* Peripheral Control functions ***********************************************/
  351. HAL_StatusTypeDef HAL_DAC_SetValue(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Alignment, uint32_t Data);
  352. /**
  353. * @}
  354. */
  355. /** @addtogroup DAC_Exported_Functions_Group4
  356. * @{
  357. */
  358. /* Peripheral State and Error functions ***************************************/
  359. HAL_DAC_StateTypeDef HAL_DAC_GetState(DAC_HandleTypeDef* hdac);
  360. uint32_t HAL_DAC_GetError(DAC_HandleTypeDef *hdac);
  361. /**
  362. * @}
  363. */
  364. /**
  365. * @}
  366. */
  367. /**
  368. * @}
  369. */
  370. /**
  371. * @}
  372. */
  373. #ifdef __cplusplus
  374. }
  375. #endif
  376. #endif /*__STM32F3xx_HAL_DAC_H */
  377. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/