Contiki 2.5
uart_usb_lib.h
1 /* This file has been prepared for Doxygen automatic documentation generation.*/
2 /*! \file uart_usb_lib.c *******************************************************
3  *
4  * \brief
5  * This file controls the UART USB functions.
6  *
7  * \addtogroup usbstick
8  *
9  * \author
10  * Atmel Corporation: http://www.atmel.com \n
11  * Support email: avr@atmel.com
12  *
13  ******************************************************************************/
14 /* Copyright (c) 2008 ATMEL Corporation
15  All rights reserved.
16 
17  Redistribution and use in source and binary forms, with or without
18  modification, are permitted provided that the following conditions are met:
19 
20  * Redistributions of source code must retain the above copyright
21  notice, this list of conditions and the following disclaimer.
22  * Redistributions in binary form must reproduce the above copyright
23  notice, this list of conditions and the following disclaimer in
24  the documentation and/or other materials provided with the
25  distribution.
26  * Neither the name of the copyright holders nor the names of
27  contributors may be used to endorse or promote products derived
28  from this software without specific prior written permission.
29 
30  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
31  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
34  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
35  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
36  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
37  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
38  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
39  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
40  POSSIBILITY OF SUCH DAMAGE.
41 */
42 
43 #ifndef _UART_USB_LIB_H_
44 #define _UART_USB_LIB_H_
45 
46 /**
47  \addtogroup cdctask
48  @{
49  */
50 
51 /*_____ I N C L U D E S ____________________________________________________*/
52 
53 
54 /*_____ M A C R O S ________________________________________________________*/
55 
56 
57 #ifdef UART_USB_DEFAULT_OUTPUT
58 #define uart_usb_putchar putchar
59 #endif
60 
61 /*_____ D E F I N I T I O N ________________________________________________*/
62 
63 typedef struct
64 {
65  U32 dwDTERate;
66  U8 bCharFormat;
67  U8 bParityType;
68  U8 bDataBits;
69 }S_line_coding;
70 
71 
72 /*_____ D E C L A R A T I O N ______________________________________________*/
73 
74 void uart_usb_init(void);
75 bit uart_usb_tx_ready(void);
76 int uart_usb_putchar(int);
77 void uart_usb_flush(void);
78 bit uart_usb_test_hit(void);
79 char uart_usb_getchar(void);
80 void uart_usb_set_stdout(void);
81 uint8_t uart_usb_get_control_line_state(void);
82 void uart_usb_set_control_line_state(uint8_t control_line_state);
83 
84 extern void uart_usb_configure_endpoints();
85 
86 /** @} **/
87 
88 #endif /* _UART_USB_LIB_H_ */
89 
90