首页 > 其他分享 >stm32系列--DAC的应用

stm32系列--DAC的应用

时间:2024-06-06 09:23:36浏览次数:19  
标签:DMA DAC -- void stm32 TIM InitStructure GPIO

 

#include "bsp_dac.h"
#include "math.h"
//#include "stm32f10x_tim.h"
//#include "stm32f10x_dma.h"
//#include "stm32f10x_dac.h"
//正弦波单个周期的点数
#define POINT_NUM 32
#define angle 3.1415/64


/* 初始波形数据 ---------------------------------------------------------*/
uint16_t Sine12bit[128] = {
2048,
2148,2248,2348,2447,2545,2642,2737,2831,
2923,3013,3100,3185,3267,3347,3423,3496,
3565,3631,3692,3750,3804,3854,3899,3940,
3976,4007,4034,4056,4073,4086,4093,4095,
4093,4086,4073,4056,4034,4007,3976,3940,
3899,3854,3804,3750,3692,3631,3565,3496,
3423,3347,3267,3185,3100,3013,2923,2831,
2737,2642,2545,2447,2348,2248,2148,2048,
1948,1848,1748,1649,1551,1454,1359,1265,
1173,1083,996,911,829,749,673,600,
531,465,404,346,292,242,197,156,
120,89,62,40,23,10,3,1,
3,10,23,40,62,89,120,156,
197,242,292,346,404,465,531,600,
673,749,829,911,996,1083,1173,1265,
1359,1454,1551,1649,1748,1848,1948
};

uint16_t TriangleWave12bit[128] = {
2048,
2148,2248,2348,2447,2545,2642,2737,2831,
2923,3013,3100,3185,3267,3347,3423,3496,
3565,3631,3692,3750,3804,3854,3899,3940,
3976,4007,4034,4056,4073,4086,4093,4095,
4093,4086,4073,4056,4034,4007,3976,3940,
3899,3854,3804,3750,3692,3631,3565,3496,
3423,3347,3267,3185,3100,3013,2923,2831,
2737,2642,2545,2447,2348,2248,2148,2048,
1948,1848,1748,1649,1551,1454,1359,1265,
1173,1083,996,911,829,749,673,600,
531,465,404,346,292,242,197,156,
120,89,62,40,23,10,3,1,
3,10,23,40,62,89,120,156,
197,242,292,346,404,465,531,600,
673,749,829,911,996,1083,1173,1265,
1359,1454,1551,1649,1748,1848,1948
};

uint16_t PulseWave12bit[128] = {
2048,
2148,2248,2348,2447,2545,2642,2737,2831,
2923,3013,3100,3185,3267,3347,3423,3496,
3565,3631,3692,3750,3804,3854,3899,3940,
3976,4007,4034,4056,4073,4086,4093,4095,
4093,4086,4073,4056,4034,4007,3976,3940,
3899,3854,3804,3750,3692,3631,3565,3496,
3423,3347,3267,3185,3100,3013,2923,2831,
2737,2642,2545,2447,2348,2248,2148,2048,
1948,1848,1748,1649,1551,1454,1359,1265,
1173,1083,996,911,829,749,673,600,
531,465,404,346,292,242,197,156,
120,89,62,40,23,10,3,1,
3,10,23,40,62,89,120,156,
197,242,292,346,404,465,531,600,
673,749,829,911,996,1083,1173,1265,
1359,1454,1551,1649,1748,1848,1948
};

