USB Component
Version 6.6
MDK-Professional Middleware for USB Device and Host
|
User API reference of the Custom Class. More...
Functions | |
uint8_t | USBH_CustomClass_Configure (const USBH_DEV *ptr_dev, const USB_DEVICE_DESCRIPTOR *ptr_dev_desc, const USB_CONFIGURATION_DESCRIPTOR *ptr_cfg_desc) |
Callback function called when custom class device is connected and needs to configure resources used by custom class device instance. | |
usbStatus | USBH_CustomClass_Unconfigure (uint8_t instance) |
Callback function called when custom class device is disconnected and needs to de-configure resources used by custom class device instance. | |
usbStatus | USBH_CustomClass_Initialize (uint8_t instance) |
Callback function called when custom class device is connected and needs to initialize custom class device instance. | |
usbStatus | USBH_CustomClass_Uninitialize (uint8_t instance) |
Callback function called when custom class device is disconnected and needs to de-initialize custom class device instance. | |
USBH_PIPE * | USBH_PipeCreate (uint8_t ctrl, uint8_t dev_addr, uint8_t dev_speed, uint8_t hub_addr, uint8_t hub_port, uint8_t ep_addr, uint8_t ep_type, uint16_t ep_max_packet_size, uint8_t ep_interval) |
Create Pipe. | |
usbStatus | USBH_PipeModify (uint8_t ctrl, USBH_PIPE *ptr_pipe, uint8_t dev_addr, uint8_t dev_speed, uint8_t hub_addr, uint8_t hub_port, uint16_t ep_max_packet_size) |
Modify Pipe. | |
usbStatus | USBH_PipeDelete (uint8_t ctrl, USBH_PIPE *ptr_pipe) |
Delete Pipe. | |
usbStatus | USBH_PipeReset (uint8_t ctrl, USBH_PIPE *ptr_pipe) |
Reset Pipe (reset data toggle) | |
usbStatus | USBH_PipeReceive (uint8_t ctrl, USBH_PIPE *ptr_pipe, uint8_t *buf, uint32_t len) |
Receive data on Pipe. | |
uint32_t | USBH_PipeReceiveGetResult (uint8_t ctrl, const USBH_PIPE *ptr_pipe) |
Get result of receive data operation on Pipe. | |
usbStatus | USBH_PipeSend (uint8_t ctrl, USBH_PIPE *ptr_pipe, const uint8_t *buf, uint32_t len) |
Send data on Pipe. | |
uint32_t | USBH_PipeSendGetResult (uint8_t ctrl, const USBH_PIPE *ptr_pipe) |
Get result of send data operation on Pipe. | |
usbStatus | USBH_PipeAbort (uint8_t ctrl, const USBH_PIPE *ptr_pipe) |
Abort send/receive operation on Pipe. | |
usbStatus | USBH_DefaultPipeReceive (uint8_t ctrl, uint8_t *buf, uint32_t len) |
Receive data on Default Pipe. | |
uint32_t | USBH_DefaultPipeReceiveGetResult (uint8_t ctrl) |
Get result of receive data operation on Default Pipe. | |
usbStatus | USBH_DefaultPipeSendSetup (uint8_t ctrl, const USB_SETUP_PACKET *setup_packet) |
Send Setup Packet on Default Pipe. | |
usbStatus | USBH_DefaultPipeSend (uint8_t ctrl, const uint8_t *buf, uint32_t len) |
Send data on Default Pipe. | |
uint32_t | USBH_DefaultPipeSendGetResult (uint8_t ctrl) |
Get result of send data operation on Default Pipe. | |
usbStatus | USBH_DefaultPipeAbort (uint8_t ctrl) |
Abort send/receive operation on Default Pipe. | |
usbStatus | USBH_ControlTransfer (uint8_t ctrl, const USB_SETUP_PACKET *setup_packet, uint8_t *data, uint32_t len) |
Do a Control Transfer on Default Pipe. | |
usbStatus | USBH_DeviceRequest_GetStatus (uint8_t ctrl, uint8_t recipient, uint8_t index, uint8_t *ptr_stat_dat) |
Standard Device Request on Default Pipe - GET_STATUS. | |
usbStatus | USBH_DeviceRequest_ClearFeature (uint8_t ctrl, uint8_t recipient, uint8_t index, uint8_t feature_selector) |
Standard Device Request on Default Pipe - CLEAR_FEATURE. | |
usbStatus | USBH_DeviceRequest_SetFeature (uint8_t ctrl, uint8_t recipient, uint8_t index, uint8_t feature_selector) |
Standard Device Request on Default Pipe - SET_FEATURE. | |
usbStatus | USBH_DeviceRequest_SetAddress (uint8_t ctrl, uint8_t device_address) |
Standard Device Request on Default Pipe - SET_ADDRESS. | |
usbStatus | USBH_DeviceRequest_GetDescriptor (uint8_t ctrl, uint8_t recipient, uint8_t descriptor_type, uint8_t descriptor_index, uint8_t language_id, uint8_t *descriptor_data, uint16_t descriptor_length) |
Standard Device Request on Default Pipe - GET_DESCRIPTOR. | |
usbStatus | USBH_DeviceRequest_SetDescriptor (uint8_t ctrl, uint8_t recipient, uint8_t descriptor_type, uint8_t descriptor_index, uint8_t language_id, uint8_t *descriptor_data, uint16_t descriptor_length) |
Standard Device Request on Default Pipe - SET_DESCRIPTOR. | |
usbStatus | USBH_DeviceRequest_GetConfiguration (uint8_t ctrl, uint8_t *ptr_configuration) |
Standard Device Request on Default Pipe - GET_CONFIGURATION. | |
usbStatus | USBH_DeviceRequest_SetConfiguration (uint8_t ctrl, uint8_t configuration) |
Standard Device Request on Default Pipe - SET_CONFIGURATION. | |
usbStatus | USBH_DeviceRequest_GetInterface (uint8_t ctrl, uint8_t index, uint8_t *ptr_alternate) |
Standard Device Request on Default Pipe - GET_INTERFACE. | |
usbStatus | USBH_DeviceRequest_SetInterface (uint8_t ctrl, uint8_t index, uint8_t alternate) |
Standard Device Request on Default Pipe - SET_INTERFACE. | |
usbStatus | USBH_DeviceRequest_SynchFrame (uint8_t ctrl, uint8_t index, uint8_t *ptr_frame_number) |
Standard Device Request on Default Pipe - SYNCH_FRAME. | |
User API reference of the Custom Class.
usbStatus USBH_ControlTransfer | ( | uint8_t | ctrl, |
const USB_SETUP_PACKET * | setup_packet, | ||
uint8_t * | data, | ||
uint32_t | len | ||
) |
Do a Control Transfer on Default Pipe.
[in] | ctrl | index of USB Host controller. |
[in] | setup_packet | pointer to setup packet. |
[in,out] | data | buffer containing data bytes to send or where data should be received in data stage of Control Transfer. |
[in] | len | number of bytes to send or receive in data stage of Control Transfer. |
The function USBH_ControlTransfer does an Control Transfer on the Default Pipe.
The argument ctrl is the index of the USB Host controller that is to be used.
The argument setup_packet pointer to setup packet.
The argument data containing data bytes to send or where data should be received in data stage of Control Transfer.
The argument len number of bytes to send or receive in data stage of Control Transfer.
Code Example
uint8_t USBH_CustomClass_Configure | ( | const USBH_DEV * | ptr_dev, |
const USB_DEVICE_DESCRIPTOR * | ptr_dev_desc, | ||
const USB_CONFIGURATION_DESCRIPTOR * | ptr_cfg_desc | ||
) |
Callback function called when custom class device is connected and needs to configure resources used by custom class device instance.
[in] | ptr_dev | pointer to device structure. |
[in] | ptr_dev_desc | pointer to device descriptor. |
[in] | ptr_cfg_desc | pointer to configuration descriptor. |
The function USBH_CustomClass_Configure should create all necessary pipes for the custom class. It needs to be adapted to the specific needs of the Custom Class that is to be supported. For more information on the USB_DEVICE_DESCRIPTOR
, please refer to Device Descriptor. For more information on the USB_CONFIGURATION_DESCRIPTOR
, please refer to Configuration Descriptor.
The argument ptr_dev specifies the pointer to the connected device.
The argument ptr_dev_desc specifies the pointer to the device descriptor (Device Descriptor) of the Custom Class.
The argument ptr_cfg_desc specifies the pointer to the configuration descriptor (Configuration Descriptor) of the Custom Class.
Code Example
usbStatus USBH_CustomClass_Initialize | ( | uint8_t | instance | ) |
Callback function called when custom class device is connected and needs to initialize custom class device instance.
[in] | instance | index of custom class device instance. |
The function USBH_CustomClass_Initialize initializes the Custom Class device when connected to the system. It needs to be adapted to the specific needs of the Custom Class that is to be supported.
The argument instance specifies device instance of the Custom Class USB Device.
Code Example
usbStatus USBH_CustomClass_Unconfigure | ( | uint8_t | instance | ) |
Callback function called when custom class device is disconnected and needs to de-configure resources used by custom class device instance.
[in] | instance | index of custom class device instance. |
The function USBH_CustomClass_Unconfigure should release all resources that were used by the Custom Class device after it has been de-initialized using USBH_CustomClass_Uninitialize. All pipes relating to the Custom Class should be removed. It needs to be adapted to the specific needs of the Custom Class that is to be supported.
The argument instance specifies device instance of the Custom Class USB Device.
Code Example
usbStatus USBH_CustomClass_Uninitialize | ( | uint8_t | instance | ) |
Callback function called when custom class device is disconnected and needs to de-initialize custom class device instance.
[in] | instance | index of custom class device instance. |
The function USBH_CustomClass_Uninitialize de-initializes the Custom Class device after it has been disconnected from the system. It needs to be adapted to the specific needs of the Custom Class that is to be supported.
The argument instance specifies device instance of the Custom Class USB Device.
Code Example
usbStatus USBH_DefaultPipeAbort | ( | uint8_t | ctrl | ) |
Abort send/receive operation on Default Pipe.
[in] | ctrl | index of USB Host controller. |
The function USBH_DefaultPipeAbort aborts active send/receive operation on the Default Pipe.
The argument ctrl is the index of the USB Host controller that is to be used.
usbStatus USBH_DefaultPipeReceive | ( | uint8_t | ctrl, |
uint8_t * | buf, | ||
uint32_t | len | ||
) |
Receive data on Default Pipe.
[in] | ctrl | index of USB Host controller. |
[out] | buf | buffer that receives data. |
[in] | len | maximum number of bytes to receive. |
The function USBH_DefaultPipeReceive receives data on the Default Pipe. Number of bytes received can be retrieved by USBH_DefaultPipeReceiveGetResult function.
The argument ctrl is the index of the USB Host controller that is to be used.
The argument buf buffer that receives data.
The argument len maximum number of bytes to receive.
uint32_t USBH_DefaultPipeReceiveGetResult | ( | uint8_t | ctrl | ) |
Get result of receive data operation on Default Pipe.
[in] | ctrl | index of USB Host controller. |
The function USBH_DefaultPipeReceiveGetResult retrieves number of received data bytes on the Default Pipe.
The argument ctrl is the index of the USB Host controller that is to be used.
usbStatus USBH_DefaultPipeSend | ( | uint8_t | ctrl, |
const uint8_t * | buf, | ||
uint32_t | len | ||
) |
Send data on Default Pipe.
[in] | ctrl | index of USB Host controller. |
[in] | buf | buffer containing data bytes to send. |
[in] | len | maximum number of bytes to send. |
The function USBH_DefaultPipeSend sends data on the Default Pipe. Number of bytes sent can be retrieved by USBH_DefaultPipeSendGetResult function.
The argument ctrl is the index of the USB Host controller that is to be used.
The argument buf buffer containing data bytes to send.
The argument len maximum number of bytes to send.
uint32_t USBH_DefaultPipeSendGetResult | ( | uint8_t | ctrl | ) |
Get result of send data operation on Default Pipe.
[in] | ctrl | index of USB Host controller. |
The function USBH_DefaultPipeSendGetResult retrieves number of successfully sent data bytes on the Default Pipe.
The argument ctrl is the index of the USB Host controller that is to be used.
usbStatus USBH_DefaultPipeSendSetup | ( | uint8_t | ctrl, |
const USB_SETUP_PACKET * | setup_packet | ||
) |
Send Setup Packet on Default Pipe.
[in] | ctrl | index of USB Host controller. |
[in] | setup_packet | pointer to setup packet. |
The function USBH_DefaultPipeSendSetup sends a setup packet on the Default Pipe.
The argument ctrl is the index of the USB Host controller that is to be used.
The argument setup_packet pointer to setup packet.
usbStatus USBH_DeviceRequest_ClearFeature | ( | uint8_t | ctrl, |
uint8_t | recipient, | ||
uint8_t | index, | ||
uint8_t | feature_selector | ||
) |
Standard Device Request on Default Pipe - CLEAR_FEATURE.
[in] | ctrl | index of USB Host controller. |
[in] | recipient | recipient. |
[in] | index | interface or endpoint index. |
[in] | feature_selector | feature selector. |
The function USBH_DeviceRequest_ClearFeature implements the standard device request CLEAR_FEATURE
. This request is used to clear or disable a specific feature.
The argument ctrl is the index of the USB Host controller that is to be used.
The argument recipient defines the recipient of the CLEAR_FEATURE
command.
The argument index denotes the interface or endpoint index to be used.
The argument feature_selector indicates the feature to be cleared.
usbStatus USBH_DeviceRequest_GetConfiguration | ( | uint8_t | ctrl, |
uint8_t * | ptr_configuration | ||
) |
Standard Device Request on Default Pipe - GET_CONFIGURATION.
[in] | ctrl | index of USB Host controller. |
[out] | ptr_configuration | pointer to where configuration will be read. |
The function USBH_DeviceRequest_GetConfiguration implements the standard device request GET_CONFIGURATION
. This request returns the current device configuration value.
The argument ctrl is the index of the USB Host controller that is to be used.
The argument ptr_configuration specifies the pointer to where the configuration will be read.
usbStatus USBH_DeviceRequest_GetDescriptor | ( | uint8_t | ctrl, |
uint8_t | recipient, | ||
uint8_t | descriptor_type, | ||
uint8_t | descriptor_index, | ||
uint8_t | language_id, | ||
uint8_t * | descriptor_data, | ||
uint16_t | descriptor_length | ||
) |
Standard Device Request on Default Pipe - GET_DESCRIPTOR.
[in] | ctrl | index of USB Host controller. |
[in] | recipient | recipient. |
[in] | descriptor_type | descriptor type. |
[in] | descriptor_index | descriptor index. |
[in] | language_id | language ID. |
[out] | descriptor_data | pointer to where descriptor data will be read. |
[in] | descriptor_length | descriptor length. |
The function USBH_DeviceRequest_GetDescriptor implements the standard device request GET_DESCRIPTOR
. This request returns the specified descriptor if the descriptor exists.
The argument ctrl is the index of the USB Host controller that is to be used.
The argument recipient defines the recipient of the GET_DESCRIPTOR
command.
The argument descriptor_type specifies the descriptor type to be queried, whereas the argument descriptor_index is used to select a specific descriptor (only for configuration and string descriptors) when several descriptors of the same type are implemented in a device.
The argument language_id specifies the Language ID for string descriptors or is set to zero for other descriptors.
The argument descriptor_data is a pointer to where descriptor data will be read and descriptor_length specifies the number of bytes to return.
usbStatus USBH_DeviceRequest_GetInterface | ( | uint8_t | ctrl, |
uint8_t | index, | ||
uint8_t * | ptr_alternate | ||
) |
Standard Device Request on Default Pipe - GET_INTERFACE.
[in] | ctrl | index of USB Host controller. |
[in] | index | interface index. |
[out] | ptr_alternate | pointer to where alternate setting data will be read. |
The function USBH_DeviceRequest_GetInterface implements the standard device request GET_INTERFACE
. This request returns the selected alternate setting for the specified interface.
The argument ctrl is the index of the USB Host controller that is to be used.
The argument index specifies the interface index.
The argument ptr_alternate specifies the pointer to where alternate setting data will be read.
usbStatus USBH_DeviceRequest_GetStatus | ( | uint8_t | ctrl, |
uint8_t | recipient, | ||
uint8_t | index, | ||
uint8_t * | ptr_stat_dat | ||
) |
Standard Device Request on Default Pipe - GET_STATUS.
[in] | ctrl | index of USB Host controller. |
[in] | recipient | recipient. |
[in] | index | interface or endpoint index. |
[out] | ptr_stat_dat | pointer to where status data should be received. |
The function USBH_DeviceRequest_GetStatus implements the standard device request GET_STATUS
. This request returns the current device configuration value.
The argument ctrl is the index of the USB Host controller that is to be used.
The argument recipient defines the recipient of the GET_STATUS
command.
The argument index denotes the interface or endpoint index to be used.
The argument ptr_stat_dat is a pointer to the where the data should be received.
usbStatus USBH_DeviceRequest_SetAddress | ( | uint8_t | ctrl, |
uint8_t | device_address | ||
) |
Standard Device Request on Default Pipe - SET_ADDRESS.
[in] | ctrl | index of USB Host controller. |
[in] | device_address | device address. |
The function USBH_DeviceRequest_SetAddress implements the standard device request SET_ADDRESS
. This request sets the device address for all future device accesses.
The argument ctrl is the index of the USB Host controller that is to be used.
The argument device_address specifies the new device address.
usbStatus USBH_DeviceRequest_SetConfiguration | ( | uint8_t | ctrl, |
uint8_t | configuration | ||
) |
Standard Device Request on Default Pipe - SET_CONFIGURATION.
[in] | ctrl | index of USB Host controller. |
[in] | configuration | configuration. |
The function USBH_DeviceRequest_SetConfiguration implements the standard device request SET_CONFIGURATION
. This request sets the device configuration.
The argument ctrl is the index of the USB Host controller that is to be used.
The argument configuration contains the new configuration to be set.
usbStatus USBH_DeviceRequest_SetDescriptor | ( | uint8_t | ctrl, |
uint8_t | recipient, | ||
uint8_t | descriptor_type, | ||
uint8_t | descriptor_index, | ||
uint8_t | language_id, | ||
uint8_t * | descriptor_data, | ||
uint16_t | descriptor_length | ||
) |
Standard Device Request on Default Pipe - SET_DESCRIPTOR.
[in] | ctrl | index of USB Host controller. |
[in] | recipient | recipient. |
[in] | descriptor_type | descriptor type. |
[in] | descriptor_index | descriptor index. |
[in] | language_id | language ID. |
[in] | descriptor_data | pointer to descriptor data to be written. |
[in] | descriptor_length | descriptor length. |
The function USBH_DeviceRequest_SetDescriptor implements the standard device request SET_DESCRIPTOR
. This request may be used to update existing or add new descriptors.
The argument ctrl is the index of the USB Host controller that is to be used.
The argument recipient defines the recipient of the SET_DESCRIPTOR
command.
The argument descriptor_type specifies the descriptor type to be queried, whereas the argument descriptor_index is used to select a specific descriptor (only for configuration and string descriptors) when several descriptors of the same type are implemented in a device.
The argument language_id specifies the Language ID for string descriptors or is set to zero for other descriptors.
The argument descriptor_data is a pointer to where descriptor data will be written and descriptor_length specifies the number of bytes to return.
usbStatus USBH_DeviceRequest_SetFeature | ( | uint8_t | ctrl, |
uint8_t | recipient, | ||
uint8_t | index, | ||
uint8_t | feature_selector | ||
) |
Standard Device Request on Default Pipe - SET_FEATURE.
[in] | ctrl | index of USB Host controller. |
[in] | recipient | recipient. |
[in] | index | interface or endpoint index. |
[in] | feature_selector | feature selector. |
The function USBH_DeviceRequest_SetFeature implements the standard device request SET_FEATURE
. This request is used to set or enable a specific feature.
The argument ctrl is the index of the USB Host controller that is to be used.
The argument recipient defines the recipient of the SET_FEATURE
command.
The argument index denotes the interface or endpoint index to be used.
The argument feature_selector indicates the feature to be cleared.
usbStatus USBH_DeviceRequest_SetInterface | ( | uint8_t | ctrl, |
uint8_t | index, | ||
uint8_t | alternate | ||
) |
Standard Device Request on Default Pipe - SET_INTERFACE.
[in] | ctrl | index of USB Host controller. |
[in] | index | interface index. |
[in] | alternate | alternate setting. |
The function USBH_DeviceRequest_SetInterface implements the standard device request SET_INTERFACE
. This request allows the host to select an alternate setting for the specified interface.
The argument ctrl is the index of the USB Host controller that is to be used.
The argument index specifies the interface index.
The argument alternate specifies the alternate setting to be set.
usbStatus USBH_DeviceRequest_SynchFrame | ( | uint8_t | ctrl, |
uint8_t | index, | ||
uint8_t * | ptr_frame_number | ||
) |
Standard Device Request on Default Pipe - SYNCH_FRAME.
[in] | ctrl | index of USB Host controller. |
[in] | index | interface or endpoint index. |
[out] | ptr_frame_number | pointer to where frame number data will be read. |
The function USBH_DeviceRequest_SynchFrame implements the standard device request SYNCH_FRAME
. This request is used to set and then report an endpoint's synchronization frame. When an endpoint supports isochronous transfers, the endpoint may also require per-frame transfers to vary in size according to a specific pattern. The host and the endpoint must agree on which frame the repeating pattern begins. The number of the frame in which the pattern began is returned to the host.
The argument ctrl is the index of the USB Host controller that is to be used.
The argument index specifies the interface index.
The argument ptr_frame_number is a pointer to where frame number data will be sent.
Abort send/receive operation on Pipe.
[in] | ctrl | index of USB Host controller. |
[in] | ptr_pipe | pointer to pipe. |
The function USBH_PipeAbort aborts active send/receive operation on a Pipe.
The argument ctrl is the index of the USB Host controller that is to be used.
The argument ptr_pipe is a pointer to pipe.
USBH_PIPE * USBH_PipeCreate | ( | uint8_t | ctrl, |
uint8_t | dev_addr, | ||
uint8_t | dev_speed, | ||
uint8_t | hub_addr, | ||
uint8_t | hub_port, | ||
uint8_t | ep_addr, | ||
uint8_t | ep_type, | ||
uint16_t | ep_max_packet_size, | ||
uint8_t | ep_interval | ||
) |
Create Pipe.
[in] | ctrl | index of USB Host controller. |
[in] | dev_addr | device address. |
[in] | dev_speed | device speed. |
[in] | hub_addr | hub address. |
[in] | hub_port | hub port. |
[in] | ep_addr | endpoint address
|
[in] | ep_type | endpoint type. |
[in] | ep_max_packet_size | endpoint maximum packet size. |
[in] | ep_interval | endpoint polling interval. |
The function USBH_PipeCreate a Pipe for communication with specific Endpoint in a Device.
The argument ctrl is the index of the USB Host controller that is to be used.
The argument dev_addr is the device address.
The argument dev_speed is the device speed.
The argument hub_addr is the hub address.
The argument hub_port is the hub port.
The argument ep_addr is the address of the endpoint.
The argument ep_type is the type of the endpoint.
The argument ep_max_packet_size is the maximum packet size of the endpoint.
The argument ep_interval is the endpoint polling interval of the endpoint.
Code Example
Delete Pipe.
[in] | ctrl | index of USB Host controller. |
[in] | ptr_pipe | pointer to pipe. |
The function USBH_PipeDelete removes a Pipe.
The argument ctrl is the index of the USB Host controller that is to be used.
The argument ptr_pipe is a pointer to pipe to be removed.
Code Example
usbStatus USBH_PipeModify | ( | uint8_t | ctrl, |
USBH_PIPE * | ptr_pipe, | ||
uint8_t | dev_addr, | ||
uint8_t | dev_speed, | ||
uint8_t | hub_addr, | ||
uint8_t | hub_port, | ||
uint16_t | ep_max_packet_size | ||
) |
Modify Pipe.
[in] | ctrl | index of USB Host controller. |
[in] | ptr_pipe | pointer to pipe. |
[in] | dev_addr | device address. |
[in] | dev_speed | device speed. |
[in] | hub_addr | hub address. |
[in] | hub_port | hub port. |
[in] | ep_max_packet_size | endpoint maximum packet size. |
The function USBH_PipeModify modifies a Pipe.
The argument ctrl is the index of the USB Host controller that is to be used.
The argument ptr_pipe is a pointer to pipe to be modified.
The argument dev_addr is the modified device address.
The argument dev_speed is the modified device speed.
The argument hub_addr is the modified hub address.
The argument hub_port is the modified hub port.
The argument ep_max_packet_size is the modified maximum packet size of the endpoint.
Receive data on Pipe.
[in] | ctrl | index of USB Host controller. |
[in] | ptr_pipe | pointer to pipe. |
[out] | buf | buffer that receives data. |
[in] | len | maximum number of bytes to receive. |
The function USBH_PipeReceive receives data on a Pipe. Number of bytes received can be retrieved by USBH_PipeReceiveGetResult function.
The argument ctrl is the index of the USB Host controller that is to be used.
The argument ptr_pipe is a pointer to pipe.
The argument buf buffer that receives data.
The argument len maximum number of bytes to receive.
Code Example
uint32_t USBH_PipeReceiveGetResult | ( | uint8_t | ctrl, |
const USBH_PIPE * | ptr_pipe | ||
) |
Get result of receive data operation on Pipe.
[in] | ctrl | index of USB Host controller. |
[in] | ptr_pipe | pointer to pipe. |
The function USBH_PipeReceiveGetResult retrieves number of received data bytes on a Pipe.
The argument ctrl is the index of the USB Host controller that is to be used.
The argument ptr_pipe is a pointer to pipe used for data reception.
Reset Pipe (reset data toggle)
[in] | ctrl | index of USB Host controller. |
[in] | ptr_pipe | pointer to pipe. |
The function USBH_PipeReset resets data toggle of a Pipe.
The argument ctrl is the index of the USB Host controller that is to be used.
The argument ptr_pipe is a pointer to pipe.
Send data on Pipe.
[in] | ctrl | index of USB Host controller. |
[in] | ptr_pipe | pointer to pipe. |
[in] | buf | buffer containing data bytes to send. |
[in] | len | maximum number of bytes to send. |
The function USBH_PipeSend sends data on a Pipe. Number of bytes sent can be retrieved by USBH_PipeSendGetResult function.
The argument ctrl is the index of the USB Host controller that is to be used.
The argument ptr_pipe is a pointer to pipe.
The argument buf buffer containing data bytes to send.
The argument len maximum number of bytes to send.
Code Example
uint32_t USBH_PipeSendGetResult | ( | uint8_t | ctrl, |
const USBH_PIPE * | ptr_pipe | ||
) |
Get result of send data operation on Pipe.
[in] | ctrl | index of USB Host controller. |
[in] | ptr_pipe | pointer to pipe. |
The function USBH_PipeSendGetResult retrieves number of successfully sent data bytes on a Pipe.
The argument ctrl is the index of the USB Host controller that is to be used.
The argument ptr_pipe is a pointer to pipe used for sending data.