50 #define kUSBCDC_sendStarted USBCDC_SEND_STARTED
51 #define kUSBCDC_sendComplete USBCDC_SEND_COMPLETE
52 #define kUSBCDC_intfBusyError USBCDC_INTERFACE_BUSY_ERROR
53 #define kUSBCDC_receiveStarted USBCDC_RECEIVE_STARTED
54 #define kUSBCDC_receiveCompleted USBCDC_RECEIVE_COMPLETED
55 #define kUSBCDC_receiveInProgress USBCDC_RECEIVE_IN_PROGRESS
56 #define kUSBCDC_generalError USBCDC_GENERAL_ERROR
57 #define kUSBCDC_busNotAvailable USBCDC_BUS_NOT_AVAILABLE
58 #define kUSBCDC_waitingForSend USBCDC_WAITING_FOR_SEND
59 #define kUSBCDC_waitingForReceive USBCDC_WAITING_FOR_RECEIVE
60 #define kUSBCDC_dataWaiting USBCDC_DATA_WAITING
61 #define kUSB_allCdcEvents USBCDC_ALL_CDC_EVENTS
62 #define kUSBCDC_noDataWaiting USBCDC_NO_DATA_WAITING
64 #define USBCDC_intfStatus USBCDC_getInterfaceStatus
65 #define USBCDC_bytesInUSBBuffer USBCDC_getBytesInUSBBuffer
69 #define USBCDC_SEND_STARTED 0x01
70 #define USBCDC_SEND_COMPLETE 0x02
71 #define USBCDC_INTERFACE_BUSY_ERROR 0x03
72 #define USBCDC_RECEIVE_STARTED 0x04
73 #define USBCDC_RECEIVE_COMPLETED 0x05
74 #define USBCDC_RECEIVE_IN_PROGRESS 0x06
75 #define USBCDC_GENERAL_ERROR 0x07
76 #define USBCDC_BUS_NOT_AVAILABLE 0x08
78 #define USBCDC_NO_DATA_WAITING 0X01
79 #define USBCDC_WAITING_FOR_SEND 0x01
80 #define USBCDC_WAITING_FOR_RECEIVE 0x02
81 #define USBCDC_DATA_WAITING 0x04
82 #define USBCDC_BUS_NOT_AVAILABLE 0x08
83 #define USBCDC_ALL_CDC_EVENTS 0xFF
88 uint16_t nCdcBytesToSend;
89 uint16_t nCdcBytesToSendLeft;
90 const uint8_t* pUsbBufferToSend;
91 uint8_t bCurrentBufferXY;
92 uint8_t bZeroPacketSent;
93 uint8_t last_ByteSend;
94 } CdcWriteCtrl[CDC_NUM_INTERFACES];
99 uint8_t *pCurrentEpPos;
100 uint16_t nBytesToReceive;
101 uint16_t nBytesToReceiveLeft;
106 uint8_t bCurrentBufferXY;
107 } CdcReadCtrl[CDC_NUM_INTERFACES];
162 uint8_t
USBCDC_sendData (
const uint8_t* data, uint16_t size, uint8_t intfNum);
436 void USBCDC_setCTS(uint8_t state);
491 uint8_t usbGetLineCoding(
void);
496 uint8_t usbSetLineCoding(
void);
501 uint8_t usbSetControlLineState(
void);
506 uint8_t Handler_SetLineCoding(
void);
uint8_t USBCDC_handleSetControlLineState(uint8_t intfNum, uint8_t lineState)
uint8_t USBCDC_abortSend(uint16_t *size, uint8_t intfNum)
uint8_t USBCDC_rejectData(uint8_t intfNum)
uint8_t USBCDC_sendData(const uint8_t *data, uint16_t size, uint8_t intfNum)
uint8_t USBCDC_getBytesInUSBBuffer(uint8_t intfNum)
uint8_t USBCDC_receiveData(uint8_t *data, uint16_t size, uint8_t intfNum)
uint8_t USBCDC_handleReceiveCompleted(uint8_t intfNum)
uint8_t USBCDC_handleDataReceived(uint8_t intfNum)
uint8_t USBCDC_handleSetLineCoding(uint8_t intfNum, uint32_t lBaudrate)
uint8_t USBCDC_handleSendCompleted(uint8_t intfNum)
uint8_t USBCDC_getInterfaceStatus(uint8_t intfNum, uint16_t *bytesSent, uint16_t *bytesReceived)
uint8_t USBCDC_abortReceive(uint16_t *size, uint8_t intfNum)