Hello when i want Using usb host and usb device in a program with lpc1788 , i add usbd_lpc17x_8x & usbh_ohci_177x_8x.c to my project but function usb_irqhandle define in both file how solve this conflict?
If you can try latest middleware and latest LPC1700_DFP pack, if not look into drivers in latest LPC1700_DFP pack. Anyways, you will have to make a common USB IRQ handler that will dispatch interrupts to corresponding USB Device or USB Host IRQ handler, depending on interrupt that happened.
I have a Keil 4.7.4 how I can find out which interupt happend?
Correct me if I'm wrong, but doesn't your chip only have one USB unit?
"USB 2.0 full-speed controller that can be configured for either device, Host, or OTG operation with an on-chip PHY for device and Host functions and a dedicated DMA controller."
So shouldn't your program then know what mode the USB unit is currently in, so you know which set of registers to look at for further decisions?
I set first USB devise mode and the second one host and I combine their interrupt (they interrupt happen in same time).. when can I know the interrupt happens does it belong to host or device?
Try downloading and installing last LPC1700_DFP pack from http://www.keil.com/dd2/pack/
and look into drivers for USB to get an idea.
I downloaded Keil.LPC1700_DFP.2.0.0.pack and install it but the question is how can I find that driver location?
c:\Keil\ARM\Pack\Keil\LPC1700_DFP\2.1.0\RTE_Driver\
files: OTG_LPC17xx.c, USBD_LPC17xx.c and USBH_LPC17xx.c