void dac1_change_to_sine(void)
{
    DMA_InitTypeDef  DMA_InitStructure;
        
    DMA_InitStructure.DMA_PeripheralBaseAddr = DAC_DHR12R1;                    
    DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)&Sine12bit;                
    DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST;                                            
    DMA_InitStructure.DMA_BufferSize = 128;                                                                    
    DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;                
    DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;                                    
    DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord;    
    DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;                    
    DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;                                                    
    DMA_InitStructure.DMA_Priority = DMA_Priority_High;                                            
    DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;

    DMA_Init(DMA2_Channel3, &DMA_InitStructure);    
}
void dac2_change_to_sine(void)
{
    DMA_InitTypeDef  DMA_InitStructure;
        
    DMA_InitStructure.DMA_PeripheralBaseAddr = DAC_DHR12R2;                    
    DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)&Sine12bit;                
    DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST;                                            
    DMA_InitStructure.DMA_BufferSize = 128;                                                                    
    DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;                
    DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;                                    
    DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord;    
    DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;                    
    DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;                                                    
    DMA_InitStructure.DMA_Priority = DMA_Priority_High;                                            
    DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;

    DMA_Init(DMA2_Channel4, &DMA_InitStructure);
}
    
void dac1_change_to_Triangle(void)
{
    DMA_InitTypeDef  DMA_InitStructure;
        
    DMA_InitStructure.DMA_PeripheralBaseAddr = DAC_DHR12R1;                    //外设数据地址
    DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)&TriangleWave12bit;                //内存数据地址 Sine12bit
    DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST;                                            //数据传输方向内存至外设
    DMA_InitStructure.DMA_BufferSize = 128;                                    //缓存大小为POINT_NUM字节                                    
    DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;                //外设数据地址固定    
    DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;                                    //内存数据地址自增
    DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord;    //外设数据以字为单位
    DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;                    //内存数据以字为单位    
    DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;                                                    //循环模式
    DMA_InitStructure.DMA_Priority = DMA_Priority_High;                                            //高DMA通道优先级
    DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;

    DMA_Init(DMA2_Channel3, &DMA_InitStructure);    
}

void dac2_change_to_Triangle(void)
{
    DMA_InitTypeDef  DMA_InitStructure;
        
    DMA_InitStructure.DMA_PeripheralBaseAddr = DAC_DHR12R2;                    //外设数据地址
    DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)&TriangleWave12bit;                //内存数据地址 Sine12bit
    DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST;                                            //数据传输方向内存至外设
    DMA_InitStructure.DMA_BufferSize = 128;                                    //缓存大小为POINT_NUM字节                                    
    DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;                //外设数据地址固定    
    DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;                                    //内存数据地址自增
    DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord;    //外设数据以字为单位
    DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;                    //内存数据以字为单位    
    DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;                                                    //循环模式
    DMA_InitStructure.DMA_Priority = DMA_Priority_High;                                            //高DMA通道优先级
    DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;
    
    DMA_Init(DMA2_Channel4, &DMA_InitStructure);
}

void dac1_change_to_Pulse(void)
{
    DMA_InitTypeDef  DMA_InitStructure;
        
    DMA_InitStructure.DMA_PeripheralBaseAddr = DAC_DHR12R1;                    
    DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)&PulseWave12bit;                
    DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST;                                            
    DMA_InitStructure.DMA_BufferSize = 128;                                                                    
    DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;                
    DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;                                    
    DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord;    
    DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;                    
    DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;                                                    
    DMA_InitStructure.DMA_Priority = DMA_Priority_High;                                            
    DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;

    DMA_Init(DMA2_Channel3, &DMA_InitStructure);
}
void dac2_change_to_Pulse(void)
{
    DMA_InitTypeDef  DMA_InitStructure;
        
    DMA_InitStructure.DMA_PeripheralBaseAddr = DAC_DHR12R2;                    
    DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)&PulseWave12bit;                
    DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST;                                            
    DMA_InitStructure.DMA_BufferSize = 128;                                                                    
    DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;                
    DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;                                    
    DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord;    
    DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;                    
    DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;                                                    
    DMA_InitStructure.DMA_Priority = DMA_Priority_High;                                            
    DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;

    DMA_Init(DMA2_Channel4, &DMA_InitStructure);    
}

