搞定了
为什么这样行
刚好相反呢?
void dac_out_value_data(INT16U value)
{
DAC_InitTypeDef DAC_InitStructure;
DAC_InitStructure.DAC_Trigger = DAC_Trigger_Software;
DAC_InitStructure.DAC_WaveGeneration = DAC_WaveGeneration_None;
//DAC_InitStructure.DAC_LFSRUnmask_TriangleAmplitude = DAC_LFSRUnmask_Bits8_0;
DAC_InitStructure.DAC_OutputBuffer = DAC_OutputBuffer_Disable;//
DAC_Init(DAC_Channel_1, &DAC_InitStructure);
DAC_SetChannel1Data(DAC_Align_12b_R, value);
DAC_SoftwareTriggerCmd(DAC_Channel_1, ENABLE);
DAC_InitStructure.DAC_Trigger = DAC_Trigger_Software;
DAC_InitStructure.DAC_WaveGeneration = DAC_WaveGeneration_None;
//DAC_InitStructure.DAC_LFSRUnmask_TriangleAmplitude = DAC_LFSRUnmask_Bits8_0;
DAC_InitStructure.DAC_OutputBuffer = DAC_OutputBuffer_Enable;//DAC_OutputBuffer_Enable;//
DAC_Init(DAC_Channel_1, &DAC_InitStructure);
}
|