DDC(9)

πŸ“¦ version 11.0, in nixpkgs unstable

✨ NAME ✨

Okay so this is the DDC(9) manual page from the Kernel Developer's Manual, and it's all about ddc β€” VESA Display Data Channel V2. Main character energy, no cap. πŸ‘‘

🌸 SYNOPSIS 🌸

#include <dev/i2c/ddcvar.h>

int
ddc_read_edid(i2c_tag_t tag, uint8_t *dest, size_t len);

πŸ’… DESCRIPTION πŸ’…

So ddc_read_edid() does exactly what it says on the tin, bestie: it reads a VESA Extended Display Identification Data block (EDID) via VESA Display Data Channel (DDCv2). DDCv2 is a protocol for data exchange between display devices (such as monitors and flat panels) and host machines using an I2C bus. The way it just... talks to your monitor? iconic. πŸ–₯️✨

Here's the tea on the arguments:

  • tag β€” a machine-dependent tag used to specify the I2C bus on which the DDCv2 device is located. It's the bus's little name tag. 🏷️
  • dest β€” a pointer to a buffer where the EDID data will be stored. That's where the good stuff goes. πŸ’Ύ
  • len β€” the amount of data to read into the buffer. (The buffer must be large enough.) Typically, this value will be 128, which is the size of a normal EDID data block. ✨

Normally the EDID data block will be post-processed with the edid_parse() function. That's the glow-up step. πŸ’–

πŸŽ€ RETURN VALUES πŸŽ€

The ddc_read_edid() function returns zero on success, and non-zero otherwise. Zero = slay, non-zero = something's off. πŸ’…

πŸ¦‹ ENVIRONMENT πŸ¦‹

The ddc_read_edid() function is part of the ddc(4) driver, and is only included in the kernel if that driver is also included. Package deal, fr fr. πŸ“¦

🌈 EXAMPLES 🌈

The following code uses ddc_read_edid() to retrieve and print information about a monitor:

struct edid_info info;
i2c_tag_t        tag;
char             buffer[128];

...
/* initialize i2c tag... */
...
if ((ddc_read_edid(tag, buffer, 128) == 0) &&
    (edid_parse(buffer, &info) == 0))
        edid_print(info);
...
Note that this must be called before the PCI bus is attached during autoconfiguration. Timing is everything, bestie. ⏰

⭐ SEE ALSO ⭐

πŸ’œ HISTORY πŸ’œ

DDCv2 support was added in NetBSD 4.0. Vintage but still cute. πŸ•°οΈ

πŸ‘‘ AUTHORS πŸ‘‘

Garrett D'Amore <gdamore@NetBSD.org>


Okay bye bestie β€” this one's from Debian, dated May 11, 2006, and the manual page is DDC(9). πŸ’–πŸŽ€

πŸ“¦ where this page comes from