新手上路
- 积分
- 28
- 金钱
- 28
- 注册时间
- 2017-7-3
- 在线时间
- 3 小时
|
1金钱
void DMA_FSMC_AD7606_Configuration(void)
{
DMA_InitTypeDef DMA_InitStructure;
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA2,ENABLE);
DMA_Cmd(DMA2_Stream0, DISABLE);
DMA_ClearFlag(FSMC_DMA_STREAM, FSMC_DMA_FLAG_FEIF | FSMC_DMA_FLAG_DMEIF | FSMC_DMA_FLAG_TEIF |
FSMC_DMA_FLAG_HTIF | FSMC_DMA_FLAG_TCIF);
DMA_DeInit(DMA2_Stream0);
DMA_InitStructure.DMA_Channel=DMA_CHANNEL_1;
DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)AD7606_FT_Base;// AD7606_FT_FSMC
//DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t)AD7606_CS0_Base;//ÔÚ StartOneDMATx_Configuration()º¯ÊýÀïÅäÖÃ
DMA_InitStructure.DMA_DIR = DMA_DIR_MemoryToMemory;// DMA_DIR_MemoryToPeripheral
//DMA_InitStructure.DMA_BufferSize = 8;
DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;//;DMA_PeripheralInc_Enable
DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord;
DMA_InitStructure.DMA_MemoryDataSize = DMA_PeripheralDataSize_HalfWord ;//DMA_MemoryDataSize_HalfWord
DMA_InitStructure.DMA_Mode = DMA_Mode_Normal;//DMA_Mode_Normal;//ÔÚNormal ģʽÏ£¬ÓëÆô¶¯ÏÂÒ»´Î´«Ê䣬Ôò
//disable the DMA channel ,reload a new number into the DMA_SNDTRx
DMA_InitStructure.DMA_Priority = DMA_Priority_VeryHigh;//DMA_Priority_Low;
DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Disable ;//DMA_FIFOMode_Disable
DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_Full;
DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single; /* Memory burst */
DMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_Single;
// DMA2_Stream7 -> FCR |= (DMA_SxFCR_DMDIS|DMA_SxFCR_FTH);
DMA_Init(DMA2_Stream0, &DMA_InitStructure);
void DMA_FSMC_FTUSB_Configuration(void)
{
DMA_InitTypeDef DMA_InitStructure;
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA2,ENABLE);
DMA_Cmd(DMA2_Stream7, DISABLE);
DMA_ClearFlag(FSMC_DMA_STREAM, FSMC_DMA_FLAG_FEIF | FSMC_DMA_FLAG_DMEIF | FSMC_DMA_FLAG_TEIF |
FSMC_DMA_FLAG_HTIF | FSMC_DMA_FLAG_TCIF);
DMA_DeInit(DMA2_Stream7);
DMA_InitStructure.DMA_Channel=DMA_CHANNEL_1;
DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)AD7606_FT_Base;// AD7606_FT_FSMC
//DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t)AD7606_FT_Base;//ÔÚ StartOneDMATx_Configuration()º¯ÊýÀïÅäÖÃ
DMA_InitStructure.DMA_DIR = DMA_DIR_MemoryToMemory;// DMA_DIR_MemoryToPeripheral
// DMA_InitStructure.DMA_BufferSize = 8;
DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Enable;//DMA_PeripheralInc_Disable;
DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte;
DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte ;//DMA_MemoryDataSize_HalfWord
DMA_InitStructure.DMA_Mode = DMA_Mode_Normal;//DMA_Mode_Normal;//ÔÚNormal ģʽÏ£¬ÓëÆô¶¯ÏÂÒ»´Î´«Ê䣬Ôò
//disable the DMA channel ,reload a new number into the DMA_SNDTRx
DMA_InitStructure.DMA_Priority = DMA_Priority_Low;//DMA_Priority_Low;
DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Disable ;//DMA_FIFOMode_Disable
DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_Full;
DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single; /* Memory burst */
DMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_Single;
// DMA2_Stream7 -> FCR |= (DMA_SxFCR_DMDIS|DMA_SxFCR_FTH);
DMA_Init(DMA2_Stream7, &DMA_InitStructure);
}
存储器到存储器模式为什么外设地址都是设置的一样的
|
|