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#[allow(unpredictable_function_pointer_comparisons)]
563#[derive(Clone, Copy, Debug, PartialEq)]
564pub struct IOUSBCompletion {
565    pub target: *mut c_void,
566    pub action: IOUSBCompletionAction,
567    pub parameter: *mut c_void,
568}
569
570#[cfg(feature = "objc2")]
571unsafe impl Encode for IOUSBCompletion {
572    const ENCODING: Encoding = Encoding::Struct(
573        "IOUSBCompletion",
574        &[
575            <*mut c_void>::ENCODING,
576            <IOUSBCompletionAction>::ENCODING,
577            <*mut c_void>::ENCODING,
578        ],
579    );
580}
581
582#[cfg(feature = "objc2")]
583unsafe impl RefEncode for IOUSBCompletion {
584    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
585}
586
587/// Struct specifying action to perform when a USB I/O completes.
588///
589/// Parameter `target`: The target to pass to the action function.
590///
591/// Parameter `action`: The function to call.
592///
593/// Parameter `parameter`: The parameter to pass to the action function.
594///
595/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbcompletionwithtimestamp?language=objc)
596#[repr(C)]
597#[allow(unpredictable_function_pointer_comparisons)]
598#[derive(Clone, Copy, Debug, PartialEq)]
599pub struct IOUSBCompletionWithTimeStamp {
600    pub target: *mut c_void,
601    pub action: IOUSBCompletionActionWithTimeStamp,
602    pub parameter: *mut c_void,
603}
604
605#[cfg(feature = "objc2")]
606unsafe impl Encode for IOUSBCompletionWithTimeStamp {
607    const ENCODING: Encoding = Encoding::Struct(
608        "IOUSBCompletionWithTimeStamp",
609        &[
610            <*mut c_void>::ENCODING,
611            <IOUSBCompletionActionWithTimeStamp>::ENCODING,
612            <*mut c_void>::ENCODING,
613        ],
614    );
615}
616
617#[cfg(feature = "objc2")]
618unsafe impl RefEncode for IOUSBCompletionWithTimeStamp {
619    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
620}
621
622/// Struct specifying action to perform when an Isochronous USB I/O completes.
623///
624/// Parameter `target`: The target to pass to the action function.
625///
626/// Parameter `action`: The function to call.
627///
628/// Parameter `parameter`: The parameter to pass to the action function.
629///
630/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbisoccompletion?language=objc)
631#[repr(C)]
632#[allow(unpredictable_function_pointer_comparisons)]
633#[derive(Clone, Copy, Debug, PartialEq)]
634pub struct IOUSBIsocCompletion {
635    pub target: *mut c_void,
636    pub action: IOUSBIsocCompletionAction,
637    pub parameter: *mut c_void,
638}
639
640#[cfg(feature = "objc2")]
641unsafe impl Encode for IOUSBIsocCompletion {
642    const ENCODING: Encoding = Encoding::Struct(
643        "IOUSBIsocCompletion",
644        &[
645            <*mut c_void>::ENCODING,
646            <IOUSBIsocCompletionAction>::ENCODING,
647            <*mut c_void>::ENCODING,
648        ],
649    );
650}
651
652#[cfg(feature = "objc2")]
653unsafe impl RefEncode for IOUSBIsocCompletion {
654    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
655}
656
657/// Struct specifying action to perform when an Low Latency Isochronous USB I/O completes.
658///
659/// Parameter `target`: The target to pass to the action function.
660///
661/// Parameter `action`: The function to call.
662///
663/// Parameter `parameter`: The parameter to pass to the action function.
664///
665/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousblowlatencyisoccompletion?language=objc)
666#[repr(C)]
667#[allow(unpredictable_function_pointer_comparisons)]
668#[derive(Clone, Copy, Debug, PartialEq)]
669pub struct IOUSBLowLatencyIsocCompletion {
670    pub target: *mut c_void,
671    pub action: IOUSBLowLatencyIsocCompletionAction,
672    pub parameter: *mut c_void,
673}
674
675#[cfg(feature = "objc2")]
676unsafe impl Encode for IOUSBLowLatencyIsocCompletion {
677    const ENCODING: Encoding = Encoding::Struct(
678        "IOUSBLowLatencyIsocCompletion",
679        &[
680            <*mut c_void>::ENCODING,
681            <IOUSBLowLatencyIsocCompletionAction>::ENCODING,
682            <*mut c_void>::ENCODING,
683        ],
684    );
685}
686
687#[cfg(feature = "objc2")]
688unsafe impl RefEncode for IOUSBLowLatencyIsocCompletion {
689    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
690}
691
692/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbmousedata?language=objc)
693#[repr(C)]
694#[derive(Clone, Copy, Debug, PartialEq)]
695pub struct IOUSBMouseData {
696    pub buttons: u16,
697    pub XDelta: i16,
698    pub YDelta: i16,
699}
700
701#[cfg(feature = "objc2")]
702unsafe impl Encode for IOUSBMouseData {
703    const ENCODING: Encoding = Encoding::Struct(
704        "IOUSBMouseData",
705        &[<u16>::ENCODING, <i16>::ENCODING, <i16>::ENCODING],
706    );
707}
708
709#[cfg(feature = "objc2")]
710unsafe impl RefEncode for IOUSBMouseData {
711    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
712}
713
714/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbmousedataptr?language=objc)
715pub type IOUSBMouseDataPtr = *mut IOUSBMouseData;
716
717/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbkeyboarddata?language=objc)
718#[repr(C)]
719#[derive(Clone, Copy, Debug, PartialEq)]
720pub struct IOUSBKeyboardData {
721    pub keycount: u16,
722    pub usbkeycode: [u16; 32],
723}
724
725#[cfg(feature = "objc2")]
726unsafe impl Encode for IOUSBKeyboardData {
727    const ENCODING: Encoding = Encoding::Struct(
728        "IOUSBKeyboardData",
729        &[<u16>::ENCODING, <[u16; 32]>::ENCODING],
730    );
731}
732
733#[cfg(feature = "objc2")]
734unsafe impl RefEncode for IOUSBKeyboardData {
735    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
736}
737
738/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbkeyboarddataptr?language=objc)
739pub type IOUSBKeyboardDataPtr = *mut IOUSBKeyboardData;
740
741/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbhiddata?language=objc)
742#[repr(C)]
743#[derive(Clone, Copy)]
744pub union IOUSBHIDData {
745    pub kbd: IOUSBKeyboardData,
746    pub mouse: IOUSBMouseData,
747}
748
749#[cfg(feature = "objc2")]
750unsafe impl Encode for IOUSBHIDData {
751    const ENCODING: Encoding = Encoding::Union(
752        "IOUSBHIDData",
753        &[<IOUSBKeyboardData>::ENCODING, <IOUSBMouseData>::ENCODING],
754    );
755}
756
757#[cfg(feature = "objc2")]
758unsafe impl RefEncode for IOUSBHIDData {
759    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
760}
761
762/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbhiddataptr?language=objc)
763pub type IOUSBHIDDataPtr = *mut IOUSBHIDData;
764
765/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevicedescriptorptr?language=objc)
766#[cfg(feature = "AppleUSBDefinitions")]
767pub type IOUSBDeviceDescriptorPtr = *mut IOUSBDeviceDescriptor;
768
769/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdescriptorheaderptr?language=objc)
770#[cfg(feature = "AppleUSBDefinitions")]
771pub type IOUSBDescriptorHeaderPtr = *mut IOUSBDescriptorHeader;
772
773/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbbosdescriptorptr?language=objc)
774#[cfg(feature = "AppleUSBDefinitions")]
775pub type IOUSBBOSDescriptorPtr = *mut IOUSBBOSDescriptor;
776
777/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevicecapabilitydescriptorheaderptr?language=objc)
778#[cfg(feature = "AppleUSBDefinitions")]
779pub type IOUSBDeviceCapabilityDescriptorHeaderPtr = *mut IOUSBDeviceCapabilityDescriptorHeader;
780
781/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevicecapabilityusb2extensionptr?language=objc)
782#[cfg(feature = "AppleUSBDefinitions")]
783pub type IOUSBDeviceCapabilityUSB2ExtensionPtr = *mut IOUSBDeviceCapabilityUSB2Extension;
784
785/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevicecapabilitysuperspeedusbptr?language=objc)
786#[cfg(feature = "AppleUSBDefinitions")]
787pub type IOUSBDeviceCapabilitySuperSpeedUSBPtr = *mut IOUSBDeviceCapabilitySuperSpeedUSB;
788
789/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevicecapabilitysuperspeedplususbptr?language=objc)
790#[cfg(feature = "AppleUSBDefinitions")]
791pub type IOUSBDeviceCapabilitySuperSpeedPlusUSBPtr = *mut IOUSBDeviceCapabilitySuperSpeedPlusUSB;
792
793/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevicecapabilitycontaineridptr?language=objc)
794#[cfg(feature = "AppleUSBDefinitions")]
795pub type IOUSBDeviceCapabilityContainerIDPtr = *mut IOUSBDeviceCapabilityContainerID;
796
797/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbplatformcapabilitydescriptorptr?language=objc)
798#[cfg(feature = "AppleUSBDefinitions")]
799pub type IOUSBPlatformCapabilityDescriptorPtr = *mut IOUSBPlatformCapabilityDescriptor;
800
801/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevicecapabilitybillboardaltconfigptr?language=objc)
802#[cfg(feature = "AppleUSBDefinitions")]
803pub type IOUSBDeviceCapabilityBillboardAltConfigPtr = *mut IOUSBDeviceCapabilityBillboardAltConfig;
804
805/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevicecapabilitybillboardptr?language=objc)
806#[cfg(feature = "AppleUSBDefinitions")]
807pub type IOUSBDeviceCapabilityBillboardPtr = *mut IOUSBDeviceCapabilityBillboard;
808
809/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevicecapabilitybillboardaltmodeptr?language=objc)
810#[cfg(feature = "AppleUSBDefinitions")]
811pub type IOUSBDeviceCapabilityBillboardAltModePtr = *mut IOUSBDeviceCapabilityBillboardAltMode;
812
813/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbconfigurationdescriptorptr?language=objc)
814#[cfg(feature = "AppleUSBDefinitions")]
815pub type IOUSBConfigurationDescriptorPtr = *mut IOUSBConfigurationDescriptor;
816
817/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbconfigurationdescheaderptr?language=objc)
818#[cfg(feature = "AppleUSBDefinitions")]
819pub type IOUSBConfigurationDescHeaderPtr = *mut IOUSBConfigurationDescHeader;
820
821/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbinterfacedescriptorptr?language=objc)
822#[cfg(feature = "AppleUSBDefinitions")]
823pub type IOUSBInterfaceDescriptorPtr = *mut IOUSBInterfaceDescriptor;
824
825/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbendpointdescriptorptr?language=objc)
826#[cfg(feature = "AppleUSBDefinitions")]
827pub type IOUSBEndpointDescriptorPtr = *mut IOUSBEndpointDescriptor;
828
829/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbstringdescriptorptr?language=objc)
830#[cfg(feature = "AppleUSBDefinitions")]
831pub type IOUSBStringDescriptorPtr = *mut IOUSBStringDescriptor;
832
833/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbsuperspeedendpointcompaniondescriptorptr?language=objc)
834#[cfg(feature = "AppleUSBDefinitions")]
835pub type IOUSBSuperSpeedEndpointCompanionDescriptorPtr =
836    *mut IOUSBSuperSpeedEndpointCompanionDescriptor;
837
838/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbsuperspeedplusisochronousendpointcompaniondescriptorptr?language=objc)
839#[cfg(feature = "AppleUSBDefinitions")]
840pub type IOUSBSuperSpeedPlusIsochronousEndpointCompanionDescriptorPtr =
841    *mut IOUSBSuperSpeedPlusIsochronousEndpointCompanionDescriptor;
842
843/// [Apple's documentation](https://developer.apple.com/documentation/iokit/uaspipedescriptorptr?language=objc)
844#[cfg(feature = "AppleUSBDefinitions")]
845pub type UASPipeDescriptorPtr = *mut UASPipeDescriptor;
846
847/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbhiddescriptorptr?language=objc)
848#[cfg(feature = "AppleUSBDefinitions")]
849pub type IOUSBHIDDescriptorPtr = *mut IOUSBHIDDescriptor;
850
851/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbhidreportdescptr?language=objc)
852#[cfg(feature = "AppleUSBDefinitions")]
853pub type IOUSBHIDReportDescPtr = *mut IOUSBHIDReportDesc;
854
855/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevicequalifierdescriptorptr?language=objc)
856#[cfg(feature = "AppleUSBDefinitions")]
857pub type IOUSBDeviceQualifierDescriptorPtr = *mut IOUSBDeviceQualifierDescriptor;
858
859/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdfudescriptorptr?language=objc)
860#[cfg(feature = "AppleUSBDefinitions")]
861pub type IOUSBDFUDescriptorPtr = *mut IOUSBDFUDescriptor;
862
863/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbinterfaceassociationdescriptorptr?language=objc)
864#[cfg(feature = "AppleUSBDefinitions")]
865pub type IOUSBInterfaceAssociationDescriptorPtr = *mut IOUSBInterfaceAssociationDescriptor;
866
867/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbdevicecapabilitydescriptortype?language=objc)
868pub const kIOUSBDeviceCapabilityDescriptorType: c_uint = 16;
869/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbdevicecapabilitydescriptorlengthmin?language=objc)
870pub const kIOUSBDeviceCapabilityDescriptorLengthMin: c_uint = 3;
871
872/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_epdesc_bmattributes_trantype_mask?language=objc)
873pub const kUSB_EPDesc_bmAttributes_TranType_Mask: c_uint = USBBitRange!(0, 1);
874/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_epdesc_bmattributes_trantype_shift?language=objc)
875pub const kUSB_EPDesc_bmAttributes_TranType_Shift: c_uint = USBBitRangePhase!(0, 1);
876/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_epdesc_bmattributes_synctype_mask?language=objc)
877pub const kUSB_EPDesc_bmAttributes_SyncType_Mask: c_uint = USBBitRange!(2, 3);
878/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_epdesc_bmattributes_synctype_shift?language=objc)
879pub const kUSB_EPDesc_bmAttributes_SyncType_Shift: c_uint = USBBitRangePhase!(2, 3);
880/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_epdesc_bmattributes_usagetype_mask?language=objc)
881pub const kUSB_EPDesc_bmAttributes_UsageType_Mask: c_uint = USBBitRange!(4, 5);
882/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_epdesc_bmattributes_usagetype_shift?language=objc)
883pub const kUSB_EPDesc_bmAttributes_UsageType_Shift: c_uint = USBBitRangePhase!(4, 5);
884/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_epdesc_wmaxpacketsize_mps_mask?language=objc)
885pub const kUSB_EPDesc_wMaxPacketSize_MPS_Mask: c_uint = USBBitRange!(0, 10);
886/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_epdesc_wmaxpacketsize_mps_shift?language=objc)
887pub const kUSB_EPDesc_wMaxPacketSize_MPS_Shift: c_uint = USBBitRangePhase!(0, 10);
888/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_epdesc_maxmps?language=objc)
889pub const kUSB_EPDesc_MaxMPS: c_uint = 1024;
890/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_hsfsepdesc_wmaxpacketsize_mult_mask?language=objc)
891pub const kUSB_HSFSEPDesc_wMaxPacketSize_Mult_Mask: c_uint = USBBitRange!(11, 12);
892/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_hsfsepdesc_wmaxpacketsize_mult_shift?language=objc)
893pub const kUSB_HSFSEPDesc_wMaxPacketSize_Mult_Shift: c_uint = USBBitRangePhase!(11, 12);
894
895/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_sscompdesc_bulk_maxstreams_mask?language=objc)
896pub const kUSB_SSCompDesc_Bulk_MaxStreams_Mask: c_uint = USBBitRange!(0, 4);
897/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_sscompdesc_bulk_maxstreams_shift?language=objc)
898pub const kUSB_SSCompDesc_Bulk_MaxStreams_Shift: c_uint = USBBitRangePhase!(0, 4);
899/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_sscompdesc_isoc_mult_mask?language=objc)
900pub const kUSB_SSCompDesc_Isoc_Mult_Mask: c_uint = USBBitRange!(0, 1);
901/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusb_sscompdesc_isoc_mult_shift?language=objc)
902pub const kUSB_SSCompDesc_Isoc_Mult_Shift: c_uint = USBBitRangePhase!(0, 1);
903
904/// [Apple's documentation](https://developer.apple.com/documentation/iokit/addpacketshift?language=objc)
905pub const addPacketShift: c_uint = 11;
906
907/// 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.
908/// Field: bVersion  Version of the structure.  Currently kUSBEndpointPropertiesVersion3.  Need to set this when using this structure
909/// Field: bAlternateSetting Used as an input for GetEndpointPropertiesV3.  Used as an output for GetPipePropertiesV3
910/// Field: bDirection Used as an input for GetEndpointPropertiesV3.  Used as an output for GetPipePropertiesV3. One of kUSBIn or kUSBOut.
911/// Field: bEndpointNumber Used as an input for GetEndpointPropertiesV3.  Used as an output for GetPipePropertiesV3
912/// Field: bTransferType  One of kUSBControl, kUSBBulk, kUSBIsoc, or kUSBInterrupt
913/// Field: bUsageType  For interrupt and isoc endpoints, the usage type.  For Bulk endpoints of the UAS Mass Storage Protocol, the pipe ID.
914/// Field: bSyncType    For isoc endpoints only
915/// Field: bInterval    The bInterval field from the Standard Endpoint descriptor.
916/// 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.
917/// Field: bMaxBurst  For SuperSpeed endpoints, maximum number of packets the endpoint can send or receive as part of a burst
918/// Field: bMaxStreams  For SuperSpeed bulk endpoints, maximum number of streams this endpoint supports.
919/// 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.
920/// 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).
921///
922/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbendpointproperties?language=objc)
923#[repr(C, packed)]
924#[derive(Clone, Copy, Debug, PartialEq)]
925pub struct IOUSBEndpointProperties {
926    pub bVersion: u8,
927    pub bAlternateSetting: u8,
928    pub bDirection: u8,
929    pub bEndpointNumber: u8,
930    pub bTransferType: u8,
931    pub bUsageType: u8,
932    pub bSyncType: u8,
933    pub bInterval: u8,
934    pub wMaxPacketSize: u16,
935    pub bMaxBurst: u8,
936    pub bMaxStreams: u8,
937    pub bMult: u8,
938    pub wBytesPerInterval: u16,
939}
940
941#[cfg(feature = "objc2")]
942unsafe impl Encode for IOUSBEndpointProperties {
943    const ENCODING: Encoding = Encoding::Struct(
944        "IOUSBEndpointProperties",
945        &[
946            <u8>::ENCODING,
947            <u8>::ENCODING,
948            <u8>::ENCODING,
949            <u8>::ENCODING,
950            <u8>::ENCODING,
951            <u8>::ENCODING,
952            <u8>::ENCODING,
953            <u8>::ENCODING,
954            <u16>::ENCODING,
955            <u8>::ENCODING,
956            <u8>::ENCODING,
957            <u8>::ENCODING,
958            <u16>::ENCODING,
959        ],
960    );
961}
962
963#[cfg(feature = "objc2")]
964unsafe impl RefEncode for IOUSBEndpointProperties {
965    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
966}
967
968/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbendpointpropertiesptr?language=objc)
969pub type IOUSBEndpointPropertiesPtr = *mut IOUSBEndpointProperties;
970
971/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbendpointpropertiesversion3?language=objc)
972pub const kUSBEndpointPropertiesVersion3: c_uint = 0x03;
973
974/// Type used to get a DeviceStatus as a single quantity.
975///
976/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/usbstatus?language=objc)
977pub type USBStatus = u16;
978
979/// [Apple's documentation](https://developer.apple.com/documentation/iokit/usbstatusptr?language=objc)
980pub type USBStatusPtr = *mut USBStatus;
981
982/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbanyclass?language=objc)
983pub const kIOUSBAnyClass: c_uint = 0xFFFF;
984/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbanysubclass?language=objc)
985pub const kIOUSBAnySubClass: c_uint = 0xFFFF;
986/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbanyprotocol?language=objc)
987pub const kIOUSBAnyProtocol: c_uint = 0xFFFF;
988/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbanyvendor?language=objc)
989pub const kIOUSBAnyVendor: c_uint = 0xFFFF;
990/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbanyproduct?language=objc)
991pub const kIOUSBAnyProduct: c_uint = 0xFFFF;
992
993/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbmatch?language=objc)
994#[repr(C)]
995#[derive(Clone, Copy, Debug, PartialEq)]
996pub struct IOUSBMatch {
997    pub usbClass: u16,
998    pub usbSubClass: u16,
999    pub usbProtocol: u16,
1000    pub usbVendor: u16,
1001    pub usbProduct: u16,
1002}
1003
1004#[cfg(feature = "objc2")]
1005unsafe impl Encode for IOUSBMatch {
1006    const ENCODING: Encoding = Encoding::Struct(
1007        "IOUSBMatch",
1008        &[
1009            <u16>::ENCODING,
1010            <u16>::ENCODING,
1011            <u16>::ENCODING,
1012            <u16>::ENCODING,
1013            <u16>::ENCODING,
1014        ],
1015    );
1016}
1017
1018#[cfg(feature = "objc2")]
1019unsafe impl RefEncode for IOUSBMatch {
1020    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1021}
1022
1023/// Struct used to find endpoints of an interface
1024/// type and direction are used to match endpoints,
1025/// type, direction, maxPacketSize and interval are updated
1026/// with the properties of the found endpoint.
1027/// Field: type Type of endpoint: kUSBControl, kUSBIsoc, kUSBBulk, kUSBInterrupt, kUSBAnyType.  If kUSBAnyType is specified, this field is treated as a don't care.
1028/// Field: direction Direction of endpoint: kUSBOut, kUSBIn, kUSBAnyDirn.   If kUSBAnyDirn is specified, this field is treated as a don't care.
1029/// Field: maxPacketSize maximum packet size of endpoint.
1030/// Field: interval Polling interval in mSec for endpoint.
1031///
1032/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbfindendpointrequest?language=objc)
1033#[repr(C)]
1034#[derive(Clone, Copy, Debug, PartialEq)]
1035pub struct IOUSBFindEndpointRequest {
1036    pub r#type: u8,
1037    pub direction: u8,
1038    pub maxPacketSize: u16,
1039    pub interval: u8,
1040}
1041
1042#[cfg(feature = "objc2")]
1043unsafe impl Encode for IOUSBFindEndpointRequest {
1044    const ENCODING: Encoding = Encoding::Struct(
1045        "?",
1046        &[
1047            <u8>::ENCODING,
1048            <u8>::ENCODING,
1049            <u16>::ENCODING,
1050            <u8>::ENCODING,
1051        ],
1052    );
1053}
1054
1055#[cfg(feature = "objc2")]
1056unsafe impl RefEncode for IOUSBFindEndpointRequest {
1057    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1058}
1059
1060/// Parameter block for control requests, using a simple pointer
1061/// for the data to be transferred.
1062/// Field: bmRequestType Request type: kUSBStandard, kUSBClass or kUSBVendor
1063/// Field: bRequest Request code
1064/// Field: wValue 16 bit parameter for request, host endianess
1065/// Field: wIndex 16 bit parameter for request, host endianess
1066/// Field: wLength Length of data part of request, 16 bits, host endianess
1067/// Field: pData Pointer to data for request - data returned in bus endianess
1068/// Field: wLenDone Set by standard completion routine to number of data bytes
1069/// actually transferred
1070///
1071/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevrequest?language=objc)
1072#[repr(C)]
1073#[derive(Clone, Copy, Debug, PartialEq)]
1074pub struct IOUSBDevRequest {
1075    pub bmRequestType: u8,
1076    pub bRequest: u8,
1077    pub wValue: u16,
1078    pub wIndex: u16,
1079    pub wLength: u16,
1080    pub pData: *mut c_void,
1081    pub wLenDone: u32,
1082}
1083
1084#[cfg(feature = "objc2")]
1085unsafe impl Encode for IOUSBDevRequest {
1086    const ENCODING: Encoding = Encoding::Struct(
1087        "?",
1088        &[
1089            <u8>::ENCODING,
1090            <u8>::ENCODING,
1091            <u16>::ENCODING,
1092            <u16>::ENCODING,
1093            <u16>::ENCODING,
1094            <*mut c_void>::ENCODING,
1095            <u32>::ENCODING,
1096        ],
1097    );
1098}
1099
1100#[cfg(feature = "objc2")]
1101unsafe impl RefEncode for IOUSBDevRequest {
1102    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1103}
1104
1105/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevicerequestptr?language=objc)
1106pub type IOUSBDeviceRequestPtr = *mut IOUSBDevRequest;
1107
1108/// Parameter block for control requests with timeouts, using a simple pointer
1109/// for the data to be transferred.  Same as a IOUSBDevRequest except for the two extra timeout fields.
1110/// Field: bmRequestType Request type: kUSBStandard, kUSBClass or kUSBVendor
1111/// Field: bRequest Request code
1112/// Field: wValue 16 bit parameter for request, host endianess
1113/// Field: wIndex 16 bit parameter for request, host endianess
1114/// Field: wLength Length of data part of request, 16 bits, host endianess
1115/// Field: pData Pointer to data for request - data returned in bus endianess
1116/// Field: wLenDone Set by standard completion routine to number of data bytes
1117/// actually transferred
1118/// 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.
1119/// 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
1120///
1121/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevrequestto?language=objc)
1122#[repr(C)]
1123#[derive(Clone, Copy, Debug, PartialEq)]
1124pub struct IOUSBDevRequestTO {
1125    pub bmRequestType: u8,
1126    pub bRequest: u8,
1127    pub wValue: u16,
1128    pub wIndex: u16,
1129    pub wLength: u16,
1130    pub pData: *mut c_void,
1131    pub wLenDone: u32,
1132    pub noDataTimeout: u32,
1133    pub completionTimeout: u32,
1134}
1135
1136#[cfg(feature = "objc2")]
1137unsafe impl Encode for IOUSBDevRequestTO {
1138    const ENCODING: Encoding = Encoding::Struct(
1139        "?",
1140        &[
1141            <u8>::ENCODING,
1142            <u8>::ENCODING,
1143            <u16>::ENCODING,
1144            <u16>::ENCODING,
1145            <u16>::ENCODING,
1146            <*mut c_void>::ENCODING,
1147            <u32>::ENCODING,
1148            <u32>::ENCODING,
1149            <u32>::ENCODING,
1150        ],
1151    );
1152}
1153
1154#[cfg(feature = "objc2")]
1155unsafe impl RefEncode for IOUSBDevRequestTO {
1156    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1157}
1158
1159/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdefaultcontrolnodatatimeoutms?language=objc)
1160pub const kUSBDefaultControlNoDataTimeoutMS: c_uint = 5000;
1161/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdefaultcontrolcompletiontimeoutms?language=objc)
1162pub const kUSBDefaultControlCompletionTimeoutMS: c_uint = 0;
1163
1164/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbbulkpipereq?language=objc)
1165#[repr(C)]
1166#[derive(Clone, Copy, Debug, PartialEq)]
1167pub struct IOUSBBulkPipeReq {
1168    pub pipeRef: u32,
1169    pub buf: *mut c_void,
1170    pub size: u32,
1171    pub noDataTimeout: u32,
1172    pub completionTimeout: u32,
1173}
1174
1175#[cfg(feature = "objc2")]
1176unsafe impl Encode for IOUSBBulkPipeReq {
1177    const ENCODING: Encoding = Encoding::Struct(
1178        "?",
1179        &[
1180            <u32>::ENCODING,
1181            <*mut c_void>::ENCODING,
1182            <u32>::ENCODING,
1183            <u32>::ENCODING,
1184            <u32>::ENCODING,
1185        ],
1186    );
1187}
1188
1189#[cfg(feature = "objc2")]
1190unsafe impl RefEncode for IOUSBBulkPipeReq {
1191    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1192}
1193
1194/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevreqool?language=objc)
1195#[repr(C)]
1196#[derive(Clone, Copy, Debug, PartialEq)]
1197pub struct IOUSBDevReqOOL {
1198    pub bmRequestType: u8,
1199    pub bRequest: u8,
1200    pub wValue: u16,
1201    pub wIndex: u16,
1202    pub wLength: u16,
1203    pub pData: *mut c_void,
1204    pub wLenDone: u32,
1205    pub pipeRef: u8,
1206}
1207
1208#[cfg(feature = "objc2")]
1209unsafe impl Encode for IOUSBDevReqOOL {
1210    const ENCODING: Encoding = Encoding::Struct(
1211        "?",
1212        &[
1213            <u8>::ENCODING,
1214            <u8>::ENCODING,
1215            <u16>::ENCODING,
1216            <u16>::ENCODING,
1217            <u16>::ENCODING,
1218            <*mut c_void>::ENCODING,
1219            <u32>::ENCODING,
1220            <u8>::ENCODING,
1221        ],
1222    );
1223}
1224
1225#[cfg(feature = "objc2")]
1226unsafe impl RefEncode for IOUSBDevReqOOL {
1227    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1228}
1229
1230/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbdevreqoolto?language=objc)
1231#[repr(C)]
1232#[derive(Clone, Copy, Debug, PartialEq)]
1233pub struct IOUSBDevReqOOLTO {
1234    pub bmRequestType: u8,
1235    pub bRequest: u8,
1236    pub wValue: u16,
1237    pub wIndex: u16,
1238    pub wLength: u16,
1239    pub pData: *mut c_void,
1240    pub wLenDone: u32,
1241    pub pipeRef: u8,
1242    pub noDataTimeout: u32,
1243    pub completionTimeout: u32,
1244}
1245
1246#[cfg(feature = "objc2")]
1247unsafe impl Encode for IOUSBDevReqOOLTO {
1248    const ENCODING: Encoding = Encoding::Struct(
1249        "?",
1250        &[
1251            <u8>::ENCODING,
1252            <u8>::ENCODING,
1253            <u16>::ENCODING,
1254            <u16>::ENCODING,
1255            <u16>::ENCODING,
1256            <*mut c_void>::ENCODING,
1257            <u32>::ENCODING,
1258            <u8>::ENCODING,
1259            <u32>::ENCODING,
1260            <u32>::ENCODING,
1261        ],
1262    );
1263}
1264
1265#[cfg(feature = "objc2")]
1266unsafe impl RefEncode for IOUSBDevReqOOLTO {
1267    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1268}
1269
1270/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbisocstruct?language=objc)
1271#[repr(C)]
1272#[derive(Clone, Copy, Debug, PartialEq)]
1273pub struct IOUSBIsocStruct {
1274    pub fPipe: u32,
1275    pub fBuffer: *mut c_void,
1276    pub fBufSize: u32,
1277    pub fStartFrame: u64,
1278    pub fNumFrames: u32,
1279    pub fFrameCounts: *mut IOUSBIsocFrame,
1280}
1281
1282#[cfg(feature = "objc2")]
1283unsafe impl Encode for IOUSBIsocStruct {
1284    const ENCODING: Encoding = Encoding::Struct(
1285        "?",
1286        &[
1287            <u32>::ENCODING,
1288            <*mut c_void>::ENCODING,
1289            <u32>::ENCODING,
1290            <u64>::ENCODING,
1291            <u32>::ENCODING,
1292            <*mut IOUSBIsocFrame>::ENCODING,
1293        ],
1294    );
1295}
1296
1297#[cfg(feature = "objc2")]
1298unsafe impl RefEncode for IOUSBIsocStruct {
1299    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1300}
1301
1302/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iousblowlatencyisocstruct?language=objc)
1303#[repr(C)]
1304#[derive(Clone, Copy, Debug, PartialEq)]
1305pub struct IOUSBLowLatencyIsocStruct {
1306    pub fPipe: u32,
1307    pub fBufSize: u32,
1308    pub fStartFrame: u64,
1309    pub fNumFrames: u32,
1310    pub fUpdateFrequency: u32,
1311    pub fDataBufferCookie: u32,
1312    pub fDataBufferOffset: u32,
1313    pub fFrameListBufferCookie: u32,
1314    pub fFrameListBufferOffset: u32,
1315}
1316
1317#[cfg(feature = "objc2")]
1318unsafe impl Encode for IOUSBLowLatencyIsocStruct {
1319    const ENCODING: Encoding = Encoding::Struct(
1320        "IOUSBLowLatencyIsocStruct",
1321        &[
1322            <u32>::ENCODING,
1323            <u32>::ENCODING,
1324            <u64>::ENCODING,
1325            <u32>::ENCODING,
1326            <u32>::ENCODING,
1327            <u32>::ENCODING,
1328            <u32>::ENCODING,
1329            <u32>::ENCODING,
1330            <u32>::ENCODING,
1331        ],
1332    );
1333}
1334
1335#[cfg(feature = "objc2")]
1336unsafe impl RefEncode for IOUSBLowLatencyIsocStruct {
1337    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1338}
1339
1340/// Structure used from user space to return the frame number and a timestamp on when the frame register was read.
1341/// Field: frame frame number
1342/// Field: timeStamp  AbsoluteTime when the frame was updated
1343///
1344/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbgetframestruct?language=objc)
1345#[repr(C)]
1346#[derive(Clone, Copy, Debug, PartialEq)]
1347pub struct IOUSBGetFrameStruct {
1348    pub frame: u64,
1349    pub timeStamp: AbsoluteTime,
1350}
1351
1352#[cfg(feature = "objc2")]
1353unsafe impl Encode for IOUSBGetFrameStruct {
1354    const ENCODING: Encoding = Encoding::Struct("?", &[<u64>::ENCODING, <AbsoluteTime>::ENCODING]);
1355}
1356
1357#[cfg(feature = "objc2")]
1358unsafe impl RefEncode for IOUSBGetFrameStruct {
1359    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1360}
1361
1362/// Structure used with FindNextInterface.
1363///
1364/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iousbfindinterfacerequest?language=objc)
1365#[repr(C)]
1366#[derive(Clone, Copy, Debug, PartialEq)]
1367pub struct IOUSBFindInterfaceRequest {
1368    pub bInterfaceClass: u16,
1369    pub bInterfaceSubClass: u16,
1370    pub bInterfaceProtocol: u16,
1371    pub bAlternateSetting: u16,
1372}
1373
1374#[cfg(feature = "objc2")]
1375unsafe impl Encode for IOUSBFindInterfaceRequest {
1376    const ENCODING: Encoding = Encoding::Struct(
1377        "?",
1378        &[
1379            <u16>::ENCODING,
1380            <u16>::ENCODING,
1381            <u16>::ENCODING,
1382            <u16>::ENCODING,
1383        ],
1384    );
1385}
1386
1387#[cfg(feature = "objc2")]
1388unsafe impl RefEncode for IOUSBFindInterfaceRequest {
1389    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1390}
1391
1392/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbfindinterfacedontcare?language=objc)
1393pub const kIOUSBFindInterfaceDontCare: c_uint = 0xFFFF;
1394
1395/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbvendoridapplecomputer?language=objc)
1396#[cfg(feature = "AppleUSBDefinitions")]
1397pub const kIOUSBVendorIDAppleComputer: c_uint = kIOUSBAppleVendorID;
1398/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiousbvendoridapple?language=objc)
1399#[cfg(feature = "AppleUSBDefinitions")]
1400pub const kIOUSBVendorIDApple: c_uint = kIOUSBAppleVendorID;
1401
1402/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdevicespeedlow?language=objc)
1403pub const kUSBDeviceSpeedLow: c_uint = 0;
1404/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdevicespeedfull?language=objc)
1405pub const kUSBDeviceSpeedFull: c_uint = 1;
1406/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdevicespeedhigh?language=objc)
1407pub const kUSBDeviceSpeedHigh: c_uint = 2;
1408/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdevicespeedsuper?language=objc)
1409pub const kUSBDeviceSpeedSuper: c_uint = 3;
1410/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdevicespeedsuperplus?language=objc)
1411pub const kUSBDeviceSpeedSuperPlus: c_uint = 4;
1412/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdevicespeedsuperplusby2?language=objc)
1413pub const kUSBDeviceSpeedSuperPlusBy2: c_uint = 5;
1414
1415/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbfullspeedmicrosecondsinframe?language=objc)
1416pub const kUSBFullSpeedMicrosecondsInFrame: c_uint = 1000;
1417/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbhighspeedmicrosecondsinframe?language=objc)
1418pub const kUSBHighSpeedMicrosecondsInFrame: c_uint = 125;
1419
1420/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusblowlatencyisochtransferkey?language=objc)
1421pub const kUSBLowLatencyIsochTransferKey: c_uint = 0x6c6c6974;
1422
1423/// Used to specify what kind of buffer to create when calling LowLatencyCreateBuffer().
1424///
1425/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/usblowlatencybuffertype?language=objc)
1426#[repr(transparent)]
1427#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1428pub struct USBLowLatencyBufferType(pub c_uint);
1429impl USBLowLatencyBufferType {
1430    #[doc(alias = "kUSBLowLatencyWriteBuffer")]
1431    pub const WriteBuffer: Self = Self(0);
1432    #[doc(alias = "kUSBLowLatencyReadBuffer")]
1433    pub const ReadBuffer: Self = Self(1);
1434    #[doc(alias = "kUSBLowLatencyFrameListBuffer")]
1435    pub const FrameListBuffer: Self = Self(2);
1436}
1437
1438#[cfg(feature = "objc2")]
1439unsafe impl Encode for USBLowLatencyBufferType {
1440    const ENCODING: Encoding = c_uint::ENCODING;
1441}
1442
1443#[cfg(feature = "objc2")]
1444unsafe impl RefEncode for USBLowLatencyBufferType {
1445    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1446}
1447
1448/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbnousernotificationtype?language=objc)
1449pub const kUSBNoUserNotificationType: c_uint = 0;
1450/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbnotenoughpowernotificationtype?language=objc)
1451pub const kUSBNotEnoughPowerNotificationType: c_uint = 1;
1452/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbindividualovercurrentnotificationtype?language=objc)
1453pub const kUSBIndividualOverCurrentNotificationType: c_uint = 2;
1454/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbgangovercurrentnotificationtype?language=objc)
1455pub const kUSBGangOverCurrentNotificationType: c_uint = 3;
1456/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbiosdevicenotenoughpowernotificationtype?language=objc)
1457pub const kUSBiOSDeviceNotEnoughPowerNotificationType: c_uint = 4;
1458/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbnotenoughpowernoacnotificationtype?language=objc)
1459pub const kUSBNotEnoughPowerNoACNotificationType: c_uint = 5;
1460/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbdevicecountexceedednotificationtype?language=objc)
1461pub const kUSBDeviceCountExceededNotificationType: c_uint = 6;
1462/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbendpointcountexceedednotificationtype?language=objc)
1463pub const kUSBEndpointCountExceededNotificationType: c_uint = 7;
1464/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbunsupportednotificationtype?language=objc)
1465pub const kUSBUnsupportedNotificationType: c_uint = 8;
1466/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbhubcountexceedednotificationtype?language=objc)
1467pub const kUSBHubCountExceededNotificationType: c_uint = 9;
1468/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbtdmlowbatterytype?language=objc)
1469pub const kUSBTDMLowBatteryType: c_uint = 10;
1470/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbctbnotenoughpowernotificationtype?language=objc)
1471pub const kUSBCTBNotEnoughPowerNotificationType: c_uint = 11;
1472/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbctbunsupportednotificationtype?language=objc)
1473pub const kUSBCTBUnsupportedNotificationType: c_uint = 12;
1474/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbcunsupportedtbportnotificationtype?language=objc)
1475pub const kUSBCUnsupportedTBPortNotificationType: c_uint = 13;
1476/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbcunsupportedtbcablenotificationtype?language=objc)
1477pub const kUSBCUnsupportedTBCableNotificationType: c_uint = 14;
1478
1479/// Options used when calling ReEnumerateDevice.
1480///
1481///
1482/// 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
1483///
1484/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/usbreenumerateoptions?language=objc)
1485#[repr(transparent)]
1486#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1487pub struct USBReEnumerateOptions(pub c_int);
1488impl USBReEnumerateOptions {
1489    #[doc(alias = "kUSBAddExtraResetTimeBit")]
1490    pub const AddExtraResetTimeBit: Self = Self(31);
1491    #[doc(alias = "kUSBReEnumerateCaptureDeviceBit")]
1492    pub const ReEnumerateCaptureDeviceBit: Self = Self(30);
1493    #[doc(alias = "kUSBReEnumerateReleaseDeviceBit")]
1494    pub const ReEnumerateReleaseDeviceBit: Self = Self(29);
1495    #[doc(alias = "kUSBAddExtraResetTimeMask")]
1496    pub const AddExtraResetTimeMask: Self =
1497        Self(1 << USBReEnumerateOptions::AddExtraResetTimeBit.0);
1498    #[doc(alias = "kUSBReEnumerateCaptureDeviceMask")]
1499    pub const ReEnumerateCaptureDeviceMask: Self =
1500        Self(1 << USBReEnumerateOptions::ReEnumerateCaptureDeviceBit.0);
1501    #[doc(alias = "kUSBReEnumerateReleaseDeviceMask")]
1502    pub const ReEnumerateReleaseDeviceMask: Self =
1503        Self(1 << USBReEnumerateOptions::ReEnumerateReleaseDeviceBit.0);
1504}
1505
1506#[cfg(feature = "objc2")]
1507unsafe impl Encode for USBReEnumerateOptions {
1508    const ENCODING: Encoding = c_int::ENCODING;
1509}
1510
1511#[cfg(feature = "objc2")]
1512unsafe impl RefEncode for USBReEnumerateOptions {
1513    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1514}
1515
1516/// 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
1517///
1518/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/usbdeviceinformationbits?language=objc)
1519#[repr(transparent)]
1520#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1521pub struct USBDeviceInformationBits(pub c_uint);
1522impl USBDeviceInformationBits {
1523    #[doc(alias = "kUSBInformationDeviceIsCaptiveBit")]
1524    pub const InformationDeviceIsCaptiveBit: Self = Self(0);
1525    #[doc(alias = "kUSBInformationDeviceIsAttachedToRootHubBit")]
1526    pub const InformationDeviceIsAttachedToRootHubBit: Self = Self(1);
1527    #[doc(alias = "kUSBInformationDeviceIsInternalBit")]
1528    pub const InformationDeviceIsInternalBit: Self = Self(2);
1529    #[doc(alias = "kUSBInformationDeviceIsConnectedBit")]
1530    pub const InformationDeviceIsConnectedBit: Self = Self(3);
1531    #[doc(alias = "kUSBInformationDeviceIsEnabledBit")]
1532    pub const InformationDeviceIsEnabledBit: Self = Self(4);
1533    #[doc(alias = "kUSBInformationDeviceIsSuspendedBit")]
1534    pub const InformationDeviceIsSuspendedBit: Self = Self(5);
1535    #[doc(alias = "kUSBInformationDeviceIsInResetBit")]
1536    pub const InformationDeviceIsInResetBit: Self = Self(6);
1537    #[doc(alias = "kUSBInformationDeviceOvercurrentBit")]
1538    pub const InformationDeviceOvercurrentBit: Self = Self(7);
1539    #[doc(alias = "kUSBInformationDevicePortIsInTestModeBit")]
1540    pub const InformationDevicePortIsInTestModeBit: Self = Self(8);
1541    #[doc(alias = "kUSBInformationDeviceIsRootHub")]
1542    pub const InformationDeviceIsRootHub: Self = Self(9);
1543    #[doc(alias = "kUSBInformationRootHubisBuiltIn")]
1544    pub const InformationRootHubisBuiltIn: Self = Self(10);
1545    #[doc(alias = "kUSBInformationRootHubIsBuiltInBit")]
1546    pub const InformationRootHubIsBuiltInBit: Self = Self(10);
1547    #[doc(alias = "kUSBInformationDeviceIsRemote")]
1548    pub const InformationDeviceIsRemote: Self = Self(11);
1549    #[doc(alias = "kUSBInformationDeviceIsAttachedToEnclosure")]
1550    pub const InformationDeviceIsAttachedToEnclosure: Self = Self(12);
1551    #[doc(alias = "kUSBInformationDeviceIsOnThunderboltBit")]
1552    pub const InformationDeviceIsOnThunderboltBit: Self = Self(13);
1553    #[doc(alias = "kUSBInformationDeviceIsCaptiveMask")]
1554    pub const InformationDeviceIsCaptiveMask: Self =
1555        Self(1 << USBDeviceInformationBits::InformationDeviceIsCaptiveBit.0);
1556    #[doc(alias = "kUSBInformationDeviceIsAttachedToRootHubMask")]
1557    pub const InformationDeviceIsAttachedToRootHubMask: Self =
1558        Self(1 << USBDeviceInformationBits::InformationDeviceIsAttachedToRootHubBit.0);
1559    #[doc(alias = "kUSBInformationDeviceIsInternalMask")]
1560    pub const InformationDeviceIsInternalMask: Self =
1561        Self(1 << USBDeviceInformationBits::InformationDeviceIsInternalBit.0);
1562    #[doc(alias = "kUSBInformationDeviceIsConnectedMask")]
1563    pub const InformationDeviceIsConnectedMask: Self =
1564        Self(1 << USBDeviceInformationBits::InformationDeviceIsConnectedBit.0);
1565    #[doc(alias = "kUSBInformationDeviceIsEnabledMask")]
1566    pub const InformationDeviceIsEnabledMask: Self =
1567        Self(1 << USBDeviceInformationBits::InformationDeviceIsEnabledBit.0);
1568    #[doc(alias = "kUSBInformationDeviceIsSuspendedMask")]
1569    pub const InformationDeviceIsSuspendedMask: Self =
1570        Self(1 << USBDeviceInformationBits::InformationDeviceIsSuspendedBit.0);
1571    #[doc(alias = "kUSBInformationDeviceIsInResetMask")]
1572    pub const InformationDeviceIsInResetMask: Self =
1573        Self(1 << USBDeviceInformationBits::InformationDeviceIsInResetBit.0);
1574    #[doc(alias = "kUSBInformationDeviceOvercurrentMask")]
1575    pub const InformationDeviceOvercurrentMask: Self =
1576        Self(1 << USBDeviceInformationBits::InformationDeviceOvercurrentBit.0);
1577    #[doc(alias = "kUSBInformationDevicePortIsInTestModeMask")]
1578    pub const InformationDevicePortIsInTestModeMask: Self =
1579        Self(1 << USBDeviceInformationBits::InformationDevicePortIsInTestModeBit.0);
1580    #[doc(alias = "kUSBInformationDeviceIsRootHubMask")]
1581    pub const InformationDeviceIsRootHubMask: Self =
1582        Self(1 << USBDeviceInformationBits::InformationDeviceIsRootHub.0);
1583    #[doc(alias = "kUSBInformationRootHubisBuiltInMask")]
1584    pub const InformationRootHubisBuiltInMask: Self =
1585        Self(1 << USBDeviceInformationBits::InformationRootHubisBuiltIn.0);
1586    #[doc(alias = "kUSBInformationRootHubIsBuiltInMask")]
1587    pub const InformationRootHubIsBuiltInMask: Self =
1588        Self(1 << USBDeviceInformationBits::InformationRootHubIsBuiltInBit.0);
1589    #[doc(alias = "kUSBInformationDeviceIsRemoteMask")]
1590    pub const InformationDeviceIsRemoteMask: Self =
1591        Self(1 << USBDeviceInformationBits::InformationDeviceIsRemote.0);
1592    #[doc(alias = "kUSBInformationDeviceIsAttachedToEnclosureMask")]
1593    pub const InformationDeviceIsAttachedToEnclosureMask: Self =
1594        Self(1 << USBDeviceInformationBits::InformationDeviceIsAttachedToEnclosure.0);
1595    #[doc(alias = "kUSBInformationDeviceIsOnThunderboltMask")]
1596    pub const InformationDeviceIsOnThunderboltMask: Self =
1597        Self(1 << USBDeviceInformationBits::InformationDeviceIsOnThunderboltBit.0);
1598}
1599
1600#[cfg(feature = "objc2")]
1601unsafe impl Encode for USBDeviceInformationBits {
1602    const ENCODING: Encoding = c_uint::ENCODING;
1603}
1604
1605#[cfg(feature = "objc2")]
1606unsafe impl RefEncode for USBDeviceInformationBits {
1607    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1608}
1609
1610/// Used to specify what kind of power will be reserved using the IOUSBDevice RequestExtraPower and ReturnExtraPower APIs.
1611///
1612/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/usbpowerrequesttypes?language=objc)
1613#[repr(transparent)]
1614#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1615pub struct USBPowerRequestTypes(pub c_uint);
1616impl USBPowerRequestTypes {
1617    #[doc(alias = "kUSBPowerDuringSleep")]
1618    pub const DuringSleep: Self = Self(0);
1619    #[doc(alias = "kUSBPowerDuringWake")]
1620    pub const DuringWake: Self = Self(1);
1621    #[doc(alias = "kUSBPowerRequestWakeRelease")]
1622    pub const RequestWakeRelease: Self = Self(2);
1623    #[doc(alias = "kUSBPowerRequestSleepRelease")]
1624    pub const RequestSleepRelease: Self = Self(3);
1625    #[doc(alias = "kUSBPowerRequestWakeReallocate")]
1626    pub const RequestWakeReallocate: Self = Self(4);
1627    #[doc(alias = "kUSBPowerRequestSleepReallocate")]
1628    pub const RequestSleepReallocate: Self = Self(5);
1629    #[doc(alias = "kUSBPowerDuringWakeRevocable")]
1630    pub const DuringWakeRevocable: Self = Self(6);
1631    #[doc(alias = "kUSBPowerDuringWakeUSB3")]
1632    pub const DuringWakeUSB3: Self = Self(7);
1633}
1634
1635#[cfg(feature = "objc2")]
1636unsafe impl Encode for USBPowerRequestTypes {
1637    const ENCODING: Encoding = c_uint::ENCODING;
1638}
1639
1640#[cfg(feature = "objc2")]
1641unsafe impl RefEncode for USBPowerRequestTypes {
1642    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1643}
1644
1645/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbnotificationpreforcedsuspendbit?language=objc)
1646pub const kUSBNotificationPreForcedSuspendBit: c_uint = 0;
1647/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbnotificationpostforcedsuspendbit?language=objc)
1648pub const kUSBNotificationPostForcedSuspendBit: c_uint = 1;
1649/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbnotificationpreforcedresumebit?language=objc)
1650pub const kUSBNotificationPreForcedResumeBit: c_uint = 2;
1651/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbnotificationpostforcedresumebit?language=objc)
1652pub const kUSBNotificationPostForcedResumeBit: c_uint = 3;
1653
1654/// 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.
1655///
1656/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/usbnotificationtypes?language=objc)
1657#[repr(transparent)]
1658#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1659pub struct USBNotificationTypes(pub c_uint);
1660impl USBNotificationTypes {
1661    #[doc(alias = "kUSBNotificationPreForcedSuspend")]
1662    pub const PreForcedSuspend: Self = Self(1 << kUSBNotificationPreForcedSuspendBit);
1663    #[doc(alias = "kUSBNotificationPostForcedSuspend")]
1664    pub const PostForcedSuspend: Self = Self(1 << kUSBNotificationPostForcedSuspendBit);
1665    #[doc(alias = "kUSBNotificationPreForcedResume")]
1666    pub const PreForcedResume: Self = Self(1 << kUSBNotificationPreForcedResumeBit);
1667    #[doc(alias = "kUSBNotificationPostForcedResume")]
1668    pub const PostForcedResume: Self = Self(1 << kUSBNotificationPostForcedResumeBit);
1669}
1670
1671#[cfg(feature = "objc2")]
1672unsafe impl Encode for USBNotificationTypes {
1673    const ENCODING: Encoding = c_uint::ENCODING;
1674}
1675
1676#[cfg(feature = "objc2")]
1677unsafe impl RefEncode for USBNotificationTypes {
1678    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1679}
1680
1681/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbconnectable?language=objc)
1682#[repr(transparent)]
1683#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1684pub struct kUSBConnectable(pub c_uint);
1685impl kUSBConnectable {
1686    #[doc(alias = "kUSBPortNotConnectable")]
1687    pub const USBPortNotConnectable: Self = Self(0);
1688    #[doc(alias = "kUSBPortConnectable")]
1689    pub const USBPortConnectable: Self = Self(1);
1690}
1691
1692#[cfg(feature = "objc2")]
1693unsafe impl Encode for kUSBConnectable {
1694    const ENCODING: Encoding = c_uint::ENCODING;
1695}
1696
1697#[cfg(feature = "objc2")]
1698unsafe impl RefEncode for kUSBConnectable {
1699    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1700}
1701
1702/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbhostconnectortype?language=objc)
1703#[repr(transparent)]
1704#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1705pub struct kUSBHostConnectorType(pub c_uint);
1706impl kUSBHostConnectorType {
1707    #[doc(alias = "kUSBTypeAConnector")]
1708    pub const USBTypeAConnector: Self = Self(0x00);
1709    #[doc(alias = "kUSBTypeMiniABConnector")]
1710    pub const USBTypeMiniABConnector: Self = Self(0x01);
1711    #[doc(alias = "kUSBTypeExpressCard")]
1712    pub const USBTypeExpressCard: Self = Self(0x02);
1713    #[doc(alias = "kUSB3TypeStdAConnector")]
1714    pub const USB3TypeStdAConnector: Self = Self(0x03);
1715    #[doc(alias = "kUSB3TypeStdBConnector")]
1716    pub const USB3TypeStdBConnector: Self = Self(0x04);
1717    #[doc(alias = "kUSB3TypeMicroBConnector")]
1718    pub const USB3TypeMicroBConnector: Self = Self(0x05);
1719    #[doc(alias = "kUSB3TypeMicroABConnector")]
1720    pub const USB3TypeMicroABConnector: Self = Self(0x06);
1721    #[doc(alias = "kUSB3TypePowerBConnector")]
1722    pub const USB3TypePowerBConnector: Self = Self(0x07);
1723    #[doc(alias = "kUSBProprietaryConnector")]
1724    pub const USBProprietaryConnector: Self = Self(0xFF);
1725}
1726
1727#[cfg(feature = "objc2")]
1728unsafe impl Encode for kUSBHostConnectorType {
1729    const ENCODING: Encoding = c_uint::ENCODING;
1730}
1731
1732#[cfg(feature = "objc2")]
1733unsafe impl RefEncode for kUSBHostConnectorType {
1734    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1735}
1736
1737/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbspeed_mask?language=objc)
1738pub const kUSBSpeed_Mask: c_uint = USBBitRange!(0, 1);
1739/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbspeed_shift?language=objc)
1740pub const kUSBSpeed_Shift: c_uint = USBBitRangePhase!(0, 1);
1741/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbaddress_mask?language=objc)
1742pub const kUSBAddress_Mask: c_uint = USBBitRange!(8, 15);
1743/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kusbaddress_shift?language=objc)
1744pub const kUSBAddress_Shift: c_uint = USBBitRangePhase!(8, 15);
1745
1746/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kxhcissroothubaddress?language=objc)
1747pub const kXHCISSRootHubAddress: c_long = kUSBMaxDevices;
1748/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kxhciusb2roothubaddress?language=objc)
1749pub const kXHCIUSB2RootHubAddress: c_long = kUSBMaxDevices + 1;
1750/// [Apple's documentation](https://developer.apple.com/documentation/iokit/ksuperspeedbusbitmask?language=objc)
1751pub const kSuperSpeedBusBitMask: c_long = 0x01000000;