📄 dsk5510_dma_mcbsp16_aic23.tci
字号:
/*
* Copyright 2002 by Spectrum Digital Incorporated.
* All rights reserved. Property of Spectrum Digital Incorporated.
*/
/*
* ======== dsk5510_dma_mcbsp16_aic23.tci ========
*/
/*
* Configure DMA transmit and receive for AIC23 codec audio data on the
* 5510 DSK. Configure DMA Channel 4 to receive data from the codec and
* channel 5 to transmit data to the codec.
*/
/*
* ======== dmaCfgReceive ========
* DMA congfiguration for Mcbsp receive channel. Configure to receive a
* codec data from from McBSP2 and put it in a buffer in DARAM.
*/
dmaCfgReceive = DMA.create("dmaCfgReceive");
dmaCfgReceive.dmaSetManually = 1;
dmaCfgReceive.dmaCsdp = 0x020d; /* Source and Destination Parameters */
/* DST BEN = 00b, no bursts */
/* DST PACK = 0, no packing */
/* DST = xx01b, DARAM */
/* SRC BEN = 0, no bursts */
/* SRC PACK = 0, no packing */
/* SRC = xx11b, peripheral bus */
/* DATA TYPE = 01b, 16-bit */
dmaCfgReceive.dmaCcr = 0x4049; /* Channel Control */
/* DST AMODE = 01b, post-increment */
/* SRC AMODE = 00b, constant */
/* END PROG = 0, not used */
/* REPEAT = 0, not used */
/* AUTOINIT = 0, no auto-init */
/* EN = 0, don't enable (the app will enable when ready) */
/* PRIO = 1, high priority */
/* FS = 0, element synchronization */
/* SYNC = 1001b, sync to McBSP2 receive event */
dmaCfgReceive.dmaCicr = 0x0008; /* Interrupt Control */
/* FRAME IE = 1, enable interrupt on frame complete */
dmaCfgReceive.dmaSrcSpaceAdv = "Data Space"; /* Source Address Space */
/* Source address is in data space */
dmaCfgReceive.dmaSrcAddrFormatAdv = "Numeric"; /* Source Address Format */
/* Source address format is numeric (not symbolic) */
dmaCfgReceive.dmaCssalNumeric = 0x6002; /* Source Address (lower)*/
/* Source address (lower) is byte address 0x6002 (McBSP2 DRR1) */
dmaCfgReceive.dmaCssauNumeric = 0x0000; /* Source Address (upper) */
/* Source address (upper) is 0 */
dmaCfgReceive.dmaDstSpaceAdv = "Data Space"; /* Destination Address Space */
/* Destination is in data space */
dmaCfgReceive.dmaDstAddrFormatAdv = "Numeric"; /* Destination Address Format */
/* Destination address format is numeric (not symbolic) */
dmaCfgReceive.dmaCdsalNumeric = 0x0000; /* Destination Address (lower) */
/* Destination address (lower) is 0, filled by app later */
dmaCfgReceive.dmaCdsauNumeric = 0x0000; /* Destination Address (upper) */
/* Destination address (upper) is 0, filled by app later */
dmaCfgReceive.dmaCenAdv = 0x0100; /* Channel Element Count */
/* CEN = 256, 256 elements per frame */
dmaCfgReceive.dmaCfnAdv = 0x0001; /* Channel Frame Count */
/* CFN = 1, 1 frame per block */
dmaCfgReceive.dmaSetManually = 0;
/*
* ======== dmaCfgTransmit ========
* DMA congfiguration for Mcbsp transmit channel. Configure to transmit a
* frame to McBSP2 from a buffer in DARAM.
*/
dmaCfgTransmit = DMA.create("dmaCfgTransmit");
dmaCfgTransmit.dmaSetManually = 1;
dmaCfgTransmit.dmaCsdp = 0x0605; /* Source and Destination Parameters */
/* DST BEN = 00b, no bursts */
/* DST PACK = 0, no packing */
/* DST = xx11b, peripheral bus */
/* SRC BEN = 0, no bursts */
/* SRC PACK = 0, no packing */
/* SRC = xx01b, DARAM */
/* DATA TYPE = 01b, 16-bit */
dmaCfgTransmit.dmaCcr = 0x104a; /* Channel Control */
/* DST AMODE = 00b, constant */
/* SRC AMODE = 01b, post-increment */
/* END PROG = 0, not used */
/* REPEAT = 0, not used */
/* AUTOINIT = 0, no auto-init */
/* EN = 0, don't enable (the app will enable when ready) */
/* PRIO = 1, high priority */
/* FS = 0, element synchronization */
/* SYNC = 1010b, sync to McBSP2 transmit event */
dmaCfgTransmit.dmaCicr = 0x0008; /* Interrupt Control */
/* FRAME IE = 1, enable interrupt on frame complete */
dmaCfgTransmit.dmaSrcSpaceAdv = "Data Space"; /* Source Address Space */
/* Source address is in data space */
dmaCfgTransmit.dmaSrcAddrFormatAdv = "Numeric"; /* Source Address Format */
/* Source address format is numeric (not symbolic) */
dmaCfgTransmit.dmaCssalNumeric = 0x0000; /* Source Address (lower) */
/* Source address (lower) is 0, filled by app later */
dmaCfgTransmit.dmaCssauNumeric = 0x0000; /* Source Address (upper) */
/* Source address (upper) is 0, filled by app later */
dmaCfgTransmit.dmaDstSpaceAdv = "Data Space"; /* Destination Address Space */
/* Destination address is in data space */
dmaCfgTransmit.dmaDstAddrFormatAdv = "Numeric"; /* Destination Address Format */
/* Destination address format is number (not symbolic) */
dmaCfgTransmit.dmaCdsalNumeric = 0x6006; /* Destination Address (lower) */
/* Source address (lower) is byte address 0x6006 (McBSP2 DXR1) */
dmaCfgTransmit.dmaCdsauNumeric = 0x0000; /* Destiantion Address (upper) */
/* Source address (lower) is 0 */
dmaCfgTransmit.dmaCenAdv = 0x0100; /* Channel Element Count */
/* CEN = 256, 256 elements per frame */
dmaCfgTransmit.dmaCfnAdv = 0x0001; /* Channel Frame Count */
/* CFN = 1, 1 frame per block */
dmaCfgTransmit.dmaSetManually = 0;
/*
* ======== DMA4 ========
* Mcbsp transmit hooked up to DMA4 channel
*/
DMA4.dmaHandleEnable = 1;
DMA4.dmaHandleName = "C55XX_DMA_MCBSP_hDmaRx";
DMA4.dmaEnablePreInit = 1;
DMA4.dmaPreInit = prog.get("dmaCfgReceive");
/*
* ======== DMA5 ========
* Mcbsp receive hooked up to DMA5 channel
*/
DMA5.dmaHandleEnable = 1;
DMA5.dmaHandleName = "C55XX_DMA_MCBSP_hDmaTx";
DMA5.dmaEnablePreInit = 1;
DMA5.dmaPreInit = prog.get("dmaCfgTransmit");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -