#include "fx2regs.h" int main() { // disconnect from USB USBCS |= bmDISCON; // allow the hardware to handle all usb endpoint 0 control USBCS &= ~(bmRENUM); // enable the output clock and set to 48mhz IFCONFIG |= bmIFCLKOE | bm3048MHZ; // enable the fifo's for external bulk end-points IFCONFIG |= bmIFCFG0 | bmIFCFG1; // configure all end-points with 8bit & auto in EP2FIFOCFG |= bmAUTOOUT; EP4FIFOCFG |= bmAUTOOUT; EP6FIFOCFG |= bmAUTOOUT; EP8FIFOCFG |= bmAUTOOUT; EP2FIFOCFG &= ~(bmWORDWIDE); EP4FIFOCFG &= ~(bmWORDWIDE); EP6FIFOCFG &= ~(bmWORDWIDE); EP8FIFOCFG &= ~(bmWORDWIDE); // TODO do i need to conifgure auto-out? // TODO does cpu setup EPnCFG? (even the defaults will work for now) // reconnect to USB USBCS &= ~(bmDISCON); return 0; }