LUFA Library - Dual Virtual Serial Device Demo
EssaiSerial.h File Reference
#include <avr/io.h>
#include <avr/wdt.h>
#include <avr/power.h>
#include <avr/interrupt.h>
#include <string.h>
#include "Descriptors.h"
#include <LUFA/Drivers/USB/USB.h>
#include <LUFA/Drivers/Board/Joystick.h>
#include <LUFA/Drivers/Board/LEDs.h>

Macros

#define LEDMASK_USB_NOTREADY   LEDS_LED1
#define LEDMASK_USB_ENUMERATING   (LEDS_LED2 | LEDS_LED3)
#define LEDMASK_USB_READY   (LEDS_LED2 | LEDS_LED4)
#define LEDMASK_USB_ERROR   (LEDS_LED1 | LEDS_LED3)

Functions

void CDC1_Task (void)
void CDC2_Task (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)

Detailed Description

Header file for DualVirtualSerial.c.

Macro Definition Documentation

#define LEDMASK_USB_ENUMERATING   (LEDS_LED2 | LEDS_LED3)

LED mask for the library LED driver, to indicate that the USB interface is enumerating.

#define LEDMASK_USB_ERROR   (LEDS_LED1 | LEDS_LED3)

LED mask for the library LED driver, to indicate that an error has occurred in the USB interface.

#define LEDMASK_USB_NOTREADY   LEDS_LED1

LED mask for the library LED driver, to indicate that the USB interface is not ready.

#define LEDMASK_USB_READY   (LEDS_LED2 | LEDS_LED4)

LED mask for the library LED driver, to indicate that the USB interface is ready.

Function Documentation

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.

void SetupHardware ( void  )

Configures the board hardware and chip peripherals for the demo's functionality.