@@ -78,19 +78,19 @@ typedef struct
7878 __IO uint32_t ErrorCode ; /*!< DAC Error code */
7979
8080#if (USE_HAL_DAC_REGISTER_CALLBACKS == 1 )
81- void (* ConvCpltCallbackCh1 ) (struct __DAC_HandleTypeDef * hdac );
82- void (* ConvHalfCpltCallbackCh1 ) (struct __DAC_HandleTypeDef * hdac );
83- void (* ErrorCallbackCh1 ) (struct __DAC_HandleTypeDef * hdac );
84- void (* DMAUnderrunCallbackCh1 ) (struct __DAC_HandleTypeDef * hdac );
81+ void (* ConvCpltCallbackCh1 )(struct __DAC_HandleTypeDef * hdac );
82+ void (* ConvHalfCpltCallbackCh1 )(struct __DAC_HandleTypeDef * hdac );
83+ void (* ErrorCallbackCh1 )(struct __DAC_HandleTypeDef * hdac );
84+ void (* DMAUnderrunCallbackCh1 )(struct __DAC_HandleTypeDef * hdac );
8585
86- void (* ConvCpltCallbackCh2 ) (struct __DAC_HandleTypeDef * hdac );
87- void (* ConvHalfCpltCallbackCh2 ) (struct __DAC_HandleTypeDef * hdac );
88- void (* ErrorCallbackCh2 ) (struct __DAC_HandleTypeDef * hdac );
89- void (* DMAUnderrunCallbackCh2 ) (struct __DAC_HandleTypeDef * hdac );
86+ void (* ConvCpltCallbackCh2 )(struct __DAC_HandleTypeDef * hdac );
87+ void (* ConvHalfCpltCallbackCh2 )(struct __DAC_HandleTypeDef * hdac );
88+ void (* ErrorCallbackCh2 )(struct __DAC_HandleTypeDef * hdac );
89+ void (* DMAUnderrunCallbackCh2 )(struct __DAC_HandleTypeDef * hdac );
9090
9191
92- void (* MspInitCallback ) (struct __DAC_HandleTypeDef * hdac );
93- void (* MspDeInitCallback ) (struct __DAC_HandleTypeDef * hdac );
92+ void (* MspInitCallback )(struct __DAC_HandleTypeDef * hdac );
93+ void (* MspDeInitCallback )(struct __DAC_HandleTypeDef * hdac );
9494#endif /* USE_HAL_DAC_REGISTER_CALLBACKS */
9595
9696} DAC_HandleTypeDef ;
@@ -143,7 +143,7 @@ typedef struct
143143 uint32_t DAC_OutputBuffer ; /*!< Specifies whether the DAC channel output buffer is enabled or disabled.
144144 This parameter can be a value of @ref DAC_output_buffer */
145145
146- uint32_t DAC_ConnectOnChipPeripheral ; /*!< Specifies whether the DAC output is connected or not to on chip peripheral .
146+ uint32_t DAC_ConnectOnChipPeripheral ; /*!< Specifies whether the DAC output is connected or not to on chip peripheral.
147147 This parameter can be a value of @ref DAC_ConnectOnChipPeripheral */
148148
149149 uint32_t DAC_UserTrimming ; /*!< Specifies the trimming mode
@@ -349,6 +349,20 @@ typedef void (*pDAC_CallbackTypeDef)(DAC_HandleTypeDef *hdac);
349349 * @}
350350 */
351351
352+ /* Delay for DAC channel voltage settling time from DAC channel startup */
353+ /* (transition from disable to enable). */
354+ /* Note: DAC channel startup time depends on board application environment: */
355+ /* impedance connected to DAC channel output. */
356+ /* The delay below is specified under conditions: */
357+ /* - voltage maximum transition (lowest to highest value) */
358+ /* - until voltage reaches final value +-1LSB */
359+ /* - DAC channel output buffer enabled */
360+ /* - load impedance of 5kOhm (min), 50pF (max) */
361+ /* Literal set to maximum value (refer to device datasheet, */
362+ /* parameter "tWAKEUP"). */
363+ /* Unit: us */
364+ #define DAC_DELAY_STARTUP_US (15UL) /*!< Delay for DAC channel voltage settling time from DAC channel startup (transition from disable to enable) */
365+
352366/* Exported macro ------------------------------------------------------------*/
353367
354368/** @defgroup DAC_Exported_Macros DAC Exported Macros
@@ -496,7 +510,7 @@ typedef void (*pDAC_CallbackTypeDef)(DAC_HandleTypeDef *hdac);
496510#define IS_DAC_CHANNEL (DACX , CHANNEL ) \
497511 (((CHANNEL) == DAC_CHANNEL_1) || \
498512 ((CHANNEL) == DAC_CHANNEL_2))
499- #endif
513+ #endif /* STM32G474xx || STM32G484xx || STM32G473xx */
500514
501515#define IS_DAC_ALIGN (ALIGN ) (((ALIGN) == DAC_ALIGN_12B_R) || \
502516 ((ALIGN) == DAC_ALIGN_12B_L) || \
@@ -538,7 +552,7 @@ void HAL_DAC_MspDeInit(DAC_HandleTypeDef *hdac);
538552/* IO operation functions *****************************************************/
539553HAL_StatusTypeDef HAL_DAC_Start (DAC_HandleTypeDef * hdac , uint32_t Channel );
540554HAL_StatusTypeDef HAL_DAC_Stop (DAC_HandleTypeDef * hdac , uint32_t Channel );
541- HAL_StatusTypeDef HAL_DAC_Start_DMA (DAC_HandleTypeDef * hdac , uint32_t Channel , uint32_t * pData , uint32_t Length ,
555+ HAL_StatusTypeDef HAL_DAC_Start_DMA (DAC_HandleTypeDef * hdac , uint32_t Channel , const uint32_t * pData , uint32_t Length ,
542556 uint32_t Alignment );
543557HAL_StatusTypeDef HAL_DAC_Stop_DMA (DAC_HandleTypeDef * hdac , uint32_t Channel );
544558void HAL_DAC_IRQHandler (DAC_HandleTypeDef * hdac );
@@ -564,8 +578,9 @@ HAL_StatusTypeDef HAL_DAC_UnRegisterCallback(DAC_HandleTypeDef *hdac, HAL_DA
564578 * @{
565579 */
566580/* Peripheral Control functions ***********************************************/
567- uint32_t HAL_DAC_GetValue (DAC_HandleTypeDef * hdac , uint32_t Channel );
568- HAL_StatusTypeDef HAL_DAC_ConfigChannel (DAC_HandleTypeDef * hdac , DAC_ChannelConfTypeDef * sConfig , uint32_t Channel );
581+ uint32_t HAL_DAC_GetValue (const DAC_HandleTypeDef * hdac , uint32_t Channel );
582+ HAL_StatusTypeDef HAL_DAC_ConfigChannel (DAC_HandleTypeDef * hdac ,
583+ const DAC_ChannelConfTypeDef * sConfig , uint32_t Channel );
569584/**
570585 * @}
571586 */
@@ -574,8 +589,8 @@ HAL_StatusTypeDef HAL_DAC_ConfigChannel(DAC_HandleTypeDef *hdac, DAC_ChannelConf
574589 * @{
575590 */
576591/* Peripheral State and Error functions ***************************************/
577- HAL_DAC_StateTypeDef HAL_DAC_GetState (DAC_HandleTypeDef * hdac );
578- uint32_t HAL_DAC_GetError (DAC_HandleTypeDef * hdac );
592+ HAL_DAC_StateTypeDef HAL_DAC_GetState (const DAC_HandleTypeDef * hdac );
593+ uint32_t HAL_DAC_GetError (const DAC_HandleTypeDef * hdac );
579594
580595/**
581596 * @}
@@ -611,4 +626,3 @@ void DAC_DMAHalfConvCpltCh1(DMA_HandleTypeDef *hdma);
611626
612627
613628#endif /* STM32G4xx_HAL_DAC_H */
614-
0 commit comments