This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to create or define GUID of drivers?

I noticed that in the Adeneo BSP for AM335x, the GPIO and other drivers have a defined GUID inside a header file

For example, in the file gpio_ioctls.h, the following line is declared.

DEFINE_GUID(
DEVICE_IFC_GPIO_GUID, 0xa0272611, 0xdea0, 0x4678,
0xae, 0x62, 0x65, 0x61, 0x5b, 0x7d, 0x53, 0xaa
);

For spi, there is sdk_spi.h with:

DEFINE_GUID(
DEVICE_IFC_SPI_GUID, 0x2e559225, 0xc95e, 0x4300,
0x86, 0xe9, 0x6a, 0x5c, 0xbc, 0x7, 0x32, 0x8f
);


I'm curious where these values were obtained because I'm looking at creating custom drivers with the same principle that shares interfaces (IFC).

  • Hi Marlon,

    The answer depends on what you are trying to achieve by using a GUID.

    If you need your own, custom, GUID you can use the GUID generator tool in Platform Builder / Visual Studio - from the Tools menu simply click Create GUID.

    However, note that some GUIDs have a specific meaning; for instance, the GUID "DD176277-CD34-4980-91EE-67DBEF3D8913" indicates to the device manager that the device driver in question is a battery driver.

    Hope this helps,
    Carsten