⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usb.h

📁 有关ARM开发板上的IXP400网络驱动程序的源码以。
💻 H
📖 第 1 页 / 共 2 页
字号:
 * * @param device USBDevice * (in) - a structure identifying the device * * This function triggers signal resuming on the bus, waking up the USB host. * Is should be used only if the host has enabled the device to do so using * the standard SET_FEATURE USB request, otherwise the function will return  * IX_FAIL and set the <i>lastError</i> field to IX_USB_NO_PERMISSION. * * @return IX_SUCCESS if the initialization was successful, IX_FAIL otherwise, * in which case a detailed error code will be set in the <i>lastError</i> field, * unless the <i>device</i> parameter is NULL. */PUBLIC IX_STATUS ixUSBSignalResume(USBDevice *device);/** * @ingroup IxUsbAPI * * @fn PUBLIC IX_STATUS ixUSBFrameCounterGet(USBDevice *device, UINT16 *counter) * * @brief Retrieve the 11-bit frame counter * * @param device USBDevice * (in) - a structure identifying the device * @param counter UINT16 * (out) - the 11-bit frame counter * * This function returns the hardware USB frame counter.<br> * Since the counter is 11-bit wide it rolls over after every 2048 frames. * * @return IX_SUCCESS if the initialization was successful, IX_FAIL otherwise, * in which case a detailed error code will be set in the <i>lastError</i> field, * unless the <i>device</i> parameter is NULL. */PUBLIC IX_STATUS ixUSBFrameCounterGet(USBDevice *device, UINT16 *counter);/** * @ingroup IxUsbAPI * * @fn PUBLIC IX_STATUS ixUSBReceiveCallbackRegister(USBDevice *device, USBReceiveCallback callbackFunction) * * @brief Register a data receive callback * * @param device USBDevice * (in) - a structure identifying the device * @param callbackFunction USBReceiveCallback (in) - receive callback function * * @return IX_SUCCESS if the initialization was successful, IX_FAIL otherwise, * in which case a detailed error code will be set in the <i>lastError</i> field, * unless the <i>device</i> parameter is NULL. */PUBLIC IX_STATUS ixUSBReceiveCallbackRegister(USBDevice *device,                              USBReceiveCallback callbackFunction);/** * @ingroup IxUsbAPI * * @fn PUBLIC IX_STATUS ixUSBSetupCallbackRegister(USBDevice *device, USBSetupCallback callbackFunction) * * @brief Register a setup receive callback * * @param device USBDevice * (in) - a structure identifying the device * @param callbackFunction USBSetupCallback (in) - setup callback function * * @return IX_SUCCESS if the initialization was successful, IX_FAIL otherwise, * in which case a detailed error code will be set in the <i>lastError</i> field, * unless the <i>device</i> parameter is NULL. */PUBLIC IX_STATUS ixUSBSetupCallbackRegister(USBDevice *device,                           USBSetupCallback callbackFunction);/** * @ingroup IxUsbAPI * * @fn PUBLIC IX_STATUS ixUSBBufferSubmit(USBDevice *device, UINT16 destinationEndpoint, IX_USB_MBLK *sendBuffer) * * @brief Submit a buffer for transmit * * @param device USBDevice * (in) - a structure identifying the device * @param destinationEndpoint UINT16 (in) - endpoint to be used for transmitting the data buffer * @param sendBuffer IX_USB_MBLK * (in) - data buffer * * @return IX_SUCCESS if the initialization was successful, IX_FAIL otherwise, * in which case a detailed error code will be set in the <i>lastError</i> field, * unless the <i>device</i> parameter is NULL. */PUBLIC IX_STATUS ixUSBBufferSubmit(USBDevice *device,                  UINT16 destinationEndpoint,                  IX_USB_MBLK *sendBuffer);/** * @fn PUBLIC IX_STATUS ixUSBBufferCancel(USBDevice *device, UINT16 destinationEndpoint, IX_USB_MBLK *sendBuffer) * * @brief Cancel a buffer previously submitted for transmitting * * @param device USBDevice * (in) - a structure identifying the device * @param destinationEndpoint UINT16 (in) - endpoint originally used for transmitting the data buffer * @param sendBuffer IX_USB_MBLK * (in) - sumbitted data buffer * * @return IX_SUCCESS if the initialization was successful, IX_FAIL otherwise, * in which case a detailed error code will be set in the <i>lastError</i> field, * unless the <i>device</i> parameter is NULL. */PUBLIC IX_STATUSixUSBBufferCancel(USBDevice *device,                  UINT16 destinationEndpoint,                   IX_USB_MBLK *sendBuffer);/** * @ingroup IxUsbAPI * * @fn PUBLIC IX_STATUS ixUSBEventCallbackRegister(USBDevice *device, USBEventCallback eventCallback, USBEventMap eventMap) * * @brief Register an event callback * * @param device USBDevice * (in) - a structure identifying the device * @param eventCallback USBEventCallback (in) - event callback function * @param eventMap USBEventMap (in) - event map * * @return IX_SUCCESS if the initialization was successful, IX_FAIL otherwise, * in which case a detailed error code will be set in the <i>lastError</i> field, * unless the <i>device</i> parameter is NULL. */PUBLIC IX_STATUS ixUSBEventCallbackRegister(USBDevice *device,                            USBEventCallback eventCallback,                            USBEventMap eventMap);/** * @ingroup IxUsbAPI * * @fn PUBLIC IX_STATUS ixUSBIsEndpointStalled(USBDevice *device, UINT16 endpointNumber, BOOL *stallState) * * @brief Retrieve an endpoint's stall status * * @param device USBDevice * (in) - a structure identifying the device * @param endpointNumber UINT16 (in) - endpoint number * @param stallState BOOL * (out) - stall state; <b>true</b> if the endpoint is stalled (<i>halted</i>) or * <b>false</b> otherwise<b>true</b> *  * @return IX_SUCCESS or IX_FAIL if the device pointer is invalid or the endpoint doesn't exist */PUBLIC IX_STATUSixUSBIsEndpointStalled(USBDevice *device, UINT16 endpointNumber, BOOL *stallState);/** * @ingroup IxUsbAPI * * @fn PUBLIC IX_USB_MBLK *ixUSBBufferAlloc(size_t size) * * @brief Allocates a buffer from the USB driver buffer pool * * @param size size_t (in) - desired size, in bytes, of the buffer to be allocated *  * @return a pointer to a newly allocated buffer or NULL if the allocation failed */PUBLIC IX_USB_MBLK*ixUSBBufferAlloc(size_t size);#ifdef IX_USB_HAS_STATISTICS_SHOW/** * @fn PUBLIC IX_STATUS ixUSBStatisticsShow(USBDevice *device) * * @brief Display device state and statistics * * @param device USBDevice * (in) - a structure identifying the device * * @return IX_SUCCESS if the initialization was successful, IX_FAIL otherwise, * in which case a detailed error code will be set in the <i>lastError</i> field, * unless the <i>device</i> parameter is NULL. */PUBLIC IX_STATUS ixUSBStatisticsShow(USBDevice *device);#endif#ifdef IX_USB_HAS_GET_ERROR_STRING/** * @ingroup IxUsbAPI * * @fn PUBLIC const char * ixUSBErrorStringGet(UINT32 errorCode) * * @brief Convert an error code into a human-readable string error message * * @param errorCode UINT32 (in) - erorr code as defined in usberrors.h * * @return a <tt>const char *</tt> pointer to the error message */PUBLIC const char * ixUSBErrorStringGet(UINT32 errorCode);#endif#ifdef IX_USB_HAS_ENDPOINT_INFO_SHOW/** * @fn PUBLIC void ixUSBEndpointInfoShow(USBDevice *device) * * @brief Display endpoint information table * * @param device USBDevice * (in) - a structure identifying the device * * @return none */PUBLIC IX_STATUS ixUSBEndpointInfoShow(USBDevice *device);#endif#ifdef IX_USB_HAS_DUMMY_MBLK/** * @ingroup IxUsbAPI * * @fn PUBLIC void free_IX_USB_MBLK(IX_USB_MBLK *this_IX_USB_MBLK) * * @brief Free an IX_USB_MBLK buffer * * @param this_IX_USB_MBLK IX_USB_MBLK * (in) - buffer * * This function is temporary and it is meant to be used as member function * inside an IX_USB_MBLK structure. Use the @ref MBLK_FREE() macro instead. * * @return none * * @internal */PUBLIC void free_IX_USB_MBLK(IX_USB_MBLK *this_IX_USB_MBLK);#endif#endif /* usb_H *//** * @} defgroup IxUsbAPI */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -