diff --git a/src/DDC.c b/src/DDC.c index 84424df..49a4194 100644 --- a/src/DDC.c +++ b/src/DDC.c @@ -413,35 +413,35 @@ bool EDIDTest(io_service_t framebuffer, struct EDID *edid) { IOI2CRequest request = {}; /*! from https://opensource.apple.com/source/IOGraphics/IOGraphics-513.1/IOGraphicsFamily/IOKit/i2c/IOI2CInterface.h.auto.html * not in https://developer.apple.com/reference/kernel/1659924-ioi2cinterface.h/ioi2crequest?changes=latest_beta&language=objc - * @struct IOI2CRequest - * @abstract A structure defining an I2C bus transaction. - * @discussion This structure is used to request an I2C transaction consisting of a send (write) to and reply (read) from a device, either of which is optional, to be carried out atomically on an I2C bus. - * @field __reservedA Set to zero. - * @field result The result of the transaction. Common errors are kIOReturnNoDevice if there is no device responding at the given address, kIOReturnUnsupportedMode if the type of transaction is unsupported on the requested bus. - * @field completion A completion routine to be executed when the request completes. If NULL is passed, the request is synchronous, otherwise it may execute asynchronously. - * @field commFlags Flags that modify the I2C transaction type. The following flags are defined:
+ * struct IOI2CRequest + * abstract A structure defining an I2C bus transaction. + * discussion This structure is used to request an I2C transaction consisting of a send (write) to and reply (read) from a device, either of which is optional, to be carried out atomically on an I2C bus. + * field __reservedA Set to zero. + * field result The result of the transaction. Common errors are kIOReturnNoDevice if there is no device responding at the given address, kIOReturnUnsupportedMode if the type of transaction is unsupported on the requested bus. + * field completion A completion routine to be executed when the request completes. If NULL is passed, the request is synchronous, otherwise it may execute asynchronously. + * field commFlags Flags that modify the I2C transaction type. The following flags are defined:
* kIOI2CUseSubAddressCommFlag Transaction includes a subaddress.
- * @field minReplyDelay Minimum delay as absolute time between send and reply transactions. - * @field sendAddress I2C address to write. - * @field sendSubAddress I2C subaddress to write. - * @field __reservedB Set to zero. - * @field sendTransactionType The following types of transaction are defined for the send part of the request:
+ * field minReplyDelay Minimum delay as absolute time between send and reply transactions. + * field sendAddress I2C address to write. + * field sendSubAddress I2C subaddress to write. + * field __reservedB Set to zero. + * field sendTransactionType The following types of transaction are defined for the send part of the request:
* kIOI2CNoTransactionType No send transaction to perform.
* kIOI2CSimpleTransactionType Simple I2C message.
* kIOI2CCombinedTransactionType Combined format I2C R/~W transaction.
- * @field sendBuffer Pointer to the send buffer. - * @field sendBytes Number of bytes to send. Set to actual bytes sent on completion of the request. - * @field replyAddress I2C Address from which to read. - * @field replySubAddress I2C Address from which to read. - * @field __reservedC Set to zero. - * @field replyTransactionType The following types of transaction are defined for the reply part of the request:
+ * field sendBuffer Pointer to the send buffer. + * field sendBytes Number of bytes to send. Set to actual bytes sent on completion of the request. + * field replyAddress I2C Address from which to read. + * field replySubAddress I2C Address from which to read. + * field __reservedC Set to zero. + * field replyTransactionType The following types of transaction are defined for the reply part of the request:
* kIOI2CNoTransactionType No reply transaction to perform.
* kIOI2CSimpleTransactionType Simple I2C message.
* kIOI2CDDCciReplyTransactionType DDC/ci message (with embedded length). See VESA DDC/ci specification.
* kIOI2CCombinedTransactionType Combined format I2C R/~W transaction.
- * @field replyBuffer Pointer to the reply buffer. - * @field replyBytes Max bytes to reply (size of replyBuffer). Set to actual bytes received on completion of the request. - * @field __reservedD Set to zero. + * field replyBuffer Pointer to the reply buffer. + * field replyBytes Max bytes to reply (size of replyBuffer). Set to actual bytes received on completion of the request. + * field __reservedD Set to zero. */ UInt8 data[128] = {}; diff --git a/src/DDC.h b/src/DDC.h index 4e76a7c..ece0786 100644 --- a/src/DDC.h +++ b/src/DDC.h @@ -237,7 +237,7 @@ struct EDID { UInt8 checksum : 8; }; -long DDCDelayBase; +extern long DDCDelayBase; // nanoseconds long DDCDelay(io_service_t framebuffer); bool DDCWrite(io_service_t framebuffer, struct DDCWriteCommand *write); bool DDCRead(io_service_t framebuffer, struct DDCReadCommand *read); diff --git a/src/ddcctl.m b/src/ddcctl.m index 350b6e4..54e8914 100644 --- a/src/ddcctl.m +++ b/src/ddcctl.m @@ -31,8 +31,6 @@ extern io_service_t CGDisplayIOServicePort(CGDirectDisplayID display) __attribute__((weak_import)); -long DDCDelayBase; - NSString *EDIDString(char *string) { NSString *temp = [[NSString alloc] initWithBytes:string length:13 encoding:NSASCIIStringEncoding];