Contiki 2.6
|
00001 /* This file has been prepared for Doxygen automatic documentation generation.*/ 00002 /*! \file uart_usb_lib.c ******************************************************* 00003 * 00004 * \brief 00005 * This file controls the UART USB functions. 00006 * 00007 * \addtogroup usbstick 00008 * 00009 * \author 00010 * Atmel Corporation: http://www.atmel.com \n 00011 * Support email: avr@atmel.com 00012 * 00013 ******************************************************************************/ 00014 /* Copyright (c) 2008 ATMEL Corporation 00015 All rights reserved. 00016 00017 Redistribution and use in source and binary forms, with or without 00018 modification, are permitted provided that the following conditions are met: 00019 00020 * Redistributions of source code must retain the above copyright 00021 notice, this list of conditions and the following disclaimer. 00022 * Redistributions in binary form must reproduce the above copyright 00023 notice, this list of conditions and the following disclaimer in 00024 the documentation and/or other materials provided with the 00025 distribution. 00026 * Neither the name of the copyright holders nor the names of 00027 contributors may be used to endorse or promote products derived 00028 from this software without specific prior written permission. 00029 00030 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00031 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00032 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00033 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00034 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00035 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00036 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00037 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00038 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00039 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00040 POSSIBILITY OF SUCH DAMAGE. 00041 */ 00042 00043 #ifndef _UART_USB_LIB_H_ 00044 #define _UART_USB_LIB_H_ 00045 00046 /** 00047 \addtogroup cdctask 00048 @{ 00049 */ 00050 00051 /*_____ I N C L U D E S ____________________________________________________*/ 00052 00053 00054 /*_____ M A C R O S ________________________________________________________*/ 00055 00056 00057 #ifdef UART_USB_DEFAULT_OUTPUT 00058 #define uart_usb_putchar putchar 00059 #endif 00060 00061 /*_____ D E F I N I T I O N ________________________________________________*/ 00062 00063 typedef struct 00064 { 00065 U32 dwDTERate; 00066 U8 bCharFormat; 00067 U8 bParityType; 00068 U8 bDataBits; 00069 }S_line_coding; 00070 00071 00072 /*_____ D E C L A R A T I O N ______________________________________________*/ 00073 00074 void uart_usb_init(void); 00075 bit uart_usb_tx_ready(void); 00076 int uart_usb_putchar(int); 00077 void uart_usb_flush(void); 00078 bit uart_usb_test_hit(void); 00079 char uart_usb_getchar(void); 00080 void uart_usb_set_stdout(void); 00081 uint8_t uart_usb_get_control_line_state(void); 00082 void uart_usb_set_control_line_state(uint8_t control_line_state); 00083 00084 extern void uart_usb_configure_endpoints(); 00085 00086 /** @} **/ 00087 00088 #endif /* _UART_USB_LIB_H_ */ 00089 00090