17 #if !defined(__CDCPROLIFIC_H__)
18 #define __CDCPROLIFIC_H__
23 #define PL_PID ( 0x2303 || 0x0609 )
27 #define PROLIFIC_REV_H 0x0202
28 #define PROLIFIC_REV_X 0x0300
29 #define PROLIFIC_REV_HX_CHIP_D 0x0400
30 #define PROLIFIC_REV_1 0x0001
32 #define kXOnChar '\x11'
33 #define kXOffChar '\x13'
35 #define SPECIAL_SHIFT (5)
36 #define SPECIAL_MASK ((1<<SPECIAL_SHIFT) - 1)
37 #define STATE_ALL ( PD_RS232_S_MASK | PD_S_MASK )
38 #define FLOW_RX_AUTO ( PD_RS232_A_RFR | PD_RS232_A_DTR | PD_RS232_A_RXO )
39 #define FLOW_TX_AUTO ( PD_RS232_A_CTS | PD_RS232_A_DSR | PD_RS232_A_TXO | PD_RS232_A_DCD )
40 #define CAN_BE_AUTO ( FLOW_RX_AUTO | FLOW_TX_AUTO )
41 #define CAN_NOTIFY ( PD_RS232_N_MASK )
42 #define EXTERNAL_MASK ( PD_S_MASK | (PD_RS232_S_MASK & ~PD_RS232_S_LOOP) )
43 #define INTERNAL_DELAY ( PD_RS232_S_LOOP )
44 #define DEFAULT_AUTO ( PD_RS232_A_DTR | PD_RS232_A_RFR | PD_RS232_A_CTS | PD_RS232_A_DSR )
45 #define DEFAULT_NOTIFY 0x00
46 #define DEFAULT_STATE ( PD_S_TX_ENABLE | PD_S_RX_ENABLE | PD_RS232_A_TXO | PD_RS232_A_RXO )
48 #define CONTINUE_SEND 1
51 #define kRxAutoFlow ((UInt32)( PD_RS232_A_RFR | PD_RS232_A_DTR | PD_RS232_A_RXO ))
52 #define kTxAutoFlow ((UInt32)( PD_RS232_A_CTS | PD_RS232_A_DSR | PD_RS232_A_TXO | PD_RS232_A_DCD ))
53 #define kControl_StateMask ((UInt32)( PD_RS232_S_CTS | PD_RS232_S_DSR | PD_RS232_S_CAR | PD_RS232_S_RI ))
54 #define kRxQueueState ((UInt32)( PD_S_RXQ_EMPTY | PD_S_RXQ_LOW_WATER | PD_S_RXQ_HIGH_WATER | PD_S_RXQ_FULL ))
55 #define kTxQueueState ((UInt32)( PD_S_TXQ_EMPTY | PD_S_TXQ_LOW_WATER | PD_S_TXQ_HIGH_WATER | PD_S_TXQ_FULL ))
57 #define kCONTROL_DTR 0x01
58 #define kCONTROL_RTS 0x02
68 #define kStateTransientMask 0x74
69 #define kBreakError 0x04
70 #define kFrameError 0x10
71 #define kParityError 0x20
72 #define kOverrunError 0x40
78 #define kHandshakeInMask ((UInt32)( PD_RS232_S_CTS | PD_RS232_S_DSR | PD_RS232_S_CAR | PD_RS232_S_RI ))
80 #define VENDOR_WRITE_REQUEST_TYPE 0x40
81 #define VENDOR_WRITE_REQUEST 0x01
83 #define VENDOR_READ_REQUEST_TYPE 0xc0
84 #define VENDOR_READ_REQUEST 0x01
89 #define DCR0_INIT 0x01
90 #define DCR0_INIT_H 0x41
91 #define DCR0_INIT_X 0x61
95 #define DCR1_INIT_H 0x80
96 #define DCR1_INIT_X 0x00
100 #define DCR2_INIT_H 0x24
101 #define DCR2_INIT_X 0x44
104 #define RESET_DOWNSTREAM_DATA_PIPE 0x08
105 #define RESET_UPSTREAM_DATA_PIPE 0x09
116 #define PL_MAX_ENDPOINTS 4
125 virtual uint8_t
Init(uint8_t parent, uint8_t port,
bool lowspeed);
134 #endif // __CDCPROLIFIC_H__
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
PL2303(USB *pusb, CDCAsyncOper *pasync)