Changeset 71f211f in mainline for uspace/lib/usbdev/include/usb/dev/poll.h
- Timestamp:
- 2018-01-13T20:47:58Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8a0c52a
- Parents:
- 7dddd7b
- git-author:
- Petr Manek <petr.manek@…> (2018-01-13 20:44:08)
- git-committer:
- Petr Manek <petr.manek@…> (2018-01-13 20:47:58)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/include/usb/dev/poll.h
r7dddd7b r71f211f 44 44 #include <stdint.h> 45 45 46 /** Automated polling instance. */ 47 typedef struct usb_device_polling usb_device_polling_t; 48 46 49 /** Parameters and callbacks for automated polling. */ 47 typedef struct {50 typedef struct usb_device_polling_config { 48 51 /** Level of debugging messages from auto polling. 49 52 * 0 - nothing … … 52 55 */ 53 56 int debug; 57 54 58 /** Maximum number of consecutive errors before polling termination. */ 55 59 size_t max_failures; 60 56 61 /** Delay between poll requests in milliseconds. 57 62 * Set to negative value to use value from endpoint descriptor. 58 63 */ 59 64 int delay; 65 60 66 /** Whether to automatically try to clear the HALT feature after 61 67 * the endpoint stalls. 62 68 */ 63 69 bool auto_clear_halt; 70 64 71 /** Callback when data arrives. 65 72 * … … 72 79 bool (*on_data)(usb_device_t *dev, uint8_t *data, size_t data_size, 73 80 void *arg); 81 74 82 /** Callback when polling is terminated. 75 83 * … … 80 88 void (*on_polling_end)(usb_device_t *dev, bool due_to_errors, 81 89 void *arg); 90 82 91 /** Callback when error occurs. 83 92 * … … 88 97 */ 89 98 bool (*on_error)(usb_device_t *dev, int err_code, void *arg); 99 90 100 /** Argument to pass to callbacks. */ 91 101 void *arg; 92 } usb_device_ auto_polling_t;102 } usb_device_polling_config_t; 93 103 94 typedef bool (*usb_polling_callback_t)(usb_device_t *, uint8_t *, size_t, void *); 95 typedef bool (*usb_polling_error_callback_t)(usb_device_t *, int, void *); 96 typedef void (*usb_polling_terminted_callback_t)(usb_device_t *, bool, void *); 97 98 extern int usb_device_auto_polling(usb_device_t *, usb_endpoint_mapping_t *, 99 const usb_device_auto_polling_t *, size_t); 104 extern int usb_device_poll(usb_device_t *, usb_endpoint_mapping_t *, 105 const usb_device_polling_config_t *, size_t, usb_device_polling_t **); 100 106 101 107 #endif
Note:
See TracChangeset
for help on using the changeset viewer.