📄 dma.h
字号:
#define DMA7_INT_PRI_7 0xFFFF
/* enable / disable interrupts for DMA0*/
#define DMA0_INT_ENABLE 0xFFFF
#define DMA0_INT_DISABLE 0xFFEF
/* Macros to Enable/Disable interrupts and set Interrupt priority for DMA0 */
#define EnableIntDMA0 IEC0bits.DMA0IE = 1
#define DisableIntDMA0 IEC0bits.DMA0IE = 0
#define SetPriorityIntDMA0(priority) IPC1bits.DMA0IP = (priority)
/* enable / disable interrupts for DMA1*/
#define DMA1_INT_ENABLE 0xFFFF
#define DMA1_INT_DISABLE 0xBFFF
/* Macros to Enable/Disable interrupts and set Interrupt priority for DMA1 */
#define EnableIntDMA1 IEC0bits.DMA1IE = 1
#define DisableIntDMA1 IEC0bits.DMA1IE = 0
#define SetPriorityIntDMA1(priority) IPC3bits.DMA1IP = (priority)
/* enable / disable interrupts for DMA2*/
#define DMA2_INT_ENABLE 0xFFFF
#define DMA2_INT_DISABLE 0xFEFF
/* Macros to Enable/Disable interrupts and set Interrupt priority for DMA2 */
#define EnableIntDMA2 IEC1bits.DMA2IE = 1
#define DisableIntDMA2 IEC1bits.DMA2IE = 0
#define SetPriorityIntDMA2(priority) IPC6bits.DMA2IP = (priority)
/* enable / disable interrupts for DMA3*/
#define DMA3_INT_ENABLE 0xFFFF
#define DMA3_INT_DISABLE 0xFFEF
/* Macros to Enable/Disable interrupts and set Interrupt priority for DMA3 */
#define EnableIntDMA3 IEC2bits.DMA3IE = 1
#define DisableIntDMA3 IEC2bits.DMA3IE = 0
#define SetPriorityIntDMA3(priority) IPC9bits.DMA3IP = (priority)
/* enable / disable interrupts for DMA4*/
#define DMA4_INT_ENABLE 0xFFFF
#define DMA4_INT_DISABLE 0x7FFF
/* Macros to Enable/Disable interrupts and set Interrupt priority for DMA4 */
#define EnableIntDMA4 IEC2bits.DMA4IE = 1
#define DisableIntDMA4 IEC2bits.DMA4IE = 0
#define SetPriorityIntDMA4(priority) IPC11bits.DMA4IP = (priority)
/* enable / disable interrupts for DMA5*/
#define DMA5_INT_ENABLE 0xFFFF
#define DMA5_INT_DISABLE 0xDFFF
/* Macros to Enable/Disable interrupts and set Interrupt priority for DMA5 */
#define EnableIntDMA5 IEC3bits.DMA5IE = 1
#define DisableIntDMA5 IEC3bits.DMA5IE = 0
#define SetPriorityIntDMA5(priority) IPC15bits.DMA5IP = (priority)
/* enable / disable interrupts for DMA6*/
#define DMA6_INT_ENABLE 0xFFFF
#define DMA6_INT_DISABLE 0xFFEF
/* Macros to Enable/Disable interrupts and set Interrupt priority for DMA6 */
#define EnableIntDMA6 IEC4bits.DMA6IE = 1
#define DisableIntDMA6 IEC4bits.DMA6IE = 0
#define SetPriorityIntDMA6(priority) IPC17bits.DMA6IP = (priority)
/* enable / disable interrupts for DMA7*/
#define DMA7_INT_ENABLE 0xFFFF
#define DMA7_INT_DISABLE 0xFFDF
/* Macros to Enable/Disable interrupts and set Interrupt priority for DMA7 */
#define EnableIntDMA7 IEC4bits.DMA7IE = 1
#define DisableIntDMA7 IEC4bits.DMA7IE = 0
#define SetPriorityIntDMA7(priority) IPC17bits.DMA7IP = (priority)
/* DMA Function Prototypes */
void CloseDMA0(void) __attribute__ ((section (".libperi"))); /*Close DMA0 channel */
void CloseDMA1(void) __attribute__ ((section (".libperi"))); /*Close DMA1 channel */
void CloseDMA2(void) __attribute__ ((section (".libperi"))); /*Close DMA2 channel */
void CloseDMA3(void) __attribute__ ((section (".libperi"))); /*Close DMA3 channel */
void CloseDMA4(void) __attribute__ ((section (".libperi"))); /*Close DMA4 channel */
void CloseDMA5(void) __attribute__ ((section (".libperi"))); /*Close DMA5 channel */
void CloseDMA6(void) __attribute__ ((section (".libperi"))); /*Close DMA6 channel */
void CloseDMA7(void) __attribute__ ((section (".libperi"))); /*Close DMA7 channel */
void ConfigIntDMA0(unsigned int config) __attribute__ ((section (".libperi")));
/* Set interrupt priority and enable/disable for DMA0 channel */
void ConfigIntDMA1(unsigned int config) __attribute__ ((section (".libperi")));
/* Set interrupt priority and enable/disable for DMA1 channel */
void ConfigIntDMA2(unsigned int config) __attribute__ ((section (".libperi")));
/* Set interrupt priority and enable/disable for DMA2 channel */
void ConfigIntDMA3(unsigned int config) __attribute__ ((section (".libperi")));
/* Set interrupt priority and enable/disable for DMA3 channel */
void ConfigIntDMA4(unsigned int config) __attribute__ ((section (".libperi")));
/* Set interrupt priority and enable/disable for DMA4 channel */
void ConfigIntDMA5(unsigned int config) __attribute__ ((section (".libperi")));
/* Set interrupt priority and enable/disable for DMA5 channel */
void ConfigIntDMA6(unsigned int config) __attribute__ ((section (".libperi")));
/* Set interrupt priority and enable/disable for DMA6 channel */
void ConfigIntDMA7(unsigned int config) __attribute__ ((section (".libperi")));
/* Set interrupt priority and enable/disable for DMA7 channel */
unsigned int DMARAMAddress(void) __attribute__ ((section (".libperi")));
/* returns the recent DMA RAM address */
char LastDMAActive(void) __attribute__ ((section (".libperi"))); /* returns the last DMA active channel*/
void OpenDMA0(unsigned int config,unsigned int irq,unsigned int sta_address,
unsigned int stb_address,unsigned int pad_adress,unsigned int count ) __attribute__ ((section (".libperi")));
/* configures the DMA0 registers: DMA0CON, DMA0REQ, DMA0STA, DMA0STB, DMA0PAD, DMA0CNT*/
void OpenDMA1(unsigned int config,unsigned int irq,unsigned int sta_address,
unsigned int stb_address,unsigned int pad_adress,unsigned int count ) __attribute__ ((section (".libperi")));
/* configures the DMA1 registers: DMA1CON, DMA1REQ, DMA1STA, DMA1STB, DMA1PAD, DMA1CNT*/
void OpenDMA2(unsigned int config,unsigned int irq,unsigned int sta_address,
unsigned int stb_address,unsigned int pad_adress,unsigned int count ) __attribute__ ((section (".libperi")));
/* configures the DMA2 registers: DMA2CON, DMA2REQ, DMA2STA, DMA2STB, DMA2PAD, DMA2CNT*/
void OpenDMA3(unsigned int config,unsigned int irq,unsigned int sta_address,
unsigned int stb_address,unsigned int pad_adress,unsigned int count ) __attribute__ ((section (".libperi")));
/* configures the DMA3 registers: DMA3CON, DMA3REQ, DMA3STA, DMA3STB, DMA3PAD, DMA3CNT*/
void OpenDMA4(unsigned int config,unsigned int irq,unsigned int sta_address,
unsigned int stb_address,unsigned int pad_adress,unsigned int count ) __attribute__ ((section (".libperi")));
/* configures the DMA4 registers: DMA4CON, DMA4REQ, DMA4STA, DMA4STB, DMA4PAD, DMA4CNT*/
void OpenDMA5(unsigned int config,unsigned int irq,unsigned int sta_address,
unsigned int stb_address,unsigned int pad_adress,unsigned int count ) __attribute__ ((section (".libperi")));
/* configures the DMA5 registers: DMA5CON, DMA5REQ, DMA5STA, DMA5STB, DMA5PAD, DMA5CNT*/
void OpenDMA6(unsigned int config,unsigned int irq,unsigned int sta_address,
unsigned int stb_address,unsigned int pad_adress,unsigned int count ) __attribute__ ((section (".libperi")));
/* configures the DMA6 registers: DMA6CON, DMA6REQ, DMA6STA, DMA6STB, DMA6PAD, DMA6CNT*/
void OpenDMA7(unsigned int config,unsigned int irq,unsigned int sta_address,
unsigned int stb_address,unsigned int pad_adress,unsigned int count ) __attribute__ ((section (".libperi")));
/* configures the DMA7 registers: DMA7CON, DMA7REQ, DMA7STA, DMA7STB, DMA7PAD, DMA7CNT*/
char PingPongStatusDMA0(void) __attribute__ ((section (".libperi"))); /* returns the register selected for ping-pong*/
char PingPongStatusDMA1(void) __attribute__ ((section (".libperi"))); /* returns the register selected for ping-pong*/
char PingPongStatusDMA2(void) __attribute__ ((section (".libperi"))); /* returns the register selected for ping-pong*/
char PingPongStatusDMA3(void) __attribute__ ((section (".libperi"))); /* returns the register selected for ping-pong*/
char PingPongStatusDMA4(void) __attribute__ ((section (".libperi"))); /* returns the register selected for ping-pong*/
char PingPongStatusDMA5(void) __attribute__ ((section (".libperi"))); /* returns the register selected for ping-pong*/
char PingPongStatusDMA6(void) __attribute__ ((section (".libperi"))); /* returns the register selected for ping-pong*/
char PingPongStatusDMA7(void) __attribute__ ((section (".libperi"))); /* returns the register selected for ping-pong*/
char WriteCollisionDMA0(void) __attribute__ ((section (".libperi")));
/* returns the channel 0 DMA RAM write collision detect */
char WriteCollisionDMA1(void) __attribute__ ((section (".libperi")));
/* returns the channel 1 DMA RAM write collision detect */
char WriteCollisionDMA2(void) __attribute__ ((section (".libperi")));
/* returns the channel 2 DMA RAM write collision detect */
char WriteCollisionDMA3(void) __attribute__ ((section (".libperi")));
/* returns the channel 3 DMA RAM write collision detect */
char WriteCollisionDMA4(void) __attribute__ ((section (".libperi")));
/* returns the channel 4 DMA RAM write collision detect */
char WriteCollisionDMA5(void) __attribute__ ((section (".libperi")));
/* returns the channel 5 DMA RAM write collision detect */
char WriteCollisionDMA6(void) __attribute__ ((section (".libperi")));
/* returns the channel 6 DMA RAM write collision detect */
char WriteCollisionDMA7(void) __attribute__ ((section (".libperi")));
/* returns the channel 7 DMA RAM write collision detect */
char WriteCollisionPeripheral0(void) __attribute__ ((section (".libperi")));
/* returns the channel0 peripheral write collision flag bit*/
char WriteCollisionPeripheral1(void) __attribute__ ((section (".libperi")));
/* returns the channel1 peripheral write collision flag bit*/
char WriteCollisionPeripheral2(void) __attribute__ ((section (".libperi")));
/* returns the channel2 peripheral write collision flag bit*/
char WriteCollisionPeripheral3(void) __attribute__ ((section (".libperi")));
/* returns the channel3 peripheral write collision flag bit*/
char WriteCollisionPeripheral4(void) __attribute__ ((section (".libperi")));
/* returns the channel4 peripheral write collision flag bit*/
char WriteCollisionPeripheral5(void) __attribute__ ((section (".libperi")));
/* returns the channel5 peripheral write collision flag bit*/
char WriteCollisionPeripheral6(void) __attribute__ ((section (".libperi")));
/* returns the channel6 peripheral write collision flag bit*/
char WriteCollisionPeripheral7(void) __attribute__ ((section (".libperi")));
/* returns the channel7 peripheral write collision flag bit*/
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -