📄 descriptordma_ppi.h
字号:
/******************************************************************************************************************/
/* Descriptor based DMA parameter customizations. Modify these parameters to */
/* suit your specific needs. */
/******************************************************************************************************************/
void Init_DMA (volatile short *, volatile int *);
//#define DESCRIPT_ARRAY //Uncomment for descriptor array mode -- steps through descriptors sequentially, as in an array
#define SMALL_DESCRIPT //Uncomment for small descriptor model -- all descriptors confined to 64K page in memory
//#define LARGE_DESCRIPT //Uncomment for small descriptor model -- max. flexibility in placing descriptors in memory
#define INTERRUPT_ENABLE //Uncomment to enable interrupt. Otherwise, no DMA interrupts.
#define TWO_D //Uncomment for 2D DMA. Otherwise, 1D is used.
//#define INT_INNER_LOOP //Uncomment for interrupting every row (applies to 2D only). Otherwise, interrupt at end of whole buffer.
//#define DISCARD_FIFO //Uncomment if discard FIFO. Otherwise, retain.
//#define BITS_8 //Uncomment for 8-bit DMA.
//#define BITS_16 //Uncomment for 16-bit DMA.
#define BITS_32 //Uncomment for 32-bit DMA.
//#define RX_DIRECTION //Uncomment for rx direction. Otherwise, tx direction.
/********************************************************************************************/
/* In descriptor based DMA, the descriptor size can vary from 1 entry to 9 entries. It is */
/* up to the individual application to determine the descriptor size. The following macros */
/* allow you to specify the size of descriptors, as well as, which DMA parameters you'd */
/* like to include as entries in your descriptor block. If in each descriptor block, some */
/* parameters remain the same throughout (static), then you do not need to write these */
/* parameters in the descriptor entry. */
/********************************************************************************************/
#define SAL //Uncomment if you want to include this entry in your descriptors. Applicable for all descriptor modes.
#define SAH //Uncomment if you want to include this entry in your descriptors. Applicable for all descriptor modes.
#define NDPL //Uncomment if using either small or large descriptor list mode.
//#define NDPH //Uncomment only if using large descripter list mode.
#define ENABLE_DMA 1 //Uncomment to enable DMA.
/*******************************************************************************************/
#ifdef DESCRIPT_ARRAY
#define DESCRIPT_FLOW 0x4000
#else
#ifdef SMALL_DESCRIPT
#define DESCRIPT_FLOW 0x6000
#else
#ifdef LARGE_DESCRIPT
#define DESCRIPT_FLOW 0x7000
#endif
#endif
#endif
#ifdef INTERRUPT_ENABLE
#ifdef INT_INNER_LOOP
#ifdef DISCARD_FIFO
#ifdef TWO_D
#ifdef RX_DIRECTION
#define SET_CON 0x00F2
#else
#define SET_CON 0x00F0
#endif
#else
#ifdef RX_DIRECTION
#define SET_CON 0x00E2
#else
#define SET_CON 0x00E0
#endif
#endif
#else
#ifdef TWO_D
#ifdef RX_DIRECTION
#define SET_CON 0x00D2
#else
#define SET_CON 0x00D0
#endif
#else
#ifdef RX_DIRECTION
#define SET_CON 0x00C2
#else
#define SET_CON 0x00C0
#endif
#endif
#endif
#else
#ifdef DISCARD_FIFO
#ifdef TWO_D
#ifdef RX_DIRECTION
#define SET_CON 0x00B2
#else
#define SET_CON 0x00B0
#endif
#else
#ifdef RX_DIRECTION
#define SET_CON 0x00A2
#else
#define SET_CON 0x00A0
#endif
#endif
#else
#ifdef TWO_D
#ifdef RX_DIRECTION
#define SET_CON 0x0092
#else
#define SET_CON 0x0090
#endif
#else
#ifdef RX_DIRECTION
#define SET_CON 0x0082
#else
#define SET_CON 0x0080
#endif
#endif
#endif
#endif
#else
#ifdef DISCARD_FIFO
#ifdef TWO_D
#ifdef RX_DIRECTION
#define SET_CON 0x0032
#else
#define SET_CON 0x0030
#endif
#else
#ifdef RX_DIRECTION
#define SET_CON 0x0022
#else
#define SET_CON 0x0020
#endif
#endif
#else
#ifdef TWO_D
#ifdef RX_DIRECTION
#define SET_CON 0x0012
#else
#define SET_CON 0x0010
#endif
#else
#ifdef RX_DIRECTION
#define SET_CON 0x0002
#else
#define SET_CON 0x0000
#endif
#endif
#endif
#endif
#ifdef BITS_8
#define DMA_CONFIG SET_CON|DESCRIPT_FLOW|ENABLE_DMA
#endif
#ifdef BITS_16
#define DMA_CONFIG SET_CON|0x0004|DESCRIPT_FLOW|ENABLE_DMA
#endif
#ifdef BITS_32
#define DMA_CONFIG SET_CON|0x0008|DESCRIPT_FLOW|ENABLE_DMA
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -