@@ -78,19 +78,19 @@ typedef struct
78
78
__IO uint32_t ErrorCode ; /*!< DAC Error code */
79
79
80
80
#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 );
85
85
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 );
90
90
91
91
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 );
94
94
#endif /* USE_HAL_DAC_REGISTER_CALLBACKS */
95
95
96
96
} DAC_HandleTypeDef ;
@@ -143,7 +143,7 @@ typedef struct
143
143
uint32_t DAC_OutputBuffer ; /*!< Specifies whether the DAC channel output buffer is enabled or disabled.
144
144
This parameter can be a value of @ref DAC_output_buffer */
145
145
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.
147
147
This parameter can be a value of @ref DAC_ConnectOnChipPeripheral */
148
148
149
149
uint32_t DAC_UserTrimming ; /*!< Specifies the trimming mode
@@ -349,6 +349,20 @@ typedef void (*pDAC_CallbackTypeDef)(DAC_HandleTypeDef *hdac);
349
349
* @}
350
350
*/
351
351
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
+
352
366
/* Exported macro ------------------------------------------------------------*/
353
367
354
368
/** @defgroup DAC_Exported_Macros DAC Exported Macros
@@ -496,7 +510,7 @@ typedef void (*pDAC_CallbackTypeDef)(DAC_HandleTypeDef *hdac);
496
510
#define IS_DAC_CHANNEL (DACX , CHANNEL ) \
497
511
(((CHANNEL) == DAC_CHANNEL_1) || \
498
512
((CHANNEL) == DAC_CHANNEL_2))
499
- #endif
513
+ #endif /* STM32G474xx || STM32G484xx || STM32G473xx */
500
514
501
515
#define IS_DAC_ALIGN (ALIGN ) (((ALIGN) == DAC_ALIGN_12B_R) || \
502
516
((ALIGN) == DAC_ALIGN_12B_L) || \
@@ -538,7 +552,7 @@ void HAL_DAC_MspDeInit(DAC_HandleTypeDef *hdac);
538
552
/* IO operation functions *****************************************************/
539
553
HAL_StatusTypeDef HAL_DAC_Start (DAC_HandleTypeDef * hdac , uint32_t Channel );
540
554
HAL_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 ,
542
556
uint32_t Alignment );
543
557
HAL_StatusTypeDef HAL_DAC_Stop_DMA (DAC_HandleTypeDef * hdac , uint32_t Channel );
544
558
void HAL_DAC_IRQHandler (DAC_HandleTypeDef * hdac );
@@ -564,8 +578,9 @@ HAL_StatusTypeDef HAL_DAC_UnRegisterCallback(DAC_HandleTypeDef *hdac, HAL_DA
564
578
* @{
565
579
*/
566
580
/* 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 );
569
584
/**
570
585
* @}
571
586
*/
@@ -574,8 +589,8 @@ HAL_StatusTypeDef HAL_DAC_ConfigChannel(DAC_HandleTypeDef *hdac, DAC_ChannelConf
574
589
* @{
575
590
*/
576
591
/* 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 );
579
594
580
595
/**
581
596
* @}
@@ -611,4 +626,3 @@ void DAC_DMAHalfConvCpltCh1(DMA_HandleTypeDef *hdma);
611
626
612
627
613
628
#endif /* STM32G4xx_HAL_DAC_H */
614
-
0 commit comments