devinfo function

The devinfo function obtains the information from specific devices that are connected to the SPI bus. The prototype for this function is:

int devinfo( void *hdl,
             uint32_t device,
             spi_devinfo_t *info );

The arguments are:

hdl
The handle of the low-level module that the init function returned.
device
The device ID. You can OR it with SPI_DEV_DEFAULT to select the current device; otherwise the next device is selected.
info
A pointer to the device information structure. This structure is defined as:
typedef struct {
    uint32_t    device;     /* Device ID */
    char        name[16];   /* Device description */
    spi_cfg_t   cfg;        /* Device configuration */
} spi_devinfo_t;
  

This function must return EOK, or EINVAL if the device ID is invalid.