DCMD_SPI_SET_CONFIG
QNX SDP8.0Devctl and Ioctl CommandsDeveloper
Set the SPI device configuration
Synopsis:
#include <hw/io-spi.h>
#define DCMD_SPI_SET_CONFIG (__DIOT (_DCMD_SPI, 0x11, spi_cfg_t))
Arguments to devctl():
Argument | Value |
---|---|
filedes | A file descriptor that you obtained by opening the device. |
dcmd | DCMD_SPI_SET_CONFIG |
dev_data_ptr | A pointer to a spi_cfg_t structure (see below) |
n_bytes | sizeof(spi_cfg_t) |
dev_info_ptr | NULL |
Description:
The DCMD_SPI_SET_CONFIG command sets the configuration for a specific device on the SPI bus.
Input:
Initialize all members of the 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.
Output:
None.
Related links:
For more information, refer to the following documents:
- SPI (Serial Peripheral Interface) Framework Technotes
- devctl() in the QNX OS C Library Reference
Page updated: