|
void DAC02_Mode_sin(void)
{
uint32_t Idx = 0;
DAC_sin02_init();
sin02.sin_frequency=char_change_num(Command01.command_number5,4);
sin02.sin_range=char_change_num(Command01.command_number6,4);
if(sin02.sin_frequency>5000)
sin02.sin_frequency=5000;
if( sin02.sin_range>3300)
sin02.sin_range=3300;
if(sin02.sin_frequency>1000)
{
sin_frequency=50000/sin02.sin_frequency;
sin02.point_num=point_num_sin2;
DAC02_sin_Config();
DAC02_TIM_Config();
TIM3_NVIC_Config();
for (Idx = 0; Idx < point_num_sin2; Idx++)
{
DualSine02bit[Idx]=(Sine12bit[Idx*(1000/point_num_sin2)])*(sin02.sin_range/100)/33;
}
}
else
{
sin_frequency=10000/sin02.sin_frequency;
sin02.point_num=point_num_sin;
DAC02_sin_Config();
DAC02_TIM_Config();
TIM3_NVIC_Config();
for (Idx = 0; Idx < point_num_sin; Idx++)
{
DualSine02bit[Idx]=(Sine12bit[Idx*(1000/point_num_sin)])*(sin02.sin_range/100)/33;
}
}
sin02.sin_runflag=1;
}
|
评分
-
查看全部评分
|