void set_Triangle_duty(int duty)// 例如duty=5050,占空比为50.5%
{
    int i;    
    int low_num=0;
    int hight_num=0;    
  hight_num = 128*duty/10000;    
    low_num=128-hight_num;    
    for(i=0;i<128;i++)
    {
        if(i<=hight_num-1)
            TriangleWave12bit[i]= (uint16_t)4095/hight_num*i;
        else
            TriangleWave12bit[i]= (uint16_t)(4095-4095/low_num*(i-hight_num));    
    }
}
void set_Pulse_duty(int duty) // 例如duty=20,占空比为20%
{
    int i;    
    int low_num=0;
    int hight_num=0;    
  hight_num = 128*duty/10000;    
    low_num=128-hight_num;
    for(i=0;i<128;i++)
    {
        if(i<=low_num-1)
        PulseWave12bit[i]= 0;
        else
        PulseWave12bit[i]= (uint16_t)(4095);    

    }
}
void set_sine_vpp(float vpp)
{
    int i;    
    for(i=0;i<128;i++)
    {
        Sine12bit[i]= (uint16_t)((sin(i*angle)+1)/2*vpp*4096/3.3);        
    }
    
}

void set_Triangle_vpp(float vpp)
{
    int i;    
    for(i=0;i<128;i++)
    {
        if(i<=63)
            TriangleWave12bit[i]= (uint16_t)vpp/3.3*4096/64*i;
        else
            TriangleWave12bit[i]= (uint16_t)(vpp/3.3*4096-vpp/3.3*4096/64*(i-64));    
    }            
}

void set_Pulse_vpp(float vpp)
{
    int i;    
    for(i=0;i<128;i++)
    {
        if(i<=63)
            PulseWave12bit[i]= 0;
        else
            PulseWave12bit[i]= (uint16_t)(vpp/3.3*4096);    
    }            
}

void set_peroid(int period)
{
    TIM_Cmd(TIM6, DISABLE);
    TIM6->ARR=period;
    TIM_Cmd(TIM6, ENABLE);    
//    TIM_Cmd(TIM7, DISABLE);
//    TIM7->ARR=period;
//    TIM_Cmd(TIM7, ENABLE);
}

void DAC1_GPIO_config(void)
{    
    GPIO_InitTypeDef GPIO_InitStructure;

  /* 使能GPIOA时钟 */
  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);    
    
    
  /* DAC的GPIO配置,模拟输入 */
  GPIO_InitStructure.GPIO_Pin =  GPIO_Pin_4;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;
  GPIO_Init(GPIOA, &GPIO_InitStructure);

}
void DAC2_GPIO_config(void)
{    
    GPIO_InitTypeDef GPIO_InitStructure;

  /* 使能GPIOA时钟 */
  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);    
    
    
  /* DAC的GPIO配置,模拟输入 */
  GPIO_InitStructure.GPIO_Pin =  GPIO_Pin_5; //pa5
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;
  GPIO_Init(GPIOA, &GPIO_InitStructure);

}


/**
  * @brief  配置DAC通道1的TIM
  * @param  无
  * @retval 无
  */
void DAC1_TIM_Config(void)
{
    
  TIM_TimeBaseInitTypeDef    TIM_TimeBaseStructure;
    
  /* 使能TIM6时钟,TIM2CLK 为72M */
  RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM6, ENABLE);
    
  /*定时器初始周期*/
  TIM_TimeBaseStructure.TIM_Period = 0X06;   //562500/25000+1=23             40KHZ                            
  TIM_TimeBaseStructure.TIM_Prescaler = 0x1;                                   //预分频,不分频 72M / (1+1) =36M
  TIM_TimeBaseStructure.TIM_ClockDivision = 0x0;                            //时钟分频系数
  TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;      //向上计数模式
  TIM_TimeBaseInit(TIM6, &TIM_TimeBaseStructure);

  /* 配置TIM6触发源 */
  TIM_SelectOutputTrigger(TIM6, TIM_TRGOSource_Update);

    /* 使能TIM6 */
  TIM_Cmd(TIM6, ENABLE);
}
/**
  * @brief  配置DAC通道2的TIM
  * @param  无
  * @retval 无
  */
