DAC_Private_Functions
[DAC]

Functions

void DAC_Cmd (uint32_t DAC_Channel, FunctionalState NewState)
 Enables or disables the specified DAC channel.
void DAC_DeInit (void)
 Deinitializes the DAC peripheral registers to their default reset values.
void DAC_DMACmd (uint32_t DAC_Channel, FunctionalState NewState)
 Enables or disables the specified DAC channel DMA request.
void DAC_DualSoftwareTriggerCmd (FunctionalState NewState)
 Enables or disables simultaneously the two DAC channels software triggers.
uint16_t DAC_GetDataOutputValue (uint32_t DAC_Channel)
 Returns the last data output value of the selected DAC cahnnel.
void DAC_Init (uint32_t DAC_Channel, DAC_InitTypeDef *DAC_InitStruct)
 Initializes the DAC peripheral according to the specified parameters in the DAC_InitStruct.
void DAC_SetChannel1Data (uint32_t DAC_Align, uint16_t Data)
 Set the specified data holding register value for DAC channel1.
void DAC_SetChannel2Data (uint32_t DAC_Align, uint16_t Data)
 Set the specified data holding register value for DAC channel2.
void DAC_SetDualChannelData (uint32_t DAC_Align, uint16_t Data2, uint16_t Data1)
 Set the specified data holding register value for dual channel DAC.
void DAC_SoftwareTriggerCmd (uint32_t DAC_Channel, FunctionalState NewState)
 Enables or disables the selected DAC channel software trigger.
void DAC_StructInit (DAC_InitTypeDef *DAC_InitStruct)
 Fills each DAC_InitStruct member with its default value.
void DAC_WaveGenerationCmd (uint32_t DAC_Channel, uint32_t DAC_Wave, FunctionalState NewState)
 Enables or disables the selected DAC channel wave generation.

Function Documentation

void DAC_Cmd ( uint32_t  DAC_Channel,
FunctionalState  NewState 
)

Enables or disables the specified DAC channel.

Parameters:
DAC_Channel,: the selected DAC channel. This parameter can be one of the following values:

  • DAC_Channel_1: DAC Channel1 selected
  • DAC_Channel_2: DAC Channel2 selected
NewState,: new state of the DAC channel. This parameter can be: ENABLE or DISABLE.
Return values:
None 

Definition at line 172 of file stm32f10x_dac.c.

References assert_param, DAC, DAC_CR_EN1, DISABLE, IS_DAC_CHANNEL, and IS_FUNCTIONAL_STATE.

Referenced by main().

void DAC_DeInit ( void   ) 

Deinitializes the DAC peripheral registers to their default reset values.

Parameters:
None 
Return values:
None 

Definition at line 97 of file stm32f10x_dac.c.

References DISABLE, ENABLE, RCC_APB1Periph_DAC, and RCC_APB1PeriphResetCmd().

void DAC_DMACmd ( uint32_t  DAC_Channel,
FunctionalState  NewState 
)

Enables or disables the specified DAC channel DMA request.

Parameters:
DAC_Channel,: the selected DAC channel. This parameter can be one of the following values:

  • DAC_Channel_1: DAC Channel1 selected
  • DAC_Channel_2: DAC Channel2 selected
NewState,: new state of the selected DAC channel DMA request. This parameter can be: ENABLE or DISABLE.
Return values:
None 

Definition at line 232 of file stm32f10x_dac.c.

References assert_param, DAC, DAC_CR_DMAEN1, DISABLE, IS_DAC_CHANNEL, and IS_FUNCTIONAL_STATE.

Referenced by main().

void DAC_DualSoftwareTriggerCmd ( FunctionalState  NewState  ) 

Enables or disables simultaneously the two DAC channels software triggers.

Parameters:
NewState,: new state of the DAC channels software triggers. This parameter can be: ENABLE or DISABLE.
Return values:
None 

Definition at line 283 of file stm32f10x_dac.c.

References assert_param, DAC, DISABLE, DUAL_SWTRIG_RESET, DUAL_SWTRIG_SET, and IS_FUNCTIONAL_STATE.

uint16_t DAC_GetDataOutputValue ( uint32_t  DAC_Channel  ) 

Returns the last data output value of the selected DAC cahnnel.

Parameters:
DAC_Channel,: the selected DAC channel. This parameter can be one of the following values:

  • DAC_Channel_1: DAC Channel1 selected
  • DAC_Channel_2: DAC Channel2 selected
Return values:
The selected DAC channel data output value.

Definition at line 429 of file stm32f10x_dac.c.

References assert_param, DAC_BASE, DOR_OFFSET, and IS_DAC_CHANNEL.

void DAC_Init ( uint32_t  DAC_Channel,
DAC_InitTypeDef DAC_InitStruct 
)

Initializes the DAC peripheral according to the specified parameters in the DAC_InitStruct.

Parameters:
DAC_Channel,: the selected DAC channel. This parameter can be one of the following values:

  • DAC_Channel_1: DAC Channel1 selected
  • DAC_Channel_2: DAC Channel2 selected
DAC_InitStruct,: pointer to a DAC_InitTypeDef structure that contains the configuration information for the specified DAC channel.
Return values:
None 

Definition at line 116 of file stm32f10x_dac.c.

