DCMD_SPI_GET_DEVINFO
QNX SDP8.0Devctl and Ioctl CommandsDeveloper
Get the SPI device information
Synopsis:
#include <hw/io-spi.h>
#define DCMD_SPI_GET_DEVINFO (__DIOT (_DCMD_SPI, 0x13, spi_devinfo_t))
Arguments to devctl():
Argument | Value |
---|---|
filedes | A file descriptor that you obtained by opening the device. |
dcmd | DCMD_SPI_GET_DEVINFO |
dev_data_ptr | A pointer to a spi_devinfo_t structure (see below) |
n_bytes | sizeof(spi_devinfo_t) |
dev_info_ptr | NULL |
Description:
The DCMD_SPI_GET_DEVINFO command gets the information for a specific device on the SPI bus.
Input:
None.
Output:
A filled spi_devinfo_t structure:
typedef struct { int devno; /* Device NO. Physical NO. */ char name[SPI_DEV_NAME_LEN]; /* Device name */ uint32_t current_clkrate; /* Device current bus speed */ spi_cfg_t cfg; /* Device configuration */ } spi_devinfo_t;The members of spi_cfg_t structure:
typedef struct { uint32_t mode; /* SPI mode */ uint32_t clock_rate; /* bus speed */ } spi_cfg_t;For the supported device modes, refer to io-spi.h.
Related documents:
For more information, refer to the following documents:
- SPI (Serial Peripheral Interface) Framework Technotes
- devctl() in the QNX OS C Library Reference
Page updated: