STM8L15x Standard Peripherals Drivers
|
DAC channels configuration: trigger, output buffer, data format. More...
Functions | |
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_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. | |
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_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 channels configuration: trigger, output buffer, data format.
=============================================================================== DAC channels configuration: trigger, output buffer, data format ===============================================================================
Function Documentation
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_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.
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_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.