objc2_io_kit/generated/usb/
USB.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5#[cfg(feature = "objc2")]
6use objc2::__framework_prelude::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kcallinterfaceopenwithgate?language=objc)
11pub const kCallInterfaceOpenWithGate: &CStr =
12    unsafe { CStr::from_bytes_with_nul_unchecked(b"kCallInterfaceOpenWithGate\0") };
13/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbunknownpipeerr?language=objc)
14pub const kIOUSBUnknownPipeErr: c_uint = iokit_usb_err!(0x61);
15/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbtoomanypipeserr?language=objc)
16pub const kIOUSBTooManyPipesErr: c_uint = iokit_usb_err!(0x60);
17/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbnoasyncporterr?language=objc)
18pub const kIOUSBNoAsyncPortErr: c_uint = iokit_usb_err!(0x5f);
19/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbnotenoughpipeserr?language=objc)
20pub const kIOUSBNotEnoughPipesErr: c_uint = iokit_usb_err!(0x5e);
21/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbnotenoughpowererr?language=objc)
22pub const kIOUSBNotEnoughPowerErr: c_uint = iokit_usb_err!(0x5d);
23/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbendpointnotfound?language=objc)
24pub const kIOUSBEndpointNotFound: c_uint = iokit_usb_err!(0x57);
25/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbconfignotfound?language=objc)
26pub const kIOUSBConfigNotFound: c_uint = iokit_usb_err!(0x56);
27/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbportwassuspended?language=objc)
28pub const kIOUSBPortWasSuspended: c_uint = iokit_usb_err!(0x52);
29/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbpipestalled?language=objc)
30pub const kIOUSBPipeStalled: c_uint = iokit_usb_err!(0x4f);
31/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbinterfacenotfound?language=objc)
32pub const kIOUSBInterfaceNotFound: c_uint = iokit_usb_err!(0x4e);
33/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousblowlatencybuffernotpreviouslyallocated?language=objc)
34pub const kIOUSBLowLatencyBufferNotPreviouslyAllocated: c_uint = iokit_usb_err!(0x4d);
35/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousblowlatencyframelistnotpreviouslyallocated?language=objc)
36pub const kIOUSBLowLatencyFrameListNotPreviouslyAllocated: c_uint = iokit_usb_err!(0x4c);
37/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbhighspeedspliterror?language=objc)
38pub const kIOUSBHighSpeedSplitError: c_uint = iokit_usb_err!(0x4b);
39/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbsyncrequestonwlthread?language=objc)
40pub const kIOUSBSyncRequestOnWLThread: c_uint = iokit_usb_err!(0x4a);
41/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbdevicenothighspeed?language=objc)
42pub const kIOUSBDeviceNotHighSpeed: c_uint = iokit_usb_err!(0x49);
43/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbdevicetransferredtocompanion?language=objc)
44pub const kIOUSBDeviceTransferredToCompanion: c_uint = iokit_usb_err!(0x49);
45/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbclearpipestallnotrecursive?language=objc)
46pub const kIOUSBClearPipeStallNotRecursive: c_uint = iokit_usb_err!(0x48);
47/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbdeviceportwasnotsuspended?language=objc)
48pub const kIOUSBDevicePortWasNotSuspended: c_uint = iokit_usb_err!(0x47);
49/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbendpointcountexceeded?language=objc)
50pub const kIOUSBEndpointCountExceeded: c_uint = iokit_usb_err!(0x46);
51/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbdevicecountexceeded?language=objc)
52pub const kIOUSBDeviceCountExceeded: c_uint = iokit_usb_err!(0x45);
53/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbstreamsnotsupported?language=objc)
54pub const kIOUSBStreamsNotSupported: c_uint = iokit_usb_err!(0x44);
55/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbinvalidssendpoint?language=objc)
56pub const kIOUSBInvalidSSEndpoint: c_uint = iokit_usb_err!(0x43);
57/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbtoomanytransactionspending?language=objc)
58pub const kIOUSBTooManyTransactionsPending: c_uint = iokit_usb_err!(0x42);
59/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbtransactionreturned?language=objc)
60pub const kIOUSBTransactionReturned: c_uint = iokit_usb_err!(0x50);
61/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbtransactiontimeout?language=objc)
62pub const kIOUSBTransactionTimeout: c_uint = iokit_usb_err!(0x51);
63/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousblinkerr?language=objc)
64pub const kIOUSBLinkErr: c_uint = iokit_usb_err!(0x10);
65/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbnotsent2err?language=objc)
66pub const kIOUSBNotSent2Err: c_uint = iokit_usb_err!(0x0f);
67/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbnotsent1err?language=objc)
68pub const kIOUSBNotSent1Err: c_uint = iokit_usb_err!(0x0e);
69/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbbufferunderrunerr?language=objc)
70pub const kIOUSBBufferUnderrunErr: c_uint = iokit_usb_err!(0x0d);
71/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbbufferoverrunerr?language=objc)
72pub const kIOUSBBufferOverrunErr: c_uint = iokit_usb_err!(0x0c);
73/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbreserved2err?language=objc)
74pub const kIOUSBReserved2Err: c_uint = iokit_usb_err!(0x0b);
75/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbreserved1err?language=objc)
76pub const kIOUSBReserved1Err: c_uint = iokit_usb_err!(0x0a);
77/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbwrongpiderr?language=objc)
78pub const kIOUSBWrongPIDErr: c_uint = iokit_usb_err!(0x07);
79/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbpidcheckerr?language=objc)
80pub const kIOUSBPIDCheckErr: c_uint = iokit_usb_err!(0x06);
81/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbdatatoggleerr?language=objc)
82pub const kIOUSBDataToggleErr: c_uint = iokit_usb_err!(0x03);
83/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbbitstuferr?language=objc)
84pub const kIOUSBBitstufErr: c_uint = iokit_usb_err!(0x02);
85/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbcrcerr?language=objc)
86pub const kIOUSBCRCErr: c_uint = iokit_usb_err!(0x01);
87/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessagehubresetport?language=objc)
88pub const kIOUSBMessageHubResetPort: c_uint = iokit_usb_msg!(0x01);
89/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessagehubsuspendport?language=objc)
90pub const kIOUSBMessageHubSuspendPort: c_uint = iokit_usb_msg!(0x02);
91/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessagehubresumeport?language=objc)
92pub const kIOUSBMessageHubResumePort: c_uint = iokit_usb_msg!(0x03);
93/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessagehubisdeviceconnected?language=objc)
94pub const kIOUSBMessageHubIsDeviceConnected: c_uint = iokit_usb_msg!(0x04);
95/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessagehubisportenabled?language=objc)
96pub const kIOUSBMessageHubIsPortEnabled: c_uint = iokit_usb_msg!(0x05);
97/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessagehubreenumerateport?language=objc)
98pub const kIOUSBMessageHubReEnumeratePort: c_uint = iokit_usb_msg!(0x06);
99/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessageporthasbeenreset?language=objc)
100pub const kIOUSBMessagePortHasBeenReset: c_uint = iokit_usb_msg!(0x0a);
101/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessageporthasbeenresumed?language=objc)
102pub const kIOUSBMessagePortHasBeenResumed: c_uint = iokit_usb_msg!(0x0b);
103/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessagehubportcleartt?language=objc)
104pub const kIOUSBMessageHubPortClearTT: c_uint = iokit_usb_msg!(0x0c);
105/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessageporthasbeensuspended?language=objc)
106pub const kIOUSBMessagePortHasBeenSuspended: c_uint = iokit_usb_msg!(0x0d);
107/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessagefromthirdparty?language=objc)
108pub const kIOUSBMessageFromThirdParty: c_uint = iokit_usb_msg!(0x0e);
109/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessageportwasnotsuspended?language=objc)
110pub const kIOUSBMessagePortWasNotSuspended: c_uint = iokit_usb_msg!(0x0f);
111/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessageexpresscardcantwake?language=objc)
112pub const kIOUSBMessageExpressCardCantWake: c_uint = iokit_usb_msg!(0x10);
113/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessagecompositedriverreconfigured?language=objc)
114pub const kIOUSBMessageCompositeDriverReconfigured: c_uint = iokit_usb_msg!(0x11);
115/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessagehubsetportrecoverytime?language=objc)
116pub const kIOUSBMessageHubSetPortRecoveryTime: c_uint = iokit_usb_msg!(0x12);
117/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessageovercurrentcondition?language=objc)
118pub const kIOUSBMessageOvercurrentCondition: c_uint = iokit_usb_msg!(0x13);
119/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessagenotenoughpower?language=objc)
120pub const kIOUSBMessageNotEnoughPower: c_uint = iokit_usb_msg!(0x14);
121/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessagecontroller?language=objc)
122pub const kIOUSBMessageController: c_uint = iokit_usb_msg!(0x15);
123/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessageroothubwakeevent?language=objc)
124pub const kIOUSBMessageRootHubWakeEvent: c_uint = iokit_usb_msg!(0x16);
125/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessagereleaseextracurrent?language=objc)
126pub const kIOUSBMessageReleaseExtraCurrent: c_uint = iokit_usb_msg!(0x17);
127/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessagereallocateextracurrent?language=objc)
128pub const kIOUSBMessageReallocateExtraCurrent: c_uint = iokit_usb_msg!(0x18);
129/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessageendpointcountexceeded?language=objc)
130pub const kIOUSBMessageEndpointCountExceeded: c_uint = iokit_usb_msg!(0x19);
131/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessagedevicecountexceeded?language=objc)
132pub const kIOUSBMessageDeviceCountExceeded: c_uint = iokit_usb_msg!(0x1a);
133/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessagehubportdevicedisconnected?language=objc)
134pub const kIOUSBMessageHubPortDeviceDisconnected: c_uint = iokit_usb_msg!(0x1b);
135/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessageunsupportedconfiguration?language=objc)
136pub const kIOUSBMessageUnsupportedConfiguration: c_uint = iokit_usb_msg!(0x1c);
137/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessagehubcountexceeded?language=objc)
138pub const kIOUSBMessageHubCountExceeded: c_uint = iokit_usb_msg!(0x1d);
139/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessagetdmlowbattery?language=objc)
140pub const kIOUSBMessageTDMLowBattery: c_uint = iokit_usb_msg!(0x1e);
141/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessagelegacysuspenddevice?language=objc)
142pub const kIOUSBMessageLegacySuspendDevice: c_uint = iokit_usb_msg!(0x1f);
143/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessagelegacyresetdevice?language=objc)
144pub const kIOUSBMessageLegacyResetDevice: c_uint = iokit_usb_msg!(0x20);
145/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessagelegacyreenumeratedevice?language=objc)
146pub const kIOUSBMessageLegacyReEnumerateDevice: c_uint = iokit_usb_msg!(0x21);
147/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbmessageconfigurationset?language=objc)
148pub const kIOUSBMessageConfigurationSet: c_uint = iokit_usb_msg!(0x22);
149/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdevicepropertybuspoweravailable?language=objc)
150pub const kUSBDevicePropertyBusPowerAvailable: &CStr =
151    unsafe { CStr::from_bytes_with_nul_unchecked(b"Bus Power Available\0") };
152/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdevicepropertylocationid?language=objc)
153#[cfg(feature = "IOUSBHostFamilyDefinitions")]
154pub const kUSBDevicePropertyLocationID: &CStr = kUSBHostPropertyLocationID;
155/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbproductidmask?language=objc)
156#[cfg(feature = "IOUSBHostFamilyDefinitions")]
157pub const kUSBProductIDMask: &CStr = kUSBHostMatchingPropertyProductIDMask;
158/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbproductidsarrayname?language=objc)
159#[cfg(feature = "IOUSBHostFamilyDefinitions")]
160pub const kUSBProductIdsArrayName: &CStr = kUSBHostMatchingPropertyProductIDArray;
161/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbsuspendport?language=objc)
162pub const kUSBSuspendPort: &CStr =
163    unsafe { CStr::from_bytes_with_nul_unchecked(b"kSuspendPort\0") };
164/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbexpresscardcantwake?language=objc)
165pub const kUSBExpressCardCantWake: &CStr =
166    unsafe { CStr::from_bytes_with_nul_unchecked(b"ExpressCardCantWake\0") };
167/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdeviceresumerecoverytime?language=objc)
168#[cfg(feature = "IOUSBHostFamilyDefinitions")]
169pub const kUSBDeviceResumeRecoveryTime: &CStr = kUSBHostDevicePropertyResumeRecoveryTime;
170/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusboutofspecmpsok?language=objc)
171pub const kUSBOutOfSpecMPSOK: &CStr =
172    unsafe { CStr::from_bytes_with_nul_unchecked(b"Out of spec MPS OK\0") };
173/// [Apple's documentation](https://developer.apple.com/documentation/iokit/koverrideifatlocationid?language=objc)
174pub const kOverrideIfAtLocationID: &CStr =
175    unsafe { CStr::from_bytes_with_nul_unchecked(b"OverrideIfAtLocationID\0") };
176/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdevicecurrentconfiguration?language=objc)
177#[cfg(feature = "IOUSBHostFamilyDefinitions")]
178pub const kUSBDeviceCurrentConfiguration: &CStr = kUSBHostDevicePropertyCurrentConfiguration;
179/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdeviceremotewakeoverride?language=objc)
180#[cfg(feature = "IOUSBHostFamilyDefinitions")]
181pub const kUSBDeviceRemoteWakeOverride: &CStr = kUSBHostDevicePropertyRemoteWakeOverride;
182/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdeviceconfigurationcurrentoverride?language=objc)
183#[cfg(feature = "IOUSBHostFamilyDefinitions")]
184pub const kUSBDeviceConfigurationCurrentOverride: &CStr =
185    kUSBHostDevicePropertyConfigurationCurrentOverride;
186/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdeviceresetdurationoverride?language=objc)
187#[cfg(feature = "IOUSBHostFamilyDefinitions")]
188pub const kUSBDeviceResetDurationOverride: &CStr = kUSBHostDevicePropertyResetDurationOverride;
189/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdevicefailedrequestedpower?language=objc)
190#[cfg(feature = "IOUSBHostFamilyDefinitions")]
191pub const kUSBDeviceFailedRequestedPower: &CStr = kUSBHostDevicePropertyFailedRequestedPower;
192/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbpropertyremovable?language=objc)
193#[cfg(feature = "IOUSBHostFamilyDefinitions")]
194pub const kUSBPropertyRemovable: &CStr = kUSBHostPortPropertyRemovable;
195/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbpropertytestmode?language=objc)
196#[cfg(feature = "IOUSBHostFamilyDefinitions")]
197pub const kUSBPropertyTestMode: &CStr = kUSBHostPortPropertyTestMode;
198/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbpropertydebuglevel?language=objc)
199#[cfg(feature = "IOUSBHostFamilyDefinitions")]
200pub const kUSBPropertyDebugLevel: &CStr = kUSBHostPropertyDebugOptions;
201/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbhubpropertypowersupply?language=objc)
202#[cfg(feature = "IOUSBHostFamilyDefinitions")]
203pub const kUSBHubPropertyPowerSupply: &CStr = kUSBHostHubPropertyPowerSupply;
204/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbcontrollersleepsupported?language=objc)
205#[cfg(feature = "IOUSBHostFamilyDefinitions")]
206pub const kUSBControllerSleepSupported: &CStr = kUSBHostControllerPropertySleepSupported;
207/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbportpropertybuscurrentallocation?language=objc)
208#[cfg(feature = "IOUSBHostFamilyDefinitions")]
209pub const kUSBPortPropertyBusCurrentAllocation: &CStr = kUSBHostPortPropertyBusCurrentAllocation;
210/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbpreferredinterface?language=objc)
211pub const kUSBPreferredInterface: &CStr =
212    unsafe { CStr::from_bytes_with_nul_unchecked(b"Preferred Interface\0") };
213/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbpreferredinterfacepriority?language=objc)
214pub const kUSBPreferredInterfacePriority: &CStr =
215    unsafe { CStr::from_bytes_with_nul_unchecked(b"priority\0") };
216/// [Apple's documentation](https://developer.apple.com/documentation/iokit/koverrideallowlowpower?language=objc)
217pub const kOverrideAllowLowPower: &CStr =
218    unsafe { CStr::from_bytes_with_nul_unchecked(b"kOverrideAllowLowPower\0") };
219/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbusercliententitlementrequired?language=objc)
220pub const kUSBUserClientEntitlementRequired: &CStr =
221    unsafe { CStr::from_bytes_with_nul_unchecked(b"UsbUserClientEntitlementRequired\0") };
222/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdevicepropertyspeed?language=objc)
223pub const kUSBDevicePropertySpeed: &CStr =
224    unsafe { CStr::from_bytes_with_nul_unchecked(b"Device Speed\0") };
225/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdevicepropertyaddress?language=objc)
226pub const kUSBDevicePropertyAddress: &CStr =
227    unsafe { CStr::from_bytes_with_nul_unchecked(b"USB Address\0") };
228/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbpreferredconfiguration?language=objc)
229pub const kUSBPreferredConfiguration: &CStr =
230    unsafe { CStr::from_bytes_with_nul_unchecked(b"Preferred Configuration\0") };
231/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbcontrollerneedscontiguousmemoryforisoch?language=objc)
232pub const kUSBControllerNeedsContiguousMemoryForIsoch: &CStr =
233    unsafe { CStr::from_bytes_with_nul_unchecked(b"Need contiguous memory for isoch\0") };
234/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbhubdontallowlowpower?language=objc)
235pub const kUSBHubDontAllowLowPower: &CStr =
236    unsafe { CStr::from_bytes_with_nul_unchecked(b"kUSBHubDontAllowLowPower\0") };
237/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kconfigurationdescriptoroverride?language=objc)
238pub const kConfigurationDescriptorOverride: &CStr =
239    unsafe { CStr::from_bytes_with_nul_unchecked(b"ConfigurationDescriptorOverride\0") };
240/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kapplerevocableextracurrent?language=objc)
241pub const kAppleRevocableExtraCurrent: &CStr =
242    unsafe { CStr::from_bytes_with_nul_unchecked(b"AAPL,revocable-extra-current\0") };
243/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kappleexternalsuperspeedports?language=objc)
244pub const kAppleExternalSuperSpeedPorts: &CStr =
245    unsafe { CStr::from_bytes_with_nul_unchecked(b"AAPL,ExternalSSPorts\0") };
246/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kappleunconnectedsuperspeedports?language=objc)
247pub const kAppleUnconnectedSuperSpeedPorts: &CStr =
248    unsafe { CStr::from_bytes_with_nul_unchecked(b"AAPL,UnconnectedSSPorts\0") };
249/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kappleacpiroothubdepth?language=objc)
250pub const kAppleAcpiRootHubDepth: &CStr =
251    unsafe { CStr::from_bytes_with_nul_unchecked(b"AAPL,root-hub-depth\0") };
252/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kapplestandardportcurrentinsleep?language=objc)
253pub const kAppleStandardPortCurrentInSleep: &CStr =
254    unsafe { CStr::from_bytes_with_nul_unchecked(b"AAPL,standard-port-current-in-sleep\0") };
255/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kappleinternalusbdevice?language=objc)
256pub const kAppleInternalUSBDevice: &CStr =
257    unsafe { CStr::from_bytes_with_nul_unchecked(b"AAPL,device-internal\0") };
258/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbbusid?language=objc)
259pub const kUSBBusID: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"AAPL,bus-id\0") };
260/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kapplepowersupply?language=objc)
261pub const kApplePowerSupply: &CStr =
262    unsafe { CStr::from_bytes_with_nul_unchecked(b"AAPL,power-supply\0") };
263/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kapplecurrentavailable?language=objc)
264pub const kAppleCurrentAvailable: &CStr =
265    unsafe { CStr::from_bytes_with_nul_unchecked(b"AAPL,current-available\0") };
266/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kapplecurrentinsleep?language=objc)
267pub const kAppleCurrentInSleep: &CStr =
268    unsafe { CStr::from_bytes_with_nul_unchecked(b"AAPL,current-in-sleep\0") };
269/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kappleportcurrentinsleep?language=objc)
270pub const kApplePortCurrentInSleep: &CStr =
271    unsafe { CStr::from_bytes_with_nul_unchecked(b"AAPL,port-current-in-sleep\0") };
272/// [Apple's documentation](https://developer.apple.com/documentation/iokit/koverrideattachedtocpu?language=objc)
273pub const kOverrideAttachedToCPU: &CStr =
274    unsafe { CStr::from_bytes_with_nul_unchecked(b"kOverrideAttachedToCPU\0") };
275/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kehciisochmaxbusstall?language=objc)
276pub const kEHCIIsochMaxBusStall: c_uint = 25000;
277/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kxhciisochmaxbusstall?language=objc)
278pub const kXHCIIsochMaxBusStall: c_uint = 25000;
279/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kohciisochmaxbusstall?language=objc)
280pub const kOHCIIsochMaxBusStall: c_uint = 25000;
281/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kuhciisochmaxbusstall?language=objc)
282pub const kUHCIIsochMaxBusStall: c_uint = 10000;
283/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kmaxbusstall10us?language=objc)
284pub const kMaxBusStall10uS: c_uint = 10000;
285/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kmaxbusstall25us?language=objc)
286pub const kMaxBusStall25uS: c_uint = 25000;
287/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdeviceidshift?language=objc)
288pub const kUSBDeviceIDShift: c_long = 7;
289/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbmaxdevices?language=objc)
290pub const kUSBMaxDevices: c_long = 128;
291/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbmaxdevice?language=objc)
292pub const kUSBMaxDevice: c_long = kUSBMaxDevices - 1;
293/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdeviceidmask?language=objc)
294pub const kUSBDeviceIDMask: c_long = 0x7f;
295/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbtoomanydevicesaddress?language=objc)
296pub const kUSBTooManyDevicesAddress: c_long = 0xfffe;
297/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbpipeidmask?language=objc)
298pub const kUSBPipeIDMask: c_long = 0xf;
299/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbmaxpipes?language=objc)
300pub const kUSBMaxPipes: c_long = 32;
301/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbinterfaceidshift?language=objc)
302pub const kUSBInterfaceIDShift: c_long = 8;
303/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbmaxinterfaces?language=objc)
304pub const kUSBMaxInterfaces: c_long = 1 << kUSBInterfaceIDShift;
305/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbinterfaceidmask?language=objc)
306pub const kUSBInterfaceIDMask: c_long = kUSBMaxInterfaces - 1;
307/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbendptshift?language=objc)
308pub const kUSBEndPtShift: c_long = 7;
309/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdevicemask?language=objc)
310pub const kUSBDeviceMask: c_long = (1 << kUSBEndPtShift) - 1;
311/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbnopipeidx?language=objc)
312pub const kUSBNoPipeIdx: c_long = -1;
313/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbucrequestwithoutusbnotificationmask?language=objc)
314pub const kUSBUCRequestWithoutUSBNotificationMask: c_long = 1 << 30;
315/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbendpointtransfertypeucmask?language=objc)
316pub const kUSBEndpointTransferTypeUCMask: c_long = 1 << 7;
317/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbstream0?language=objc)
318pub const kUSBStream0: c_long = 0;
319/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbmaxstream?language=objc)
320pub const kUSBMaxStream: c_long = 65533;
321/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbprimestream?language=objc)
322pub const kUSBPRimeStream: c_long = 0xfffe;
323/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbnostream?language=objc)
324pub const kUSBNoStream: c_long = 0xffff;
325/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbstreamidmask?language=objc)
326pub const kUSBStreamIDMask: c_long = 0xffff;
327/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbstreamidallstreamsmask?language=objc)
328pub const kUSBStreamIDAllStreamsMask: c_long = 1 << 31;
329
330/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbrqdirnshift?language=objc)
331#[cfg(feature = "AppleUSBDefinitions")]
332pub const kUSBRqDirnShift: c_uint = tIOUSBDeviceRequest::IOUSBDeviceRequestDirectionPhase.0;
333/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbrqdirnmask?language=objc)
334pub const kUSBRqDirnMask: c_uint = 1;
335/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbrqtypeshift?language=objc)
336#[cfg(feature = "AppleUSBDefinitions")]
337pub const kUSBRqTypeShift: c_uint = tIOUSBDeviceRequest::IOUSBDeviceRequestTypePhase.0;
338/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbrqtypemask?language=objc)
339pub const kUSBRqTypeMask: c_uint = 3;
340/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbrqrecipientmask?language=objc)
341#[cfg(feature = "AppleUSBDefinitions")]
342pub const kUSBRqRecipientMask: c_uint = tIOUSBDeviceRequest::IOUSBDeviceRequestRecipientMask.0;
343
344/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbmaxfsisocendpointreqcount?language=objc)
345pub const kUSBMaxFSIsocEndpointReqCount: c_uint = 1023;
346/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbmaxhsisocendpointreqcount?language=objc)
347pub const kUSBMaxHSIsocEndpointReqCount: c_uint = 3072;
348/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbmaxhsisocframecount?language=objc)
349pub const kUSBMaxHSIsocFrameCount: c_uint = 7168;
350
351/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kcleardevicefeature?language=objc)
352#[cfg(feature = "USBSpec")]
353pub const kClearDeviceFeature: c_uint =
354    EncodeRequest!(kUSBRqClearFeature, kUSBOut, kUSBStandard, kUSBDevice);
355/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kclearinterfacefeature?language=objc)
356#[cfg(feature = "USBSpec")]
357pub const kClearInterfaceFeature: c_uint =
358    EncodeRequest!(kUSBRqClearFeature, kUSBOut, kUSBStandard, kUSBInterface);
359/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kclearendpointfeature?language=objc)
360#[cfg(feature = "USBSpec")]
361pub const kClearEndpointFeature: c_uint =
362    EncodeRequest!(kUSBRqClearFeature, kUSBOut, kUSBStandard, kUSBEndpoint);
363/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kgetconfiguration?language=objc)
364#[cfg(feature = "USBSpec")]
365pub const kGetConfiguration: c_uint =
366    EncodeRequest!(kUSBRqGetConfig, kUSBIn, kUSBStandard, kUSBDevice);
367/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kgetdescriptor?language=objc)
368#[cfg(feature = "USBSpec")]
369pub const kGetDescriptor: c_uint =
370    EncodeRequest!(kUSBRqGetDescriptor, kUSBIn, kUSBStandard, kUSBDevice);
371/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kgetinterface?language=objc)
372#[cfg(feature = "USBSpec")]
373pub const kGetInterface: c_uint =
374    EncodeRequest!(kUSBRqGetInterface, kUSBIn, kUSBStandard, kUSBInterface);
375/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kgetdevicestatus?language=objc)
376#[cfg(feature = "USBSpec")]
377pub const kGetDeviceStatus: c_uint =
378    EncodeRequest!(kUSBRqGetStatus, kUSBIn, kUSBStandard, kUSBDevice);
379/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kgetinterfacestatus?language=objc)
380#[cfg(feature = "USBSpec")]
381pub const kGetInterfaceStatus: c_uint =
382    EncodeRequest!(kUSBRqGetStatus, kUSBIn, kUSBStandard, kUSBInterface);
383/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kgetendpointstatus?language=objc)
384#[cfg(feature = "USBSpec")]
385pub const kGetEndpointStatus: c_uint =
386    EncodeRequest!(kUSBRqGetStatus, kUSBIn, kUSBStandard, kUSBEndpoint);
387/// [Apple's documentation](https://developer.apple.com/documentation/iokit/ksetaddress?language=objc)
388#[cfg(feature = "USBSpec")]
389pub const kSetAddress: c_uint = EncodeRequest!(kUSBRqSetAddress, kUSBOut, kUSBStandard, kUSBDevice);
390/// [Apple's documentation](https://developer.apple.com/documentation/iokit/ksetconfiguration?language=objc)
391#[cfg(feature = "USBSpec")]
392pub const kSetConfiguration: c_uint =
393    EncodeRequest!(kUSBRqSetConfig, kUSBOut, kUSBStandard, kUSBDevice);
394/// [Apple's documentation](https://developer.apple.com/documentation/iokit/ksetdescriptor?language=objc)
395#[cfg(feature = "USBSpec")]
396pub const kSetDescriptor: c_uint =
397    EncodeRequest!(kUSBRqSetDescriptor, kUSBOut, kUSBStandard, kUSBDevice);
398/// [Apple's documentation](https://developer.apple.com/documentation/iokit/ksetdevicefeature?language=objc)
399#[cfg(feature = "USBSpec")]
400pub const kSetDeviceFeature: c_uint =
401    EncodeRequest!(kUSBRqSetFeature, kUSBOut, kUSBStandard, kUSBDevice);
402/// [Apple's documentation](https://developer.apple.com/documentation/iokit/ksetinterfacefeature?language=objc)
403#[cfg(feature = "USBSpec")]
404pub const kSetInterfaceFeature: c_uint =
405    EncodeRequest!(kUSBRqSetFeature, kUSBOut, kUSBStandard, kUSBInterface);
406/// [Apple's documentation](https://developer.apple.com/documentation/iokit/ksetendpointfeature?language=objc)
407#[cfg(feature = "USBSpec")]
408pub const kSetEndpointFeature: c_uint =
409    EncodeRequest!(kUSBRqSetFeature, kUSBOut, kUSBStandard, kUSBEndpoint);
410/// [Apple's documentation](https://developer.apple.com/documentation/iokit/ksetinterface?language=objc)
411#[cfg(feature = "USBSpec")]
412pub const kSetInterface: c_uint =
413    EncodeRequest!(kUSBRqSetInterface, kUSBOut, kUSBStandard, kUSBInterface);
414/// [Apple's documentation](https://developer.apple.com/documentation/iokit/ksyncframe?language=objc)
415#[cfg(feature = "USBSpec")]
416pub const kSyncFrame: c_uint = EncodeRequest!(kUSBRqSyncFrame, kUSBIn, kUSBStandard, kUSBEndpoint);
417
418/// [Apple's documentation](https://developer.apple.com/documentation/iokit/usbdeviceaddress?language=objc)
419pub type USBDeviceAddress = u16;
420
421/// [Apple's documentation](https://developer.apple.com/documentation/iokit/usbphysicaladdress32?language=objc)
422pub type USBPhysicalAddress32 = u32;
423
424/// Structure used to encode information about each isoc frame.
425///
426/// Parameter `frStatus`: Returns status associated with the frame.
427///
428/// Parameter `frReqCount`: Input specifiying how many bytes to read or write.
429///
430/// Parameter `frActCount`: Actual # of bytes transferred.
431///
432/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbisocframe?language=objc)
433#[repr(C)]
434#[derive(Clone, Copy, Debug, PartialEq)]
435pub struct IOUSBIsocFrame {
436    pub frStatus: IOReturn,
437    pub frReqCount: u16,
438    pub frActCount: u16,
439}
440
441#[cfg(feature = "objc2")]
442unsafe impl Encode for IOUSBIsocFrame {
443    const ENCODING: Encoding = Encoding::Struct(
444        "IOUSBIsocFrame",
445        &[<IOReturn>::ENCODING, <u16>::ENCODING, <u16>::ENCODING],
446    );
447}
448
449#[cfg(feature = "objc2")]
450unsafe impl RefEncode for IOUSBIsocFrame {
451    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
452}
453
454/// Structure used to encode information about each isoc frame that is processed
455/// at hardware interrupt time (low latency).
456///
457/// Parameter `frStatus`: Returns status associated with the frame.
458///
459/// Parameter `frReqCount`: Input specifiying how many bytes to read or write.
460///
461/// Parameter `frActCount`: Actual # of bytes transferred.
462///
463/// Parameter `frTimeStamp`: Time stamp that indicates time when frame was procesed.
464///
465/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousblowlatencyisocframe?language=objc)
466#[repr(C)]
467#[derive(Clone, Copy, Debug, PartialEq)]
468pub struct IOUSBLowLatencyIsocFrame {
469    pub frStatus: IOReturn,
470    pub frReqCount: u16,
471    pub frActCount: u16,
472    pub frTimeStamp: AbsoluteTime,
473}
474
475#[cfg(feature = "objc2")]
476unsafe impl Encode for IOUSBLowLatencyIsocFrame {
477    const ENCODING: Encoding = Encoding::Struct(
478        "IOUSBLowLatencyIsocFrame",
479        &[
480            <IOReturn>::ENCODING,
481            <u16>::ENCODING,
482            <u16>::ENCODING,
483            <AbsoluteTime>::ENCODING,
484        ],
485    );
486}
487
488#[cfg(feature = "objc2")]
489unsafe impl RefEncode for IOUSBLowLatencyIsocFrame {
490    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
491}
492
493/// Function called when USB I/O completes.
494///
495/// Parameter `target`: The target specified in the IOUSBCompletion struct.
496///
497/// Parameter `parameter`: The parameter specified in the IOUSBCompletion struct.
498///
499/// Parameter `status`: Completion status.
500///
501/// Parameter `bufferSizeRemaining`: Bytes left to be transferred.
502///
503/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbcompletionaction?language=objc)
504pub type IOUSBCompletionAction =
505    Option<unsafe extern "C-unwind" fn(*mut c_void, *mut c_void, IOReturn, u32)>;
506
507/// Function called when USB I/O completes.
508///
509/// Parameter `target`: The target specified in the IOUSBCompletion struct.
510///
511/// Parameter `parameter`: The parameter specified in the IOUSBCompletion struct.
512///
513/// Parameter `status`: Completion status.
514///
515/// Parameter `bufferSizeRemaining`: Bytes left to be transferred.
516///
517/// Parameter `timeStamp`: Time at which the transaction was processed.
518///
519/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbcompletionactionwithtimestamp?language=objc)
520pub type IOUSBCompletionActionWithTimeStamp =
521    Option<unsafe extern "C-unwind" fn(*mut c_void, *mut c_void, IOReturn, u32, AbsoluteTime)>;
522
523/// Function called when Isochronous USB I/O completes.
524///
525/// Parameter `target`: The target specified in the IOUSBIsocCompletionn struct.
526///
527/// Parameter `parameter`: The parameter specified in the IOUSBIsocCompletion struct.
528///
529/// Parameter `status`: Completion status.
530///
531/// Parameter `pFrames`: Pointer to the frame list containing the status for each frame transferred.
532///
533/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbisoccompletionaction?language=objc)
534pub type IOUSBIsocCompletionAction =
535    Option<unsafe extern "C-unwind" fn(*mut c_void, *mut c_void, IOReturn, *mut IOUSBIsocFrame)>;
536
537/// Function called when Low Latency Isochronous USB I/O completes.
538///
539/// Parameter `target`: The target specified in the IOUSBLowLatencyIsocCompletion struct.
540///
541/// Parameter `parameter`: The parameter specified in the IOUSBLowLatencyIsocCompletion struct.
542///
543/// Parameter `status`: Completion status.
544///
545/// Parameter `pFrames`: Pointer to the low latency frame list containing the status for each frame transferred.
546///
547/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousblowlatencyisoccompletionaction?language=objc)
548pub type IOUSBLowLatencyIsocCompletionAction = Option<
549    unsafe extern "C-unwind" fn(*mut c_void, *mut c_void, IOReturn, *mut IOUSBLowLatencyIsocFrame),
550>;
551
552/// Struct specifying action to perform when a USB I/O completes.
553///
554/// Parameter `target`: The target to pass to the action function.
555///
556/// Parameter `action`: The function to call.
557///
558/// Parameter `parameter`: The parameter to pass to the action function.
559///
560/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbcompletion?language=objc)
561#[repr(C)]
562#[derive(Clone, Copy, Debug, PartialEq)]
563pub struct IOUSBCompletion {
564    pub target: *mut c_void,
565    pub action: IOUSBCompletionAction,
566    pub parameter: *mut c_void,
567}
568
569#[cfg(feature = "objc2")]
570unsafe impl Encode for IOUSBCompletion {
571    const ENCODING: Encoding = Encoding::Struct(
572        "IOUSBCompletion",
573        &[
574            <*mut c_void>::ENCODING,
575            <IOUSBCompletionAction>::ENCODING,
576            <*mut c_void>::ENCODING,
577        ],
578    );
579}
580
581#[cfg(feature = "objc2")]
582unsafe impl RefEncode for IOUSBCompletion {
583    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
584}
585
586/// Struct specifying action to perform when a USB I/O completes.
587///
588/// Parameter `target`: The target to pass to the action function.
589///
590/// Parameter `action`: The function to call.
591///
592/// Parameter `parameter`: The parameter to pass to the action function.
593///
594/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbcompletionwithtimestamp?language=objc)
595#[repr(C)]
596#[derive(Clone, Copy, Debug, PartialEq)]
597pub struct IOUSBCompletionWithTimeStamp {
598    pub target: *mut c_void,
599    pub action: IOUSBCompletionActionWithTimeStamp,
600    pub parameter: *mut c_void,
601}
602
603#[cfg(feature = "objc2")]
604unsafe impl Encode for IOUSBCompletionWithTimeStamp {
605    const ENCODING: Encoding = Encoding::Struct(
606        "IOUSBCompletionWithTimeStamp",
607        &[
608            <*mut c_void>::ENCODING,
609            <IOUSBCompletionActionWithTimeStamp>::ENCODING,
610            <*mut c_void>::ENCODING,
611        ],
612    );
613}
614
615#[cfg(feature = "objc2")]
616unsafe impl RefEncode for IOUSBCompletionWithTimeStamp {
617    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
618}
619
620/// Struct specifying action to perform when an Isochronous USB I/O completes.
621///
622/// Parameter `target`: The target to pass to the action function.
623///
624/// Parameter `action`: The function to call.
625///
626/// Parameter `parameter`: The parameter to pass to the action function.
627///
628/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbisoccompletion?language=objc)
629#[repr(C)]
630#[derive(Clone, Copy, Debug, PartialEq)]
631pub struct IOUSBIsocCompletion {
632    pub target: *mut c_void,
633    pub action: IOUSBIsocCompletionAction,
634    pub parameter: *mut c_void,
635}
636
637#[cfg(feature = "objc2")]
638unsafe impl Encode for IOUSBIsocCompletion {
639    const ENCODING: Encoding = Encoding::Struct(
640        "IOUSBIsocCompletion",
641        &[
642            <*mut c_void>::ENCODING,
643            <IOUSBIsocCompletionAction>::ENCODING,
644            <*mut c_void>::ENCODING,
645        ],
646    );
647}
648
649#[cfg(feature = "objc2")]
650unsafe impl RefEncode for IOUSBIsocCompletion {
651    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
652}
653
654/// Struct specifying action to perform when an Low Latency Isochronous USB I/O completes.
655///
656/// Parameter `target`: The target to pass to the action function.
657///
658/// Parameter `action`: The function to call.
659///
660/// Parameter `parameter`: The parameter to pass to the action function.
661///
662/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousblowlatencyisoccompletion?language=objc)
663#[repr(C)]
664#[derive(Clone, Copy, Debug, PartialEq)]
665pub struct IOUSBLowLatencyIsocCompletion {
666    pub target: *mut c_void,
667    pub action: IOUSBLowLatencyIsocCompletionAction,
668    pub parameter: *mut c_void,
669}
670
671#[cfg(feature = "objc2")]
672unsafe impl Encode for IOUSBLowLatencyIsocCompletion {
673    const ENCODING: Encoding = Encoding::Struct(
674        "IOUSBLowLatencyIsocCompletion",
675        &[
676            <*mut c_void>::ENCODING,
677            <IOUSBLowLatencyIsocCompletionAction>::ENCODING,
678            <*mut c_void>::ENCODING,
679        ],
680    );
681}
682
683#[cfg(feature = "objc2")]
684unsafe impl RefEncode for IOUSBLowLatencyIsocCompletion {
685    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
686}
687
688/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbmousedata?language=objc)
689#[repr(C)]
690#[derive(Clone, Copy, Debug, PartialEq)]
691pub struct IOUSBMouseData {
692    pub buttons: u16,
693    pub XDelta: i16,
694    pub YDelta: i16,
695}
696
697#[cfg(feature = "objc2")]
698unsafe impl Encode for IOUSBMouseData {
699    const ENCODING: Encoding = Encoding::Struct(
700        "IOUSBMouseData",
701        &[<u16>::ENCODING, <i16>::ENCODING, <i16>::ENCODING],
702    );
703}
704
705#[cfg(feature = "objc2")]
706unsafe impl RefEncode for IOUSBMouseData {
707    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
708}
709
710/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbmousedataptr?language=objc)
711pub type IOUSBMouseDataPtr = *mut IOUSBMouseData;
712
713/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbkeyboarddata?language=objc)
714#[repr(C)]
715#[derive(Clone, Copy, Debug, PartialEq)]
716pub struct IOUSBKeyboardData {
717    pub keycount: u16,
718    pub usbkeycode: [u16; 32],
719}
720
721#[cfg(feature = "objc2")]
722unsafe impl Encode for IOUSBKeyboardData {
723    const ENCODING: Encoding = Encoding::Struct(
724        "IOUSBKeyboardData",
725        &[<u16>::ENCODING, <[u16; 32]>::ENCODING],
726    );
727}
728
729#[cfg(feature = "objc2")]
730unsafe impl RefEncode for IOUSBKeyboardData {
731    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
732}
733
734/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbkeyboarddataptr?language=objc)
735pub type IOUSBKeyboardDataPtr = *mut IOUSBKeyboardData;
736
737/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbhiddata?language=objc)
738#[repr(C)]
739#[derive(Clone, Copy)]
740pub union IOUSBHIDData {
741    pub kbd: IOUSBKeyboardData,
742    pub mouse: IOUSBMouseData,
743}
744
745#[cfg(feature = "objc2")]
746unsafe impl Encode for IOUSBHIDData {
747    const ENCODING: Encoding = Encoding::Union(
748        "IOUSBHIDData",
749        &[<IOUSBKeyboardData>::ENCODING, <IOUSBMouseData>::ENCODING],
750    );
751}
752
753#[cfg(feature = "objc2")]
754unsafe impl RefEncode for IOUSBHIDData {
755    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
756}
757
758/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbhiddataptr?language=objc)
759pub type IOUSBHIDDataPtr = *mut IOUSBHIDData;
760
761/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevicedescriptorptr?language=objc)
762#[cfg(feature = "AppleUSBDefinitions")]
763pub type IOUSBDeviceDescriptorPtr = *mut IOUSBDeviceDescriptor;
764
765/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdescriptorheaderptr?language=objc)
766#[cfg(feature = "AppleUSBDefinitions")]
767pub type IOUSBDescriptorHeaderPtr = *mut IOUSBDescriptorHeader;
768
769/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbbosdescriptorptr?language=objc)
770#[cfg(feature = "AppleUSBDefinitions")]
771pub type IOUSBBOSDescriptorPtr = *mut IOUSBBOSDescriptor;
772
773/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevicecapabilitydescriptorheaderptr?language=objc)
774#[cfg(feature = "AppleUSBDefinitions")]
775pub type IOUSBDeviceCapabilityDescriptorHeaderPtr = *mut IOUSBDeviceCapabilityDescriptorHeader;
776
777/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevicecapabilityusb2extensionptr?language=objc)
778#[cfg(feature = "AppleUSBDefinitions")]
779pub type IOUSBDeviceCapabilityUSB2ExtensionPtr = *mut IOUSBDeviceCapabilityUSB2Extension;
780
781/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevicecapabilitysuperspeedusbptr?language=objc)
782#[cfg(feature = "AppleUSBDefinitions")]
783pub type IOUSBDeviceCapabilitySuperSpeedUSBPtr = *mut IOUSBDeviceCapabilitySuperSpeedUSB;
784
785/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevicecapabilitysuperspeedplususbptr?language=objc)
786#[cfg(feature = "AppleUSBDefinitions")]
787pub type IOUSBDeviceCapabilitySuperSpeedPlusUSBPtr = *mut IOUSBDeviceCapabilitySuperSpeedPlusUSB;
788
789/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevicecapabilitycontaineridptr?language=objc)
790#[cfg(feature = "AppleUSBDefinitions")]
791pub type IOUSBDeviceCapabilityContainerIDPtr = *mut IOUSBDeviceCapabilityContainerID;
792
793/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbplatformcapabilitydescriptorptr?language=objc)
794#[cfg(feature = "AppleUSBDefinitions")]
795pub type IOUSBPlatformCapabilityDescriptorPtr = *mut IOUSBPlatformCapabilityDescriptor;
796
797/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevicecapabilitybillboardaltconfigptr?language=objc)
798#[cfg(feature = "AppleUSBDefinitions")]
799pub type IOUSBDeviceCapabilityBillboardAltConfigPtr = *mut IOUSBDeviceCapabilityBillboardAltConfig;
800
801/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevicecapabilitybillboardptr?language=objc)
802#[cfg(feature = "AppleUSBDefinitions")]
803pub type IOUSBDeviceCapabilityBillboardPtr = *mut IOUSBDeviceCapabilityBillboard;
804
805/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevicecapabilitybillboardaltmodeptr?language=objc)
806#[cfg(feature = "AppleUSBDefinitions")]
807pub type IOUSBDeviceCapabilityBillboardAltModePtr = *mut IOUSBDeviceCapabilityBillboardAltMode;
808
809/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbconfigurationdescriptorptr?language=objc)
810#[cfg(feature = "AppleUSBDefinitions")]
811pub type IOUSBConfigurationDescriptorPtr = *mut IOUSBConfigurationDescriptor;
812
813/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbconfigurationdescheaderptr?language=objc)
814#[cfg(feature = "AppleUSBDefinitions")]
815pub type IOUSBConfigurationDescHeaderPtr = *mut IOUSBConfigurationDescHeader;
816
817/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbinterfacedescriptorptr?language=objc)
818#[cfg(feature = "AppleUSBDefinitions")]
819pub type IOUSBInterfaceDescriptorPtr = *mut IOUSBInterfaceDescriptor;
820
821/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbendpointdescriptorptr?language=objc)
822#[cfg(feature = "AppleUSBDefinitions")]
823pub type IOUSBEndpointDescriptorPtr = *mut IOUSBEndpointDescriptor;
824
825/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbstringdescriptorptr?language=objc)
826#[cfg(feature = "AppleUSBDefinitions")]
827pub type IOUSBStringDescriptorPtr = *mut IOUSBStringDescriptor;
828
829/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbsuperspeedendpointcompaniondescriptorptr?language=objc)
830#[cfg(feature = "AppleUSBDefinitions")]
831pub type IOUSBSuperSpeedEndpointCompanionDescriptorPtr =
832    *mut IOUSBSuperSpeedEndpointCompanionDescriptor;
833
834/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbsuperspeedplusisochronousendpointcompaniondescriptorptr?language=objc)
835#[cfg(feature = "AppleUSBDefinitions")]
836pub type IOUSBSuperSpeedPlusIsochronousEndpointCompanionDescriptorPtr =
837    *mut IOUSBSuperSpeedPlusIsochronousEndpointCompanionDescriptor;
838
839/// [Apple's documentation](https://developer.apple.com/documentation/iokit/uaspipedescriptorptr?language=objc)
840#[cfg(feature = "AppleUSBDefinitions")]
841pub type UASPipeDescriptorPtr = *mut UASPipeDescriptor;
842
843/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbhiddescriptorptr?language=objc)
844#[cfg(feature = "AppleUSBDefinitions")]
845pub type IOUSBHIDDescriptorPtr = *mut IOUSBHIDDescriptor;
846
847/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbhidreportdescptr?language=objc)
848#[cfg(feature = "AppleUSBDefinitions")]
849pub type IOUSBHIDReportDescPtr = *mut IOUSBHIDReportDesc;
850
851/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevicequalifierdescriptorptr?language=objc)
852#[cfg(feature = "AppleUSBDefinitions")]
853pub type IOUSBDeviceQualifierDescriptorPtr = *mut IOUSBDeviceQualifierDescriptor;
854
855/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdfudescriptorptr?language=objc)
856#[cfg(feature = "AppleUSBDefinitions")]
857pub type IOUSBDFUDescriptorPtr = *mut IOUSBDFUDescriptor;
858
859/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbinterfaceassociationdescriptorptr?language=objc)
860#[cfg(feature = "AppleUSBDefinitions")]
861pub type IOUSBInterfaceAssociationDescriptorPtr = *mut IOUSBInterfaceAssociationDescriptor;
862
863/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbdevicecapabilitydescriptortype?language=objc)
864pub const kIOUSBDeviceCapabilityDescriptorType: c_uint = 16;
865/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbdevicecapabilitydescriptorlengthmin?language=objc)
866pub const kIOUSBDeviceCapabilityDescriptorLengthMin: c_uint = 3;
867
868/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_epdesc_bmattributes_trantype_mask?language=objc)
869pub const kUSB_EPDesc_bmAttributes_TranType_Mask: c_uint = USBBitRange!(0, 1);
870/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_epdesc_bmattributes_trantype_shift?language=objc)
871pub const kUSB_EPDesc_bmAttributes_TranType_Shift: c_uint = USBBitRangePhase!(0, 1);
872/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_epdesc_bmattributes_synctype_mask?language=objc)
873pub const kUSB_EPDesc_bmAttributes_SyncType_Mask: c_uint = USBBitRange!(2, 3);
874/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_epdesc_bmattributes_synctype_shift?language=objc)
875pub const kUSB_EPDesc_bmAttributes_SyncType_Shift: c_uint = USBBitRangePhase!(2, 3);
876/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_epdesc_bmattributes_usagetype_mask?language=objc)
877pub const kUSB_EPDesc_bmAttributes_UsageType_Mask: c_uint = USBBitRange!(4, 5);
878/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_epdesc_bmattributes_usagetype_shift?language=objc)
879pub const kUSB_EPDesc_bmAttributes_UsageType_Shift: c_uint = USBBitRangePhase!(4, 5);
880/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_epdesc_wmaxpacketsize_mps_mask?language=objc)
881pub const kUSB_EPDesc_wMaxPacketSize_MPS_Mask: c_uint = USBBitRange!(0, 10);
882/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_epdesc_wmaxpacketsize_mps_shift?language=objc)
883pub const kUSB_EPDesc_wMaxPacketSize_MPS_Shift: c_uint = USBBitRangePhase!(0, 10);
884/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_epdesc_maxmps?language=objc)
885pub const kUSB_EPDesc_MaxMPS: c_uint = 1024;
886/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_hsfsepdesc_wmaxpacketsize_mult_mask?language=objc)
887pub const kUSB_HSFSEPDesc_wMaxPacketSize_Mult_Mask: c_uint = USBBitRange!(11, 12);
888/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_hsfsepdesc_wmaxpacketsize_mult_shift?language=objc)
889pub const kUSB_HSFSEPDesc_wMaxPacketSize_Mult_Shift: c_uint = USBBitRangePhase!(11, 12);
890
891/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_sscompdesc_bulk_maxstreams_mask?language=objc)
892pub const kUSB_SSCompDesc_Bulk_MaxStreams_Mask: c_uint = USBBitRange!(0, 4);
893/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_sscompdesc_bulk_maxstreams_shift?language=objc)
894pub const kUSB_SSCompDesc_Bulk_MaxStreams_Shift: c_uint = USBBitRangePhase!(0, 4);
895/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_sscompdesc_isoc_mult_mask?language=objc)
896pub const kUSB_SSCompDesc_Isoc_Mult_Mask: c_uint = USBBitRange!(0, 1);
897/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_sscompdesc_isoc_mult_shift?language=objc)
898pub const kUSB_SSCompDesc_Isoc_Mult_Shift: c_uint = USBBitRangePhase!(0, 1);
899
900/// [Apple's documentation](https://developer.apple.com/documentation/iokit/addpacketshift?language=objc)
901pub const addPacketShift: c_uint = 11;
902
903/// Structure used with the IOUSBLib GetEndpointPropertiesV3 and GetPipePropertiesV3 API. Most of the fields are taken directly from corresponding Standard Endpoint Descriptor and SuperSpeed Endpoint Companion Descriptor. wBytesPerInterval will be synthesized for  High Speed High Bandwidth Isochronous endpoints.
904/// Field: bVersion  Version of the structure.  Currently kUSBEndpointPropertiesVersion3.  Need to set this when using this structure
905/// Field: bAlternateSetting Used as an input for GetEndpointPropertiesV3.  Used as an output for GetPipePropertiesV3
906/// Field: bDirection Used as an input for GetEndpointPropertiesV3.  Used as an output for GetPipePropertiesV3. One of kUSBIn or kUSBOut.
907/// Field: bEndpointNumber Used as an input for GetEndpointPropertiesV3.  Used as an output for GetPipePropertiesV3
908/// Field: bTransferType  One of kUSBControl, kUSBBulk, kUSBIsoc, or kUSBInterrupt
909/// Field: bUsageType  For interrupt and isoc endpoints, the usage type.  For Bulk endpoints of the UAS Mass Storage Protocol, the pipe ID.
910/// Field: bSyncType    For isoc endpoints only
911/// Field: bInterval    The bInterval field from the Standard Endpoint descriptor.
912/// Field: wMaxPacketSize  The meaning of this value depends on whether this is called with GetPipePropertiesV3 or GetEndpointPropertiesV3. See the documentation of those calls for more info.
913/// Field: bMaxBurst  For SuperSpeed endpoints, maximum number of packets the endpoint can send or receive as part of a burst
914/// Field: bMaxStreams  For SuperSpeed bulk endpoints, maximum number of streams this endpoint supports.
915/// Field: bMult  For SuperSpeed isoc endpoints, this is the mult value from the SuperSpeed Endpoint Companion Descriptor. For High Speed isoc and interrupt endpoints, this is bits 11 and 12 of the Standard Endpoint Descriptor, which represents a similar value.
916/// Field: wBytesPerInterval  For SuperSpeed interrupt and isoc endpoints, this is the wBytesPerInterval from the SuperSpeed Endpoint Companion Descriptor. For High Speed High Bandwidth isoc endpoints, this will be equal to wMaxPacketSize * (bMult+1).
917///
918/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbendpointproperties?language=objc)
919#[repr(C, packed)]
920#[derive(Clone, Copy, Debug, PartialEq)]
921pub struct IOUSBEndpointProperties {
922    pub bVersion: u8,
923    pub bAlternateSetting: u8,
924    pub bDirection: u8,
925    pub bEndpointNumber: u8,
926    pub bTransferType: u8,
927    pub bUsageType: u8,
928    pub bSyncType: u8,
929    pub bInterval: u8,
930    pub wMaxPacketSize: u16,
931    pub bMaxBurst: u8,
932    pub bMaxStreams: u8,
933    pub bMult: u8,
934    pub wBytesPerInterval: u16,
935}
936
937#[cfg(feature = "objc2")]
938unsafe impl Encode for IOUSBEndpointProperties {
939    const ENCODING: Encoding = Encoding::Struct(
940        "IOUSBEndpointProperties",
941        &[
942            <u8>::ENCODING,
943            <u8>::ENCODING,
944            <u8>::ENCODING,
945            <u8>::ENCODING,
946            <u8>::ENCODING,
947            <u8>::ENCODING,
948            <u8>::ENCODING,
949            <u8>::ENCODING,
950            <u16>::ENCODING,
951            <u8>::ENCODING,
952            <u8>::ENCODING,
953            <u8>::ENCODING,
954            <u16>::ENCODING,
955        ],
956    );
957}
958
959#[cfg(feature = "objc2")]
960unsafe impl RefEncode for IOUSBEndpointProperties {
961    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
962}
963
964/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbendpointpropertiesptr?language=objc)
965pub type IOUSBEndpointPropertiesPtr = *mut IOUSBEndpointProperties;
966
967/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbendpointpropertiesversion3?language=objc)
968pub const kUSBEndpointPropertiesVersion3: c_uint = 0x03;
969
970/// Type used to get a DeviceStatus as a single quantity.
971///
972/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/usbstatus?language=objc)
973pub type USBStatus = u16;
974
975/// [Apple's documentation](https://developer.apple.com/documentation/iokit/usbstatusptr?language=objc)
976pub type USBStatusPtr = *mut USBStatus;
977
978/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbanyclass?language=objc)
979pub const kIOUSBAnyClass: c_uint = 0xFFFF;
980/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbanysubclass?language=objc)
981pub const kIOUSBAnySubClass: c_uint = 0xFFFF;
982/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbanyprotocol?language=objc)
983pub const kIOUSBAnyProtocol: c_uint = 0xFFFF;
984/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbanyvendor?language=objc)
985pub const kIOUSBAnyVendor: c_uint = 0xFFFF;
986/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbanyproduct?language=objc)
987pub const kIOUSBAnyProduct: c_uint = 0xFFFF;
988
989/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbmatch?language=objc)
990#[repr(C)]
991#[derive(Clone, Copy, Debug, PartialEq)]
992pub struct IOUSBMatch {
993    pub usbClass: u16,
994    pub usbSubClass: u16,
995    pub usbProtocol: u16,
996    pub usbVendor: u16,
997    pub usbProduct: u16,
998}
999
1000#[cfg(feature = "objc2")]
1001unsafe impl Encode for IOUSBMatch {
1002    const ENCODING: Encoding = Encoding::Struct(
1003        "IOUSBMatch",
1004        &[
1005            <u16>::ENCODING,
1006            <u16>::ENCODING,
1007            <u16>::ENCODING,
1008            <u16>::ENCODING,
1009            <u16>::ENCODING,
1010        ],
1011    );
1012}
1013
1014#[cfg(feature = "objc2")]
1015unsafe impl RefEncode for IOUSBMatch {
1016    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1017}
1018
1019/// Struct used to find endpoints of an interface
1020/// type and direction are used to match endpoints,
1021/// type, direction, maxPacketSize and interval are updated
1022/// with the properties of the found endpoint.
1023/// Field: type Type of endpoint: kUSBControl, kUSBIsoc, kUSBBulk, kUSBInterrupt, kUSBAnyType.  If kUSBAnyType is specified, this field is treated as a don't care.
1024/// Field: direction Direction of endpoint: kUSBOut, kUSBIn, kUSBAnyDirn.   If kUSBAnyDirn is specified, this field is treated as a don't care.
1025/// Field: maxPacketSize maximum packet size of endpoint.
1026/// Field: interval Polling interval in mSec for endpoint.
1027///
1028/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbfindendpointrequest?language=objc)
1029#[repr(C)]
1030#[derive(Clone, Copy, Debug, PartialEq)]
1031pub struct IOUSBFindEndpointRequest {
1032    pub r#type: u8,
1033    pub direction: u8,
1034    pub maxPacketSize: u16,
1035    pub interval: u8,
1036}
1037
1038#[cfg(feature = "objc2")]
1039unsafe impl Encode for IOUSBFindEndpointRequest {
1040    const ENCODING: Encoding = Encoding::Struct(
1041        "?",
1042        &[
1043            <u8>::ENCODING,
1044            <u8>::ENCODING,
1045            <u16>::ENCODING,
1046            <u8>::ENCODING,
1047        ],
1048    );
1049}
1050
1051#[cfg(feature = "objc2")]
1052unsafe impl RefEncode for IOUSBFindEndpointRequest {
1053    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1054}
1055
1056/// Parameter block for control requests, using a simple pointer
1057/// for the data to be transferred.
1058/// Field: bmRequestType Request type: kUSBStandard, kUSBClass or kUSBVendor
1059/// Field: bRequest Request code
1060/// Field: wValue 16 bit parameter for request, host endianess
1061/// Field: wIndex 16 bit parameter for request, host endianess
1062/// Field: wLength Length of data part of request, 16 bits, host endianess
1063/// Field: pData Pointer to data for request - data returned in bus endianess
1064/// Field: wLenDone Set by standard completion routine to number of data bytes
1065/// actually transferred
1066///
1067/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevrequest?language=objc)
1068#[repr(C)]
1069#[derive(Clone, Copy, Debug, PartialEq)]
1070pub struct IOUSBDevRequest {
1071    pub bmRequestType: u8,
1072    pub bRequest: u8,
1073    pub wValue: u16,
1074    pub wIndex: u16,
1075    pub wLength: u16,
1076    pub pData: *mut c_void,
1077    pub wLenDone: u32,
1078}
1079
1080#[cfg(feature = "objc2")]
1081unsafe impl Encode for IOUSBDevRequest {
1082    const ENCODING: Encoding = Encoding::Struct(
1083        "?",
1084        &[
1085            <u8>::ENCODING,
1086            <u8>::ENCODING,
1087            <u16>::ENCODING,
1088            <u16>::ENCODING,
1089            <u16>::ENCODING,
1090            <*mut c_void>::ENCODING,
1091            <u32>::ENCODING,
1092        ],
1093    );
1094}
1095
1096#[cfg(feature = "objc2")]
1097unsafe impl RefEncode for IOUSBDevRequest {
1098    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1099}
1100
1101/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevicerequestptr?language=objc)
1102pub type IOUSBDeviceRequestPtr = *mut IOUSBDevRequest;
1103
1104/// Parameter block for control requests with timeouts, using a simple pointer
1105/// for the data to be transferred.  Same as a IOUSBDevRequest except for the two extra timeout fields.
1106/// Field: bmRequestType Request type: kUSBStandard, kUSBClass or kUSBVendor
1107/// Field: bRequest Request code
1108/// Field: wValue 16 bit parameter for request, host endianess
1109/// Field: wIndex 16 bit parameter for request, host endianess
1110/// Field: wLength Length of data part of request, 16 bits, host endianess
1111/// Field: pData Pointer to data for request - data returned in bus endianess
1112/// Field: wLenDone Set by standard completion routine to number of data bytes
1113/// actually transferred
1114/// Field: noDataTimeout Specifies a time value in milliseconds. Once the request is queued on the bus, if no data is transferred in this amount of time, the request will be aborted and returned.
1115/// Field: completionTimeout Specifies a time value in milliseconds. Once the request is queued on the bus, if the entire request is not completed in this amount of time, the request will be aborted and returned
1116///
1117/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevrequestto?language=objc)
1118#[repr(C)]
1119#[derive(Clone, Copy, Debug, PartialEq)]
1120pub struct IOUSBDevRequestTO {
1121    pub bmRequestType: u8,
1122    pub bRequest: u8,
1123    pub wValue: u16,
1124    pub wIndex: u16,
1125    pub wLength: u16,
1126    pub pData: *mut c_void,
1127    pub wLenDone: u32,
1128    pub noDataTimeout: u32,
1129    pub completionTimeout: u32,
1130}
1131
1132#[cfg(feature = "objc2")]
1133unsafe impl Encode for IOUSBDevRequestTO {
1134    const ENCODING: Encoding = Encoding::Struct(
1135        "?",
1136        &[
1137            <u8>::ENCODING,
1138            <u8>::ENCODING,
1139            <u16>::ENCODING,
1140            <u16>::ENCODING,
1141            <u16>::ENCODING,
1142            <*mut c_void>::ENCODING,
1143            <u32>::ENCODING,
1144            <u32>::ENCODING,
1145            <u32>::ENCODING,
1146        ],
1147    );
1148}
1149
1150#[cfg(feature = "objc2")]
1151unsafe impl RefEncode for IOUSBDevRequestTO {
1152    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1153}
1154
1155/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdefaultcontrolnodatatimeoutms?language=objc)
1156pub const kUSBDefaultControlNoDataTimeoutMS: c_uint = 5000;
1157/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdefaultcontrolcompletiontimeoutms?language=objc)
1158pub const kUSBDefaultControlCompletionTimeoutMS: c_uint = 0;
1159
1160/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbbulkpipereq?language=objc)
1161#[repr(C)]
1162#[derive(Clone, Copy, Debug, PartialEq)]
1163pub struct IOUSBBulkPipeReq {
1164    pub pipeRef: u32,
1165    pub buf: *mut c_void,
1166    pub size: u32,
1167    pub noDataTimeout: u32,
1168    pub completionTimeout: u32,
1169}
1170
1171#[cfg(feature = "objc2")]
1172unsafe impl Encode for IOUSBBulkPipeReq {
1173    const ENCODING: Encoding = Encoding::Struct(
1174        "?",
1175        &[
1176            <u32>::ENCODING,
1177            <*mut c_void>::ENCODING,
1178            <u32>::ENCODING,
1179            <u32>::ENCODING,
1180            <u32>::ENCODING,
1181        ],
1182    );
1183}
1184
1185#[cfg(feature = "objc2")]
1186unsafe impl RefEncode for IOUSBBulkPipeReq {
1187    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1188}
1189
1190/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevreqool?language=objc)
1191#[repr(C)]
1192#[derive(Clone, Copy, Debug, PartialEq)]
1193pub struct IOUSBDevReqOOL {
1194    pub bmRequestType: u8,
1195    pub bRequest: u8,
1196    pub wValue: u16,
1197    pub wIndex: u16,
1198    pub wLength: u16,
1199    pub pData: *mut c_void,
1200    pub wLenDone: u32,
1201    pub pipeRef: u8,
1202}
1203
1204#[cfg(feature = "objc2")]
1205unsafe impl Encode for IOUSBDevReqOOL {
1206    const ENCODING: Encoding = Encoding::Struct(
1207        "?",
1208        &[
1209            <u8>::ENCODING,
1210            <u8>::ENCODING,
1211            <u16>::ENCODING,
1212            <u16>::ENCODING,
1213            <u16>::ENCODING,
1214            <*mut c_void>::ENCODING,
1215            <u32>::ENCODING,
1216            <u8>::ENCODING,
1217        ],
1218    );
1219}
1220
1221#[cfg(feature = "objc2")]
1222unsafe impl RefEncode for IOUSBDevReqOOL {
1223    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1224}
1225
1226/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevreqoolto?language=objc)
1227#[repr(C)]
1228#[derive(Clone, Copy, Debug, PartialEq)]
1229pub struct IOUSBDevReqOOLTO {
1230    pub bmRequestType: u8,
1231    pub bRequest: u8,
1232    pub wValue: u16,
1233    pub wIndex: u16,
1234    pub wLength: u16,
1235    pub pData: *mut c_void,
1236    pub wLenDone: u32,
1237    pub pipeRef: u8,
1238    pub noDataTimeout: u32,
1239    pub completionTimeout: u32,
1240}
1241
1242#[cfg(feature = "objc2")]
1243unsafe impl Encode for IOUSBDevReqOOLTO {
1244    const ENCODING: Encoding = Encoding::Struct(
1245        "?",
1246        &[
1247            <u8>::ENCODING,
1248            <u8>::ENCODING,
1249            <u16>::ENCODING,
1250            <u16>::ENCODING,
1251            <u16>::ENCODING,
1252            <*mut c_void>::ENCODING,
1253            <u32>::ENCODING,
1254            <u8>::ENCODING,
1255            <u32>::ENCODING,
1256            <u32>::ENCODING,
1257        ],
1258    );
1259}
1260
1261#[cfg(feature = "objc2")]
1262unsafe impl RefEncode for IOUSBDevReqOOLTO {
1263    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1264}
1265
1266/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbisocstruct?language=objc)
1267#[repr(C)]
1268#[derive(Clone, Copy, Debug, PartialEq)]
1269pub struct IOUSBIsocStruct {
1270    pub fPipe: u32,
1271    pub fBuffer: *mut c_void,
1272    pub fBufSize: u32,
1273    pub fStartFrame: u64,
1274    pub fNumFrames: u32,
1275    pub fFrameCounts: *mut IOUSBIsocFrame,
1276}
1277
1278#[cfg(feature = "objc2")]
1279unsafe impl Encode for IOUSBIsocStruct {
1280    const ENCODING: Encoding = Encoding::Struct(
1281        "?",
1282        &[
1283            <u32>::ENCODING,
1284            <*mut c_void>::ENCODING,
1285            <u32>::ENCODING,
1286            <u64>::ENCODING,
1287            <u32>::ENCODING,
1288            <*mut IOUSBIsocFrame>::ENCODING,
1289        ],
1290    );
1291}
1292
1293#[cfg(feature = "objc2")]
1294unsafe impl RefEncode for IOUSBIsocStruct {
1295    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1296}
1297
1298/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousblowlatencyisocstruct?language=objc)
1299#[repr(C)]
1300#[derive(Clone, Copy, Debug, PartialEq)]
1301pub struct IOUSBLowLatencyIsocStruct {
1302    pub fPipe: u32,
1303    pub fBufSize: u32,
1304    pub fStartFrame: u64,
1305    pub fNumFrames: u32,
1306    pub fUpdateFrequency: u32,
1307    pub fDataBufferCookie: u32,
1308    pub fDataBufferOffset: u32,
1309    pub fFrameListBufferCookie: u32,
1310    pub fFrameListBufferOffset: u32,
1311}
1312
1313#[cfg(feature = "objc2")]
1314unsafe impl Encode for IOUSBLowLatencyIsocStruct {
1315    const ENCODING: Encoding = Encoding::Struct(
1316        "IOUSBLowLatencyIsocStruct",
1317        &[
1318            <u32>::ENCODING,
1319            <u32>::ENCODING,
1320            <u64>::ENCODING,
1321            <u32>::ENCODING,
1322            <u32>::ENCODING,
1323            <u32>::ENCODING,
1324            <u32>::ENCODING,
1325            <u32>::ENCODING,
1326            <u32>::ENCODING,
1327        ],
1328    );
1329}
1330
1331#[cfg(feature = "objc2")]
1332unsafe impl RefEncode for IOUSBLowLatencyIsocStruct {
1333    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1334}
1335
1336/// Structure used from user space to return the frame number and a timestamp on when the frame register was read.
1337/// Field: frame frame number
1338/// Field: timeStamp  AbsoluteTime when the frame was updated
1339///
1340/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbgetframestruct?language=objc)
1341#[repr(C)]
1342#[derive(Clone, Copy, Debug, PartialEq)]
1343pub struct IOUSBGetFrameStruct {
1344    pub frame: u64,
1345    pub timeStamp: AbsoluteTime,
1346}
1347
1348#[cfg(feature = "objc2")]
1349unsafe impl Encode for IOUSBGetFrameStruct {
1350    const ENCODING: Encoding = Encoding::Struct("?", &[<u64>::ENCODING, <AbsoluteTime>::ENCODING]);
1351}
1352
1353#[cfg(feature = "objc2")]
1354unsafe impl RefEncode for IOUSBGetFrameStruct {
1355    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1356}
1357
1358/// Structure used with FindNextInterface.
1359///
1360/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbfindinterfacerequest?language=objc)
1361#[repr(C)]
1362#[derive(Clone, Copy, Debug, PartialEq)]
1363pub struct IOUSBFindInterfaceRequest {
1364    pub bInterfaceClass: u16,
1365    pub bInterfaceSubClass: u16,
1366    pub bInterfaceProtocol: u16,
1367    pub bAlternateSetting: u16,
1368}
1369
1370#[cfg(feature = "objc2")]
1371unsafe impl Encode for IOUSBFindInterfaceRequest {
1372    const ENCODING: Encoding = Encoding::Struct(
1373        "?",
1374        &[
1375            <u16>::ENCODING,
1376            <u16>::ENCODING,
1377            <u16>::ENCODING,
1378            <u16>::ENCODING,
1379        ],
1380    );
1381}
1382
1383#[cfg(feature = "objc2")]
1384unsafe impl RefEncode for IOUSBFindInterfaceRequest {
1385    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1386}
1387
1388/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbfindinterfacedontcare?language=objc)
1389pub const kIOUSBFindInterfaceDontCare: c_uint = 0xFFFF;
1390
1391/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbvendoridapplecomputer?language=objc)
1392#[cfg(feature = "AppleUSBDefinitions")]
1393pub const kIOUSBVendorIDAppleComputer: c_uint = kIOUSBAppleVendorID;
1394/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbvendoridapple?language=objc)
1395#[cfg(feature = "AppleUSBDefinitions")]
1396pub const kIOUSBVendorIDApple: c_uint = kIOUSBAppleVendorID;
1397
1398/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdevicespeedlow?language=objc)
1399pub const kUSBDeviceSpeedLow: c_uint = 0;
1400/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdevicespeedfull?language=objc)
1401pub const kUSBDeviceSpeedFull: c_uint = 1;
1402/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdevicespeedhigh?language=objc)
1403pub const kUSBDeviceSpeedHigh: c_uint = 2;
1404/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdevicespeedsuper?language=objc)
1405pub const kUSBDeviceSpeedSuper: c_uint = 3;
1406/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdevicespeedsuperplus?language=objc)
1407pub const kUSBDeviceSpeedSuperPlus: c_uint = 4;
1408/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdevicespeedsuperplusby2?language=objc)
1409pub const kUSBDeviceSpeedSuperPlusBy2: c_uint = 5;
1410
1411/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbfullspeedmicrosecondsinframe?language=objc)
1412pub const kUSBFullSpeedMicrosecondsInFrame: c_uint = 1000;
1413/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbhighspeedmicrosecondsinframe?language=objc)
1414pub const kUSBHighSpeedMicrosecondsInFrame: c_uint = 125;
1415
1416/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusblowlatencyisochtransferkey?language=objc)
1417pub const kUSBLowLatencyIsochTransferKey: c_uint = 0x6c6c6974;
1418
1419/// Used to specify what kind of buffer to create when calling LowLatencyCreateBuffer().
1420///
1421/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/usblowlatencybuffertype?language=objc)
1422#[repr(transparent)]
1423#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1424pub struct USBLowLatencyBufferType(pub c_uint);
1425impl USBLowLatencyBufferType {
1426    #[doc(alias = "kUSBLowLatencyWriteBuffer")]
1427    pub const WriteBuffer: Self = Self(0);
1428    #[doc(alias = "kUSBLowLatencyReadBuffer")]
1429    pub const ReadBuffer: Self = Self(1);
1430    #[doc(alias = "kUSBLowLatencyFrameListBuffer")]
1431    pub const FrameListBuffer: Self = Self(2);
1432}
1433
1434#[cfg(feature = "objc2")]
1435unsafe impl Encode for USBLowLatencyBufferType {
1436    const ENCODING: Encoding = c_uint::ENCODING;
1437}
1438
1439#[cfg(feature = "objc2")]
1440unsafe impl RefEncode for USBLowLatencyBufferType {
1441    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1442}
1443
1444/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbnousernotificationtype?language=objc)
1445pub const kUSBNoUserNotificationType: c_uint = 0;
1446/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbnotenoughpowernotificationtype?language=objc)
1447pub const kUSBNotEnoughPowerNotificationType: c_uint = 1;
1448/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbindividualovercurrentnotificationtype?language=objc)
1449pub const kUSBIndividualOverCurrentNotificationType: c_uint = 2;
1450/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbgangovercurrentnotificationtype?language=objc)
1451pub const kUSBGangOverCurrentNotificationType: c_uint = 3;
1452/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbiosdevicenotenoughpowernotificationtype?language=objc)
1453pub const kUSBiOSDeviceNotEnoughPowerNotificationType: c_uint = 4;
1454/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbnotenoughpowernoacnotificationtype?language=objc)
1455pub const kUSBNotEnoughPowerNoACNotificationType: c_uint = 5;
1456/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdevicecountexceedednotificationtype?language=objc)
1457pub const kUSBDeviceCountExceededNotificationType: c_uint = 6;
1458/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbendpointcountexceedednotificationtype?language=objc)
1459pub const kUSBEndpointCountExceededNotificationType: c_uint = 7;
1460/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbunsupportednotificationtype?language=objc)
1461pub const kUSBUnsupportedNotificationType: c_uint = 8;
1462/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbhubcountexceedednotificationtype?language=objc)
1463pub const kUSBHubCountExceededNotificationType: c_uint = 9;
1464/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbtdmlowbatterytype?language=objc)
1465pub const kUSBTDMLowBatteryType: c_uint = 10;
1466/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbctbnotenoughpowernotificationtype?language=objc)
1467pub const kUSBCTBNotEnoughPowerNotificationType: c_uint = 11;
1468/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbctbunsupportednotificationtype?language=objc)
1469pub const kUSBCTBUnsupportedNotificationType: c_uint = 12;
1470/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbcunsupportedtbportnotificationtype?language=objc)
1471pub const kUSBCUnsupportedTBPortNotificationType: c_uint = 13;
1472/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbcunsupportedtbcablenotificationtype?language=objc)
1473pub const kUSBCUnsupportedTBCableNotificationType: c_uint = 14;
1474
1475/// Options used when calling ReEnumerateDevice.
1476///
1477///
1478/// any drivers attached to a Mass Storage Class IOUSBInterface.  A client needs to have the appropriate permissions in order to specify this bit.  See IOUSBLib.h
1479///
1480/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/usbreenumerateoptions?language=objc)
1481#[repr(transparent)]
1482#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1483pub struct USBReEnumerateOptions(pub c_int);
1484impl USBReEnumerateOptions {
1485    #[doc(alias = "kUSBAddExtraResetTimeBit")]
1486    pub const AddExtraResetTimeBit: Self = Self(31);
1487    #[doc(alias = "kUSBReEnumerateCaptureDeviceBit")]
1488    pub const ReEnumerateCaptureDeviceBit: Self = Self(30);
1489    #[doc(alias = "kUSBReEnumerateReleaseDeviceBit")]
1490    pub const ReEnumerateReleaseDeviceBit: Self = Self(29);
1491    #[doc(alias = "kUSBAddExtraResetTimeMask")]
1492    pub const AddExtraResetTimeMask: Self =
1493        Self(1 << USBReEnumerateOptions::AddExtraResetTimeBit.0);
1494    #[doc(alias = "kUSBReEnumerateCaptureDeviceMask")]
1495    pub const ReEnumerateCaptureDeviceMask: Self =
1496        Self(1 << USBReEnumerateOptions::ReEnumerateCaptureDeviceBit.0);
1497    #[doc(alias = "kUSBReEnumerateReleaseDeviceMask")]
1498    pub const ReEnumerateReleaseDeviceMask: Self =
1499        Self(1 << USBReEnumerateOptions::ReEnumerateReleaseDeviceBit.0);
1500}
1501
1502#[cfg(feature = "objc2")]
1503unsafe impl Encode for USBReEnumerateOptions {
1504    const ENCODING: Encoding = c_int::ENCODING;
1505}
1506
1507#[cfg(feature = "objc2")]
1508unsafe impl RefEncode for USBReEnumerateOptions {
1509    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1510}
1511
1512/// GetUSBDeviceInformation will return a unit32_t value with bits set indicating that a particular state is present in the USB device.  These bits are described here
1513///
1514/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/usbdeviceinformationbits?language=objc)
1515#[repr(transparent)]
1516#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1517pub struct USBDeviceInformationBits(pub c_uint);
1518impl USBDeviceInformationBits {
1519    #[doc(alias = "kUSBInformationDeviceIsCaptiveBit")]
1520    pub const InformationDeviceIsCaptiveBit: Self = Self(0);
1521    #[doc(alias = "kUSBInformationDeviceIsAttachedToRootHubBit")]
1522    pub const InformationDeviceIsAttachedToRootHubBit: Self = Self(1);
1523    #[doc(alias = "kUSBInformationDeviceIsInternalBit")]
1524    pub const InformationDeviceIsInternalBit: Self = Self(2);
1525    #[doc(alias = "kUSBInformationDeviceIsConnectedBit")]
1526    pub const InformationDeviceIsConnectedBit: Self = Self(3);
1527    #[doc(alias = "kUSBInformationDeviceIsEnabledBit")]
1528    pub const InformationDeviceIsEnabledBit: Self = Self(4);
1529    #[doc(alias = "kUSBInformationDeviceIsSuspendedBit")]
1530    pub const InformationDeviceIsSuspendedBit: Self = Self(5);
1531    #[doc(alias = "kUSBInformationDeviceIsInResetBit")]
1532    pub const InformationDeviceIsInResetBit: Self = Self(6);
1533    #[doc(alias = "kUSBInformationDeviceOvercurrentBit")]
1534    pub const InformationDeviceOvercurrentBit: Self = Self(7);
1535    #[doc(alias = "kUSBInformationDevicePortIsInTestModeBit")]
1536    pub const InformationDevicePortIsInTestModeBit: Self = Self(8);
1537    #[doc(alias = "kUSBInformationDeviceIsRootHub")]
1538    pub const InformationDeviceIsRootHub: Self = Self(9);
1539    #[doc(alias = "kUSBInformationRootHubisBuiltIn")]
1540    pub const InformationRootHubisBuiltIn: Self = Self(10);
1541    #[doc(alias = "kUSBInformationRootHubIsBuiltInBit")]
1542    pub const InformationRootHubIsBuiltInBit: Self = Self(10);
1543    #[doc(alias = "kUSBInformationDeviceIsRemote")]
1544    pub const InformationDeviceIsRemote: Self = Self(11);
1545    #[doc(alias = "kUSBInformationDeviceIsAttachedToEnclosure")]
1546    pub const InformationDeviceIsAttachedToEnclosure: Self = Self(12);
1547    #[doc(alias = "kUSBInformationDeviceIsOnThunderboltBit")]
1548    pub const InformationDeviceIsOnThunderboltBit: Self = Self(13);
1549    #[doc(alias = "kUSBInformationDeviceIsCaptiveMask")]
1550    pub const InformationDeviceIsCaptiveMask: Self =
1551        Self(1 << USBDeviceInformationBits::InformationDeviceIsCaptiveBit.0);
1552    #[doc(alias = "kUSBInformationDeviceIsAttachedToRootHubMask")]
1553    pub const InformationDeviceIsAttachedToRootHubMask: Self =
1554        Self(1 << USBDeviceInformationBits::InformationDeviceIsAttachedToRootHubBit.0);
1555    #[doc(alias = "kUSBInformationDeviceIsInternalMask")]
1556    pub const InformationDeviceIsInternalMask: Self =
1557        Self(1 << USBDeviceInformationBits::InformationDeviceIsInternalBit.0);
1558    #[doc(alias = "kUSBInformationDeviceIsConnectedMask")]
1559    pub const InformationDeviceIsConnectedMask: Self =
1560        Self(1 << USBDeviceInformationBits::InformationDeviceIsConnectedBit.0);
1561    #[doc(alias = "kUSBInformationDeviceIsEnabledMask")]
1562    pub const InformationDeviceIsEnabledMask: Self =
1563        Self(1 << USBDeviceInformationBits::InformationDeviceIsEnabledBit.0);
1564    #[doc(alias = "kUSBInformationDeviceIsSuspendedMask")]
1565    pub const InformationDeviceIsSuspendedMask: Self =
1566        Self(1 << USBDeviceInformationBits::InformationDeviceIsSuspendedBit.0);
1567    #[doc(alias = "kUSBInformationDeviceIsInResetMask")]
1568    pub const InformationDeviceIsInResetMask: Self =
1569        Self(1 << USBDeviceInformationBits::InformationDeviceIsInResetBit.0);
1570    #[doc(alias = "kUSBInformationDeviceOvercurrentMask")]
1571    pub const InformationDeviceOvercurrentMask: Self =
1572        Self(1 << USBDeviceInformationBits::InformationDeviceOvercurrentBit.0);
1573    #[doc(alias = "kUSBInformationDevicePortIsInTestModeMask")]
1574    pub const InformationDevicePortIsInTestModeMask: Self =
1575        Self(1 << USBDeviceInformationBits::InformationDevicePortIsInTestModeBit.0);
1576    #[doc(alias = "kUSBInformationDeviceIsRootHubMask")]
1577    pub const InformationDeviceIsRootHubMask: Self =
1578        Self(1 << USBDeviceInformationBits::InformationDeviceIsRootHub.0);
1579    #[doc(alias = "kUSBInformationRootHubisBuiltInMask")]
1580    pub const InformationRootHubisBuiltInMask: Self =
1581        Self(1 << USBDeviceInformationBits::InformationRootHubisBuiltIn.0);
1582    #[doc(alias = "kUSBInformationRootHubIsBuiltInMask")]
1583    pub const InformationRootHubIsBuiltInMask: Self =
1584        Self(1 << USBDeviceInformationBits::InformationRootHubIsBuiltInBit.0);
1585    #[doc(alias = "kUSBInformationDeviceIsRemoteMask")]
1586    pub const InformationDeviceIsRemoteMask: Self =
1587        Self(1 << USBDeviceInformationBits::InformationDeviceIsRemote.0);
1588    #[doc(alias = "kUSBInformationDeviceIsAttachedToEnclosureMask")]
1589    pub const InformationDeviceIsAttachedToEnclosureMask: Self =
1590        Self(1 << USBDeviceInformationBits::InformationDeviceIsAttachedToEnclosure.0);
1591    #[doc(alias = "kUSBInformationDeviceIsOnThunderboltMask")]
1592    pub const InformationDeviceIsOnThunderboltMask: Self =
1593        Self(1 << USBDeviceInformationBits::InformationDeviceIsOnThunderboltBit.0);
1594}
1595
1596#[cfg(feature = "objc2")]
1597unsafe impl Encode for USBDeviceInformationBits {
1598    const ENCODING: Encoding = c_uint::ENCODING;
1599}
1600
1601#[cfg(feature = "objc2")]
1602unsafe impl RefEncode for USBDeviceInformationBits {
1603    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1604}
1605
1606/// Used to specify what kind of power will be reserved using the IOUSBDevice RequestExtraPower and ReturnExtraPower APIs.
1607///
1608/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/usbpowerrequesttypes?language=objc)
1609#[repr(transparent)]
1610#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1611pub struct USBPowerRequestTypes(pub c_uint);
1612impl USBPowerRequestTypes {
1613    #[doc(alias = "kUSBPowerDuringSleep")]
1614    pub const DuringSleep: Self = Self(0);
1615    #[doc(alias = "kUSBPowerDuringWake")]
1616    pub const DuringWake: Self = Self(1);
1617    #[doc(alias = "kUSBPowerRequestWakeRelease")]
1618    pub const RequestWakeRelease: Self = Self(2);
1619    #[doc(alias = "kUSBPowerRequestSleepRelease")]
1620    pub const RequestSleepRelease: Self = Self(3);
1621    #[doc(alias = "kUSBPowerRequestWakeReallocate")]
1622    pub const RequestWakeReallocate: Self = Self(4);
1623    #[doc(alias = "kUSBPowerRequestSleepReallocate")]
1624    pub const RequestSleepReallocate: Self = Self(5);
1625    #[doc(alias = "kUSBPowerDuringWakeRevocable")]
1626    pub const DuringWakeRevocable: Self = Self(6);
1627    #[doc(alias = "kUSBPowerDuringWakeUSB3")]
1628    pub const DuringWakeUSB3: Self = Self(7);
1629}
1630
1631#[cfg(feature = "objc2")]
1632unsafe impl Encode for USBPowerRequestTypes {
1633    const ENCODING: Encoding = c_uint::ENCODING;
1634}
1635
1636#[cfg(feature = "objc2")]
1637unsafe impl RefEncode for USBPowerRequestTypes {
1638    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1639}
1640
1641/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbnotificationpreforcedsuspendbit?language=objc)
1642pub const kUSBNotificationPreForcedSuspendBit: c_uint = 0;
1643/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbnotificationpostforcedsuspendbit?language=objc)
1644pub const kUSBNotificationPostForcedSuspendBit: c_uint = 1;
1645/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbnotificationpreforcedresumebit?language=objc)
1646pub const kUSBNotificationPreForcedResumeBit: c_uint = 2;
1647/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbnotificationpostforcedresumebit?language=objc)
1648pub const kUSBNotificationPostForcedResumeBit: c_uint = 3;
1649
1650/// Used to register for USB notifications. These types may be OR'd together if more than one notification is desired. These notification are expected to be acknowledged before the process (e.g. system sleep or system wake) can be continued. See RegisterForNotification and AcknowledgeNotification in IOUSBDeviceInterface and IOUSBInterfaceInterface.
1651///
1652/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/usbnotificationtypes?language=objc)
1653#[repr(transparent)]
1654#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1655pub struct USBNotificationTypes(pub c_uint);
1656impl USBNotificationTypes {
1657    #[doc(alias = "kUSBNotificationPreForcedSuspend")]
1658    pub const PreForcedSuspend: Self = Self(1 << kUSBNotificationPreForcedSuspendBit);
1659    #[doc(alias = "kUSBNotificationPostForcedSuspend")]
1660    pub const PostForcedSuspend: Self = Self(1 << kUSBNotificationPostForcedSuspendBit);
1661    #[doc(alias = "kUSBNotificationPreForcedResume")]
1662    pub const PreForcedResume: Self = Self(1 << kUSBNotificationPreForcedResumeBit);
1663    #[doc(alias = "kUSBNotificationPostForcedResume")]
1664    pub const PostForcedResume: Self = Self(1 << kUSBNotificationPostForcedResumeBit);
1665}
1666
1667#[cfg(feature = "objc2")]
1668unsafe impl Encode for USBNotificationTypes {
1669    const ENCODING: Encoding = c_uint::ENCODING;
1670}
1671
1672#[cfg(feature = "objc2")]
1673unsafe impl RefEncode for USBNotificationTypes {
1674    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1675}
1676
1677/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbconnectable?language=objc)
1678#[repr(transparent)]
1679#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1680pub struct kUSBConnectable(pub c_uint);
1681impl kUSBConnectable {
1682    #[doc(alias = "kUSBPortNotConnectable")]
1683    pub const USBPortNotConnectable: Self = Self(0);
1684    #[doc(alias = "kUSBPortConnectable")]
1685    pub const USBPortConnectable: Self = Self(1);
1686}
1687
1688#[cfg(feature = "objc2")]
1689unsafe impl Encode for kUSBConnectable {
1690    const ENCODING: Encoding = c_uint::ENCODING;
1691}
1692
1693#[cfg(feature = "objc2")]
1694unsafe impl RefEncode for kUSBConnectable {
1695    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1696}
1697
1698/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbhostconnectortype?language=objc)
1699#[repr(transparent)]
1700#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1701pub struct kUSBHostConnectorType(pub c_uint);
1702impl kUSBHostConnectorType {
1703    #[doc(alias = "kUSBTypeAConnector")]
1704    pub const USBTypeAConnector: Self = Self(0x00);
1705    #[doc(alias = "kUSBTypeMiniABConnector")]
1706    pub const USBTypeMiniABConnector: Self = Self(0x01);
1707    #[doc(alias = "kUSBTypeExpressCard")]
1708    pub const USBTypeExpressCard: Self = Self(0x02);
1709    #[doc(alias = "kUSB3TypeStdAConnector")]
1710    pub const USB3TypeStdAConnector: Self = Self(0x03);
1711    #[doc(alias = "kUSB3TypeStdBConnector")]
1712    pub const USB3TypeStdBConnector: Self = Self(0x04);
1713    #[doc(alias = "kUSB3TypeMicroBConnector")]
1714    pub const USB3TypeMicroBConnector: Self = Self(0x05);
1715    #[doc(alias = "kUSB3TypeMicroABConnector")]
1716    pub const USB3TypeMicroABConnector: Self = Self(0x06);
1717    #[doc(alias = "kUSB3TypePowerBConnector")]
1718    pub const USB3TypePowerBConnector: Self = Self(0x07);
1719    #[doc(alias = "kUSBProprietaryConnector")]
1720    pub const USBProprietaryConnector: Self = Self(0xFF);
1721}
1722
1723#[cfg(feature = "objc2")]
1724unsafe impl Encode for kUSBHostConnectorType {
1725    const ENCODING: Encoding = c_uint::ENCODING;
1726}
1727
1728#[cfg(feature = "objc2")]
1729unsafe impl RefEncode for kUSBHostConnectorType {
1730    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1731}
1732
1733/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbspeed_mask?language=objc)
1734pub const kUSBSpeed_Mask: c_uint = USBBitRange!(0, 1);
1735/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbspeed_shift?language=objc)
1736pub const kUSBSpeed_Shift: c_uint = USBBitRangePhase!(0, 1);
1737/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbaddress_mask?language=objc)
1738pub const kUSBAddress_Mask: c_uint = USBBitRange!(8, 15);
1739/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbaddress_shift?language=objc)
1740pub const kUSBAddress_Shift: c_uint = USBBitRangePhase!(8, 15);
1741
1742/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kxhcissroothubaddress?language=objc)
1743pub const kXHCISSRootHubAddress: c_long = kUSBMaxDevices;
1744/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kxhciusb2roothubaddress?language=objc)
1745pub const kXHCIUSB2RootHubAddress: c_long = kUSBMaxDevices + 1;
1746/// [Apple's documentation](https://developer.apple.com/documentation/iokit/ksuperspeedbusbitmask?language=objc)
1747pub const kSuperSpeedBusBitMask: c_long = 0x01000000;