48 #define CR_CLEAR_MASK ((uint32_t)0x00000FFE)
51 #define DUAL_SWTRIG_SET ((uint32_t)0x00000003)
52 #define DUAL_SWTRIG_RESET ((uint32_t)0xFFFFFFFC)
55 #define DHR12R1_OFFSET ((uint32_t)0x00000008)
56 #define DHR12R2_OFFSET ((uint32_t)0x00000014)
57 #define DHR12RD_OFFSET ((uint32_t)0x00000020)
60 #define DOR_OFFSET ((uint32_t)0x0000002C)
119 uint32_t tmpreg1 = 0, tmpreg2 = 0;
139 tmpreg1 |= tmpreg2 << DAC_Channel;
189 #if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL)
203 void DAC_ITConfig(uint32_t DAC_Channel, uint32_t DAC_IT,
FunctionalState NewState)
213 DAC->CR |= (DAC_IT << DAC_Channel);
218 DAC->CR &= (~(uint32_t)(DAC_IT << DAC_Channel));
323 DAC->CR |= DAC_Wave << DAC_Channel;
328 DAC->CR &= ~(DAC_Wave << DAC_Channel);
344 __IO uint32_t tmp = 0;
354 *(
__IO uint32_t *) tmp = Data;
369 __IO uint32_t tmp = 0;
379 *(
__IO uint32_t *)tmp = Data;
398 uint32_t data = 0, tmp = 0;
408 data = ((uint32_t)Data2 << 8) | Data1;
412 data = ((uint32_t)Data2 << 16) | Data1;
419 *(
__IO uint32_t *)tmp = data;
432 __IO uint32_t tmp = 0;
438 tmp +=
DOR_OFFSET + ((uint32_t)DAC_Channel >> 2);
441 return (uint16_t) (*(
__IO uint32_t*) tmp);
444 #if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL)
456 FlagStatus DAC_GetFlagStatus(uint32_t DAC_Channel, uint32_t DAC_FLAG)
464 if ((
DAC->SR & (DAC_FLAG << DAC_Channel)) != (uint8_t)
RESET)
489 void DAC_ClearFlag(uint32_t DAC_Channel, uint32_t DAC_FLAG)
496 DAC->SR = (DAC_FLAG << DAC_Channel);
510 ITStatus DAC_GetITStatus(uint32_t DAC_Channel, uint32_t DAC_IT)
513 uint32_t enablestatus = 0;
520 enablestatus = (
DAC->CR & (DAC_IT << DAC_Channel)) ;
523 if (((
DAC->SR & (DAC_IT << DAC_Channel)) != (uint32_t)
RESET) && enablestatus)
548 void DAC_ClearITPendingBit(uint32_t DAC_Channel, uint32_t DAC_IT)
555 DAC->SR = (DAC_IT << DAC_Channel);