Global Informatics

- Информатика и вычислительная техника

Результаты вычислительных экспериментов

void

USART3_Configuration(void

)

{usart_struct. USART_BaudRate = 115200;_struct. USART_WordLength = USART_WordLength_8b;_struct. USART_StopBits = USART_StopBits_1;_struct. USART_Parity = USART_Parity_No;_struct. USART_HardwareFlowControl = USART_HardwareFlowControl_None;_struct. USART_Mode = USART_Mode_Rx | USART_Mode_Tx;_Init (USART3, &usart_struct);_DMACmd (USART3, USART_DMAReq_Tx, ENABLE);_DMACmd (USART3, USART_DMAReq_Rx, ENABLE);_Cmd (USART3, ENABLE); }

Рисунок ПБ.1 - Продолжение

void

DMA2_Stream0_Chanel0_Configuration(void

)

{DMA_DeInit (DMA2_Stream0);_struct. DMA_Channel = DMA_Channel_0;_struct. DMA_PeripheralBaseAddr = (uint32_t) (&ADC1->DR);_struct. DMA_Memory0BaseAddr = (uint32_t) buffer;_struct. DMA_DIR = DMA_DIR_PeripheralToMemory;_struct. DMA_BufferSize = sizeof(buffer);_struct. DMA_PeripheralInc = DMA_PeripheralInc_Disable;_struct. DMA_MemoryInc = DMA_MemoryInc_Enable;_struct. DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte;_struct. DMA_MemoryDataSize = DMA_MemoryDataSize_Byte;_struct. DMA_Mode = DMA_Mode_Circular;_struct. DMA_Priority = DMA_Priority_High;_struct. DMA_FIFOMode = DMA_FIFOMode_Disable;_struct. DMA_FIFOThreshold = DMA_FIFOThreshold_HalfFull;_struct. DMA_MemoryBurst = DMA_MemoryBurst_Single;_struct. DMA_PeripheralBurst = DMA_PeripheralBurst_Single;_Init (DMA2_Stream0, &dma2_struct);_Cmd (DMA2_Stream0, ENABLE);

}

void

ADC1_Configuration(void

)

{ADC_DeInit ();_common_init_struct. ADC_Mode = ADC_Mode_Independent; // _common_init_struct. ADC_Prescaler = ADC_Prescaler_Div2;_CommonInit (&adc_common_init_struct);_init_struct. ADC_Resolution = ADC_Resolution_8b;_init_struct. ADC_ScanConvMode = DISABLE;_init_struct. ADC_ContinuousConvMode = DISABLE;_init_struct. ADC_ExternalTrigConvEdge = ADC_ExternalTrigConvEdge_Rising;_init_struct. ADC_ExternalTrigConv = ADC_ExternalTrigConv_T2_TRGO;_init_struct. ADC_DataAlign = ADC_DataAlign_Right;_init_struct. ADC_NbrOfConversion = 0;_Init (ADC1, &adc1_init_struct); ADC_RegularChannelConfig (ADC1, ADC_Channel_0, 1, ADC_SampleTime_3Cycles);_EnableIRQ (ADC_IRQn);_ITConfig (ADC1, ADC_IT_EOC, ENABLE);_Cmd (ADC1, ENABLE); }

void

DMA1_Stream6_Chanel7_Configuration(void

)

{DMA_DeInit (DMA1_Stream6);_struct. DMA_Channel = DMA_Channel_7;_struct. DMA_PeripheralBaseAddr = (uint32_t) & (DAC->DHR8R2);_struct. DMA_Memory0BaseAddr = (uint32_t) sin; // Escalator8bit;_struct. DMA_DIR = DMA_DIR_MemoryToPeripheral;_struct. DMA_BufferSize = sizeof

(sin); // ) Escalator8bit;_struct. DMA_PeripheralInc = DMA_PeripheralInc_Disable;_struct. DMA_MemoryInc = DMA_MemoryInc_Enable;_struct. DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte;_struct. DMA_MemoryDataSize = DMA_MemoryDataSize_Byte;_struct. DMA_Mode = DMA_Mode_Circular;_struct. DMA_Priority = DMA_Priority_High;_struct. DMA_FIFOMode = DMA_FIFOMode_Disable;_struct. DMA_FIFOThreshold = DMA_FIFOThreshold_HalfFull;_struct. DMA_MemoryBurst = DMA_MemoryBurst_Single;_struct. DMA_PeripheralBurst = DMA_PeripheralBurst_Single;_Init (DMA1_Stream6, &dma1_struct);_Cmd (DMA1_Stream6, ENABLE); }

void

DAC_Chanel2_Configuration(void

)

{dac_struct. DAC_Trigger = DAC_Trigger_T6_TRGO;_struct. DAC_WaveGeneration = DAC_WaveGeneration_None;_struct. DAC_OutputBuffer = DAC_OutputBuffer_Disable;_Init (DAC_Channel_2, &dac_struct);_Cmd (DAC_Channel_2, ENABLE);_DMACmd (DAC_Channel_2, ENABLE); }

Перейти на страницу: 1 2 3 4 5 6 7 8

Статья в тему

Автоматизация управление асинхронным электроприводом
Автоматизация - это комплексная конструктивно-технологическая задача создания принципиально новой техники на базе прогрессивных процессов обработки, контроля, сборки. Автоматизация технологических процессов есть совокупность мероприятий по разработке новых технологических проце ...

Главные разделы


www.globalinformatics.ru © 2021 - Все права защищены!