moryInc=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 - Продовження
void DMA1_Stream3_Chanel4_Configuration ( void )
{DMA_DeInit (DMA1_Stream3); _struct. DMA_Channel=DMA_Channel_4; _struct. DMA_PeripheralBaseAddr=(uint32_t) (& USART3-> DR); _struct. DMA_Memory0BaseAddr=(uint32_t) buffer; _struct. DMA_DIR=DMA_DIR_MemoryToPeripheral; _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_Normal; _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_Stream3, & dma1_struct); _Cmd (DMA1_Stream3, ENABLE ); }
void DMA1_Stream1_Chanel4_Configuration ( void )
{DMA_DeInit (DMA1_Stream1); _struct. DMA_Channel=DMA_Channel_4; _struct. DMA_PeripheralBaseAddr=(uint32_t) (& USART3-> DR); _struct. DMA_Memory0BaseAddr=(uint32_t) recived_data; _struct. DMA_DIR=DMA_DIR_PeripheralToMemory; _struct. DMA_BufferSize= sizeof (recived_data); _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_Stream1, & dma1_struct); _EnableIRQ ( DMA1_Stream1_IRQn ); _ITConfig (DMA1_Stream1, DMA_IT_TC, ENABLE ) ; _Cmd (DMA1_Stream1, ENABLE ); }
int main ( void )
{RCC_Configuration (); _Configuration (); _Snapshot_Configuration (); _Adc_Con...