Created
March 25, 2021 03:15
-
-
Save zhuowei/223e449a90a32eefd2c3244e252818d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
@import Darwin; | |
@import Foundation; | |
typedef mach_port_t io_object_t; | |
typedef io_object_t io_service_t; | |
typedef CFTypeRef IOAVServiceRef; | |
typedef CFTypeRef IOAVDeviceRef; | |
typedef kern_return_t IOReturn; | |
// allocator: must be kCFAllocatorDefault | |
// Note that this defaults to grabbing the external IOAVService: | |
// iOS 12.4: | |
// { | |
// IOProviderClass = IOAVService; | |
// Location = External; | |
// } | |
// iOS 14.1: | |
// { | |
// IOPropertyMatch = { | |
// IOAVServiceUserInterfaceSupported = 1; | |
// }; | |
// Location = External; | |
// } | |
extern IOAVServiceRef IOAVServiceCreate(CFAllocatorRef allocator); | |
extern IOAVServiceRef IOAVServiceCreateWithService(CFAllocatorRef allocator, io_service_t service); | |
#define IOAVLocationExternal 0 | |
#define IOAVLocationEmbedded 1 | |
extern IOAVServiceRef IOAVServiceCreateWithLocation(CFAllocatorRef allocator, uint32_t location); | |
#define IOAVServiceI2CArg4Max (1 << 12) | |
// w4 must be less than (1 << 12) or it returns kIOReturnBadArgument | |
extern IOReturn IOAVServiceReadI2C(IOAVServiceRef service, uint32_t w1, uint32_t w2, void* w3, | |
uint32_t w4); | |
extern IOReturn IOAVServiceWriteI2C(IOAVServiceRef service, uint32_t w1, uint32_t w2, void* w3, | |
uint32_t w4); | |
extern IOReturn IOAVServiceSetVirtualEDIDMode(IOAVServiceRef service, void* x1_possibly_unused, | |
CFDataRef x2); | |
extern IOReturn IOAVServiceCopyEDID(IOAVServiceRef service, CFDataRef* x1); | |
// not sure what a device does that a service can't?? | |
extern IOAVDeviceRef IOAVServiceGetDevice(IOAVServiceRef service); | |
extern IOAVDeviceRef IOAVDeviceCreateWithService(CFAllocatorRef allocator, io_service_t service); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment