A quick summary of the files required to get this to play nice in PE:
drag the USB-DRV folder into the files pane
into the user modules folder in the files pane I dragged:
hid_usb_config.h
hid.c
hid.h
hid_usb_config.c
target.c
There is the issue of PE wanting to generate the isr vectors. I used an interrupt vector bean to create a USB vector to usb_it_handler. there is still a clash when running the bdm loader, but it works. (vector is defined twice)
I edited the following
hid_usb_config.h: EP0_PACKET_SIZE
hid.c MAX_REPORT_LENGTH
hid_usb_config.c the descriptors and message length stuff
target.c i put this in for the interupt enable and disable functions.
I configured the CPU bean for the proper clock settings
in my application I put the following calls in for initialization
usb_cfg_init()
set_mode(dm_generic)
HID_init(500,0)
out_report = hid_add_report(rpt_out,0,1)
in_report = hid_add_report(rpt_in,0,32)
in my main endless loop I put:
hid_process()
in a 100ms task I put the report loader
if(!hid_report_pending(in_report)
{
...... fill up bytes in array USB_Report_In[32]
hid_write_report(in_report,USB_Report_In);
}
the above are the basics as I remember them......
Bob