📄 dma.h
字号:
#ifndef __DMA_H__
#define __DMA_H__
int Test_DMA(void);
void Test_ExtDMA(void);
/********************************************************************************
* DMA Control Register Definition
*
* 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
* +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
* |DM |CM | TW |SB | X |BT |SI |SF |DF |SD |DD | MODE |BS |RE |
* +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
*
* DM: Denand mode 0: normal, 1: demand
* CM: Continuous mode 0: normal, 1: continuous
* TW: Transfer width 00: byte(8-bit), 01: halfword(16-bit)
* 10: word(32-bit), 11: not used
* SB: Single/Block mode 0: single mode, 1: block mode
* BT: 4 Burst mode 0: normal, 1: 4 burst
* SI: Stop interrupt enable 0: No interrupt, 1: generate interrupt
* SF: Source address fix 0: increase/decrease, 1: fixed
* DF: Destination address address fix 0: increase/decrease, 1: fixed
* SD: Source address direction 0: increase, 1: decrease
* DD: Destination address direction 0: increase, 1: decrease
* MODE: DMA mode select 00: Software, 01: Ext. REQ, 10: UART, 11: SIO,Timer
* BS: Busy status(Read only) 0: Idle state, 1: Busy state
* RE: Run Enable 0: disable, 1: enable
********************************************************************************/
#define DMA_CTRL_NO_DEMAND 0x0000
#define DMA_CTRL_DEMAND 0x8000
#define DMA_CTRL_NO_CONT 0x0000
#define DMA_CTRL_CONT 0x4000
#define DMA_CTRL_TW_BYTE 0x0000
#define DMA_CTRL_TW_HLAFWORD 0x1000
#define DMA_CTRL_TW_WORD 0x2000
#define DMA_CTRL_SINGLE 0x0000
#define DMA_CTRL_BLOCK 0x0800
#define DMA_CTRL_NORMAL 0x0000
#define DMA_CTRL_BURST 0x0200
#define DMA_CTRL_NO_INT 0x0000
#define DMA_CTRL_INT 0x0100
#define DMA_CTRL_SRC_CHANGE 0x0000
#define DMA_CTRL_SRC_FIX 0x0080
#define DMA_CTRL_DST_CHANGE 0x0000
#define DMA_CTRL_DST_FIX 0x0040
#define DMA_CTRL_SRC_INC 0x0000
#define DMA_CTRL_SRC_DEC 0x0020
#define DMA_CTRL_DST_INC 0x0000
#define DMA_CTRL_DST_DEC 0x0010
#define DMA_CTRL_MODE_SW 0x0000
#define DMA_CTRL_MODE_EXT 0x0004
#define DMA_CTRL_MODE_UART 0x0008
#define DMA_CTRL_MODE_SIO 0x000c
#define DMA_STATE_IDLE 0x0000
#define DMA_STATE_BUSY 0x0002
#define DMA_RUN_DISABLE 0x0000
#define DMA_RUN_ENABLE 0x0001
#endif /*__POWER_H__*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -