136 #define CR_CLEAR_MASK ((uint32_t)0x00000FFE) 139 #define DUAL_SWTRIG_SET ((uint32_t)0x00000003) 140 #define DUAL_SWTRIG_RESET ((uint32_t)0xFFFFFFFC) 143 #define DHR12R1_OFFSET ((uint32_t)0x00000008) 144 #define DHR12R2_OFFSET ((uint32_t)0x00000014) 145 #define DHR12RD_OFFSET ((uint32_t)0x00000020) 148 #define DOR_OFFSET ((uint32_t)0x0000002C) 211 uint32_t tmpreg1 = 0, tmpreg2 = 0;
236 tmpreg1 |= tmpreg2 << DAC_Channel;
377 DACx->
CR |= DAC_Wave << DAC_Channel;
382 DACx->
CR &= ~(DAC_Wave << DAC_Channel);
399 __IO uint32_t tmp = 0;
406 tmp = (uint32_t)DACx;
410 *(
__IO uint32_t *) tmp = Data;
427 __IO uint32_t tmp = 0;
434 tmp = (uint32_t)DACx;
438 *(
__IO uint32_t *)tmp = Data;
460 uint32_t data = 0, tmp = 0;
471 data = ((uint32_t)Data2 << 8) | Data1;
475 data = ((uint32_t)Data2 << 16) | Data1;
478 tmp = (uint32_t)DACx;
482 *(
__IO uint32_t *)tmp = data;
496 __IO uint32_t tmp = 0;
502 tmp = (uint32_t) DACx;
503 tmp +=
DOR_OFFSET + ((uint32_t)DAC_Channel >> 2);
506 return (uint16_t) (*(
__IO uint32_t*) tmp);
602 DACx->
CR |= (DAC_IT << DAC_Channel);
607 DACx->
CR &= (~(uint32_t)(DAC_IT << DAC_Channel));
635 if ((DACx->
SR & (DAC_FLAG << DAC_Channel)) != (uint8_t)
RESET)
669 DACx->
SR = (DAC_FLAG << DAC_Channel);
689 uint32_t enablestatus = 0;
697 enablestatus = (DACx->
CR & (DAC_IT << DAC_Channel)) ;
700 if (((DACx->
SR & (DAC_IT << DAC_Channel)) != (uint32_t)
RESET) && enablestatus)
734 DACx->
SR = (DAC_IT << DAC_Channel);
void DAC_SetChannel1Data(DAC_TypeDef *DACx, uint32_t DAC_Align, uint16_t Data)
Set the specified data holding register value for DAC channel1.
uint32_t DAC_Buffer_Switch
#define DAC_SWTRIGR_SWTRIG1
#define DUAL_SWTRIG_RESET
#define IS_DAC_FLAG(FLAG)
void DAC_StructInit(DAC_InitTypeDef *DAC_InitStruct)
Fills each DAC_InitStruct member with its default value.
Digital to Analog Converter.
void assert_param(int val)
#define IS_DAC_WAVE(WAVE)
#define IS_DAC_LFSR_UNMASK_TRIANGLE_AMPLITUDE(VALUE)
#define IS_FUNCTIONAL_STATE(STATE)
uint16_t DAC_GetDataOutputValue(DAC_TypeDef *DACx, uint32_t DAC_Channel)
Returns the last data output value of the selected DAC channel.
void RCC_APB1PeriphResetCmd(uint32_t RCC_APB1Periph, FunctionalState NewState)
Forces or releases Low Speed APB (APB1) peripheral reset.
void DAC_ClearITPendingBit(DAC_TypeDef *DACx, uint32_t DAC_Channel, uint32_t DAC_IT)
Clears the DAC channel's interrupt pending bits.
void DAC_SoftwareTriggerCmd(DAC_TypeDef *DACx, uint32_t DAC_Channel, FunctionalState NewState)
Enables or disables the selected DAC channel software trigger.
This file contains all the functions prototypes for the RCC firmware library.
void DAC_SetDualChannelData(DAC_TypeDef *DACx, uint32_t DAC_Align, uint16_t Data2, uint16_t Data1)
Set the specified data holding register value for dual channel DAC.
#define IS_DAC_ALL_PERIPH(PERIPH)
#define RCC_APB1Periph_DAC2
void DAC_DeInit(DAC_TypeDef *DACx)
Deinitializes the DAC peripheral registers to their default reset values.
void DAC_ClearFlag(DAC_TypeDef *DACx, uint32_t DAC_Channel, uint32_t DAC_FLAG)
Clears the DAC channel's pending flags.
void DAC_Cmd(DAC_TypeDef *DACx, uint32_t DAC_Channel, FunctionalState NewState)
Enables or disables the specified DAC channel.
#define RCC_APB1Periph_DAC1
void DAC_WaveGenerationCmd(DAC_TypeDef *DACx, uint32_t DAC_Channel, uint32_t DAC_Wave, FunctionalState NewState)
Enables or disables the selected DAC channel wave generation.
This file contains all the functions prototypes for the DAC firmware library.
void DAC_Init(DAC_TypeDef *DACx, uint32_t DAC_Channel, DAC_InitTypeDef *DAC_InitStruct)
Initializes the DAC peripheral according to the specified parameters in the DAC_InitStruct.
void DAC_DualSoftwareTriggerCmd(DAC_TypeDef *DACx, FunctionalState NewState)
Enables or disables simultaneously the two DAC channels software triggers.
FlagStatus DAC_GetFlagStatus(DAC_TypeDef *DACx, uint32_t DAC_Channel, uint32_t DAC_FLAG)
Checks whether the specified DAC flag is set or not.
#define DAC_LFSRUnmask_Bit0
uint32_t DAC_LFSRUnmask_TriangleAmplitude
void DAC_ITConfig(DAC_TypeDef *DACx, uint32_t DAC_Channel, uint32_t DAC_IT, FunctionalState NewState)
Enables or disables the specified DAC interrupts.
#define IS_DAC_LIST1_PERIPH(PERIPH)
void DAC_DMACmd(DAC_TypeDef *DACx, uint32_t DAC_Channel, FunctionalState NewState)
Enables or disables the specified DAC channel DMA request. When enabled DMA1 is generated when an ext...
#define DAC_BufferSwitch_Enable
void DAC_SetChannel2Data(DAC_TypeDef *DACx, uint32_t DAC_Align, uint16_t Data)
Set the specified data holding register value for DAC channel2.
#define IS_DAC_ALIGN(ALIGN)
#define IS_DAC_GENERATE_WAVE(WAVE)
#define IS_DAC_DATA(DATA)
#define IS_DAC_BUFFER_SWITCH_STATE(STATE)
DAC Init structure definition.
#define IS_DAC_CHANNEL(CHANNEL)
uint32_t DAC_WaveGeneration
#define IS_DAC_TRIGGER(TRIGGER)
#define DAC_WaveGeneration_None
ITStatus DAC_GetITStatus(DAC_TypeDef *DACx, uint32_t DAC_Channel, uint32_t DAC_IT)
Checks whether the specified DAC interrupt has occurred or not.