⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dspsyscfg_c.c

📁 使用5509A的usb的程序代码
💻 C
字号:
/*   Do *not* directly modify this file.  It was    *//*   generated by the Configuration Tool; any  *//*   changes risk being overwritten.                *//* INPUT DspSys.cdb *//*  Include Header File  */#include "DspSyscfg.h"#ifdef __cplusplus#pragma CODE_SECTION(".text:CSL_cfgInit")#else#pragma CODE_SECTION(CSL_cfgInit,".text:CSL_cfgInit")#endif#ifdef __cplusplus#pragma FUNC_EXT_CALLED()#else#pragma FUNC_EXT_CALLED(CSL_cfgInit)#endif#define N     4extern Uint16 databuffer0;extern Uint16 databuffer1;extern Uint16 databuffer2;extern void USB_ctl_handler();extern void USB_ctl_handler();extern void USB_bulkOutEvHandler();extern void USB_bulkInEvHandler();USB_EpObj* myUsbConfig[N+1];static int _cslUsbIndex_ = 0;/*  Config Structures */DMA_Config dmaCfg0 = {    0x0009,        /*  Source Destination Register (CSDP)  */    0x4060,        /*  Control Register (CCR)  */    0x0008,        /*  Interrupt Control Register (CICR)  */    (DMA_AdrPtr)0x100000,        /*  Lower Source Address (CSSA_L)- Numeric(Byte Address)  */    0x0010,        /*  Upper Source Address (CSSA_U) - Numeric(Byte Address)  */    (DMA_AdrPtr)&databuffer0,        /*  Lower Destination Address (CDSA_L) - Symbolic(Byte Address)  */    NULL,        /*  Upper Destination Address (CDSA_U) - Symbolic(Byte Address)  */    0x0800,        /*  Element Number (CEN)  */    0x0001,        /*  Frame Number (CFN)  */    0x0000,        /*  Frame Index (CFI)  */    0x0000         /*  Element Index (CEI)  */};DMA_Config dmaCfg1 = {    0x0009,        /*  Source Destination Register (CSDP)  */    0x4200,        /*  Control Register (CCR)  */    0x0020,        /*  Interrupt Control Register (CICR)  */    (DMA_AdrPtr)0x100000,        /*  Lower Source Address (CSSA_L)- Numeric(Byte Address)  */    0x0010,        /*  Upper Source Address (CSSA_U) - Numeric(Byte Address)  */    (DMA_AdrPtr)&databuffer1,        /*  Lower Destination Address (CDSA_L) - Symbolic(Byte Address)  */    NULL,        /*  Upper Destination Address (CDSA_U) - Symbolic(Byte Address)  */    0x0800,        /*  Element Number (CEN)  */    0x0001,        /*  Frame Number (CFN)  */    0x0000,        /*  Frame Index (CFI)  */    0x0000         /*  Element Index (CEI)  */};DMA_Config dmaCfg2 = {    0x0009,        /*  Source Destination Register (CSDP)  */    0x0060,        /*  Control Register (CCR)  */    0x0008,        /*  Interrupt Control Register (CICR)  */    (DMA_AdrPtr)0x100000,        /*  Lower Source Address (CSSA_L)- Numeric(Byte Address)  */    0x0010,        /*  Upper Source Address (CSSA_U) - Numeric(Byte Address)  */    (DMA_AdrPtr)&databuffer2,        /*  Lower Destination Address (CDSA_L) - Symbolic(Byte Address)  */    NULL,        /*  Upper Destination Address (CDSA_U) - Symbolic(Byte Address)  */    0x0800,        /*  Element Number (CEN)  */    0x0001,        /*  Frame Number (CFN)  */    0x0000,        /*  Frame Index (CFI)  */    0x0000         /*  Element Index (CEI)  */};EMIF_Config emifCfg0 = {    0x0220,        /*  Global Control Register   */    0x0000,        /*  Global Reset Register   */    0x1111,        /*  CE0 Space Control Register 1   */    0x7fff,        /*  CE0 Space Control Register 2   */    0x0001,        /*  CE0 Space Control Register 3   */    0x1fff,        /*  CE1 Space Control Register 1   */    0x5fff,        /*  CE1 Space Control Register 2   */    0x0000,        /*  CE1 Space Control Register 3   */    0x3fff,        /*  CE2 Space Control Register 1   */    0x5fff,        /*  CE2 Space Control Register 2   */    0x5fff,        /*  CE2 Space Control Register 3   */    0x3fff,        /*  CE3 Space Control Register 1   */    0x5fff,        /*  CE3 Space Control Register 2   */    0x5fff,        /*  CE3 Space Control Register 3   */    0x2911,        /*  SDRAM Control Register 1   */    0x0410,        /*  SDRAM Period Register   */    0x0000,        /*  SDRAM Initialization Register   */    0x0131         /*  SDRAM Control Register 2   */};TIMER_Config timerCfg0 = {    0x0030,        /*  Timer Control Register (TCR)   */    0x383f,        /*  Timer Period Register (PRD)   */    0x0009         /*  Timer Prescalar Register (PRSC)   */};USB_EpObj usbEpObjOut0 = {    USB_OUT_EP0,        /*  Endpoint Number   */    USB_CTRL,        /*  Transfer type value   */    0x0040,        /*  Maximum Packet Size Supported by EP   */    0x003d,        /*  Event Mask   */    USB_ctl_handler,        /*  Pointer to USB event ISR   */    0x0000,        /*  Data Flags   */    0x0000,        /*  Status   */    0x6782,        /*  Endpoint descriptor reg block start addr   */    0x6680,        /*  DMA reg block start addr   */    0x0000,        /*  Total byte count   */    0x0000,        /*  Number of bytes in the active node of the linked list   */    NULL,        /*  Pointer to store the number of bytes moved in (out)   */    NULL,        /*  Active data buffer pointer   */    NULL,        /*  Pointer to NEXT Buffer   */    0x0000         /*  Event Flag   */};USB_EpObj usbEpObjIn0 = {    USB_IN_EP0,        /*  Endpoint Number   */    USB_CTRL,        /*  Transfer type value   */    0x0040,        /*  Maximum Packet Size Supported by EP   */    0x0020,        /*  Event Mask   */    USB_ctl_handler,        /*  Pointer to USB event ISR   */    0x0000,        /*  Data Flags   */    0x0000,        /*  Status   */    0x6780,        /*  Endpoint descriptor reg block start addr   */    0x66c0,        /*  DMA reg block start addr   */    0x0000,        /*  Total byte count   */    0x0000,        /*  Number of bytes in the active node of the linked list   */    NULL,        /*  Pointer to store the number of bytes moved in (out)   */    NULL,        /*  Active data buffer pointer   */    NULL,        /*  Pointer to NEXT Buffer   */    0x0000         /*  Event Flag   */};USB_EpObj usbEpObjOut2 = {    USB_OUT_EP2,        /*  Endpoint Number   */    USB_BULK,        /*  Transfer type value   */    0x0040,        /*  Maximum Packet Size Supported by EP   */    0x0020,        /*  Event Mask   */    USB_bulkOutEvHandler,        /*  Pointer to USB event ISR   */    0x0000,        /*  Data Flags   */    0x0000,        /*  Status   */    0x6710,        /*  Endpoint descriptor reg block start addr   */    0x5810,        /*  DMA reg block start addr   */    0x0000,        /*  Total byte count   */    0x0000,        /*  Number of bytes in the active node of the linked list   */    NULL,        /*  Pointer to store the number of bytes moved in (out)   */    NULL,        /*  Active data buffer pointer   */    NULL,        /*  Pointer to NEXT Buffer   */    0x0000         /*  Event Flag   */};USB_EpObj usbEpObjIn2 = {    USB_IN_EP2,        /*  Endpoint Number   */    USB_BULK,        /*  Transfer type value   */    0x0040,        /*  Maximum Packet Size Supported by EP   */    0x0021,        /*  Event Mask   */    USB_bulkInEvHandler,        /*  Pointer to USB event ISR   */    0x0000,        /*  Data Flags   */    0x0000,        /*  Status   */    0x6750,        /*  Endpoint descriptor reg block start addr   */    0x5850,        /*  DMA reg block start addr   */    0x0000,        /*  Total byte count   */    0x0000,        /*  Number of bytes in the active node of the linked list   */    NULL,        /*  Pointer to store the number of bytes moved in (out)   */    NULL,        /*  Active data buffer pointer   */    NULL,        /*  Pointer to NEXT Buffer   */    0x0000         /*  Event Flag   */};/*  Handles  */DMA_Handle hDma0;DMA_Handle hDma1;DMA_Handle hDma2;TIMER_Handle hTimer1;/* *  ======== CSL_cfgInit() ========   */void CSL_cfgInit(){    dmaCfg0.dmacdsal = (DMA_AdrPtr)(((Uint32)(&databuffer0) << 1) & 0xFFFF);    dmaCfg0.dmacdsau = (Uint16)((Uint32)(&databuffer0) >> 15);    dmaCfg1.dmacdsal = (DMA_AdrPtr)(((Uint32)(&databuffer1) << 1) & 0xFFFF);    dmaCfg1.dmacdsau = (Uint16)((Uint32)(&databuffer1) >> 15);    dmaCfg2.dmacdsal = (DMA_AdrPtr)(((Uint32)(&databuffer2) << 1) & 0xFFFF);    dmaCfg2.dmacdsau = (Uint16)((Uint32)(&databuffer2) >> 15);    hDma0 = DMA_open(DMA_CHA0, DMA_OPEN_RESET);    hDma1 = DMA_open(DMA_CHA1, DMA_OPEN_RESET);    hDma2 = DMA_open(DMA_CHA2, DMA_OPEN_RESET);    hTimer1 = TIMER_open(TIMER_DEV1, TIMER_OPEN_RESET);    myUsbConfig[_cslUsbIndex_++] = &usbEpObjOut0;    myUsbConfig[_cslUsbIndex_++] = &usbEpObjIn0;    myUsbConfig[_cslUsbIndex_++] = &usbEpObjOut2;    myUsbConfig[_cslUsbIndex_++] = &usbEpObjIn2;            DMA_config(hDma0, &dmaCfg0);    DMA_config(hDma1, &dmaCfg1);    DMA_config(hDma2, &dmaCfg2);    EMIF_config(&emifCfg0);    TIMER_config(hTimer1, &timerCfg0);    /* You must use DMA_start() in your main code to start the DMA. */	        /* You must use MCBSP_start() in your main code to start the MCBSP. */        /* You must use RTC_start() in your main code to start the RTC. */        /* You must use WDTIM_start() in your main code to start the WDTIM. */}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -