Xmega Application Note


main.c File Reference


Detailed Description

This application will enumerates as a CDC (communication device class) virtual COM port. The application can be used as a USB to serial converter.

Application note:
AVR1907: Xplain Evaluation Board
Documentation
For comprehensive code documentation, supported compilers, compiler settings and supported devices see readme.html
Author:
Atmel Corporation: http://www.atmel.com
Support email: avr@atmel.com
Revision
3119
Date
2010-01-12 15:53:30 +0100 (ti, 12 jan 2010)

Copyright (c) 2010, Atmel Corporation All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. The name of ATMEL may not be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file main.c.

#include "config.h"
#include "usb_task.h"
#include "cdc_task.h"
#include "usb_descriptors.h"

Include dependency graph for main.c:

Go to the source code of this file.

Functions

int main (void)
 Main routine for initializing and running the tasks.


Function Documentation

int main ( void   ) 

Main routine for initializing and running the tasks.

The sample dual role application is based on two different tasks:

  • The usb_task (usb_task.c associated source file), is the task performing the USB low level enumeration process in device mode.
  • The cdc task performs the loop back application between USB and Software USART interfaces.

Definition at line 61 of file main.c.

References cdc_task(), cdc_task_init(), Clear_prescaler, Led_init, usb_task(), and usb_task_init().

00062 {
00063         /* Initialize the LED */
00064         Led_init();
00065         
00066         /* Clear the prescaler on the device to enable a xxMHz clock, */
00067         Clear_prescaler();
00068         
00069         /* Initialize all the USB related settings. */
00070         usb_task_init();
00071         
00072         /* Initialize the CDC related settings. */
00073         cdc_task_init();
00074         
00075         /* An eternal loop to handle the USB and CDC tasks. */
00076         while(1){
00077                 usb_task();
00078                 cdc_task();
00079         };
00080 
00081 
00082 
00083 }

Here is the call graph for this function:

@DOC_TITLE@
Generated on Mon Jan 18 09:26:10 2010 for AVR1907 Xplain USB Gateway by doxygen 1.5.5