USBLib API Guide  1.00.00.01
usbhcdc.h
Go to the documentation of this file.
1 //*****************************************************************************
2 //
3 // usbhcdc.h - This hold the host driver for CDC class.
4 //
5 // Copyright (c) 2008-2017 Texas Instruments Incorporated. All rights reserved.
6 // Software License Agreement
7 //
8 // Texas Instruments (TI) is supplying this software for use solely and
9 // exclusively on TI's microcontroller products. The software is owned by
10 // TI and/or its suppliers, and is protected under applicable copyright
11 // laws. You may not combine this software with "viral" open-source
12 // software in order to form a larger program.
13 //
14 // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
15 // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
16 // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17 // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
18 // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
19 // DAMAGES, FOR ANY REASON WHATSOEVER.
20 //
21 //*****************************************************************************
22 
23 #ifndef __USBHCDC_H__
24 #define __USBHCDC_H__
25 
26 //*****************************************************************************
27 //
28 // If building with a C++ compiler, make all of the definitions in this header
29 // have a C binding.
30 //
31 //*****************************************************************************
32 #ifdef __cplusplus
33 extern "C"
34 {
35 #endif
36 
37 //*****************************************************************************
38 //
41 //
42 //*****************************************************************************
43 
44 typedef struct tCDCInstance tCDCInstance;
45 
46 //*****************************************************************************
47 //
48 // These defines are the the events that will be passed in the \e ui32Event
49 // parameter of the callback from the driver.
50 //
51 //*****************************************************************************
52 #define CDC_EVENT_OPEN 1
53 #define CDC_EVENT_CLOSE 2
54 
55 //*****************************************************************************
56 //
57 // CDC USB requests.
58 //
59 //*****************************************************************************
60 #define USBREQ_GET_LINE_CODING 0x21
61 #define USBREQ_SET_LINE_CODING 0x20
62 #define USBREQ_SET_CONTROL_LINE_STATE 0x22
63 
64 #define USB_GET_LINE_CODING_SIZE 0x07
65 #define CDC_DEACTIVATE_CARRIER 0x00
66 #define CDC_ACTIVATE_CARRIER 0x03
67 
68 //*****************************************************************************
69 //
70 // These defines are the the events that will be passed in the ui32Event
71 // parameter of the callback from the driver.
72 //
73 //*****************************************************************************
74 
75 //
77 //
78 #define USBH_EVENT_RX_CDC_DATA USBH_CDC_EVENT_BASE + 16
79 
80 //
81 // CDC data to send
82 //
83 #define USBH_EVENT_TX_CDC_DATA USBH_CDC_EVENT_BASE + 17
84 
85 //*****************************************************************************
86 //
89 //
90 //*****************************************************************************
91 typedef enum
92 {
93  //
96  //
98 
99  //
101  //
103 
104  //
106  //
108 
109  //
111  //
113 
114  //
116  //
118 
119  //
121  //
123 
124  //
126  //
128 
129  //
131  //
133 
134  //
136  //
138 }
140 
141 //*****************************************************************************
142 //
143 // Prototypes.
144 //
145 //*****************************************************************************
146 extern tCDCInstance * USBHCDCOpen(tCDCSubClassProtocol iDeviceType,
147  tUSBCallback pfnCallback,
148  void *pvCBData);
149 extern void USBHCDCClose(tCDCInstance *psCDCInstance);
150 
151 extern uint32_t USBHCDCSetControlLineState(tCDCInstance *psCDCInstance, uint16_t carrierValue);
152 extern uint32_t USBHCDCSetLineCoding(tCDCInstance *psCDCInstance, uint8_t *pui8Data);
153 extern uint32_t USBHCDCGetLineCoding(tCDCInstance *psCDCInstance, uint8_t *pui8Buffer,
154  uint32_t ui32Size);
155 extern uint32_t USBHCDCReadData(tCDCInstance *psCDCInstance, uint32_t ui32Interface,
156  uint8_t *pui8Data, uint32_t ui32Size);
157 
159 extern uint32_t USBHCDCWriteData(tCDCInstance *psCDCInstance, uint32_t ui32Interface,
160  uint8_t *pui8Data, uint32_t ui32Size);
161 
162 //*****************************************************************************
163 //
164 // Close the Doxygen group.
166 //
167 //*****************************************************************************
168 
169 //*****************************************************************************
170 //
171 // Mark the end of the C bindings section for C++ compilers.
172 //
173 //*****************************************************************************
174 #ifdef __cplusplus
175 }
176 #endif
177 #endif
This is a vendor specific device.
Definition: usbhcdc.h:137
This is Ethernet Networking Control device.
Definition: usbhcdc.h:127
This is CAPI control device.
Definition: usbhcdc.h:122
struct tCDCInstance tCDCInstance
Definition: usbhcdc.h:44
tCDCInstance * USBHCDCOpen(tCDCSubClassProtocol iDeviceType, tUSBCallback pfnCallback, void *pvCBData)
Definition: usbhcdc.c:147
tCDCSubClassProtocol
Definition: usbhcdc.h:91
void USBHCDCClose(tCDCInstance *psCDCInstance)
Definition: usbhcdc.c:196
This is ATM Networking control device.
Definition: usbhcdc.h:132
This is multi-channel control device.
Definition: usbhcdc.h:117
uint32_t USBHCDCGetLineCoding(tCDCInstance *psCDCInstance, uint8_t *pui8Buffer, uint32_t ui32Size)
Definition: usbhcdc.c:514
uint32_t USBHCDCSetLineCoding(tCDCInstance *psCDCInstance, uint8_t *pui8Data)
Definition: usbhcdc.c:567
uint32_t USBHCDCSetControlLineState(tCDCInstance *psCDCInstance, uint16_t carrierValue)
Definition: usbhcdc.c:621
This is a direct line control device.
Definition: usbhcdc.h:102
Definition: usbhost.h:156
uint32_t(* tUSBCallback)(void *pvCBData, uint32_t ui32Event, uint32_t ui32MsgParam, void *pvMsgData)
Definition: usblib.h:1220
uint32_t USBHCDCReadData(tCDCInstance *psCDCInstance, uint32_t ui32Interface, uint8_t *pui8Data, uint32_t ui32Size)
Definition: usbhcdc.c:686
const tUSBHostClassDriver g_sUSBCDCClassDriver
Definition: usbhcdc.c:112
This is telephone control device.
Definition: usbhcdc.h:112
This is a abstract control device.
Definition: usbhcdc.h:107
Definition: usbhcdc.h:97
uint32_t USBHCDCWriteData(tCDCInstance *psCDCInstance, uint32_t ui32Interface, uint8_t *pui8Data, uint32_t ui32Size)
Definition: usbhcdc.c:722
© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale