Changeset d4da860 in mainline
- Timestamp:
- 2017-10-27T00:20:51Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0798689, 584121d
- Parents:
- 37e8c4a
- Location:
- uspace/lib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/Makefile
r37e8c4a rd4da860 32 32 -Iinclude \ 33 33 -Igeneric/private \ 34 -I$(LIBUSB_PREFIX)/include \35 34 -I$(LIBPCM_PREFIX)/include 36 35 LIBRARY = libdrv -
uspace/lib/drv/include/usb_iface.h
r37e8c4a rd4da860 40 40 #include "ddf/driver.h" 41 41 #include <async.h> 42 #include <usb/usb.h>43 42 44 43 typedef async_sess_t usb_dev_session_t; 44 45 /** USB speeds. */ 46 typedef enum { 47 /** USB 1.1 low speed (1.5Mbits/s). */ 48 USB_SPEED_LOW, 49 /** USB 1.1 full speed (12Mbits/s). */ 50 USB_SPEED_FULL, 51 /** USB 2.0 high speed (480Mbits/s). */ 52 USB_SPEED_HIGH, 53 /** Psuedo-speed serving as a boundary. */ 54 USB_SPEED_MAX 55 } usb_speed_t; 56 57 /** USB endpoint number type. 58 * Negative values could be used to indicate error. 59 */ 60 typedef int16_t usb_endpoint_t; 61 62 /** USB address type. 63 * Negative values could be used to indicate error. 64 */ 65 typedef int16_t usb_address_t; 66 67 /** USB transfer type. */ 68 typedef enum { 69 USB_TRANSFER_CONTROL = 0, 70 USB_TRANSFER_ISOCHRONOUS = 1, 71 USB_TRANSFER_BULK = 2, 72 USB_TRANSFER_INTERRUPT = 3 73 } usb_transfer_type_t; 74 75 /** USB data transfer direction. */ 76 typedef enum { 77 USB_DIRECTION_IN, 78 USB_DIRECTION_OUT, 79 USB_DIRECTION_BOTH 80 } usb_direction_t; 81 82 /** USB complete address type. 83 * Pair address + endpoint is identification of transaction recipient. 84 */ 85 typedef union { 86 struct { 87 usb_address_t address; 88 usb_endpoint_t endpoint; 89 } __attribute__((packed)); 90 uint32_t packed; 91 } usb_target_t; 45 92 46 93 extern usb_dev_session_t *usb_dev_connect(devman_handle_t); -
uspace/lib/drv/include/usbhc_iface.h
r37e8c4a rd4da860 41 41 42 42 #include "ddf/driver.h" 43 #include <usb /usb.h>43 #include <usb_iface.h> 44 44 #include <stdbool.h> 45 45 -
uspace/lib/drv/include/usbhid_iface.h
r37e8c4a rd4da860 38 38 39 39 #include "ddf/driver.h" 40 #include <usb/usb.h>41 40 42 41 extern int usbhid_dev_get_event_length(async_sess_t *, size_t *); -
uspace/lib/usb/Makefile
r37e8c4a rd4da860 31 31 EXTRA_CFLAGS += \ 32 32 -I$(LIBDRV_PREFIX)/include \ 33 -I$(LIBUSBDEV_PREFIX)/include \34 33 -Iinclude 35 34 -
uspace/lib/usb/include/usb/usb.h
r37e8c4a rd4da860 39 39 #include <stdint.h> 40 40 #include <types/common.h> 41 #include <usb_iface.h> 41 42 42 43 /** Convert 16bit value from native (host) endianness to USB endianness. */ … … 52 53 #define uint32_usb2host(n) uint32_t_le2host((n)) 53 54 54 55 /** USB transfer type. */56 typedef enum {57 USB_TRANSFER_CONTROL = 0,58 USB_TRANSFER_ISOCHRONOUS = 1,59 USB_TRANSFER_BULK = 2,60 USB_TRANSFER_INTERRUPT = 361 } usb_transfer_type_t;62 63 55 const char * usb_str_transfer_type(usb_transfer_type_t t); 64 56 const char * usb_str_transfer_type_short(usb_transfer_type_t t); 65 57 66 /** USB data transfer direction. */67 typedef enum {68 USB_DIRECTION_IN,69 USB_DIRECTION_OUT,70 USB_DIRECTION_BOTH71 } usb_direction_t;72 73 58 const char *usb_str_direction(usb_direction_t); 74 75 /** USB speeds. */76 typedef enum {77 /** USB 1.1 low speed (1.5Mbits/s). */78 USB_SPEED_LOW,79 /** USB 1.1 full speed (12Mbits/s). */80 USB_SPEED_FULL,81 /** USB 2.0 high speed (480Mbits/s). */82 USB_SPEED_HIGH,83 /** Psuedo-speed serving as a boundary. */84 USB_SPEED_MAX85 } usb_speed_t;86 59 87 60 static inline bool usb_speed_is_11(const usb_speed_t s) … … 108 81 } usb_request_recipient_t; 109 82 110 /** USB address type.111 * Negative values could be used to indicate error.112 */113 typedef int16_t usb_address_t;114 115 83 /** Default USB address. */ 116 84 #define USB_ADDRESS_DEFAULT 0 … … 132 100 } 133 101 134 /** USB endpoint number type.135 * Negative values could be used to indicate error.136 */137 typedef int16_t usb_endpoint_t;138 139 102 /** Default control endpoint */ 140 103 #define USB_ENDPOINT_DEFAULT_CONTROL 0 … … 155 118 (ep < USB11_ENDPOINT_MAX); 156 119 } 157 158 159 /** USB complete address type.160 * Pair address + endpoint is identification of transaction recipient.161 */162 typedef union {163 struct {164 usb_address_t address;165 usb_endpoint_t endpoint;166 } __attribute__((packed));167 uint32_t packed;168 } usb_target_t;169 120 170 121 /** Check USB target for allowed values (address and endpoint).
Note:
See TracChangeset
for help on using the changeset viewer.