void DAC2_TIM_Config(void)
{
    
  TIM_TimeBaseInitTypeDef    TIM_TimeBaseStructure;
    
  /* 使能TIM6时钟,TIM2CLK 为72M */
  RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM7, ENABLE);
    
  /*定时器初始周期*/
  TIM_TimeBaseStructure.TIM_Period = 0X17;                                            
  TIM_TimeBaseStructure.TIM_Prescaler = 0x1;                                   //预分频,不分频 72M / (1+1) =36M
  TIM_TimeBaseStructure.TIM_ClockDivision = 0x0;                            //时钟分频系数
  TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;      //向上计数模式
  TIM_TimeBaseInit(TIM7, &TIM_TimeBaseStructure);

  /* 配置TIM7触发源 */
  TIM_SelectOutputTrigger(TIM7, TIM_TRGOSource_Update);

    /* 使能TIM7 */
  TIM_Cmd(TIM7, ENABLE);
}


/**
  * @brief  配置DMA
  * @param  无
  * @retval 无
  */
void DAC1_DMA_Config(void)
{    
    DMA_InitTypeDef  DMA_InitStructure;
    
    DAC_InitTypeDef  DAC_InitStructure;

    /* 使能DMA2时钟 */
    RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA2, ENABLE);
    
    /* 使能DAC时钟 */    
    RCC_APB1PeriphClockCmd(RCC_APB1Periph_DAC, ENABLE);
    
        
      /* 配置DAC 通道1 */
    DAC_InitStructure.DAC_Trigger = DAC_Trigger_T6_TRGO;                        //使用TIM6作为触发源
    DAC_InitStructure.DAC_WaveGeneration = DAC_WaveGeneration_None;    //不使用波形发生器
    DAC_InitStructure.DAC_OutputBuffer = DAC_OutputBuffer_Disable;    //不使用DAC输出缓冲
  
    DAC_Init(DAC_Channel_1, &DAC_InitStructure);
    
    /* 配置DMA2 */

      DMA_InitStructure.DMA_PeripheralBaseAddr = DAC_DHR12R1;                    //外设数据地址
      DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)&Sine12bit;                //内存数据地址 Sine12bit
      DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST;                                            //数据传输方向内存至外设
      DMA_InitStructure.DMA_BufferSize = 128;                                    //缓存大小为POINT_NUM字节                                    
      DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;                //外设数据地址固定    
      DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;                                    //内存数据地址自增
      DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord;    //外设数据以字为单位
      DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;                    //内存数据以字为单位    
      DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;                                                    //循环模式
      DMA_InitStructure.DMA_Priority = DMA_Priority_High;                                            //高DMA通道优先级
      DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;                                                        //非内存至内存模式    

      DMA_Init(DMA2_Channel3, &DMA_InitStructure);
    
  /* 使能DMA2-14通道 */
  DMA_Cmd(DMA2_Channel3, ENABLE);
  /* 使能通道1 由PA4输出 */
  DAC_Cmd(DAC_Channel_1, ENABLE);
  /* 使能DAC的DMA请求 */
  DAC_DMACmd(DAC_Channel_1, ENABLE);
}


/**
  * @brief  配置DMA
  * @param  无
  * @retval 无
  */
