📄 dma.c
字号:
/*
* uart.c - uart api & driver
*
* Author: li ming <admin@lumit.org>
* Date: 2008-4-16
* Copyleft: http://www.lumit.org
*/
#include "dma.h"
#define SFR_BASE 0x03FF0000
/* GDMA Interface */
#define GDMACON0 *((volatile unsigned *)(SFR_BASE+0xB000))
#define GDMACON0EN *((volatile unsigned *)(SFR_BASE+0xB020))
#define GDMACON1 *((volatile unsigned *)(SFR_BASE+0xC000))
#define GDMACON1EN *((volatile unsigned *)(SFR_BASE+0xC020))
#define GDMASRC0 *((volatile unsigned *)(SFR_BASE+0xB004))
#define GDMASRC1 *((volatile unsigned *)(SFR_BASE+0xC004))
#define GDMADST0 *((volatile unsigned *)(SFR_BASE+0xB008))
#define GDMADST1 *((volatile unsigned *)(SFR_BASE+0xC008))
#define GDMACNT0 *((volatile unsigned *)(SFR_BASE+0xB00C))
#define GDMACNT1 *((volatile unsigned *)(SFR_BASE+0xC00C))
/* GDMA Initialization*/
char source[8]={'1','2','3','4','5','6',0xa,0xd},dst[50]={0,};
void GDMA_Init(void)
{
GDMASRC0= (int)source; //source address
//GDMADST0= (int)dst0; //destination address
GDMACON0= 0x8409; //0x8D09
GDMACNT0= 0x4; //the number of transmittion
//GDMASRC1= (int)source1; //source address
GDMADST1= (int)dst; //destination address
GDMACON1= 0x8009; //0x8D09
GDMACNT1= 50; //the number of receive
}
void GDMA_Start(void)
{
GDMACON0EN= 0x01; //enable GDMA0
GDMACON1EN= 0x01; //enable GDMA1
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -