STM8L15x Standard Peripherals Drivers
|
DAC driver modules. More...
Modules | |
DAC_Exported_types | |
DAC_Exported_Constants | |
DAC_Private_Functions | |
Functions | |
void | DAC_ClearFlag (DAC_Channel_TypeDef DAC_Channel, DAC_FLAG_TypeDef DAC_FLAG) |
Clears the DAC channel's pending flags. | |
void | DAC_ClearITPendingBit (DAC_Channel_TypeDef DAC_Channel, DAC_IT_TypeDef DAC_IT) |
Clears the DAC channel's interrupt pending bits. | |
void | DAC_Cmd (DAC_Channel_TypeDef 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 (DAC_Channel_TypeDef 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 (DAC_Channel_TypeDef DAC_Channel) |
Returns the last data output value of the selected DAC channel. | |
FlagStatus | DAC_GetFlagStatus (DAC_Channel_TypeDef DAC_Channel, DAC_FLAG_TypeDef DAC_FLAG) |
Checks whether the specified DAC flag is set or not. | |
ITStatus | DAC_GetITStatus (DAC_Channel_TypeDef DAC_Channel, DAC_IT_TypeDef DAC_IT) |
Checks whether the specified DAC interrupt has occurred or not. | |
void | DAC_Init (DAC_Channel_TypeDef DAC_Channel, DAC_Trigger_TypeDef DAC_Trigger, DAC_OutputBuffer_TypeDef DAC_OutputBuffer) |
Initializes the DAC according to the specified parameters. | |
void | DAC_ITConfig (DAC_Channel_TypeDef DAC_Channel, DAC_IT_TypeDef DAC_IT, FunctionalState NewState) |
Enables or disables the specified DAC interrupts. | |
void | DAC_SetChannel1Data (DAC_Align_TypeDef DAC_Align, uint16_t DAC_Data) |
Set the specified data holding register value for DAC channel1. | |
void | DAC_SetChannel2Data (DAC_Align_TypeDef DAC_Align, uint16_t DAC_Data) |
Set the specified data holding register value for DAC channel2. | |
void | DAC_SetDualChannelData (DAC_Align_TypeDef DAC_Align, uint16_t DAC_Data2, uint16_t DAC_Data1) |
Set the specified data holding register value for dual channel DAC. | |
void | DAC_SetNoiseWaveLFSR (DAC_Channel_TypeDef DAC_Channel, DAC_LFSRUnmask_TypeDef DAC_LFSRUnmask) |
Select DAC Noise Wave Generation LFSR according to the specified parameters. | |
void | DAC_SetTriangleWaveAmplitude (DAC_Channel_TypeDef DAC_Channel, DAC_TriangleAmplitude_TypeDef DAC_TriangleAmplitude) |
Select DAC Triangle Wave Generation Amplitude according to the specified parameters. | |
void | DAC_SoftwareTriggerCmd (DAC_Channel_TypeDef DAC_Channel, FunctionalState NewState) |
Enables or disables the selected DAC channel software trigger. | |
void | DAC_WaveGenerationCmd (DAC_Channel_TypeDef DAC_Channel, DAC_Wave_TypeDef DAC_Wave, FunctionalState NewState) |
Enables or disables the selected DAC channel wave generation. |
Detailed Description
DAC driver modules.
Function Documentation
void DAC_ClearFlag | ( | DAC_Channel_TypeDef | DAC_Channel, |
DAC_FLAG_TypeDef | DAC_FLAG | ||
) |
Clears the DAC channel's pending flags.
Definition at line 736 of file stm8l15x_dac.c.
References DAC, IS_DAC_CHANNEL, and IS_DAC_FLAG.
void DAC_ClearITPendingBit | ( | DAC_Channel_TypeDef | DAC_Channel, |
DAC_IT_TypeDef | DAC_IT | ||
) |
Clears the DAC channel's interrupt pending bits.
Definition at line 807 of file stm8l15x_dac.c.
References DAC, IS_DAC_CHANNEL, and IS_DAC_IT.
void DAC_Cmd | ( | DAC_Channel_TypeDef | DAC_Channel, |
FunctionalState | NewState | ||
) |
Enables or disables the specified DAC channel.
- Note:
- When the DAC channel is enabled the trigger source can no more be modified.
Definition at line 248 of file stm8l15x_dac.c.
References CR1_Offset, DAC_BASE, DAC_CR1_EN, DISABLE, IS_DAC_CHANNEL, and IS_FUNCTIONAL_STATE.
void DAC_DeInit | ( | void | ) |
Deinitializes the DAC peripheral registers to their default reset values.
Definition at line 136 of file stm8l15x_dac.c.
References DAC, DAC_CR1_RESET_VALUE, DAC_CR2_RESET_VALUE, DAC_DHR8_RESET_VALUE, DAC_LDHRH_RESET_VALUE, DAC_LDHRL_RESET_VALUE, DAC_RDHRH_RESET_VALUE, DAC_RDHRL_RESET_VALUE, DAC_SR_RESET_VALUE, and DAC_SWTRIGR_RESET_VALUE.
void DAC_DMACmd | ( | DAC_Channel_TypeDef | DAC_Channel, |
FunctionalState | NewState | ||
) |
Enables or disables the specified DAC channel DMA request.
When enabled DMA1 is generated when an external trigger occurs
Definition at line 607 of file stm8l15x_dac.c.
References CR2_Offset, DAC_BASE, DAC_CR2_DMAEN, DISABLE, IS_DAC_CHANNEL, and IS_FUNCTIONAL_STATE.
void DAC_DualSoftwareTriggerCmd | ( | FunctionalState | NewState | ) |
Enables or disables simultaneously the two DAC channels software triggers.
Definition at line 305 of file stm8l15x_dac.c.
References DAC, DAC_SWTRIGR_SWTRIG1, DAC_SWTRIGR_SWTRIG2, DISABLE, and IS_FUNCTIONAL_STATE.
uint16_t DAC_GetDataOutputValue | ( | DAC_Channel_TypeDef | DAC_Channel | ) |
Returns the last data output value of the selected DAC channel.
Definition at line 553 of file stm8l15x_dac.c.
References DAC, DAC_Channel_1, and IS_DAC_CHANNEL.
FlagStatus DAC_GetFlagStatus | ( | DAC_Channel_TypeDef | DAC_Channel, |
DAC_FLAG_TypeDef | DAC_FLAG | ||
) |
Checks whether the specified DAC flag is set or not.
- Note:
- The DMA underrun occurs when a second external trigger arrives before the acknowledgement for the first external trigger is received (first request).
Definition at line 698 of file stm8l15x_dac.c.
References DAC, IS_DAC_CHANNEL, IS_DAC_FLAG, RESET, and SET.
ITStatus DAC_GetITStatus | ( | DAC_Channel_TypeDef | DAC_Channel, |
DAC_IT_TypeDef | DAC_IT | ||
) |
Checks whether the specified DAC interrupt has occurred or not.
- Note:
- The DMA underrun occurs when a second external trigger arrives before the acknowledgement for the first external trigger is received (first request).
Definition at line 764 of file stm8l15x_dac.c.
References CR2_Offset, DAC, DAC_BASE, IS_DAC_CHANNEL, IS_DAC_IT, RESET, and SET.
void DAC_Init | ( | DAC_Channel_TypeDef | DAC_Channel, |
DAC_Trigger_TypeDef | DAC_Trigger, | ||
DAC_OutputBuffer_TypeDef | DAC_OutputBuffer | ||
) |
Initializes the DAC according to the specified parameters.
Definition at line 202 of file stm8l15x_dac.c.
References CR1_Offset, DAC_BASE, DAC_CR1_BOFF, DAC_CR1_TEN, DAC_CR1_TSEL, DAC_Trigger_None, IS_DAC_CHANNEL, IS_DAC_OUTPUT_BUFFER_STATE, and IS_DAC_TRIGGER.
void DAC_ITConfig | ( | DAC_Channel_TypeDef | DAC_Channel, |
DAC_IT_TypeDef | DAC_IT, | ||
FunctionalState | NewState | ||
) |
Enables or disables the specified DAC interrupts.
- Note:
- The DMA underrun occurs when a second external trigger arrives before the acknowledgement for the first external trigger is received (first request).
Definition at line 661 of file stm8l15x_dac.c.
References CR2_Offset, DAC_BASE, DISABLE, IS_DAC_CHANNEL, IS_DAC_IT, and IS_FUNCTIONAL_STATE.
void DAC_SetChannel1Data | ( | DAC_Align_TypeDef | DAC_Align, |
uint16_t | DAC_Data | ||
) |
Set the specified data holding register value for DAC channel1.
Definition at line 449 of file stm8l15x_dac.c.
References CH1RDHRH_Offset, DAC, DAC_Align_8b_R, DAC_BASE, IS_DAC_ALIGN, and IS_DAC_DATA_08R.
void DAC_SetChannel2Data | ( | DAC_Align_TypeDef | DAC_Align, |
uint16_t | DAC_Data | ||
) |
Set the specified data holding register value for DAC channel2.
Definition at line 480 of file stm8l15x_dac.c.
References CH2RDHRH_Offset, DAC, DAC_Align_8b_R, DAC_BASE, IS_DAC_ALIGN, and IS_DAC_DATA_08R.
void DAC_SetDualChannelData | ( | DAC_Align_TypeDef | DAC_Align, |
uint16_t | DAC_Data2, | ||
uint16_t | DAC_Data1 | ||
) |
Set the specified data holding register value for dual channel DAC.
- Note:
- In dual mode, a unique register access is required to write in both DAC channels at the same time.
Definition at line 516 of file stm8l15x_dac.c.
References DAC, DAC_Align_8b_R, DAC_BASE, DCH1RDHRH_Offset, IS_DAC_ALIGN, and IS_DAC_DATA_08R.
void DAC_SetNoiseWaveLFSR | ( | DAC_Channel_TypeDef | DAC_Channel, |
DAC_LFSRUnmask_TypeDef | DAC_LFSRUnmask | ||
) |
Select DAC Noise Wave Generation LFSR according to the specified parameters.
Definition at line 382 of file stm8l15x_dac.c.
References CR2_Offset, DAC_BASE, DAC_CR2_MAMPx, IS_DAC_CHANNEL, and IS_DAC_LFSR_UNMASK_TRIANGLE_AMPLITUDE.
void DAC_SetTriangleWaveAmplitude | ( | DAC_Channel_TypeDef | DAC_Channel, |
DAC_TriangleAmplitude_TypeDef | DAC_TriangleAmplitude | ||
) |
Select DAC Triangle Wave Generation Amplitude according to the specified parameters.
Definition at line 421 of file stm8l15x_dac.c.
References CR2_Offset, DAC_BASE, DAC_CR2_MAMPx, IS_DAC_CHANNEL, and IS_DAC_LFSR_UNMASK_TRIANGLE_AMPLITUDE.
void DAC_SoftwareTriggerCmd | ( | DAC_Channel_TypeDef | DAC_Channel, |
FunctionalState | NewState | ||
) |
Enables or disables the selected DAC channel software trigger.
Definition at line 280 of file stm8l15x_dac.c.
References DAC, DAC_SWTRIGR_SWTRIG1, DISABLE, IS_DAC_CHANNEL, and IS_FUNCTIONAL_STATE.
void DAC_WaveGenerationCmd | ( | DAC_Channel_TypeDef | DAC_Channel, |
DAC_Wave_TypeDef | DAC_Wave, | ||
FunctionalState | NewState | ||
) |
Enables or disables the selected DAC channel wave generation.
Definition at line 336 of file stm8l15x_dac.c.
References CR1_Offset, DAC_BASE, DAC_CR1_WAVEN, DISABLE, IS_DAC_CHANNEL, IS_DAC_WAVE, and IS_FUNCTIONAL_STATE.