void DAC2_DMA_Config(void)
{    
    DMA_InitTypeDef  DMA_InitStructure;
    
    DAC_InitTypeDef  DAC_InitStructure;

    /* 使能DMA2时钟 */
    RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA2, ENABLE);
    
    /* 使能DAC时钟 */    
    RCC_APB1PeriphClockCmd(RCC_APB1Periph_DAC, ENABLE);
    
        
      /* 配置DAC 通道2 */
    DAC_InitStructure.DAC_Trigger = DAC_Trigger_T7_TRGO;                        //使用TIM6作为触发源
    DAC_InitStructure.DAC_WaveGeneration = DAC_WaveGeneration_None;    //不使用波形发生器
    DAC_InitStructure.DAC_OutputBuffer = DAC_OutputBuffer_Disable;    //不使用DAC输出缓冲
  
    DAC_Init(DAC_Channel_2, &DAC_InitStructure);
    
    /* 配置DMA2 */

      DMA_InitStructure.DMA_PeripheralBaseAddr = DAC_DHR12R2;                    //外设数据地址
      DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)&Sine12bit;                //内存数据地址 Sine12bit
      DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST;                                            //数据传输方向内存至外设
      DMA_InitStructure.DMA_BufferSize = 128;                                    //缓存大小为POINT_NUM字节                                    
      DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;                //外设数据地址固定    
      DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;                                    //内存数据地址自增
      DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord;    //外设数据以字为单位
      DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;                    //内存数据以字为单位    
      DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;                                                    //循环模式
      DMA_InitStructure.DMA_Priority = DMA_Priority_High;                                            //高DMA通道优先级
      DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;                                                        //非内存至内存模式    

      DMA_Init(DMA2_Channel4, &DMA_InitStructure);
    
  /* 使能DMA2-14通道 */
  DMA_Cmd(DMA2_Channel4, ENABLE);
  /* 使能通道1 由PA4输出 */
  DAC_Cmd(DAC_Channel_2, ENABLE);
  /* 使能DAC的DMA请求 */
  DAC_DMACmd(DAC_Channel_2, ENABLE);
}


void DAC1_Mode_Init(void)
{
    DAC1_GPIO_config();
    DAC1_TIM_Config();    
    DAC1_DMA_Config();
}

void DAC2_Mode_Init(void)
{
    DAC2_GPIO_config();
    DAC2_TIM_Config();    
    DAC2_DMA_Config();
}
DAC1_Mode_Init

 

void sendreplay(void)
{
    u8 i;
    unsigned long  period=0;
    unsigned long  period_us=0;
    unsigned long  freq=0;
    unsigned long  freq_temp=0;
    u16  duty=0;
    
    for(i=0;i<24;i++)
    {
        if(myusart.rcbuf[i] != rcbuf_bak[i]) break;
    }
    
    if(i<24)
    {
        for(i=0;i<24;i++) rcbuf_bak[i] = myusart.rcbuf[i];
    freq = (myusart.rcbuf[4]<<8)+    myusart.rcbuf[5];
            
            freq_temp =freq;
            //频率设置统一处理
            if(freq < _freq_min)
            {
                freq = _freq_min;
       }
            else if(freq > _freq_max )
            {
                freq = _freq_max;
      }
            period = (int)(_freq_vel/freq - 1);
            //占空比
            duty = (myusart.rcbuf[6]<<8)+    myusart.rcbuf[7];
            period_us = 1000000 / freq;
            if(myusart.rcbuf[3]==0x01)//确定波形
            {
                dac1_change_to_sine();
                set_peroid(period);
                //占空比就是50%
                h_period_us = period_us/2;
                l_period_us = period_us - h_period_us;                    
            }
            else if(myusart.rcbuf[3]==0x02)
            {
                //PA6
                if(freq_temp < _freq_min)
                {
                    freq_temp = _freq_min;
                }
                set_pwm1(freq_temp,duty);
                period_us = 1000000 / freq_temp;
                h_period_us = period_us*duty/10000;
                l_period_us = period_us - h_period_us;    
            }
            else if(myusart.rcbuf[3]==0x03)
            {
                set_Triangle_duty(duty);//无法避免重新计算数组值
                dac1_change_to_Triangle();    
                set_peroid(period);
                h_period_us = period_us*duty/10000;
                l_period_us = period_us - h_period_us;    

      }
    }

}
sendreplay

 

