Texas Instruments TMS320DM357 manual Supported Use Case Examples

Models: TMS320DM357

1 144
Download 144 pages 62.56 Kb
Page 16
Image 16

Introduction

www.ti.com

1.5Supported Use Case Examples

The USB supports the following user cases:

Detailed information about the architecture and operation of the USB controller follows in Section 2. Programming examples are also provided for each of the operational modes of the controller.

User Case 1: An example of how to initialize the USB controller

Example 1. Initializing the USB Controller

//Routine to initialize USB controller void usb_init()

{

//local loop variable

int I;

//VBUS must be controlled externally. The following routine

//should perform whatever actions are required (if any) to

//turn off VBUS in the system.

vbus_off();

//Reset the USB controller usbRegs->CTRLR = 0x00000001;

//Power on PHY and oscillator by clearing bits 2, 1, and 0 of USBPHY_CTL sysRegs->USB_PHY_CTRL = 0x000000D0;

//Clear all pending interrupts usbRegs->INTCLRR = usbRegs->INTSRCR;

// Initialize CPPI

DMA

 

 

usbRegs->RCPPICR

=

0;

//Disable

the RX DMA

usbRegs->TCPPICR

=

0;

//Disable

the TX DMA

//Initialize CPPI DMA state for(I = 0; i<4; I++) {

usbRegs->CHANNEL[i].TCPPIDMASTATEW0 = 0; usbRegs->CHANNEL[i].TCPPIDMASTATEW1 = 0; usbRegs->CHANNEL[i].TCPPIDMASTATEW2 = 0; usbRegs->CHANNEL[i].TCPPIDMASTATEW3 = 0; usbRegs->CHANNEL[i].TCPPIDMASTATEW4 = 0; usbRegs->CHANNEL[i].TCPPIDMASTATEW5 = 0; usbRegs->CHANNEL[i].RCPPIDMASTATEW0 = 0; usbRegs->CHANNEL[i].RCPPIDMASTATEW1 = 0; usbRegs->CHANNEL[i].RCPPIDMASTATEW2 = 0; usbRegs->CHANNEL[i].RCPPIDMASTATEW3 = 0; usbRegs->CHANNEL[i].RCPPIDMASTATEW4 = 0; usbRegs->CHANNEL[i].RCPPIDMASTATEW5 = 0; usbRegs->CHANNEL[i].RCPPIDMASTATEW6 = 0;

}

}

16

Universal Serial Bus (USB) Controller

SPRUGH3–November 2008

Submit Documentation Feedback

Page 16
Image 16
Texas Instruments TMS320DM357 manual Supported Use Case Examples, Example 1. Initializing the USB Controller