Changeset f1d6866 in mainline for uspace/lib/usb/include/usb/usb.h
- Timestamp:
- 2011-09-18T21:22:59Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- dcc44ca1
- Parents:
- 85ff862 (diff), 45a9cf4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/include/usb/usb.h
r85ff862 rf1d6866 36 36 #define LIBUSB_USB_H_ 37 37 38 #include <bool.h> 38 39 #include <sys/types.h> 39 40 #include <byteorder.h> … … 105 106 * Negative values could be used to indicate error. 106 107 */ 107 typedef int usb_address_t;108 typedef int16_t usb_address_t; 108 109 109 110 /** Default USB address. */ … … 115 116 * Negative values could be used to indicate error. 116 117 */ 117 typedef int usb_endpoint_t;118 typedef int16_t usb_endpoint_t; 118 119 119 120 /** Maximum endpoint number in USB 1.1. … … 125 126 * Pair address + endpoint is identification of transaction recipient. 126 127 */ 127 typedef struct { 128 usb_address_t address; 129 usb_endpoint_t endpoint; 128 typedef union { 129 struct { 130 usb_address_t address; 131 usb_endpoint_t endpoint; 132 } __attribute__((packed)); 133 uint32_t packed; 130 134 } usb_target_t; 135 136 /** Check USB target for allowed values (address and endpoint). 137 * 138 * @param target. 139 * @return True, if values are wihtin limits, false otherwise. 140 */ 141 static inline bool usb_target_is_valid(usb_target_t target) 142 { 143 return !(target.endpoint > 15 || target.endpoint < 0 144 || target.address >= USB11_ADDRESS_MAX || target.address < 0); 145 } 131 146 132 147 /** Compare USB targets (addresses and endpoints).
Note:
See TracChangeset
for help on using the changeset viewer.