References assert_param, CR_CLEAR_MASK, DAC, DAC_InitTypeDef::DAC_LFSRUnmask_TriangleAmplitude, DAC_InitTypeDef::DAC_OutputBuffer, DAC_InitTypeDef::DAC_Trigger, DAC_InitTypeDef::DAC_WaveGeneration, IS_DAC_GENERATE_WAVE, IS_DAC_LFSR_UNMASK_TRIANGLE_AMPLITUDE, IS_DAC_OUTPUT_BUFFER_STATE, and IS_DAC_TRIGGER.

Referenced by main().

void DAC_SetChannel1Data ( uint32_t  DAC_Align,
uint16_t  Data 
)

Set the specified data holding register value for DAC channel1.

Parameters:
DAC_Align,: Specifies the data alignement for DAC channel1. This parameter can be one of the following values:

  • DAC_Align_8b_R: 8bit right data alignement selected
  • DAC_Align_12b_L: 12bit left data alignement selected
  • DAC_Align_12b_R: 12bit right data alignement selected
Data : Data to be loaded in the selected data holding register.
Return values:
None 

Definition at line 341 of file stm32f10x_dac.c.

References assert_param, DAC_BASE, DHR12R1_OFFSET, IS_DAC_ALIGN, and IS_DAC_DATA.

Referenced by main().

void DAC_SetChannel2Data ( uint32_t  DAC_Align,
uint16_t  Data 
)

Set the specified data holding register value for DAC channel2.

Parameters:
DAC_Align,: Specifies the data alignement for DAC channel2. This parameter can be one of the following values:

  • DAC_Align_8b_R: 8bit right data alignement selected
  • DAC_Align_12b_L: 12bit left data alignement selected
  • DAC_Align_12b_R: 12bit right data alignement selected
Data : Data to be loaded in the selected data holding register.
Return values:
None 

Definition at line 366 of file stm32f10x_dac.c.

References assert_param, DAC_BASE, DHR12R2_OFFSET, IS_DAC_ALIGN, and IS_DAC_DATA.

void DAC_SetDualChannelData ( uint32_t  DAC_Align,
uint16_t  Data2,
uint16_t  Data1 
)

Set the specified data holding register value for dual channel DAC.

Parameters:
DAC_Align,: Specifies the data alignement for dual channel DAC. This parameter can be one of the following values:

  • DAC_Align_8b_R: 8bit right data alignement selected
  • DAC_Align_12b_L: 12bit left data alignement selected
  • DAC_Align_12b_R: 12bit right data alignement selected
Data2,: Data for DAC Channel2 to be loaded in the selected data holding register.
Data1,: Data for DAC Channel1 to be loaded in the selected data holding register.
Return values:
None 

Definition at line 395 of file stm32f10x_dac.c.

References assert_param, DAC_Align_8b_R, DAC_BASE, DHR12RD_OFFSET, IS_DAC_ALIGN, and IS_DAC_DATA.

Referenced by main().

void DAC_SoftwareTriggerCmd ( uint32_t  DAC_Channel,
FunctionalState  NewState 
)

Enables or disables the selected DAC channel software trigger.

Parameters:
DAC_Channel,: the selected DAC channel. This parameter can be one of the following values:

  • DAC_Channel_1: DAC Channel1 selected
  • DAC_Channel_2: DAC Channel2 selected
NewState,: new state of the selected DAC channel software trigger. This parameter can be: ENABLE or DISABLE.
Return values:
None 

Definition at line 259 of file stm32f10x_dac.c.

References assert_param, DAC, DAC_SWTRIGR_SWTRIG1, DISABLE, IS_DAC_CHANNEL, and IS_FUNCTIONAL_STATE.

Referenced by main().

void DAC_StructInit ( DAC_InitTypeDef DAC_InitStruct  ) 

Fills each DAC_InitStruct member with its default value.

Parameters:
DAC_InitStruct : pointer to a DAC_InitTypeDef structure which will be initialized.
Return values:
None 

Definition at line 149 of file stm32f10x_dac.c.

References DAC_LFSRUnmask_Bit0, DAC_InitTypeDef::DAC_LFSRUnmask_TriangleAmplitude, DAC_InitTypeDef::DAC_OutputBuffer, DAC_OutputBuffer_Enable, DAC_InitTypeDef::DAC_Trigger, DAC_Trigger_None, DAC_InitTypeDef::DAC_WaveGeneration, and DAC_WaveGeneration_None.

void DAC_WaveGenerationCmd ( uint32_t  DAC_Channel,
uint32_t  DAC_Wave,
FunctionalState  NewState 
)

Enables or disables the selected DAC channel wave generation.

Parameters:
DAC_Channel,: the selected DAC channel. This parameter can be one of the following values:

  • DAC_Channel_1: DAC Channel1 selected
  • DAC_Channel_2: DAC Channel2 selected
DAC_Wave,: Specifies the wave type to enable or disable. This parameter can be one of the following values:

  • DAC_Wave_Noise: noise wave generation
  • DAC_Wave_Triangle: triangle wave generation
NewState,: new state of the selected DAC channel wave generation. This parameter can be: ENABLE or DISABLE.
Return values:
None 

Definition at line 313 of file stm32f10x_dac.c.

References assert_param, DAC, DISABLE, IS_DAC_CHANNEL, IS_DAC_WAVE, and IS_FUNCTIONAL_STATE.

STM32F10x Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM32(CORTEX M3) 32-bit Microcontrollers platform visit  www.st.com/STM32