- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello ,
I am running a demo which uses the usb device controller in the kit . The PC is acting as a host and the kit as a usb device . This is the main file :
LCD_Test();
disable();
disconnect_USB();
usleep(1000000);
Hal4D13_ResetDevice();
bUSBCheck_Device_State.State_bits.DEVICE_DEFAULT_STATE = 1;
bUSBCheck_Device_State.State_bits.DEVICE_ADDRESS_STATE = 0;
bUSBCheck_Device_State.State_bits.DEVICE_CONFIGURATION_STATE = 0;
bUSBCheck_Device_State.State_bits.RESET_BITS = 0;
usleep(1000000);
reconnect_USB();
CHECK_CHIP_ID();
Hal4D13_AcquireD13(USB_DC_IRQ,(void*)usb_isr);
enable();
bD13flags.bits.verbose=1;
while (1)
{
if (bUSBCheck_Device_State.State_bits.RESET_BITS == 1)
{
disable();
break;
}
if (bD13flags.bits.suspend)
{
disable();
bD13flags.bits.suspend= 0;
enable();
suspend_change();
} // Suspend Change Handler
if (bD13flags.bits.DCP_state == USBFSM4DCP_SETUPPROC)
{
disable();
SetupToken_Handler();
enable();
} // Setup Token Handler
if ((bD13flags.bits.DCP_state == USBFSM4DCP_REQUESTPROC) && !ControlData.Abort)
{
disable();
bD13flags.bits.DCP_state = 0x00;
DeviceRequest_Handler();
enable();
} // Device Request Handler
usleep(1);
}
return 0;
}
I know what functions generally do but I hope that somebody explains why it's written in that sequence and I don't understand how the driver generally works .
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
read this code carefully···
![](/skins/images/C4F7392A5C68ACA60290C9576F107044/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page