标签:DMA,DAC,--,void,stm32,TIM,InitStructure,GPIO
From: https://www.cnblogs.com/zhouyuqing1024/p/18234413

相关文章

  • 如何合理利用数据外发管控平台,保护重要图纸的知识产权?
    在企业业务开展过程中,数据外发成为越来越普遍的数据交换场景。在机械制造业的生产过程中,设计图纸扮演着非常重要的角色,制造企业与合作单位的图纸文件交流频繁,会为数据交换过程带来风险。是否有统一的数据外发管控平台,让设计图纸能安全、高效地流转和使用,成为制造企业所关心的重要......
  • 主成分分析(PCA)介绍
    目录计算过程投影分量计算假设你有一家理发店,已经记录了过去一年中所有顾客的头发长度和发型偏好的数据。现在你想从这些数据中提取一些主要的信息,比如顾客最常选择的发型类型,以及不同发型之间的相关性等。这对于你未来开展有针对性的营销活动很有帮助。具体来说,我们可以将......
  • 高效AI出图工具Fooocus
    市面上有几大王牌,sd,comfyui,mj以及Fooocus安装https://github.com/lllyasviel/Fooocus下载后会有3个启动bat,根据自己选择,默认启动会联网下载模型模型下载模型路径为Fooocus\models\checkpoints,也可以用之前其他软件下载好的模型如果使用inpaint,会下载到Fooocus\models\inpai......
  • goto 语句以及 setjump、longjump 函数的注意事项总结
    关于goto、setjmp、longjmp的注意事项,总结如下:goto语句避免滥用:goto语句虽然能够提供一种直接的跳转方式,但过度使用会使程序结构变得复杂,难以阅读和维护。应优先考虑使用结构化的控制流语句(如if、while、for等)。防止死循环:在使用goto语句时,要特别注意不要形成死......
  • TCP通信——基于C语言连接
    设计两个程序分别作为服务器和客户端,互相进行连接服务器/*************************************************************************************************************************** filename: tcp_server.c* author :Dazz* date :2024/6/5* functio......
  • EDA数据跨网交换解决方案,一文了解!
    EDA数据通常与电子设计自动化相关,这是一种利用计算机辅助设计(CAD)软件来完成超大规模集成电路(VLSI)芯片的功能设计、综合、验证、物理设计等流程的技术。以下是一些会涉及到EDA数据的行业:集成电路设计:EDA是集成电路设计流程中不可或缺的工具,设计工程师使用EDA工具来设计和验证复杂......
  • linux 基线检查加固
    修改vsftp回显信息ansible-ihoststask-mshell-a"grep'ftpd_banner'/etc/vsftpd/vsftpd.conf"sed-i'/ftpd_banner/s/^/#/g'/etc/vsftpd/vsftpd.confansible-ihoststask-mshell-a"echo'ftpd_banner="Authorize......
  • Sql数据库CT的开启
    1、数据库CT开启ALTERDATABASE[数据库名]SETCHANGE_TRACKING=ON(CHANGE_RETENTION=【Ct日志保留天数】DAYS,AUTO_CLEANUP=ON);关闭ALTERDATABASE[数据库名]SETCHANGE_TRACKING=OFF2、表CT开启ALTERTABLEdbo.[表名]ENABLECHANGE_TRACKINGWIT......
  • 网站外链优势劣势及如何判断?
    在现代互联网时代中,网站外链作为一种重要的优化手段被广泛应用。然而,网站外链是否真的有所帮助,如何判断外链的优劣成为了许多网站主和SEO从业者关注的问题。本文将介绍网站外链的优势和劣势,并提供一些判断外链质量的方法和注意事项。一、网站外链的优势1.增加网站权重和排名:网站......
  • 垃圾分类 环保主题 网页设计 html源码 大作业
    ......