00001 /* ---------------------------------------------------------------------------- 00002 * SAM Software Package License 00003 * ---------------------------------------------------------------------------- 00004 * Copyright (c) 2014, Atmel Corporation 00005 * 00006 * All rights reserved. 00007 * 00008 * Redistribution and use in source and binary forms, with or without 00009 * modification, are permitted provided that the following conditions are met: 00010 * 00011 * - Redistributions of source code must retain the above copyright notice, 00012 * this list of conditions and the disclaimer below. 00013 * 00014 * Atmel's name may not be used to endorse or promote products derived from 00015 * this software without specific prior written permission. 00016 * 00017 * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR 00018 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00019 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 00020 * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, 00021 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00022 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 00023 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00024 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00025 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 00026 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00027 * ---------------------------------------------------------------------------- 00028 */ 00029 00030 /** 00031 * \file 00032 * 00033 * Single CDC Serial Port Function for USB device & composite driver. 00034 */ 00035 00036 #ifndef CDCDSERIAL_H 00037 #define CDCDSERIAL_H 00038 00039 /** \addtogroup usbd_cdc 00040 *@{ 00041 */ 00042 00043 /*------------------------------------------------------------------------------ 00044 * Headers 00045 *------------------------------------------------------------------------------*/ 00046 00047 /* These headers were introduced in C99 00048 by working group ISO/IEC JTC1/SC22/WG14. */ 00049 #include <stdint.h> 00050 00051 #include <USBRequests.h> 00052 00053 #include <USBDDriver.h> 00054 #include <CDCDSerialPort.h> 00055 00056 /*------------------------------------------------------------------------------ 00057 * Definitions 00058 *------------------------------------------------------------------------------*/ 00059 00060 /*------------------------------------------------------------------------------ 00061 * Types 00062 *------------------------------------------------------------------------------*/ 00063 00064 /*------------------------------------------------------------------------------ 00065 * Exported functions 00066 *------------------------------------------------------------------------------*/ 00067 00068 extern void CDCDSerial_Initialize( 00069 USBDDriver * pUsbd, uint8_t bInterfaceNb); 00070 00071 extern uint32_t CDCDSerial_RequestHandler( 00072 const USBGenericRequest *request); 00073 00074 extern void CDCDSerial_ConfigureFunction( 00075 USBGenericDescriptor * pDescriptors, uint16_t wLength); 00076 00077 extern uint32_t CDCDSerial_Write( 00078 void *data, 00079 uint32_t size, 00080 TransferCallback callback, 00081 void *argument); 00082 00083 extern uint32_t CDCDSerial_Read( 00084 void *data, 00085 uint32_t size, 00086 TransferCallback callback, 00087 void *argument); 00088 00089 extern void CDCDSerial_GetLineCoding(CDCLineCoding * pLineCoding); 00090 00091 extern uint8_t CDCDSerial_GetControlLineState(void); 00092 00093 extern uint16_t CDCDSerial_GetSerialState(void); 00094 00095 extern void CDCDSerial_SetSerialState(uint16_t serialState); 00096 00097 extern uint8_t CDCDSerial_LineCodingIsToChange( 00098 CDCLineCoding * pLineCoding); 00099 00100 extern void CDCDSerial_ControlLineStateChanged( 00101 uint8_t DTR,uint8_t RTS); 00102 00103 /**@}*/ 00104 00105 #endif /*#ifndef CDCSERIAL_H*/ 00106