The spi_getdevinfo() function gets the information for a specific device on the SPI bus. The prototype for this function is:
int spi_getdevinfo( int fd,
                    uint32_t device,
                    spi_devinfo_t *devinfo );
The arguments are:
| Specify: | To get information about: | 
|---|---|
| SPI_DEV_ID_NONE | The first device | 
| A device ID ORed with SPI_DEV_DEFAULT | The specified device | 
| A device ID | The next device | 
typedef struct {
    uint32_t    device;     /* Device ID */
    char        name[16];   /* Device description */
    spi_cfg_t   cfg;        /* Device configuration */
} spi_devinfo_t;
  
This function returns EOK if the device information is obtained successfully.