LUFA Library - Dual Virtual Serial Device Demo
|
#include "EssaiSerial.h"
Functions | |
int | main (void) |
void | SetupHardware (void) |
void | EVENT_USB_Device_Connect (void) |
void | EVENT_USB_Device_Disconnect (void) |
void | EVENT_USB_Device_ConfigurationChanged (void) |
void | EVENT_USB_Device_ControlRequest (void) |
void | CDC1_Task (void) |
void | CDC2_Task (void) |
Variables | |
static CDC_LineEncoding_t | LineEncoding1 |
static CDC_LineEncoding_t | LineEncoding2 |
Main source file for the DualVirtualSerial demo. This file contains the main tasks of the demo and is responsible for the initial application hardware configuration.
void CDC1_Task | ( | void | ) |
Function to manage CDC data transmission and reception to and from the host for the first CDC interface, which sends joystick movements to the host as ASCII strings.
void CDC2_Task | ( | void | ) |
Function to manage CDC data transmission and reception to and from the host for the second CDC interface, which echoes back all data sent to it from the host.
void EVENT_USB_Device_ConfigurationChanged | ( | void | ) |
Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration of the USB device after enumeration - the device endpoints are configured and the CDC management tasks are started.
void EVENT_USB_Device_Connect | ( | void | ) |
Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and starts the library USB task to begin the enumeration and USB management process.
void EVENT_USB_Device_ControlRequest | ( | void | ) |
Event handler for the USB_ControlRequest event. This is used to catch and process control requests sent to the device from the USB host before passing along unhandled control requests to the library for processing internally.
void EVENT_USB_Device_Disconnect | ( | void | ) |
Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via the status LEDs and stops the USB management and CDC management tasks.
int main | ( | void | ) |
Main program entry point. This routine configures the hardware required by the application, then enters a loop to run the application tasks in sequence.
void SetupHardware | ( | void | ) |
Configures the board hardware and chip peripherals for the demo's functionality.
|
static |
Contains the current baud rate and other settings of the first virtual serial port. While this demo does not use the physical USART and thus does not use these settings, they must still be retained and returned to the host upon request or the host will assume the device is non-functional.
These values are set by the host via a class-specific request, however they are not required to be used accurately. It is possible to completely ignore these value or use other settings as the host is completely unaware of the physical serial link characteristics and instead sends and receives data in endpoint streams.
|
static |
Contains the current baud rate and other settings of the second virtual serial port. While this demo does not use the physical USART and thus does not use these settings, they must still be retained and returned to the host upon request or the host will assume the device is non-functional.
These values are set by the host via a class-specific request, however they are not required to be used accurately. It is possible to completely ignore these value or use other settings as the host is completely unaware of the physical serial link characteristics and instead sends and receives data in endpoint streams.