Lightweight USB stack  1.0
usb_cdcp.h
1 /* This file is the part of the Lightweight USB device Stack for STM32 microcontrollers
2  *
3  * Copyright ©2016 Dmitry Filimonchuk <dmitrystu[at]gmail[dot]com>
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  * http://www.apache.org/licenses/LICENSE-2.0
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
26 #ifndef _USB_CDC_PSTN_H_
27 #define _USB_CDC_PSTN_H_
28 
29 #ifdef __cplusplus
30  extern "C" {
31 #endif
32 
33 
36 #define USB_CDC_SUBCLASS_DLC 0x01
37 #define USB_CDC_SUBCLASS_TEL 0x03
38  /* @} */
39 
42 #define USB_DTYPE_CDC_LINE_MANAGEMENT 0x03
43 #define USB_DTYPE_CDC_TEL_RING 0x04
44 #define USB_DTYPE_CDC_TEL_CALL 0x05
46 #define USB_DTYPE_CDC_TEL_OPMODE 0x08
51 #define USB_CDC_SET_AUX_LINE_STATE 0x10
53 #define USB_CDC_SET_HOOK_STATE 0x11
55 #define USB_CDC_PULSE_SETU 0x12
56 #define USB_CDC_SEND_PULSE 0x13
58 #define USB_CDC_SET_PULSE_TIME 0x14
60 #define USB_CDC_RING_AUX_JACK 0x15
62 #define USB_CDC_SET_RINGER_PARMS 0x30
64 #define USB_CDC_GET_RINGER_PARMS 0x31
66 #define USB_CDC_SET_OPERATION_PARMS 0x32
69 #define USB_CDC_GET_OPERATION_PARMS 0x33
70 #define USB_CDC_SET_LINE_PARMS 0x34
71 #define USB_CDC_GET_LINE_PARMS 0x35
72 #define USB_CDC_DIAL_DIGITS 0x36
77 #define USB_CDC_NTF_AUX_JACK_HOOK_STATE 0x08
79 #define USB_CDC_NTF_RING_DETECT 0x09
81 #define USB_CDC_NTF_CALL_STATE_CHANGE 0x28
84 #define USB_CDC_NTF_LINE_STATE_CHANGE 0x29
93 #define USB_CDC_DLM_PULSE 0x01
95 #define USB_CDC_DLM_AUX 0x02
97 #define USB_CDC_DLM_XTRAPULSE 0x04
104 #define USB_CDC_TOM_SIMPLE 0x01
105 #define USB_CDC_TOM_STANDALONE 0x02
106 #define USB_CDC_TOM_CENTRIC 0x04
112 #define USB_CDC_TCS_DIALTONE 0x01
114 #define USB_CDC_TCS_STATE 0x02
115 #define USB_CDC_TCS_CALLERID 0x04
116 #define USB_CDC_TCS_RINGING 0x08
117 #define USB_CDC_TCS_DTMF 0x10
119 #define USB_CDC_TCS_NOTIFY 0x20
127 struct usb_cdc_dlm_desc {
128  uint8_t bFunctionLength;
129  uint8_t bDescriptorType;
130  uint8_t bDescriptorSubType;
131  uint8_t bmCapabilities;
133 } __attribute__ ((packed));
139 struct usb_cdc_tring_desc {
140  uint8_t bFunctionLength;
141  uint8_t bDescriptorType;
142  uint8_t bDescriptorSubType;
143  uint8_t bRingerVolSteps;
144  uint8_t bNumRingerPatterns;
145 } __attribute__ ((packed));
146 
154 struct usb_cdc_tom_desc {
155  uint8_t bFunctionLength;
156  uint8_t bDescriptorType;
157  uint8_t bDescriptorSubType;
158  uint8_t bmCapabilities;
160 } __attribute__ ((packed));
166 struct usb_cdc_tcs_desc {
167  uint8_t bFunctionLength;
168  uint8_t bDescriptorType;
169  uint8_t bDescriptorSubType;
170  uint32_t bmCapabilities;
172 } __attribute__ ((packed));
173 
176 #ifdef __cplusplus
177  }
178 #endif
179 #endif /* _USB_CDC_PSTN_H_ */
Telephone Operational Modes Functional Descriptor.
Definition: usb_cdcp.h:175
uint8_t bRingerVolSteps
Number of discrete steps in volume supported by the ringer.
Definition: usb_cdcp.h:164
uint8_t bDescriptorType
CS_INTERFACE descriptor type.
Definition: usb_cdcp.h:162
uint8_t bNumRingerPatterns
Number of ringer patterns supported.
Definition: usb_cdcp.h:165
Telephone Ringer Functional Descriptor.
Definition: usb_cdcp.h:160
uint8_t bDescriptorSubType
Direct Line Management Functional Descriptor.
Definition: usb_cdcp.h:163
Telephone Call State Reporting Capabilities Descriptor.
Definition: usb_cdcp.h:187
uint8_t bFunctionLength
Size of this functional descriptor, in bytes.
Definition: usb_cdcp.h:161