NetBurner 3.5.6
PDF Version
usb_cdc.h
1/*NB_REVISION*/
2
3/*NB_COPYRIGHT*/
4
5#ifndef __USB_CDC_H
6#define __USB_CDC_H
7#include <usb.h>
8
9#define CDC_SEND_ENC_CMD (0x00)
10#define CDC_GET_ENC_RESP (0x01)
11#define CDC_SET_COMM_FEAT (0x02)
12#define CDC_GET_COMM_FEAT (0x03)
13#define CDC_CLR_COMM_FEAT (0x04)
14#define CDC_SET_AUX_LINE_STATE (0x10)
15#define CDC_SET_HOOK_STATE (0x11)
16#define CDC_PULSE_SETUP (0x12)
17#define CDC_SEND_PULSE (0x13)
18#define CDC_SET_PULSE_TIME (0x14)
19#define CDC_RING_AUX_JACK (0x15)
20#define CDC_SET_LINE_CODING (0x20)
21#define CDC_GET_LINE_CODING (0x21)
22#define CDC_SET_CTL_LINE_STATE (0x22)
23#define CDC_SEND_BREAK (0x23)
24#define CDC_SET_RINGER_PARAMS (0x30)
25#define CDC_GET_RINGER_PARAMS (0x31)
26#define CDC_SET_OP_PARAMS (0x32)
27#define CDC_GET_OP_PARAMS (0x33)
28#define CDC_SET_LINE_PARAMS (0x34)
29#define CDC_GET_LINE_PARAMS (0x35)
30#define CDC_DIAL_DIGITS (0x36)
31#define CDC_SET_UNIT_PARAM (0x37)
32#define CDC_GET_UNIT_PARAM (0x38)
33#define CDC_CLR_UNIT_PARAM (0x39)
34#define CDC_GET_PROFILE (0x3A)
35#define CDC_SET_ETH_MCAST_FILTS (0x40)
36#define CDC_SET_ETH_PMNG_PATFILT (0x41)
37#define CDC_GET_ETH_PMNG_PATFILT (0x42)
38#define CDC_SET_ETH_PKT_FILT (0x43)
39#define CDC_GET_ETH_STATS (0x44)
40#define CDC_ATM_DATA_FMT (0x50)
41#define CDC_ATM_DEV_STATS (0x51)
42#define CDC_ATM_DEFAULT_VC (0x52)
43#define CDC_ATM_VC_STATS (0x53)
44#define CDC_GET_NTB_PARAMS (0x80)
45#define CDC_GET_NET_ADDR (0x81)
46#define CDC_SET_NET_ADDR (0x82)
47#define CDC_GET_NTB_FMT (0x83)
48#define CDC_SET_NTB_FMT (0x84)
49#define CDC_GET_NTB_INPUT_SZ (0x85)
50#define CDC_SET_NTB_INPUT_SZ (0x86)
51#define CDC_GET_MAX_DGRAM_SZ (0x87)
52#define CDC_SET_MAX_DGRAM_SZ (0x88)
53#define CDC_GET_CRC_MODE (0x89)
54#define CDC_SET_CRC_MODE (0x8A)
55
56
57#define CDC_SET_CTL_LINE_STATE_DTR (0x01)
58#define CDC_SET_CTL_LINE_STATE_RTS (0x02)
59
60struct CDC_LineCoding_t {
61 leuint32_t dwDTERate; // Data terminal rate, bps
62 uint8_t bCharFormat; // 0: 1 stop bit, 1: 1.5 stop bits, 2: 2 stop bits
63 uint8_t bParityType; // 0: None, 1: Odd, 2: Even, 3: Mark, 4: Space
64 uint8_t bDataBits; // Data bits (5, 6, 7, 8, or 16)
65} __attribute__((packed));
66
67struct CDC_LineStatus_t {
68 leuint16_t wLength; // Length of struct
69 leuint32_t dwRingerBitmap; // Ringer configuration bitmap for this line
70 leuint32_t dwLineState;
71 leuint32_t dwCallState[8]; // state of Call _n_ on this line
72} __attribute__((packed));
73
74//namespace nbrtos {
75//namespace USB {
76//class CDC_Data_Endpt : public EndPt {
77// virtual int ProcessRxBuffer(Device *dev, uint8_t endPtNum, bufPttr_t buf, int bufLen);
78// virtual int TransmitBuffer(bufPtr_t buf, int bufLen);
79//};
80//
81//}
82//}
83
84#endif /* ----- #ifndef __USB_CDC_H ----- */
85