79 #define USBH_CDC_BUFFER_SIZE 1024 129 USBH_CDC_InterfaceInit,
130 USBH_CDC_InterfaceDeInit,
131 USBH_CDC_ClassRequest,
159 COMMUNICATION_INTERFACE_CLASS_CODE,
160 ABSTRACT_CONTROL_MODEL,
163 if(interface == 0xFF)
165 USBH_DbgLog (
"Cannot Find the interface for Communication Interface Class.", phost->pActiveClass->Name);
174 if(phost->device.CfgDesc.Itf_Desc[interface].Ep_Desc[0].bEndpointAddress & 0x80)
176 CDC_Handle->
CommItf.
NotifEp = phost->device.CfgDesc.Itf_Desc[interface].Ep_Desc[0].bEndpointAddress;
177 CDC_Handle->
CommItf.
NotifEpSize = phost->device.CfgDesc.Itf_Desc[interface].Ep_Desc[0].wMaxPacketSize;
187 phost->device.address,
195 DATA_INTERFACE_CLASS_CODE,
197 NO_CLASS_SPECIFIC_PROTOCOL_CODE);
199 if(interface == 0xFF)
201 USBH_DbgLog (
"Cannot Find the interface for Data Interface Class.", phost->pActiveClass->Name);
206 if(phost->device.CfgDesc.Itf_Desc[interface].Ep_Desc[0].bEndpointAddress & 0x80)
208 CDC_Handle->
DataItf.
InEp = phost->device.CfgDesc.Itf_Desc[interface].Ep_Desc[0].bEndpointAddress;
209 CDC_Handle->
DataItf.
InEpSize = phost->device.CfgDesc.Itf_Desc[interface].Ep_Desc[0].wMaxPacketSize;
213 CDC_Handle->
DataItf.
OutEp = phost->device.CfgDesc.Itf_Desc[interface].Ep_Desc[0].bEndpointAddress;
214 CDC_Handle->
DataItf.
OutEpSize = phost->device.CfgDesc.Itf_Desc[interface].Ep_Desc[0].wMaxPacketSize;
217 if(phost->device.CfgDesc.Itf_Desc[interface].Ep_Desc[1].bEndpointAddress & 0x80)
219 CDC_Handle->
DataItf.
InEp = phost->device.CfgDesc.Itf_Desc[interface].Ep_Desc[1].bEndpointAddress;
220 CDC_Handle->
DataItf.
InEpSize = phost->device.CfgDesc.Itf_Desc[interface].Ep_Desc[1].wMaxPacketSize;
224 CDC_Handle->
DataItf.
OutEp = phost->device.CfgDesc.Itf_Desc[interface].Ep_Desc[1].bEndpointAddress;
225 CDC_Handle->
DataItf.
OutEpSize = phost->device.CfgDesc.Itf_Desc[interface].Ep_Desc[1].wMaxPacketSize;
238 phost->device.address,
246 phost->device.address,
316 status = GetLineCoding(phost, &CDC_Handle->
LineCoding);
337 switch(CDC_Handle->
state)
360 req_status = GetLineCoding(phost, &(CDC_Handle->
LineCoding));
383 CDC_ProcessTransmission(phost);
384 CDC_ProcessReception(phost);
447 USB_REQ_RECIPIENT_INTERFACE;
469 USB_REQ_RECIPIENT_INTERFACE;
494 #if (USBH_USE_OS == 1) 557 #if (USBH_USE_OS == 1) 582 #if (USBH_USE_OS == 1) 650 #if (USBH_USE_OS == 1) 657 #if (USBH_USE_OS == 1) 712 #if (USBH_USE_OS == 1)
USBH_StatusTypeDef USBH_OpenPipe(USBH_HandleTypeDef *phost, uint8_t ch_num, uint8_t epnum, uint8_t dev_address, uint8_t speed, uint8_t ep_type, uint16_t mps)
USBH_Open_Pipe Open a pipe.
USBH_StatusTypeDef USBH_SelectInterface(USBH_HandleTypeDef *phost, uint8_t interface)
USBH_SelectInterface Select current interface.
__weak void USBH_CDC_TransmitCallback(USBH_HandleTypeDef *phost)
The function informs user that data have been received.
USBD_CDC_LineCodingTypeDef linecoding
uint8_t USBH_AllocPipe(USBH_HandleTypeDef *phost, uint8_t ep_addr)
USBH_Alloc_Pipe Allocate a new Pipe.
USBH_StatusTypeDef USBH_BulkReceiveData(USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length, uint8_t hc_num)
USBH_BulkReceiveData Receives IN bulk packet from device.
#define HOST_USER_CLASS_ACTIVE
USBH_StatusTypeDef USBH_FreePipe(USBH_HandleTypeDef *phost, uint8_t idx)
USBH_Free_Pipe Free the USB Pipe.
uint8_t USBH_FindInterface(USBH_HandleTypeDef *phost, uint8_t Class, uint8_t SubClass, uint8_t Protocol)
USBH_FindInterface Find the interface index for a specific class.
USBH_StatusTypeDef USBH_ClrFeature(USBH_HandleTypeDef *phost, uint8_t ep_num)
USBH_ClrFeature This request is used to clear or disable a specific feature.
USBH_StatusTypeDef USBH_BulkSendData(USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length, uint8_t hc_num, uint8_t do_ping)
USBH_BulkSendData Sends the Bulk Packet to the device.
void(* pUser)(struct _USBH_HandleTypeDef *pHandle, uint8_t id)
uint32_t USBH_LL_GetLastXferSize(USBH_HandleTypeDef *phost, uint8_t)
USBH_LL_GetLastXferSize Return the last transferred packet size.
__weak void USBH_CDC_LineCodingChanged(USBH_HandleTypeDef *phost)
The function informs user that Settings have been changed.
USBH_StatusTypeDef USBH_CDC_Receive(USBH_HandleTypeDef *phost, uint8_t *pbuff, uint32_t length)
This function prepares the state before issuing the class specific commands.
USBH_StatusTypeDef USBH_CtlReq(USBH_HandleTypeDef *phost, uint8_t *buff, uint16_t length)
USBH_CtlReq USBH_CtlReq sends a control request and provide the status after completion of the reques...
#define USB_REQ_TYPE_CLASS
CDC_CommItfTypedef CommItf
USBH_ClassTypeDef CDC_Class
USBH_StatusTypeDef USBH_CDC_Stop(USBH_HandleTypeDef *phost)
USBH_CDC_Stop Stop current CDC Transmission.
#define LINE_CODING_STRUCTURE_SIZE
USBH_StatusTypeDef USBH_CDC_Transmit(USBH_HandleTypeDef *phost, uint8_t *pbuff, uint32_t length)
This function prepares the state before issuing the class specific commands.
CDC_DataItfTypedef DataItf
uint16_t USBH_CDC_GetLastReceivedDataSize(USBH_HandleTypeDef *phost)
This function return last received data size.
USBH_StatusTypeDef USBH_LL_SetToggle(USBH_HandleTypeDef *phost, uint8_t, uint8_t)
USBH_LL_SetToggle Set toggle for a pipe.
USBH_URBStateTypeDef USBH_LL_GetURBState(USBH_HandleTypeDef *phost, uint8_t)
USBH_LL_GetURBState Get a URB state from the low level driver.
USBH_StatusTypeDef USBH_CDC_GetLineCoding(USBH_HandleTypeDef *phost, CDC_LineCodingTypeDef *linecodin)
This function prepares the state before issuing the class specific commands.
__IO HOST_StateTypeDef gState
#define CDC_GET_LINE_CODING
struct _CDC_LineCodingStructure::@36 b
CDC_DataStateTypeDef data_tx_state
__weak void USBH_CDC_ReceiveCallback(USBH_HandleTypeDef *phost)
The function informs user that data have been sent.
CDC_LineCodingTypeDef LineCoding
osStatus osMessagePut(osMessageQId queue_id, uint32_t info, uint32_t millisec)
Put a Message to a Queue.
This file contains all the prototypes for the usbh_cdc.c.
uint8_t Array[LINE_CODING_STRUCTURE_SIZE]
CDC_DataStateTypeDef data_rx_state
USBH_ClassTypeDef * pActiveClass
USBH_StatusTypeDef USBH_CDC_SetLineCoding(USBH_HandleTypeDef *phost, CDC_LineCodingTypeDef *linecodin)
This function prepares the state before issuing the class specific commands.
struct _USB_Setup::_SetupPkt_Struc b
CDC_LineCodingTypeDef * pUserLineCoding
#define CDC_SET_LINE_CODING
USBH_StatusTypeDef USBH_ClosePipe(USBH_HandleTypeDef *phost, uint8_t pipe_num)
USBH_ClosePipe Close a pipe.