On 09/10/14 19:08, dumdum4413 wrote:
> I am still confused about a few things
> 1: I am assuming the interrupt is enabled so the AVR can do other things
> where there is no data going back and forth on the USB.
Yes, exactly so. It provides a driver for the AVR-libc stdio.h
implementation so you can use putc, getc, printf, scanf etc to do
buffered serial IO over USB via stdin/stdout.
> 2: What do I have to do to eliminate the joystick, and the LED's as they
> are not used in this application?
You need to remove the USB device descriptors for everything other than
the things you need, see the top of
http://sourceforge.net/p/abavr/lib/ci/default/tree/USBSerial/usb_serial.c for
example. The rest of the code in there defines the handlers and
callbacks that LUFA requires, and implements a driver that hooks it all
into the AVR-libc stdio implementation.
> 3: Where exactly is the point of handoff between the USB and the main part
> of my program? Meaning, where do I put data to be sent out the USB, and
> vice versa?
You need first to initialise the handler:
USBSerial usbSerial(USB_SERIAL_IN_RAW | USB_SERIAL_OUT_TEXT);
Then provided you call the run() method regularly to do the normal LUFA
handling tasks you'll be able to use stdio functions to do IO to the USB
device
For a working example see
http://sourceforge.net/p/abavr/apps/ci/default/tree/MinimusCDCSerialDemo/main.cpp
--
Alan Burlison
--